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 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.
//----------------------------------------------------------------
// 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
- CodeGeneratorOptions.cs
- UnsignedPublishLicense.cs
- XmlObjectSerializerReadContextComplex.cs
- TransformedBitmap.cs
- TextSelectionHighlightLayer.cs
- DoubleKeyFrameCollection.cs
- SoapBinding.cs
- FileDialog.cs
- ListBindableAttribute.cs
- SystemTcpStatistics.cs
- TypeResolver.cs
- ProcessingInstructionAction.cs
- WindowAutomationPeer.cs
- DocumentStatusResources.cs
- HTTPRemotingHandler.cs
- MinimizableAttributeTypeConverter.cs
- SqlGatherProducedAliases.cs
- TableColumnCollection.cs
- XPathChildIterator.cs
- GridErrorDlg.cs
- ReferenceService.cs
- XmlQueryRuntime.cs
- SynchronizationLockException.cs
- ChineseLunisolarCalendar.cs
- RankException.cs
- ProfilePropertySettingsCollection.cs
- XmlIterators.cs
- HScrollProperties.cs
- Pointer.cs
- Task.cs
- MobileControlPersister.cs
- Atom10FormatterFactory.cs
- RelationshipEndCollection.cs
- ConnectionPool.cs
- ObjectComplexPropertyMapping.cs
- TdsParserHelperClasses.cs
- SocketStream.cs
- DataSvcMapFileSerializer.cs
- TimeZone.cs
- EmptyCollection.cs
- MulticastNotSupportedException.cs
- safemediahandle.cs
- BevelBitmapEffect.cs
- WebScriptMetadataMessageEncoderFactory.cs
- HyperLinkColumn.cs
- RawKeyboardInputReport.cs
- TextBoxBaseDesigner.cs
- DataRowChangeEvent.cs
- ArrowControl.xaml.cs
- Style.cs
- StringSource.cs
- TextServicesDisplayAttribute.cs
- ServiceModelConfigurationSection.cs
- CodeTypeMemberCollection.cs
- FlowDocumentReaderAutomationPeer.cs
- DbInsertCommandTree.cs
- TextParaClient.cs
- StylusPlugInCollection.cs
- NoResizeSelectionBorderGlyph.cs
- FunctionImportElement.cs
- XPathDocumentBuilder.cs
- CompressEmulationStream.cs
- WebBrowserBase.cs
- TickBar.cs
- ValidatorCompatibilityHelper.cs
- ContextMarshalException.cs
- Int64AnimationUsingKeyFrames.cs
- FontFamilyConverter.cs
- HotSpotCollection.cs
- XmlSchemaCompilationSettings.cs
- AdRotator.cs
- UnsafeNativeMethods.cs
- StatusBarPanelClickEvent.cs
- RuntimeResourceSet.cs
- ErrorView.xaml.cs
- PersonalizationState.cs
- IndexedString.cs
- StringHandle.cs
- DebugController.cs
- EntityDataSourceStatementEditorForm.cs
- BinaryUtilClasses.cs
- XPathNodePointer.cs
- SafeCoTaskMem.cs
- ResetableIterator.cs
- DoubleAverageAggregationOperator.cs
- EncryptedPackageFilter.cs
- Stylesheet.cs
- Condition.cs
- SymbolEqualComparer.cs
- StringInfo.cs
- ByteAnimation.cs
- RegexRunnerFactory.cs
- TableDetailsCollection.cs
- PerfCounters.cs
- PrimitiveXmlSerializers.cs
- DeclaredTypeValidator.cs
- HttpStreamXmlDictionaryWriter.cs
- ZipArchive.cs
- Thickness.cs
- EDesignUtil.cs