Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / Tools / System.Activities.Presentation / System / Activities / Presentation / View / TypeResolvingOptions.cs / 1305376 / TypeResolvingOptions.cs
//---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------- namespace System.Activities.Presentation.View { using System.Runtime; using System.Collections.ObjectModel; using System.Diagnostics.CodeAnalysis; [Fx.Tag.XamlVisible(false)] public class TypeResolvingOptions { public FuncFilter { get; set; } [SuppressMessage(FxCop.Category.Usage, FxCop.Rule.CollectionPropertiesShouldBeReadOnly, Justification = "Setter is provided to data binding on this property.")] internal ObservableCollection MostRecentlyUsedTypes { get; set; } public bool BrowseTypeDirectly { get; set; } internal static TypeResolvingOptions Merge(TypeResolvingOptions lhs, TypeResolvingOptions rhs) { if (lhs == null) { return rhs; } else if (rhs == null) { return lhs; } return new TypeResolvingOptions { Filter = FuncAnd(lhs.Filter, rhs.Filter), MostRecentlyUsedTypes = Intersect(lhs.MostRecentlyUsedTypes, rhs.MostRecentlyUsedTypes), BrowseTypeDirectly = lhs.BrowseTypeDirectly && rhs.BrowseTypeDirectly }; } static Func FuncAnd(Func lhs, Func rhs) { if (lhs == null) { return rhs; } else if (rhs == null) { return lhs; } return new Func ((e) => lhs(e) && rhs(e)); } static ObservableCollection Intersect (ObservableCollection lhs, ObservableCollection rhs) { if (lhs == null) { return rhs; } else if (rhs == null) { return lhs; } ObservableCollection collection = new ObservableCollection (); foreach (T t in lhs) { if (rhs.Contains(t)) { collection.Add(t); } } return collection; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------- namespace System.Activities.Presentation.View { using System.Runtime; using System.Collections.ObjectModel; using System.Diagnostics.CodeAnalysis; [Fx.Tag.XamlVisible(false)] public class TypeResolvingOptions { public Func Filter { get; set; } [SuppressMessage(FxCop.Category.Usage, FxCop.Rule.CollectionPropertiesShouldBeReadOnly, Justification = "Setter is provided to data binding on this property.")] internal ObservableCollection MostRecentlyUsedTypes { get; set; } public bool BrowseTypeDirectly { get; set; } internal static TypeResolvingOptions Merge(TypeResolvingOptions lhs, TypeResolvingOptions rhs) { if (lhs == null) { return rhs; } else if (rhs == null) { return lhs; } return new TypeResolvingOptions { Filter = FuncAnd(lhs.Filter, rhs.Filter), MostRecentlyUsedTypes = Intersect(lhs.MostRecentlyUsedTypes, rhs.MostRecentlyUsedTypes), BrowseTypeDirectly = lhs.BrowseTypeDirectly && rhs.BrowseTypeDirectly }; } static Func FuncAnd(Func lhs, Func rhs) { if (lhs == null) { return rhs; } else if (rhs == null) { return lhs; } return new Func ((e) => lhs(e) && rhs(e)); } static ObservableCollection Intersect (ObservableCollection lhs, ObservableCollection rhs) { if (lhs == null) { return rhs; } else if (rhs == null) { return lhs; } ObservableCollection collection = new ObservableCollection (); foreach (T t in lhs) { if (rhs.Contains(t)) { collection.Add(t); } } return collection; } } } // 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
- EntityWithChangeTrackerStrategy.cs
- DataGridViewCellValidatingEventArgs.cs
- CfgParser.cs
- AlphabeticalEnumConverter.cs
- ApplicationDirectory.cs
- LineInfo.cs
- CreatingCookieEventArgs.cs
- EdmComplexTypeAttribute.cs
- Random.cs
- NameHandler.cs
- ContentPropertyAttribute.cs
- ReferentialConstraintRoleElement.cs
- RadioButtonAutomationPeer.cs
- DebugController.cs
- ApplicationManager.cs
- SelfSignedCertificate.cs
- PropertyConverter.cs
- InvalidPropValue.cs
- ProcessExitedException.cs
- ClientApiGenerator.cs
- Recipient.cs
- HyperLinkColumn.cs
- DbConnectionPoolIdentity.cs
- RedistVersionInfo.cs
- DataGridTableCollection.cs
- TemplateControlCodeDomTreeGenerator.cs
- RecommendedAsConfigurableAttribute.cs
- GeometryDrawing.cs
- EntitySet.cs
- UnsafeNativeMethods.cs
- ContourSegment.cs
- _ListenerResponseStream.cs
- SerializerProvider.cs
- LinearGradientBrush.cs
- elementinformation.cs
- Attribute.cs
- TrackBarDesigner.cs
- TableHeaderCell.cs
- ToolTipAutomationPeer.cs
- TypeBuilder.cs
- httpserverutility.cs
- MarkupExtensionReturnTypeAttribute.cs
- XmlKeywords.cs
- _SafeNetHandles.cs
- SettingsPropertyValueCollection.cs
- Pens.cs
- InputLanguageSource.cs
- StatusBarPanelClickEvent.cs
- SecurityDocument.cs
- XmlSerializer.cs
- HandlerFactoryWrapper.cs
- XmlCharacterData.cs
- CodeStatementCollection.cs
- FormView.cs
- TrustManagerPromptUI.cs
- DataServiceOperationContext.cs
- Classification.cs
- XmlSchemaProviderAttribute.cs
- FrugalList.cs
- DataTableNewRowEvent.cs
- _Events.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- NotifyCollectionChangedEventArgs.cs
- HeaderUtility.cs
- RTLAwareMessageBox.cs
- StagingAreaInputItem.cs
- RightsManagementManager.cs
- ServerType.cs
- ArraySubsetEnumerator.cs
- EnumMember.cs
- XmlDictionary.cs
- FilterException.cs
- FillErrorEventArgs.cs
- ExpressionBuilderContext.cs
- Size.cs
- ContainerActivationHelper.cs
- OwnerDrawPropertyBag.cs
- TextFormatterContext.cs
- DesignerVerb.cs
- ShapeTypeface.cs
- VisualBasicReference.cs
- EncodingInfo.cs
- PixelFormat.cs
- TreeIterators.cs
- ScrollEventArgs.cs
- FrameworkContentElement.cs
- PermissionToken.cs
- ColorInterpolationModeValidation.cs
- CellIdBoolean.cs
- ToolStripDropDown.cs
- BaseCollection.cs
- BitmapEffect.cs
- FixedSOMTableRow.cs
- Image.cs
- RequestTimeoutManager.cs
- SqlProcedureAttribute.cs
- SerializationAttributes.cs
- WebPartEditorCancelVerb.cs
- ThicknessAnimation.cs
- HttpValueCollection.cs