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
- ArgumentDesigner.xaml.cs
- GeneratedContractType.cs
- ReachDocumentSequenceSerializerAsync.cs
- CommandTreeTypeHelper.cs
- LinkLabelLinkClickedEvent.cs
- RegistrationProxy.cs
- DrawingContextWalker.cs
- NativeMethods.cs
- DocumentViewerAutomationPeer.cs
- ISessionStateStore.cs
- AutomationPropertyInfo.cs
- InvalidEnumArgumentException.cs
- OrCondition.cs
- ErrorFormatter.cs
- ErrorTableItemStyle.cs
- ListControl.cs
- ResizeBehavior.cs
- Exceptions.cs
- FormConverter.cs
- RightsManagementInformation.cs
- MasterPageParser.cs
- ButtonBase.cs
- AnonymousIdentificationModule.cs
- TypeConverterBase.cs
- CodeEventReferenceExpression.cs
- Resources.Designer.cs
- complextypematerializer.cs
- VectorValueSerializer.cs
- MethodCallTranslator.cs
- TemplateEditingService.cs
- HyperlinkAutomationPeer.cs
- XmlWhitespace.cs
- ContainsRowNumberChecker.cs
- PKCS1MaskGenerationMethod.cs
- XmlILIndex.cs
- DataGridAddNewRow.cs
- TextTreeNode.cs
- DataColumnSelectionConverter.cs
- SocketInformation.cs
- WebPartDescription.cs
- Token.cs
- XmlSerializerFactory.cs
- BlurEffect.cs
- SmtpFailedRecipientException.cs
- SizeLimitedCache.cs
- OptionUsage.cs
- Activity.cs
- CodeDefaultValueExpression.cs
- COM2ExtendedBrowsingHandler.cs
- DecimalAnimationBase.cs
- WebCategoryAttribute.cs
- ObjectListCommand.cs
- WindowsFormsHost.cs
- WorkflowMarkupSerializationManager.cs
- DependencyPropertyAttribute.cs
- HostedElements.cs
- CodeArgumentReferenceExpression.cs
- HtmlLinkAdapter.cs
- EventHandlingScope.cs
- ContentTextAutomationPeer.cs
- HtmlInputText.cs
- ConnectionStringsExpressionBuilder.cs
- CustomErrorsSectionWrapper.cs
- DbModificationClause.cs
- Polygon.cs
- ChannelSinkStacks.cs
- DynamicDiscoveryDocument.cs
- HashJoinQueryOperatorEnumerator.cs
- TextTreeTextNode.cs
- CategoryAttribute.cs
- _TransmitFileOverlappedAsyncResult.cs
- PlanCompiler.cs
- RouteCollection.cs
- ComplexPropertyEntry.cs
- odbcmetadatacollectionnames.cs
- SecurityUtils.cs
- ZipPackage.cs
- FieldMetadata.cs
- DataServiceSaveChangesEventArgs.cs
- TransformValueSerializer.cs
- templategroup.cs
- MaskedTextBox.cs
- WorkflowViewElement.cs
- TdsParserHelperClasses.cs
- TypeViewSchema.cs
- BamlCollectionHolder.cs
- ItemList.cs
- ConnectionPoint.cs
- Assembly.cs
- XmlAttributeHolder.cs
- TcpClientCredentialType.cs
- Int32Collection.cs
- PropertyPathConverter.cs
- DesignerResources.cs
- TextReader.cs
- LogicalCallContext.cs
- AppearanceEditorPart.cs
- MenuRenderer.cs
- precedingquery.cs
- MediaSystem.cs