Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / EventSetter.cs / 1305600 / 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 /// [TypeConverter(typeof(System.Windows.Markup.EventSetterHandlerConverter))] 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
- FilteredAttributeCollection.cs
- XmlSchemaSimpleTypeRestriction.cs
- FileChangesMonitor.cs
- HybridDictionary.cs
- DataGridViewUtilities.cs
- ListSourceHelper.cs
- ProfileParameter.cs
- arc.cs
- Utils.cs
- AccessText.cs
- Clause.cs
- HttpDebugHandler.cs
- ExclusiveTcpListener.cs
- EventsTab.cs
- IsolatedStorageFileStream.cs
- HotSpotCollectionEditor.cs
- DbConnectionPoolGroupProviderInfo.cs
- CodeConstructor.cs
- NavigationPropertyEmitter.cs
- ApplicationManager.cs
- InstancePersistenceEvent.cs
- WebColorConverter.cs
- CompositeClientFormatter.cs
- DesignBindingValueUIHandler.cs
- safex509handles.cs
- OperationAbortedException.cs
- EnvelopedSignatureTransform.cs
- NamedObject.cs
- Rule.cs
- DateTimeValueSerializer.cs
- GuidConverter.cs
- XmlIlTypeHelper.cs
- WebFormsRootDesigner.cs
- OleDbCommand.cs
- HtmlToClrEventProxy.cs
- DependencyPropertyAttribute.cs
- SimpleType.cs
- SqlTypesSchemaImporter.cs
- CodeDelegateCreateExpression.cs
- ObjectAssociationEndMapping.cs
- TabControl.cs
- HasCopySemanticsAttribute.cs
- TextEffect.cs
- TraceContext.cs
- FlowNode.cs
- ObjectStateManagerMetadata.cs
- SelectionEditor.cs
- OledbConnectionStringbuilder.cs
- ScrollViewer.cs
- uribuilder.cs
- EventEntry.cs
- ToolStripProgressBar.cs
- DrawingAttributes.cs
- QuaternionRotation3D.cs
- ConstrainedGroup.cs
- Int32CollectionConverter.cs
- SchemaCollectionCompiler.cs
- PublisherMembershipCondition.cs
- RuntimeEnvironment.cs
- DataBoundControl.cs
- PageRouteHandler.cs
- XmlDocumentType.cs
- Wildcard.cs
- HttpModuleCollection.cs
- _RequestLifetimeSetter.cs
- InteropAutomationProvider.cs
- UrlMappingCollection.cs
- Color.cs
- ConfigXmlElement.cs
- WindowsClaimSet.cs
- RectAnimationBase.cs
- GridViewCommandEventArgs.cs
- IsolationInterop.cs
- XamlWriter.cs
- UnorderedHashRepartitionStream.cs
- EdmToObjectNamespaceMap.cs
- TcpClientChannel.cs
- SoapSchemaExporter.cs
- PageMediaType.cs
- DataGridViewImageColumn.cs
- PerformanceCounterManager.cs
- BindingMAnagerBase.cs
- InternalBufferManager.cs
- WebSysDescriptionAttribute.cs
- Separator.cs
- SQLByte.cs
- XmlSchemaSimpleContentRestriction.cs
- CfgRule.cs
- RayHitTestParameters.cs
- StackOverflowException.cs
- COAUTHINFO.cs
- Bits.cs
- PartialTrustVisibleAssembly.cs
- SrgsItemList.cs
- ImageSource.cs
- XmlDataSource.cs
- TypeDependencyAttribute.cs
- validation.cs
- Rule.cs
- RefreshInfo.cs