Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / Tools / System.Activities.Presentation / System / Activities / Presentation / Base / Core / PropertyEditing / categoryentry.cs / 1305376 / categoryentry.cs
namespace System.Activities.Presentation.PropertyEditing { using System.ComponentModel; using System.Diagnostics; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Activities.Presentation; using System; ////// The CategoryEntry class is a part of the property editing object model. It models a /// Category which has a localized name along with a collection of properties. /// public abstract class CategoryEntry : INotifyPropertyChanged, IPropertyFilterTarget { private string _name; private bool _matchesFilter; ////// Creates a new CategoryEntry. For host Infrastructure use /// /// The localized name of the corresponding Category as defined by the /// CategoryAttribute ///When name is either empty or null. protected CategoryEntry(string name) { if (string.IsNullOrEmpty(name)) throw FxTrace.Exception.ArgumentNull("name"); _name = name; } ////// Returns the localized Category name /// public string CategoryName { get { return _name; } } ////// Returns an IEnumerable collection of all of the properties in the category. /// public abstract IEnumerableProperties { get; } /// /// Indexer that returns a Property instance given the property name. /// /// The string property name to return a Property instance for. ///Property corresponding to the passed in propertyName if it exists, otherwise null public abstract PropertyEntry this[string propertyName] { get; } // INotifyPropertyChanged Members ////// INotifyPropertyChanged event /// public event PropertyChangedEventHandler PropertyChanged; ////// Raises the INotifyPropertyChanged.PropertyChanged event /// /// the name of the property that is changing ///When propertyName is null protected virtual void OnPropertyChanged(string propertyName) { if (propertyName == null) throw FxTrace.Exception.ArgumentNull("propertyName"); if (PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } } // IPropertyFilterTarget Members ////// IPropertyFilterTarget event /// public event EventHandlerFilterApplied; /// /// Raises the IPropertyFilterTarget.FilterApplied event /// /// The PropertyFilter being applied protected virtual void OnFilterApplied(PropertyFilter filter) { if (FilterApplied != null) { FilterApplied(this, new PropertyFilterAppliedEventArgs(filter)); } } ////// IPropertyFilterTarget method /// /// public virtual void ApplyFilter(PropertyFilter filter) { this.MatchesFilter = filter == null ? true : filter.Match(this); OnFilterApplied(filter); } ////// IPropertyFilterTarget property /// public virtual bool MatchesFilter { get { return _matchesFilter; } protected set { if (_matchesFilter != value) { _matchesFilter = value; this.OnPropertyChanged("MatchesFilter"); } } } ////// IPropertyFilterTarget method /// /// The PropertyFilterPredicate to match against ///true if there is a match, otherwise false public abstract bool MatchesPredicate(PropertyFilterPredicate predicate); } } // 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.ComponentModel; using System.Diagnostics; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Activities.Presentation; using System; ////// The CategoryEntry class is a part of the property editing object model. It models a /// Category which has a localized name along with a collection of properties. /// public abstract class CategoryEntry : INotifyPropertyChanged, IPropertyFilterTarget { private string _name; private bool _matchesFilter; ////// Creates a new CategoryEntry. For host Infrastructure use /// /// The localized name of the corresponding Category as defined by the /// CategoryAttribute ///When name is either empty or null. protected CategoryEntry(string name) { if (string.IsNullOrEmpty(name)) throw FxTrace.Exception.ArgumentNull("name"); _name = name; } ////// Returns the localized Category name /// public string CategoryName { get { return _name; } } ////// Returns an IEnumerable collection of all of the properties in the category. /// public abstract IEnumerableProperties { get; } /// /// Indexer that returns a Property instance given the property name. /// /// The string property name to return a Property instance for. ///Property corresponding to the passed in propertyName if it exists, otherwise null public abstract PropertyEntry this[string propertyName] { get; } // INotifyPropertyChanged Members ////// INotifyPropertyChanged event /// public event PropertyChangedEventHandler PropertyChanged; ////// Raises the INotifyPropertyChanged.PropertyChanged event /// /// the name of the property that is changing ///When propertyName is null protected virtual void OnPropertyChanged(string propertyName) { if (propertyName == null) throw FxTrace.Exception.ArgumentNull("propertyName"); if (PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } } // IPropertyFilterTarget Members ////// IPropertyFilterTarget event /// public event EventHandlerFilterApplied; /// /// Raises the IPropertyFilterTarget.FilterApplied event /// /// The PropertyFilter being applied protected virtual void OnFilterApplied(PropertyFilter filter) { if (FilterApplied != null) { FilterApplied(this, new PropertyFilterAppliedEventArgs(filter)); } } ////// IPropertyFilterTarget method /// /// public virtual void ApplyFilter(PropertyFilter filter) { this.MatchesFilter = filter == null ? true : filter.Match(this); OnFilterApplied(filter); } ////// IPropertyFilterTarget property /// public virtual bool MatchesFilter { get { return _matchesFilter; } protected set { if (_matchesFilter != value) { _matchesFilter = value; this.OnPropertyChanged("MatchesFilter"); } } } ////// IPropertyFilterTarget method /// /// The PropertyFilterPredicate to match against ///true if there is a match, otherwise false public abstract bool MatchesPredicate(PropertyFilterPredicate predicate); } } // 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
- GeneralTransform.cs
- ShutDownListener.cs
- CommentAction.cs
- ExtensibleSyndicationObject.cs
- SessionState.cs
- ToggleButton.cs
- TimerElapsedEvenArgs.cs
- PropertyGridEditorPart.cs
- DirectoryRedirect.cs
- DataGridViewCellStyleChangedEventArgs.cs
- ToolStripCodeDomSerializer.cs
- AdornerLayer.cs
- SecurityPermission.cs
- RayHitTestParameters.cs
- Size3DConverter.cs
- ServerType.cs
- SingleConverter.cs
- StateMachineWorkflowDesigner.cs
- ArraySegment.cs
- XmlComment.cs
- WinEventQueueItem.cs
- EmptyCollection.cs
- WebPartDisplayModeCollection.cs
- InProcStateClientManager.cs
- TargetFrameworkUtil.cs
- PerfService.cs
- BuildProviderUtils.cs
- UpdatableGenericsFeature.cs
- SelectionEditingBehavior.cs
- GroupPartitionExpr.cs
- PriorityQueue.cs
- BitmapEffectInput.cs
- StaticFileHandler.cs
- ValueSerializer.cs
- SHA256Managed.cs
- MenuBase.cs
- Registry.cs
- CustomPeerResolverService.cs
- RijndaelManaged.cs
- GridViewUpdatedEventArgs.cs
- ZipIOExtraFieldElement.cs
- ValueTypeIndexerReference.cs
- ServiceNameElementCollection.cs
- ComplusEndpointConfigContainer.cs
- BitmapPalette.cs
- SplineQuaternionKeyFrame.cs
- XmlSchemaSimpleContentExtension.cs
- TailPinnedEventArgs.cs
- BookmarkUndoUnit.cs
- CollectionTraceRecord.cs
- PreviewPrintController.cs
- LazyLoadBehavior.cs
- XmlUnspecifiedAttribute.cs
- SessionStateContainer.cs
- ByteStream.cs
- ThicknessAnimation.cs
- TdsEnums.cs
- GroupStyle.cs
- CollectionViewGroupRoot.cs
- EventEntry.cs
- ProjectionCamera.cs
- XmlNamespaceDeclarationsAttribute.cs
- AdCreatedEventArgs.cs
- DynamicDataRoute.cs
- LayoutEditorPart.cs
- CodeDefaultValueExpression.cs
- precedingquery.cs
- PDBReader.cs
- ImageKeyConverter.cs
- HtmlInputRadioButton.cs
- XmlElementAttribute.cs
- CompensatableTransactionScopeActivity.cs
- RotateTransform.cs
- TraceRecords.cs
- ScriptDescriptor.cs
- DataGridViewRowStateChangedEventArgs.cs
- NamedPipeHostedTransportConfiguration.cs
- CustomLineCap.cs
- GridItemPattern.cs
- MULTI_QI.cs
- TcpChannelHelper.cs
- DbCommandTree.cs
- CompleteWizardStep.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- SignatureToken.cs
- TPLETWProvider.cs
- CheckBoxField.cs
- MaskedTextProvider.cs
- PerformanceCounterCategory.cs
- ResizeGrip.cs
- EntitySqlQueryState.cs
- ShapingEngine.cs
- MediaPlayer.cs
- IntegerValidatorAttribute.cs
- MenuCommands.cs
- ContextMenuStrip.cs
- WebBrowser.cs
- WebBrowserUriTypeConverter.cs
- RefreshPropertiesAttribute.cs
- DataSourceDescriptorCollection.cs