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
- datacache.cs
- SmtpNegotiateAuthenticationModule.cs
- GenerateScriptTypeAttribute.cs
- PostBackTrigger.cs
- FragmentNavigationEventArgs.cs
- XmlEntityReference.cs
- NativeActivity.cs
- BezierSegment.cs
- AsyncCallback.cs
- ColorKeyFrameCollection.cs
- WebServiceHandlerFactory.cs
- Evidence.cs
- AuthenticationService.cs
- AbandonedMutexException.cs
- WebPartDescription.cs
- SharedMemory.cs
- AuthenticatedStream.cs
- SafeCoTaskMem.cs
- InfoCardCryptoHelper.cs
- DbQueryCommandTree.cs
- EntitySet.cs
- RecordsAffectedEventArgs.cs
- PropertyCondition.cs
- RotateTransform.cs
- SoapObjectReader.cs
- HtmlContainerControl.cs
- SecurityTokenTypes.cs
- CLSCompliantAttribute.cs
- ResponseBodyWriter.cs
- ScopedKnownTypes.cs
- HtmlTableCellCollection.cs
- KnownIds.cs
- BitmapEffectInput.cs
- AvTraceFormat.cs
- PrimitiveDataContract.cs
- ImageCollectionEditor.cs
- NavigationWindow.cs
- Application.cs
- CodeGeneratorAttribute.cs
- WarningException.cs
- DataGridViewAutoSizeColumnModeEventArgs.cs
- Header.cs
- DataBindingHandlerAttribute.cs
- HMACSHA512.cs
- BrowserCapabilitiesFactoryBase.cs
- PenThreadWorker.cs
- IndependentlyAnimatedPropertyMetadata.cs
- PerfService.cs
- WhitespaceRuleLookup.cs
- GetIndexBinder.cs
- MethodBuilder.cs
- IdleTimeoutMonitor.cs
- Common.cs
- SafeHGlobalHandleCritical.cs
- TemplateField.cs
- PasswordRecovery.cs
- XmlTextReaderImplHelpers.cs
- RegexParser.cs
- ResourceReferenceExpression.cs
- MobileUserControl.cs
- NotSupportedException.cs
- DetailsViewDeleteEventArgs.cs
- EdgeModeValidation.cs
- SafeNativeMethods.cs
- Transform3DGroup.cs
- IsolatedStorageException.cs
- ApplicationServiceHelper.cs
- ReadOnlyNameValueCollection.cs
- Rotation3DAnimation.cs
- ParsedRoute.cs
- PageRouteHandler.cs
- XslTransform.cs
- RemoteWebConfigurationHost.cs
- CatalogPartDesigner.cs
- FillRuleValidation.cs
- SiteMap.cs
- JournalEntryListConverter.cs
- Mutex.cs
- TrackingSection.cs
- AccessDataSourceWizardForm.cs
- Size.cs
- ParameterCollection.cs
- StandardOleMarshalObject.cs
- MessagePropertyAttribute.cs
- JumpTask.cs
- DocumentAutomationPeer.cs
- WebPartCollection.cs
- TreeView.cs
- DiagnosticsConfigurationHandler.cs
- QuinticEase.cs
- DataFieldConverter.cs
- ConnectionPoolManager.cs
- DnsEndPoint.cs
- OletxTransactionManager.cs
- CryptoStream.cs
- ListBoxItemAutomationPeer.cs
- EntityAdapter.cs
- ZipFileInfo.cs
- DelegateBodyWriter.cs
- DataViewManagerListItemTypeDescriptor.cs