Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / Tools / System.Activities.Presentation / System / Activities / Presentation / Base / Core / Metadata / AttributeCallbackBuilder.cs / 1305376 / AttributeCallbackBuilder.cs
//---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------- namespace System.Activities.Presentation.Metadata { using System.Runtime; using System.Activities.Presentation.Internal.Metadata; using System.Activities.Presentation.Internal.Properties; using System; using System.ComponentModel; using System.Globalization; using System.Reflection; using System.Windows; using System.Activities.Presentation; //// An instance of this class is passed to callback delegates to lazily // populate the attributes for a type. // [Fx.Tag.XamlVisible(false)] public sealed class AttributeCallbackBuilder { private MutableAttributeTable _table; private Type _callbackType; internal AttributeCallbackBuilder(MutableAttributeTable table, Type callbackType) { _table = table; _callbackType = callbackType; } //// The type this callback is being invoked for. // public Type CallbackType { get { return _callbackType; } } //// Adds the contents of the provided attributes to this builder. // Conflicts are resolved with a last-in-wins strategy. // // // The new attributes to add. // //if type or attributes is null public void AddCustomAttributes(params Attribute[] attributes) { if (attributes == null) { throw FxTrace.Exception.ArgumentNull("attributes"); } _table.AddCustomAttributes(_callbackType, attributes); } //// Adds the contents of the provided attributes to this builder. // Conflicts are resolved with a last-in-wins strategy. // // An event or property descriptor to add attributes to. // // The new attributes to add. // //if descriptor or attributes is null public void AddCustomAttributes(MemberDescriptor descriptor, params Attribute[] attributes) { if (descriptor == null) { throw FxTrace.Exception.ArgumentNull("descriptor"); } if (attributes == null) { throw FxTrace.Exception.ArgumentNull("attributes"); } _table.AddCustomAttributes(_callbackType, descriptor, attributes); } //// Adds the contents of the provided attributes to this builder. // Conflicts are resolved with a last-in-wins strategy. // // An event or property info to add attributes to. // // The new attributes to add. // //if member or attributes is null public void AddCustomAttributes(MemberInfo member, params Attribute[] attributes) { if (member == null) { throw FxTrace.Exception.ArgumentNull("member"); } if (attributes == null) { throw FxTrace.Exception.ArgumentNull("attributes"); } _table.AddCustomAttributes(_callbackType, member, attributes); } //// Adds attributes to the member with the given name. The member can be a property // or an event. The member is evaluated on demand when the user queries // attributes on a given property or event. // // // The member to add attributes for. Only property and event members are supported; // all others will be ignored. // // // The new attributes to add. // public void AddCustomAttributes(string memberName, params Attribute[] attributes) { if (memberName == null) { throw FxTrace.Exception.ArgumentNull("memberName"); } if (attributes == null) { throw FxTrace.Exception.ArgumentNull("attributes"); } _table.AddCustomAttributes(_callbackType, memberName, attributes); } //// Adds the contents of the provided attributes to this builder. // Conflicts are resolved with a last-in-wins strategy. // // A dependency property to add attributes to. // // The new attributes to add. // //if dp or attributes is null public void AddCustomAttributes(DependencyProperty dp, params Attribute[] attributes) { if (dp == null) { throw FxTrace.Exception.ArgumentNull("dp"); } if (attributes == null) { throw FxTrace.Exception.ArgumentNull("attributes"); } _table.AddCustomAttributes(_callbackType, dp, attributes); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------- namespace System.Activities.Presentation.Metadata { using System.Runtime; using System.Activities.Presentation.Internal.Metadata; using System.Activities.Presentation.Internal.Properties; using System; using System.ComponentModel; using System.Globalization; using System.Reflection; using System.Windows; using System.Activities.Presentation; //// An instance of this class is passed to callback delegates to lazily // populate the attributes for a type. // [Fx.Tag.XamlVisible(false)] public sealed class AttributeCallbackBuilder { private MutableAttributeTable _table; private Type _callbackType; internal AttributeCallbackBuilder(MutableAttributeTable table, Type callbackType) { _table = table; _callbackType = callbackType; } //// The type this callback is being invoked for. // public Type CallbackType { get { return _callbackType; } } //// Adds the contents of the provided attributes to this builder. // Conflicts are resolved with a last-in-wins strategy. // // // The new attributes to add. // //if type or attributes is null public void AddCustomAttributes(params Attribute[] attributes) { if (attributes == null) { throw FxTrace.Exception.ArgumentNull("attributes"); } _table.AddCustomAttributes(_callbackType, attributes); } //// Adds the contents of the provided attributes to this builder. // Conflicts are resolved with a last-in-wins strategy. // // An event or property descriptor to add attributes to. // // The new attributes to add. // //if descriptor or attributes is null public void AddCustomAttributes(MemberDescriptor descriptor, params Attribute[] attributes) { if (descriptor == null) { throw FxTrace.Exception.ArgumentNull("descriptor"); } if (attributes == null) { throw FxTrace.Exception.ArgumentNull("attributes"); } _table.AddCustomAttributes(_callbackType, descriptor, attributes); } //// Adds the contents of the provided attributes to this builder. // Conflicts are resolved with a last-in-wins strategy. // // An event or property info to add attributes to. // // The new attributes to add. // //if member or attributes is null public void AddCustomAttributes(MemberInfo member, params Attribute[] attributes) { if (member == null) { throw FxTrace.Exception.ArgumentNull("member"); } if (attributes == null) { throw FxTrace.Exception.ArgumentNull("attributes"); } _table.AddCustomAttributes(_callbackType, member, attributes); } //// Adds attributes to the member with the given name. The member can be a property // or an event. The member is evaluated on demand when the user queries // attributes on a given property or event. // // // The member to add attributes for. Only property and event members are supported; // all others will be ignored. // // // The new attributes to add. // public void AddCustomAttributes(string memberName, params Attribute[] attributes) { if (memberName == null) { throw FxTrace.Exception.ArgumentNull("memberName"); } if (attributes == null) { throw FxTrace.Exception.ArgumentNull("attributes"); } _table.AddCustomAttributes(_callbackType, memberName, attributes); } //// Adds the contents of the provided attributes to this builder. // Conflicts are resolved with a last-in-wins strategy. // // A dependency property to add attributes to. // // The new attributes to add. // //if dp or attributes is null public void AddCustomAttributes(DependencyProperty dp, params Attribute[] attributes) { if (dp == null) { throw FxTrace.Exception.ArgumentNull("dp"); } if (attributes == null) { throw FxTrace.Exception.ArgumentNull("attributes"); } _table.AddCustomAttributes(_callbackType, dp, attributes); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DSACryptoServiceProvider.cs
- ListBindableAttribute.cs
- KeyMatchBuilder.cs
- RoleExceptions.cs
- ErrorEventArgs.cs
- ButtonBaseAutomationPeer.cs
- BinaryMessageEncodingBindingElement.cs
- GAC.cs
- _FixedSizeReader.cs
- FaultPropagationRecord.cs
- InfocardExtendedInformationEntry.cs
- ScrollChangedEventArgs.cs
- MissingMemberException.cs
- ControlIdConverter.cs
- NativeMethods.cs
- WindowsProgressbar.cs
- RegexBoyerMoore.cs
- DataTable.cs
- CreateUserWizardStep.cs
- DelegatedStream.cs
- ViewStateException.cs
- EpmSyndicationContentDeSerializer.cs
- SaveFileDialog.cs
- PriorityChain.cs
- SystemIPInterfaceStatistics.cs
- ParserStreamGeometryContext.cs
- SettingsContext.cs
- ThreadExceptionEvent.cs
- Resources.Designer.cs
- FlowDocumentReaderAutomationPeer.cs
- RecognitionEventArgs.cs
- InvalidPrinterException.cs
- DatatypeImplementation.cs
- XmlAutoDetectWriter.cs
- XamlTemplateSerializer.cs
- PasswordRecoveryDesigner.cs
- DynamicPropertyHolder.cs
- DeferredReference.cs
- DataGridCell.cs
- XmlAttributeOverrides.cs
- TaskFileService.cs
- FactoryGenerator.cs
- DataViewListener.cs
- DataMemberAttribute.cs
- UpdatePanelTriggerCollection.cs
- JsonSerializer.cs
- ExtendedPropertyDescriptor.cs
- WindowsServiceCredential.cs
- CapabilitiesAssignment.cs
- HttpResponseInternalBase.cs
- XhtmlConformanceSection.cs
- COMException.cs
- OracleFactory.cs
- RubberbandSelector.cs
- HttpHeaderCollection.cs
- VectorCollectionConverter.cs
- RightsManagementEncryptedStream.cs
- Command.cs
- TreeViewEvent.cs
- ModulesEntry.cs
- SyntaxCheck.cs
- ParentQuery.cs
- RotationValidation.cs
- ToolboxSnapDragDropEventArgs.cs
- SingleStorage.cs
- XPathAncestorIterator.cs
- PropertyEntry.cs
- OleDbConnectionInternal.cs
- ListBox.cs
- Int32Rect.cs
- TextParentUndoUnit.cs
- InstancePersistence.cs
- XmlDocumentType.cs
- CodeIdentifiers.cs
- SessionEndingEventArgs.cs
- QuotaExceededException.cs
- UnionCodeGroup.cs
- MulticastDelegate.cs
- AssociationType.cs
- objectresult_tresulttype.cs
- LinqDataSourceInsertEventArgs.cs
- Attributes.cs
- WebRequest.cs
- XmlCollation.cs
- TypeCollectionPropertyEditor.cs
- LocalBuilder.cs
- XmlSchemaCompilationSettings.cs
- TransformerInfo.cs
- CodeComment.cs
- ImagingCache.cs
- RowToParametersTransformer.cs
- StatusBarAutomationPeer.cs
- GridPattern.cs
- RawTextInputReport.cs
- SecurityTokenProviderContainer.cs
- ScrollPatternIdentifiers.cs
- TextSelectionProcessor.cs
- ISAPIWorkerRequest.cs
- SqlConnectionManager.cs
- SqlTypesSchemaImporter.cs