Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- XamlPoint3DCollectionSerializer.cs
- PreDigestedSignedInfo.cs
- ParameterReplacerVisitor.cs
- PageClientProxyGenerator.cs
- TraceHandlerErrorFormatter.cs
- WebPartCloseVerb.cs
- AssociationEndMember.cs
- ReadOnlyAttribute.cs
- Metadata.cs
- ListViewItem.cs
- WeakReference.cs
- DesignerTransaction.cs
- DataGridViewIntLinkedList.cs
- Util.cs
- GenericIdentity.cs
- SourceFileBuildProvider.cs
- FloaterParagraph.cs
- ClonableStack.cs
- CodeDomConfigurationHandler.cs
- DbConnectionFactory.cs
- IMembershipProvider.cs
- DateBoldEvent.cs
- AuthenticationModuleElementCollection.cs
- QuaternionKeyFrameCollection.cs
- PeerUnsafeNativeMethods.cs
- SafeHandles.cs
- ViewGenerator.cs
- FixedStringLookup.cs
- TreeWalkHelper.cs
- DataMemberFieldConverter.cs
- MetadataUtilsSmi.cs
- DesignerActionPanel.cs
- RectangleHotSpot.cs
- BuildProvider.cs
- ControlDesigner.cs
- CustomValidator.cs
- Geometry3D.cs
- PrintDocument.cs
- UnsettableComboBox.cs
- dataprotectionpermission.cs
- TableHeaderCell.cs
- ClientRuntimeConfig.cs
- ChannelServices.cs
- BuildProvider.cs
- UnsafeNativeMethodsMilCoreApi.cs
- SystemIcmpV6Statistics.cs
- PresentationAppDomainManager.cs
- DataGridCommandEventArgs.cs
- Completion.cs
- WindowsFormsLinkLabel.cs
- InvariantComparer.cs
- ColumnMapTranslator.cs
- RegexWriter.cs
- NameValueSectionHandler.cs
- MsmqIntegrationProcessProtocolHandler.cs
- UriTemplateClientFormatter.cs
- ParameterCollection.cs
- TdsValueSetter.cs
- CreateRefExpr.cs
- DataServiceResponse.cs
- SemaphoreSlim.cs
- SpStreamWrapper.cs
- CodeStatementCollection.cs
- TrackingServices.cs
- ThicknessAnimation.cs
- DateTimeUtil.cs
- JavascriptXmlWriterWrapper.cs
- CheckBoxStandardAdapter.cs
- NavigationFailedEventArgs.cs
- ZipIOLocalFileBlock.cs
- ProcessHost.cs
- IntegerCollectionEditor.cs
- ListViewSortEventArgs.cs
- HotCommands.cs
- SecurityVersion.cs
- ServiceDescriptions.cs
- StickyNoteHelper.cs
- AsyncStreamReader.cs
- DecimalSumAggregationOperator.cs
- TabletCollection.cs
- Shared.cs
- BitmapEffectDrawingContent.cs
- MruCache.cs
- RelationshipType.cs
- ListChangedEventArgs.cs
- TitleStyle.cs
- Crypto.cs
- WebPartTracker.cs
- TypedTableBase.cs
- OleDbWrapper.cs
- PathStreamGeometryContext.cs
- ProfileBuildProvider.cs
- XPathSingletonIterator.cs
- bidPrivateBase.cs
- PathGradientBrush.cs
- OleStrCAMarshaler.cs
- ControlIdConverter.cs
- MessageSmuggler.cs
- StreamWithDictionary.cs
- WebPartChrome.cs