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
- CodeAssignStatement.cs
- StateMachineWorkflow.cs
- MultiAsyncResult.cs
- pingexception.cs
- LockRecursionException.cs
- DataServiceQueryProvider.cs
- SqlResolver.cs
- CodeTypeReferenceCollection.cs
- DescendantOverDescendantQuery.cs
- TransactionFlowBindingElementImporter.cs
- ServicePointManagerElement.cs
- GacUtil.cs
- ConstructorExpr.cs
- BrowserCapabilitiesCompiler.cs
- XmlSchemaComplexContentExtension.cs
- DataGridViewCheckBoxCell.cs
- BinaryFormatter.cs
- StringValidatorAttribute.cs
- CodeCommentStatementCollection.cs
- OptimalTextSource.cs
- ExtensionWindow.cs
- NullNotAllowedCollection.cs
- cache.cs
- BasePropertyDescriptor.cs
- KeyFrames.cs
- WebPartAuthorizationEventArgs.cs
- RemoteWebConfigurationHost.cs
- EntityContainerEntitySet.cs
- TrackingQuery.cs
- SchemaRegistration.cs
- ApplicationHost.cs
- DataTableReader.cs
- PnrpPermission.cs
- ToolTipAutomationPeer.cs
- DynamicObjectAccessor.cs
- _IPv6Address.cs
- PeerEndPoint.cs
- MultiBinding.cs
- DbParameterCollectionHelper.cs
- DataBoundControl.cs
- CompositeFontFamily.cs
- FileLogRecordStream.cs
- EdmItemCollection.cs
- WindowsListView.cs
- ReaderWriterLockSlim.cs
- HwndSource.cs
- WebServiceErrorEvent.cs
- DataRowExtensions.cs
- BaseParser.cs
- UIntPtr.cs
- ReflectPropertyDescriptor.cs
- MasterPageBuildProvider.cs
- DesignerLoader.cs
- IBuiltInEvidence.cs
- TextParaLineResult.cs
- CategoryNameCollection.cs
- ButtonBase.cs
- KeyMatchBuilder.cs
- MetaModel.cs
- ComEventsMethod.cs
- ServicePerformanceCounters.cs
- MsmqOutputMessage.cs
- DelayedRegex.cs
- Line.cs
- EncoderFallback.cs
- NamedPipeTransportSecurity.cs
- RegexNode.cs
- BounceEase.cs
- DocumentReference.cs
- XslAstAnalyzer.cs
- TransformGroup.cs
- AlphabetConverter.cs
- DataBindingCollection.cs
- BadImageFormatException.cs
- HeaderUtility.cs
- WorkflowApplicationCompletedException.cs
- OletxCommittableTransaction.cs
- Icon.cs
- SystemIPGlobalProperties.cs
- DemultiplexingDispatchMessageFormatter.cs
- CultureTable.cs
- DESCryptoServiceProvider.cs
- TextRunCacheImp.cs
- BufferModeSettings.cs
- XPathNodeIterator.cs
- ButtonColumn.cs
- Misc.cs
- PasswordRecovery.cs
- FrameworkElement.cs
- _LoggingObject.cs
- RoutedCommand.cs
- HierarchicalDataBoundControlAdapter.cs
- FocusChangedEventArgs.cs
- DefaultBinder.cs
- ProfilePropertySettings.cs
- BaseAsyncResult.cs
- SQLResource.cs
- WorkflowServiceInstance.cs
- ProxyGenerator.cs
- AssemblyNameProxy.cs