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
- WizardForm.cs
- WindowsPrincipal.cs
- ContainerFilterService.cs
- WebPartConnectionsConnectVerb.cs
- GACIdentityPermission.cs
- AuthenticationServiceManager.cs
- IsolatedStorageFileStream.cs
- LinearKeyFrames.cs
- PlatformNotSupportedException.cs
- DoubleAnimationBase.cs
- XmlWellformedWriter.cs
- Int64AnimationUsingKeyFrames.cs
- ScrollEvent.cs
- LocatorBase.cs
- Content.cs
- LinkButton.cs
- RecordConverter.cs
- SharedPersonalizationStateInfo.cs
- WebServiceEnumData.cs
- DoubleLink.cs
- DataRowExtensions.cs
- EditingScope.cs
- XPathSelectionIterator.cs
- WebBrowserHelper.cs
- SqlBuilder.cs
- Message.cs
- TextBreakpoint.cs
- StylusPointPropertyInfo.cs
- StreamedFramingRequestChannel.cs
- HitTestWithGeometryDrawingContextWalker.cs
- ComboBoxAutomationPeer.cs
- ExtenderProviderService.cs
- NotFiniteNumberException.cs
- ExceptionHandlers.cs
- EncodingTable.cs
- DateTimePicker.cs
- SelectionRangeConverter.cs
- InputMethodStateTypeInfo.cs
- ToolStripItemRenderEventArgs.cs
- ServicePointManagerElement.cs
- QueryOperator.cs
- TransformValueSerializer.cs
- TraceSection.cs
- TypeName.cs
- HttpHeaderCollection.cs
- TraceEventCache.cs
- grammarelement.cs
- ProviderBase.cs
- TextureBrush.cs
- HttpListenerPrefixCollection.cs
- CryptoKeySecurity.cs
- CompositeScriptReference.cs
- GetPageNumberCompletedEventArgs.cs
- DBConnection.cs
- TemplatePartAttribute.cs
- MailWriter.cs
- AsyncCompletedEventArgs.cs
- SqlNodeAnnotation.cs
- ConnectionPointGlyph.cs
- TabletDeviceInfo.cs
- WebUtil.cs
- SQLBinaryStorage.cs
- Model3DCollection.cs
- IndexedEnumerable.cs
- HwndTarget.cs
- MonitoringDescriptionAttribute.cs
- ButtonPopupAdapter.cs
- ContractUtils.cs
- CheckBoxBaseAdapter.cs
- X509PeerCertificateAuthentication.cs
- xmlsaver.cs
- TreeView.cs
- DataGridViewSelectedCellCollection.cs
- StringValueConverter.cs
- BufferAllocator.cs
- SqlDataSourceSelectingEventArgs.cs
- EventMappingSettings.cs
- ExcludePathInfo.cs
- DynamicValidatorEventArgs.cs
- DiscardableAttribute.cs
- AdornerPresentationContext.cs
- DesignerCommandSet.cs
- KeyValueInternalCollection.cs
- KeyTime.cs
- Scheduler.cs
- COM2PictureConverter.cs
- SkipQueryOptionExpression.cs
- NetworkInformationPermission.cs
- MbpInfo.cs
- LiteralControl.cs
- TimerEventSubscriptionCollection.cs
- TdsParserHelperClasses.cs
- Number.cs
- ConfigurationConverterBase.cs
- DataGridTextBoxColumn.cs
- Models.cs
- Vector3DCollectionValueSerializer.cs
- cache.cs
- DependencyPropertyDescriptor.cs
- UnsafeNativeMethods.cs