Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Framework / System / Windows / EventSetter.cs / 1 / EventSetter.cs
/****************************************************************************\ * * File: SetterBase.cs * * TargetType event setting class. * * Copyright (C) 2004 by Microsoft Corporation. All rights reserved. * \***************************************************************************/ using System; using System.ComponentModel; // EditorBrowsableAttribute namespace System.Windows { ////// TargetType event setting class. /// public class EventSetter : SetterBase { ////// EventSetter construction /// public EventSetter() { } ////// EventSetter construction /// public EventSetter(RoutedEvent routedEvent, Delegate handler) { if (routedEvent == null) { throw new ArgumentNullException("routedEvent"); } if (handler == null) { throw new ArgumentNullException("handler"); } _event = routedEvent; _handler = handler; } ////// Event that is being set by this setter /// public RoutedEvent Event { get { return _event; } set { if (value == null) { throw new ArgumentNullException("value"); } CheckSealed(); _event = value; } } ////// Handler delegate that is being set by this setter /// public Delegate Handler { get { return _handler; } set { if (value == null) { throw new ArgumentNullException("value"); } CheckSealed(); _handler = value; } } ////// HandledEventsToo flag that is being set by this setter /// [EditorBrowsable(EditorBrowsableState.Never)] public bool HandledEventsToo { get { return _handledEventsToo; } set { CheckSealed(); _handledEventsToo = value; } } // // Do the error checking that we can only do once all of the properties have been // set, then call up to base. // internal override void Seal() { if (_event == null) { throw new ArgumentException(SR.Get(SRID.NullPropertyIllegal, "EventSetter.Event")); } if (_handler == null) { throw new ArgumentException(SR.Get(SRID.NullPropertyIllegal, "EventSetter.Handler")); } if (_handler.GetType() != _event.HandlerType) { throw new ArgumentException(SR.Get(SRID.HandlerTypeIllegal)); } base.Seal(); } private RoutedEvent _event; private Delegate _handler; private bool _handledEventsToo; } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Zone.cs
- WmiPutTraceRecord.cs
- SqlTrackingWorkflowInstance.cs
- PropertyValueChangedEvent.cs
- BackgroundFormatInfo.cs
- ManagementPath.cs
- TypeSchema.cs
- StickyNote.cs
- TextRunProperties.cs
- HttpRequestBase.cs
- XslCompiledTransform.cs
- securitycriticaldata.cs
- RemotingConfigParser.cs
- Triplet.cs
- HttpModuleCollection.cs
- SemanticKeyElement.cs
- DLinqColumnProvider.cs
- DoubleIndependentAnimationStorage.cs
- RIPEMD160Managed.cs
- RSAPKCS1KeyExchangeFormatter.cs
- ObjectDataSourceFilteringEventArgs.cs
- CompressEmulationStream.cs
- __TransparentProxy.cs
- XmlNotation.cs
- PriorityQueue.cs
- DataObjectAttribute.cs
- FormViewInsertEventArgs.cs
- EventLogPropertySelector.cs
- FileDialog_Vista_Interop.cs
- SR.cs
- sqlinternaltransaction.cs
- SqlDataRecord.cs
- ListViewDeleteEventArgs.cs
- Command.cs
- SoapIncludeAttribute.cs
- TableSectionStyle.cs
- SimpleTextLine.cs
- ComponentChangingEvent.cs
- DataTable.cs
- WMIGenerator.cs
- SQLBytes.cs
- BitmapEffectInputData.cs
- MLangCodePageEncoding.cs
- WebPartConnectionsConfigureVerb.cs
- TableLayout.cs
- ScriptControlDescriptor.cs
- _CommandStream.cs
- WinCategoryAttribute.cs
- FixedSOMLineCollection.cs
- BrowserCapabilitiesCodeGenerator.cs
- DirectionalLight.cs
- IListConverters.cs
- CompilerError.cs
- SimpleBitVector32.cs
- AssertFilter.cs
- OdbcFactory.cs
- CounterSet.cs
- HistoryEventArgs.cs
- SelectionList.cs
- MobileResource.cs
- ToolStripSplitButton.cs
- CreateUserErrorEventArgs.cs
- InvalidPropValue.cs
- SerialPinChanges.cs
- MarginCollapsingState.cs
- StrongTypingException.cs
- HttpHandlersSection.cs
- QilValidationVisitor.cs
- FrameworkElement.cs
- FontResourceCache.cs
- HtmlEncodedRawTextWriter.cs
- HighlightVisual.cs
- SqlExpressionNullability.cs
- Debug.cs
- WebColorConverter.cs
- recordstatefactory.cs
- Classification.cs
- ControlTemplate.cs
- SchemaInfo.cs
- PrintDialog.cs
- NativeMethods.cs
- GeneralTransform3DGroup.cs
- HwndAppCommandInputProvider.cs
- CacheSection.cs
- OperatingSystem.cs
- CodeSubDirectory.cs
- OutputCacheSettings.cs
- Margins.cs
- Style.cs
- SkewTransform.cs
- TypeNameConverter.cs
- DesignerOptionService.cs
- BitmapMetadataBlob.cs
- RequestStatusBarUpdateEventArgs.cs
- GridViewDeleteEventArgs.cs
- TraceListeners.cs
- RoleManagerSection.cs
- RSAPKCS1SignatureFormatter.cs
- TabletDeviceInfo.cs
- BindingMAnagerBase.cs