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
- SegmentInfo.cs
- LineInfo.cs
- MailBnfHelper.cs
- EntityConnection.cs
- ModulesEntry.cs
- NetworkAddressChange.cs
- Interlocked.cs
- CompositionTarget.cs
- SafeNativeMethods.cs
- Item.cs
- PeerNodeTraceRecord.cs
- TextDecorationCollection.cs
- DBDataPermissionAttribute.cs
- DateTimeConverter2.cs
- WebDisplayNameAttribute.cs
- XmlElementAttributes.cs
- DataControlPagerLinkButton.cs
- SerTrace.cs
- KeyedCollection.cs
- autovalidator.cs
- ObjectSet.cs
- XmlComment.cs
- XmlValidatingReader.cs
- RegexRunnerFactory.cs
- Point3DAnimation.cs
- EncodingNLS.cs
- _MultipleConnectAsync.cs
- DragEvent.cs
- DependencyProperty.cs
- PageCatalogPart.cs
- PaintEvent.cs
- AudioFileOut.cs
- unsafeIndexingFilterStream.cs
- COM2PictureConverter.cs
- WMICapabilities.cs
- SqlConnection.cs
- HiddenField.cs
- Visual3DCollection.cs
- Button.cs
- NotEqual.cs
- COM2EnumConverter.cs
- WinFormsSecurity.cs
- FileLogRecordEnumerator.cs
- ReplyChannelAcceptor.cs
- GroupDescription.cs
- StylusSystemGestureEventArgs.cs
- DataBindingCollectionConverter.cs
- ISAPIApplicationHost.cs
- TraceHandler.cs
- Rfc2898DeriveBytes.cs
- ScriptRegistrationManager.cs
- ListParagraph.cs
- WindowAutomationPeer.cs
- HashCodeCombiner.cs
- FillErrorEventArgs.cs
- FreezableOperations.cs
- AliasGenerator.cs
- WizardStepBase.cs
- ProxyWebPartConnectionCollection.cs
- InfiniteTimeSpanConverter.cs
- WebBrowserNavigatedEventHandler.cs
- InputBinding.cs
- ClientConfigurationSystem.cs
- ReflectEventDescriptor.cs
- XamlGridLengthSerializer.cs
- ReflectionPermission.cs
- IxmlLineInfo.cs
- XPathNodeInfoAtom.cs
- OleDbTransaction.cs
- SignatureDescription.cs
- ParentQuery.cs
- Help.cs
- JulianCalendar.cs
- TableLayoutCellPaintEventArgs.cs
- SafeCoTaskMem.cs
- _OverlappedAsyncResult.cs
- EdgeProfileValidation.cs
- CatalogPart.cs
- ClientTargetCollection.cs
- SecurityState.cs
- DesignBindingPicker.cs
- InkCanvasSelectionAdorner.cs
- OleDbSchemaGuid.cs
- LineUtil.cs
- ForceCopyBuildProvider.cs
- ColumnWidthChangingEvent.cs
- DataError.cs
- GlobalProxySelection.cs
- BindingMemberInfo.cs
- ThreadSafeList.cs
- StylusPlugInCollection.cs
- ProxyWebPart.cs
- HttpResponseInternalWrapper.cs
- RecordConverter.cs
- PriorityRange.cs
- ValidatorUtils.cs
- RequestTimeoutManager.cs
- EntityException.cs
- Crc32.cs
- MonthCalendar.cs