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
- XmlILCommand.cs
- SqlDataSourceEnumerator.cs
- KeysConverter.cs
- AssociationSetMetadata.cs
- AutomationIdentifierGuids.cs
- CryptoApi.cs
- ByteStorage.cs
- EnumConverter.cs
- PreProcessInputEventArgs.cs
- DataTableCollection.cs
- HtmlEmptyTagControlBuilder.cs
- DropDownButton.cs
- HostingPreferredMapPath.cs
- XmlSchemaAttributeGroup.cs
- ColumnPropertiesGroup.cs
- XslCompiledTransform.cs
- Canvas.cs
- PreviousTrackingServiceAttribute.cs
- LinkAreaEditor.cs
- AccessDataSourceView.cs
- SafeEventLogWriteHandle.cs
- TextEditorContextMenu.cs
- WhileDesigner.cs
- Assert.cs
- Vector3DCollectionValueSerializer.cs
- GenericPrincipal.cs
- DataSourceSerializationException.cs
- WebReferencesBuildProvider.cs
- KeyEvent.cs
- NonClientArea.cs
- DynamicDiscoSearcher.cs
- ScriptBehaviorDescriptor.cs
- PtsHost.cs
- XmlWrappingReader.cs
- NavigationExpr.cs
- PrivilegedConfigurationManager.cs
- HostingEnvironmentSection.cs
- InternalMappingException.cs
- DataGridViewButtonColumn.cs
- AnnotationService.cs
- ipaddressinformationcollection.cs
- MachineKeyConverter.cs
- ClickablePoint.cs
- WorkflowRuntime.cs
- HtmlContainerControl.cs
- QuaternionKeyFrameCollection.cs
- ScriptManagerProxy.cs
- ComboBoxAutomationPeer.cs
- BooleanExpr.cs
- SqlDataSourceCache.cs
- TextStore.cs
- ProfessionalColorTable.cs
- DbParameterCollection.cs
- XmlCountingReader.cs
- StringArrayConverter.cs
- Cloud.cs
- SamlAssertionKeyIdentifierClause.cs
- CompiledAction.cs
- DataListItemEventArgs.cs
- FormsAuthenticationTicket.cs
- Column.cs
- Stackframe.cs
- CodeIdentifiers.cs
- OleDbPropertySetGuid.cs
- SqlDependencyUtils.cs
- ActivityCodeDomSerializer.cs
- MimeObjectFactory.cs
- MouseWheelEventArgs.cs
- ConstructorExpr.cs
- QueryOperatorEnumerator.cs
- WebPartConnection.cs
- EventlogProvider.cs
- BufferedWebEventProvider.cs
- DbParameterCollectionHelper.cs
- AuthenticationSection.cs
- datacache.cs
- AutoGeneratedField.cs
- GacUtil.cs
- SelectionGlyphBase.cs
- CryptoProvider.cs
- ProgressBarHighlightConverter.cs
- BackStopAuthenticationModule.cs
- DirectoryNotFoundException.cs
- XmlCountingReader.cs
- HandleCollector.cs
- PointAnimationClockResource.cs
- PeerInvitationResponse.cs
- CapabilitiesSection.cs
- AttachedPropertyBrowsableAttribute.cs
- RemoteWebConfigurationHostStream.cs
- OptimalTextSource.cs
- GiveFeedbackEvent.cs
- Array.cs
- MobileTextWriter.cs
- Lookup.cs
- PageAdapter.cs
- X509AudioLogo.cs
- RsaSecurityTokenAuthenticator.cs
- WebPartConnectionsConnectVerb.cs
- ModelTreeManager.cs