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
- FusionWrap.cs
- WindowsComboBox.cs
- TargetPerspective.cs
- UInt64.cs
- XmlSequenceWriter.cs
- WebPartDisplayModeCancelEventArgs.cs
- JoinCqlBlock.cs
- CodeAttributeDeclaration.cs
- ResXResourceReader.cs
- CompiledXpathExpr.cs
- AutoResetEvent.cs
- TextSpanModifier.cs
- Rule.cs
- ListSortDescriptionCollection.cs
- AnimationTimeline.cs
- DbConnectionPool.cs
- PatternMatcher.cs
- NumberAction.cs
- StatusBar.cs
- ASCIIEncoding.cs
- TablePattern.cs
- ObjectStorage.cs
- ManipulationStartedEventArgs.cs
- DrawingContextWalker.cs
- ServicePointManagerElement.cs
- AvTraceDetails.cs
- HttpModuleCollection.cs
- ToolStripGripRenderEventArgs.cs
- RectangleConverter.cs
- ValidatedControlConverter.cs
- WsdlExporter.cs
- XmlObjectSerializerWriteContextComplex.cs
- MarkupObject.cs
- CompositeFontFamily.cs
- Rotation3DAnimation.cs
- PersistChildrenAttribute.cs
- PartManifestEntry.cs
- ServiceManager.cs
- DescendantBaseQuery.cs
- PassportPrincipal.cs
- Crypto.cs
- BrowserDefinitionCollection.cs
- CursorConverter.cs
- ParamArrayAttribute.cs
- CngKeyCreationParameters.cs
- CachedPathData.cs
- XmlEncoding.cs
- ControlCachePolicy.cs
- Size.cs
- HttpFileCollection.cs
- UnauthorizedAccessException.cs
- SharedPerformanceCounter.cs
- PcmConverter.cs
- GenerateHelper.cs
- ToolStripSplitStackLayout.cs
- DateRangeEvent.cs
- LiteralTextContainerControlBuilder.cs
- RoleGroup.cs
- IProvider.cs
- RegexReplacement.cs
- MustUnderstandSoapException.cs
- XAMLParseException.cs
- BindStream.cs
- ToolStripDesignerAvailabilityAttribute.cs
- SqlFacetAttribute.cs
- GetResponse.cs
- SizeLimitedCache.cs
- RecommendedAsConfigurableAttribute.cs
- RawUIStateInputReport.cs
- TabletDevice.cs
- HtmlImage.cs
- ErrorWrapper.cs
- SystemPens.cs
- CreateUserWizardDesigner.cs
- PTConverter.cs
- Gdiplus.cs
- ErrorRuntimeConfig.cs
- StructureChangedEventArgs.cs
- ResourceWriter.cs
- precedingquery.cs
- ServiceManager.cs
- GeometryModel3D.cs
- DirtyTextRange.cs
- AdRotator.cs
- ConfigErrorGlyph.cs
- SafeCloseHandleCritical.cs
- ItemCheckedEvent.cs
- XsdBuildProvider.cs
- SmtpMail.cs
- FixedPageStructure.cs
- ParseHttpDate.cs
- DataRecord.cs
- AutomationEventArgs.cs
- HelpInfo.cs
- SettingsSection.cs
- DataGridCellsPresenter.cs
- VisemeEventArgs.cs
- TextParagraphCache.cs
- FontWeight.cs
- base64Transforms.cs