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
- MetadataSource.cs
- Environment.cs
- ToolboxItemCollection.cs
- ObjectStorage.cs
- loginstatus.cs
- Bidi.cs
- SoapMessage.cs
- ScalarConstant.cs
- UnicodeEncoding.cs
- SqlCacheDependency.cs
- NGCUIElementCollectionSerializerAsync.cs
- CountdownEvent.cs
- SapiAttributeParser.cs
- ObfuscateAssemblyAttribute.cs
- SiteMapDataSource.cs
- ProtocolsConfiguration.cs
- IIS7UserPrincipal.cs
- ObjectConverter.cs
- InvalidComObjectException.cs
- HTMLTextWriter.cs
- QueueProcessor.cs
- WindowsAuthenticationModule.cs
- InfoCardRSACryptoProvider.cs
- IndexerNameAttribute.cs
- TypeInformation.cs
- MonitorWrapper.cs
- HandleRef.cs
- SessionStateContainer.cs
- _NetworkingPerfCounters.cs
- RowParagraph.cs
- MsmqIntegrationAppDomainProtocolHandler.cs
- TemplateComponentConnector.cs
- unsafenativemethodstextservices.cs
- DataGridViewBand.cs
- ServiceOperationHelpers.cs
- AlgoModule.cs
- WorkflowShape.cs
- ReservationCollection.cs
- XmlSchemaChoice.cs
- QueryContext.cs
- FocusTracker.cs
- BindingGraph.cs
- CopyAttributesAction.cs
- WorkflowValidationFailedException.cs
- CacheEntry.cs
- __TransparentProxy.cs
- MemberAssignmentAnalysis.cs
- AddingNewEventArgs.cs
- Relationship.cs
- DecoderBestFitFallback.cs
- safex509handles.cs
- WindowAutomationPeer.cs
- ButtonColumn.cs
- Calendar.cs
- PrinterUnitConvert.cs
- ListViewDeletedEventArgs.cs
- LocalizationParserHooks.cs
- DataServiceException.cs
- SaveFileDialog.cs
- InvokeMemberBinder.cs
- DBBindings.cs
- QilInvoke.cs
- AnimatedTypeHelpers.cs
- IDReferencePropertyAttribute.cs
- MarshalDirectiveException.cs
- SamlAuthenticationStatement.cs
- XPathEmptyIterator.cs
- TableRow.cs
- UIElementParaClient.cs
- BooleanAnimationBase.cs
- AuthenticationException.cs
- FileChangeNotifier.cs
- SqlGatherConsumedAliases.cs
- SubpageParaClient.cs
- ConfigurationErrorsException.cs
- GridProviderWrapper.cs
- ToolStripMenuItem.cs
- LiteralControl.cs
- StatusBar.cs
- BlurBitmapEffect.cs
- EventArgs.cs
- MobileControlPersister.cs
- WindowsAltTab.cs
- ExtensionDataObject.cs
- XmlDocumentType.cs
- WindowsUpDown.cs
- ConvertTextFrag.cs
- RadioButton.cs
- ModifierKeysValueSerializer.cs
- AppDomainUnloadedException.cs
- BinaryObjectWriter.cs
- DesignerAttribute.cs
- AdapterDictionary.cs
- ShapingEngine.cs
- SubpageParaClient.cs
- FormatVersion.cs
- Help.cs
- OleDbConnectionFactory.cs
- MouseCaptureWithinProperty.cs
- ContractMapping.cs