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
- PanelDesigner.cs
- HttpClientProtocol.cs
- ServiceReference.cs
- WebPartAddingEventArgs.cs
- OleDbEnumerator.cs
- cookiecontainer.cs
- MethodCallConverter.cs
- IIS7UserPrincipal.cs
- RichTextBox.cs
- LineSegment.cs
- PtsCache.cs
- QuaternionKeyFrameCollection.cs
- HtmlAnchor.cs
- Size3DConverter.cs
- SqlCacheDependency.cs
- OdbcConnectionString.cs
- XmlComplianceUtil.cs
- ConfigurationConverterBase.cs
- XmlRawWriter.cs
- TypeGeneratedEventArgs.cs
- DataFormats.cs
- StringSource.cs
- ComponentDispatcher.cs
- FormDesigner.cs
- HtmlTableCellCollection.cs
- WebEventTraceProvider.cs
- DataGridViewEditingControlShowingEventArgs.cs
- RegexCaptureCollection.cs
- AsymmetricKeyExchangeDeformatter.cs
- MSAANativeProvider.cs
- InputScopeManager.cs
- ScrollPatternIdentifiers.cs
- DesignTimeVisibleAttribute.cs
- InvalidDataContractException.cs
- HtmlTableRow.cs
- XappLauncher.cs
- RegisteredScript.cs
- SpecularMaterial.cs
- MediaContextNotificationWindow.cs
- BitVector32.cs
- Translator.cs
- DialogResultConverter.cs
- IsolatedStorageException.cs
- _AuthenticationState.cs
- MouseActionValueSerializer.cs
- RouteValueDictionary.cs
- DebugHandleTracker.cs
- XmlObjectSerializerWriteContextComplex.cs
- ExtendedPropertyCollection.cs
- PrintDialog.cs
- SessionEndedEventArgs.cs
- SQLUtility.cs
- ValidationError.cs
- ClipboardData.cs
- SiteMapHierarchicalDataSourceView.cs
- QuaternionKeyFrameCollection.cs
- UserCancellationException.cs
- PolyQuadraticBezierSegment.cs
- UnmanagedMarshal.cs
- AppDomainCompilerProxy.cs
- WMIGenerator.cs
- MoveSizeWinEventHandler.cs
- RawStylusInputCustomDataList.cs
- BulletedListDesigner.cs
- httpapplicationstate.cs
- WorkflowMarkupSerializer.cs
- CodeStatement.cs
- SQLByteStorage.cs
- DataGridColumnEventArgs.cs
- CompositeActivityValidator.cs
- PopOutPanel.cs
- HostingEnvironmentException.cs
- ModelUIElement3D.cs
- BaseResourcesBuildProvider.cs
- TreeNodeBindingCollection.cs
- TextProperties.cs
- CodeExporter.cs
- CommonRemoteMemoryBlock.cs
- BinaryParser.cs
- UriTemplateTrieLocation.cs
- XmlBinaryReaderSession.cs
- ToolStripItemDataObject.cs
- SoapEnumAttribute.cs
- SettingsSavedEventArgs.cs
- WeakHashtable.cs
- StrokeRenderer.cs
- BitmapEffectGeneralTransform.cs
- SQLSingleStorage.cs
- SocketInformation.cs
- basecomparevalidator.cs
- TypeDependencyAttribute.cs
- QilParameter.cs
- ClrPerspective.cs
- CharacterString.cs
- CngProvider.cs
- DuplicateMessageDetector.cs
- HelpOperationInvoker.cs
- ReturnValue.cs
- LogAppendAsyncResult.cs
- OperationCanceledException.cs