Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / Tools / System.Activities.Presentation / System / Activities / Presentation / Base / Core / PropertyEditing / CategoryEditor.cs / 1305376 / CategoryEditor.cs
namespace System.Activities.Presentation.PropertyEditing { using System; using System.Collections.Generic; using System.ComponentModel; using System.Globalization; using System.Text; using System.Windows; using System.Windows.Media; using System.Activities.Presentation.Internal.Properties; using System.Activities.Presentation; ////// Derive this class to provide a custom CategoryEditor for a set of Properties in a property /// browser host. /// public abstract class CategoryEditor { ////// This method is called once for each property in the category to determine which properties /// are edited by this CategoryEditor. When a property is consumed by a CategoryEditor, it does /// not show up as a separate row in that category. /// /// The PropertyEntry to check to see if its edited by this CategoryEditor ///true if this editor edits that property, otherwise false public abstract bool ConsumesProperty(PropertyEntry propertyEntry); ////// Returns a localized string that indicates which category this editor belongs to. CategoryEditors are /// defined on types and, thus, at load time they need to indicate the actual category they belong to. /// public abstract string TargetCategory { get; } ////// Returns a DataTemplate that is hosted by the PropertyInspector as the UI for a CategoryEditor. /// The DataSource of this DataTemplate is set to a CategoryEntry. /// public abstract DataTemplate EditorTemplate { get; } ////// Returns an object that the host can place into a ContentControl in order to display it. /// This icon may be used to adorn the editor for this category in /// a collapsed mode, should it support one. /// /// The desired size of the image to return. This method should make /// the best attempt in matching the requested size, but it doesn't guarantee it. public abstract object GetImage(Size desiredSize); ////// Utility method that creates a new EditorAttribute for the specified /// CategoryEditor /// /// CategoryEditor instance for which to create /// the new EditorAttribute ///New EditorAttribute for the specified CategoryEditor public static EditorAttribute CreateEditorAttribute(CategoryEditor editor) { if (editor == null) throw FxTrace.Exception.ArgumentNull("editor"); return CreateEditorAttribute(editor.GetType()); } ////// Utility method that creates a new EditorAttribute for the specified /// CategoryEditor type /// /// CategoryEditor type for which to create /// the new EditorAttribute ///New EditorAttribute for the specified CategoryEditor type public static EditorAttribute CreateEditorAttribute(Type categoryEditorType) { if (categoryEditorType == null) throw FxTrace.Exception.ArgumentNull("categoryEditorType"); if (!typeof(CategoryEditor).IsAssignableFrom(categoryEditorType)) throw FxTrace.Exception.AsError(new ArgumentException( string.Format( CultureInfo.CurrentCulture, Resources.Error_ArgIncorrectType, "categoryEditorType", typeof(CategoryEditor).Name))); return new EditorAttribute(categoryEditorType, categoryEditorType); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. namespace System.Activities.Presentation.PropertyEditing { using System; using System.Collections.Generic; using System.ComponentModel; using System.Globalization; using System.Text; using System.Windows; using System.Windows.Media; using System.Activities.Presentation.Internal.Properties; using System.Activities.Presentation; ////// Derive this class to provide a custom CategoryEditor for a set of Properties in a property /// browser host. /// public abstract class CategoryEditor { ////// This method is called once for each property in the category to determine which properties /// are edited by this CategoryEditor. When a property is consumed by a CategoryEditor, it does /// not show up as a separate row in that category. /// /// The PropertyEntry to check to see if its edited by this CategoryEditor ///true if this editor edits that property, otherwise false public abstract bool ConsumesProperty(PropertyEntry propertyEntry); ////// Returns a localized string that indicates which category this editor belongs to. CategoryEditors are /// defined on types and, thus, at load time they need to indicate the actual category they belong to. /// public abstract string TargetCategory { get; } ////// Returns a DataTemplate that is hosted by the PropertyInspector as the UI for a CategoryEditor. /// The DataSource of this DataTemplate is set to a CategoryEntry. /// public abstract DataTemplate EditorTemplate { get; } ////// Returns an object that the host can place into a ContentControl in order to display it. /// This icon may be used to adorn the editor for this category in /// a collapsed mode, should it support one. /// /// The desired size of the image to return. This method should make /// the best attempt in matching the requested size, but it doesn't guarantee it. public abstract object GetImage(Size desiredSize); ////// Utility method that creates a new EditorAttribute for the specified /// CategoryEditor /// /// CategoryEditor instance for which to create /// the new EditorAttribute ///New EditorAttribute for the specified CategoryEditor public static EditorAttribute CreateEditorAttribute(CategoryEditor editor) { if (editor == null) throw FxTrace.Exception.ArgumentNull("editor"); return CreateEditorAttribute(editor.GetType()); } ////// Utility method that creates a new EditorAttribute for the specified /// CategoryEditor type /// /// CategoryEditor type for which to create /// the new EditorAttribute ///New EditorAttribute for the specified CategoryEditor type public static EditorAttribute CreateEditorAttribute(Type categoryEditorType) { if (categoryEditorType == null) throw FxTrace.Exception.ArgumentNull("categoryEditorType"); if (!typeof(CategoryEditor).IsAssignableFrom(categoryEditorType)) throw FxTrace.Exception.AsError(new ArgumentException( string.Format( CultureInfo.CurrentCulture, Resources.Error_ArgIncorrectType, "categoryEditorType", typeof(CategoryEditor).Name))); return new EditorAttribute(categoryEditorType, categoryEditorType); } } } // 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
- WebControlsSection.cs
- ProxyWebPart.cs
- EventManager.cs
- SapiGrammar.cs
- ScriptModule.cs
- Stroke2.cs
- SRef.cs
- ApplicationInterop.cs
- Vector3DAnimation.cs
- safex509handles.cs
- Switch.cs
- AtomServiceDocumentSerializer.cs
- HyperlinkAutomationPeer.cs
- GradientStopCollection.cs
- OleDbRowUpdatedEvent.cs
- HtmlInputPassword.cs
- PriorityRange.cs
- PenThread.cs
- UpdatePanelControlTrigger.cs
- PropertyGridDesigner.cs
- HandlerMappingMemo.cs
- FixedDocument.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- ScriptMethodAttribute.cs
- DataGridViewColumn.cs
- PinProtectionHelper.cs
- AuthenticationService.cs
- LinqTreeNodeEvaluator.cs
- ReadWriteObjectLock.cs
- ListBindingConverter.cs
- RowType.cs
- XPathException.cs
- DataTableCollection.cs
- GridViewHeaderRowPresenterAutomationPeer.cs
- DataGridViewAutoSizeColumnModeEventArgs.cs
- WeakHashtable.cs
- Splitter.cs
- QueryConverter.cs
- DataPagerFieldCollection.cs
- StyleCollection.cs
- HttpListenerContext.cs
- ResourceKey.cs
- SizeValueSerializer.cs
- DefaultEventAttribute.cs
- ObjectSpanRewriter.cs
- XappLauncher.cs
- CurrencyManager.cs
- UIElementHelper.cs
- DataComponentMethodGenerator.cs
- ToolboxComponentsCreatedEventArgs.cs
- UndoEngine.cs
- _SslSessionsCache.cs
- ResourceManagerWrapper.cs
- ApplicationFileParser.cs
- DeferredSelectedIndexReference.cs
- ConfigXmlWhitespace.cs
- WindowsRebar.cs
- MaskedTextProvider.cs
- XamlSerializerUtil.cs
- SymbolTable.cs
- SafePointer.cs
- OutputCacheModule.cs
- Keyboard.cs
- WebSysDescriptionAttribute.cs
- SoapException.cs
- InputProviderSite.cs
- FtpWebRequest.cs
- PtsCache.cs
- DictionaryEntry.cs
- DataGridViewRowPostPaintEventArgs.cs
- AssemblyEvidenceFactory.cs
- CallbackValidator.cs
- HttpModulesSection.cs
- LayoutInformation.cs
- AuthStoreRoleProvider.cs
- PathParser.cs
- TextParagraph.cs
- DateTime.cs
- FileRecordSequenceCompletedAsyncResult.cs
- DesignBindingValueUIHandler.cs
- EditorBrowsableAttribute.cs
- Grid.cs
- XmlTextReader.cs
- ListViewPagedDataSource.cs
- Int64.cs
- PermissionToken.cs
- OracleLob.cs
- COAUTHIDENTITY.cs
- AsymmetricKeyExchangeDeformatter.cs
- TimelineGroup.cs
- DashStyles.cs
- SynchronizationLockException.cs
- HttpListenerTimeoutManager.cs
- ExtractedStateEntry.cs
- GotoExpression.cs
- SmiEventSink_DeferedProcessing.cs
- SelectionEditor.cs
- DataColumnMapping.cs
- XPathAncestorIterator.cs
- WebPartZone.cs