Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / ndp / fx / src / DataEntity / System / Data / Metadata / MetadataArtifactLoaderComposite.cs / 2 / MetadataArtifactLoaderComposite.cs
//----------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// @owner [....]
//---------------------------------------------------------------------
using System.Collections.Generic;
using System.Collections;
using System.Diagnostics;
using System.Globalization;
using System.Reflection;
using System.Text;
using System.Xml;
using System.Data.Mapping;
using System.IO;
using System.Security;
using System.Security.Permissions;
using System.Collections.ObjectModel;
namespace System.Data.Metadata.Edm
{
///
/// This class represents a super-collection (a collection of collections)
/// of artifact resources. Typically, this "meta-collection" would contain
/// artifacts represented as individual files, directories (which are in
/// turn collections of files), and embedded resources.
///
/// This is the root class for access to all loader objects.
internal class MetadataArtifactLoaderComposite : MetadataArtifactLoader, IEnumerable
{
///
/// The list of loaders aggregated by the composite.
///
private readonly ReadOnlyCollection _children;
///
/// Constructor - loads all resources into the _children collection
///
/// A list of collections to aggregate
public MetadataArtifactLoaderComposite(List children)
{
Debug.Assert(children != null);
_children = new List(children).AsReadOnly();
}
public override string Path
{
get { return string.Empty; }
}
public override void CollectFilePermissionPaths(List paths, DataSpace spaceToGet)
{
foreach (MetadataArtifactLoader loader in _children)
{
loader.CollectFilePermissionPaths(paths, spaceToGet);
}
}
public override bool IsComposite
{
get
{
return true;
}
}
///
/// Get the list of paths to all artifacts in the original, unexpanded form
///
/// A List of strings identifying paths to all resources
public override List GetOriginalPaths()
{
List list = new List();
foreach (MetadataArtifactLoader loader in _children)
{
list.AddRange(loader.GetOriginalPaths());
}
return list;
}
///
/// Get paths to artifacts for a specific DataSpace, in the original, unexpanded
/// form
///
/// The DataSpace for the artifacts of interest
/// A List of strings identifying paths to all artifacts for a specific DataSpace
public override List GetOriginalPaths(DataSpace spaceToGet)
{
List list = new List();
foreach (MetadataArtifactLoader loader in _children)
{
list.AddRange(loader.GetOriginalPaths(spaceToGet));
}
return list;
}
///
/// Get paths to artifacts for a specific DataSpace.
///
/// The DataSpace for the artifacts of interest
/// A List of strings identifying paths to all artifacts for a specific DataSpace
public override List GetPaths(DataSpace spaceToGet)
{
List list = new List();
foreach (MetadataArtifactLoader loader in _children)
{
list.AddRange(loader.GetPaths(spaceToGet));
}
return list;
}
///
/// Get paths to all artifacts
///
/// A List of strings identifying paths to all resources
public override List GetPaths()
{
List list = new List();
foreach (MetadataArtifactLoader resource in _children)
{
list.AddRange(resource.GetPaths());
}
return list;
}
///
/// Aggregates all resource streams from the _children collection
///
/// A List of XmlReader objects; cannot be null
public override List GetReaders(Dictionary sourceDictionary)
{
List list = new List();
foreach (MetadataArtifactLoader resource in _children)
{
list.AddRange(resource.GetReaders(sourceDictionary));
}
return list;
}
///
/// Get XmlReaders for a specific DataSpace.
///
/// The DataSpace corresponding to the requested artifacts
/// A List of XmlReader objects
public override List CreateReaders(DataSpace spaceToGet)
{
List list = new List();
foreach (MetadataArtifactLoader resource in _children)
{
list.AddRange(resource.CreateReaders(spaceToGet));
}
return list;
}
#region IEnumerable Members
public IEnumerator GetEnumerator()
{
return this._children.GetEnumerator();
}
#endregion
#region IEnumerable Members
IEnumerator IEnumerable.GetEnumerator()
{
return this._children.GetEnumerator();
}
#endregion
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//----------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// @owner [....]
//---------------------------------------------------------------------
using System.Collections.Generic;
using System.Collections;
using System.Diagnostics;
using System.Globalization;
using System.Reflection;
using System.Text;
using System.Xml;
using System.Data.Mapping;
using System.IO;
using System.Security;
using System.Security.Permissions;
using System.Collections.ObjectModel;
namespace System.Data.Metadata.Edm
{
///
/// This class represents a super-collection (a collection of collections)
/// of artifact resources. Typically, this "meta-collection" would contain
/// artifacts represented as individual files, directories (which are in
/// turn collections of files), and embedded resources.
///
/// This is the root class for access to all loader objects.
internal class MetadataArtifactLoaderComposite : MetadataArtifactLoader, IEnumerable
{
///
/// The list of loaders aggregated by the composite.
///
private readonly ReadOnlyCollection _children;
///
/// Constructor - loads all resources into the _children collection
///
/// A list of collections to aggregate
public MetadataArtifactLoaderComposite(List children)
{
Debug.Assert(children != null);
_children = new List(children).AsReadOnly();
}
public override string Path
{
get { return string.Empty; }
}
public override void CollectFilePermissionPaths(List paths, DataSpace spaceToGet)
{
foreach (MetadataArtifactLoader loader in _children)
{
loader.CollectFilePermissionPaths(paths, spaceToGet);
}
}
public override bool IsComposite
{
get
{
return true;
}
}
///
/// Get the list of paths to all artifacts in the original, unexpanded form
///
/// A List of strings identifying paths to all resources
public override List GetOriginalPaths()
{
List list = new List();
foreach (MetadataArtifactLoader loader in _children)
{
list.AddRange(loader.GetOriginalPaths());
}
return list;
}
///
/// Get paths to artifacts for a specific DataSpace, in the original, unexpanded
/// form
///
/// The DataSpace for the artifacts of interest
/// A List of strings identifying paths to all artifacts for a specific DataSpace
public override List GetOriginalPaths(DataSpace spaceToGet)
{
List list = new List();
foreach (MetadataArtifactLoader loader in _children)
{
list.AddRange(loader.GetOriginalPaths(spaceToGet));
}
return list;
}
///
/// Get paths to artifacts for a specific DataSpace.
///
/// The DataSpace for the artifacts of interest
/// A List of strings identifying paths to all artifacts for a specific DataSpace
public override List GetPaths(DataSpace spaceToGet)
{
List list = new List();
foreach (MetadataArtifactLoader loader in _children)
{
list.AddRange(loader.GetPaths(spaceToGet));
}
return list;
}
///
/// Get paths to all artifacts
///
/// A List of strings identifying paths to all resources
public override List GetPaths()
{
List list = new List();
foreach (MetadataArtifactLoader resource in _children)
{
list.AddRange(resource.GetPaths());
}
return list;
}
///
/// Aggregates all resource streams from the _children collection
///
/// A List of XmlReader objects; cannot be null
public override List GetReaders(Dictionary sourceDictionary)
{
List list = new List();
foreach (MetadataArtifactLoader resource in _children)
{
list.AddRange(resource.GetReaders(sourceDictionary));
}
return list;
}
///
/// Get XmlReaders for a specific DataSpace.
///
/// The DataSpace corresponding to the requested artifacts
/// A List of XmlReader objects
public override List CreateReaders(DataSpace spaceToGet)
{
List list = new List();
foreach (MetadataArtifactLoader resource in _children)
{
list.AddRange(resource.CreateReaders(spaceToGet));
}
return list;
}
#region IEnumerable Members
public IEnumerator GetEnumerator()
{
return this._children.GetEnumerator();
}
#endregion
#region IEnumerable Members
IEnumerator IEnumerable.GetEnumerator()
{
return this._children.GetEnumerator();
}
#endregion
}
}
// 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
- BaseTreeIterator.cs
- WebPartUtil.cs
- XamlSerializerUtil.cs
- UIElementParagraph.cs
- PreviewKeyDownEventArgs.cs
- ContainerUtilities.cs
- GradientBrush.cs
- ILGenerator.cs
- TokenCreationException.cs
- AccessibilityApplicationManager.cs
- ActivityTypeCodeDomSerializer.cs
- CodeNamespaceImportCollection.cs
- ReflectTypeDescriptionProvider.cs
- IncrementalCompileAnalyzer.cs
- ScriptResourceInfo.cs
- PageThemeParser.cs
- InfoCardBaseException.cs
- SignedPkcs7.cs
- WhitespaceRuleReader.cs
- NegationPusher.cs
- RoleManagerModule.cs
- RuleSetCollection.cs
- LineBreak.cs
- ScriptResourceHandler.cs
- MatrixConverter.cs
- formatter.cs
- SqlDataSourceStatusEventArgs.cs
- peernodeimplementation.cs
- XsltException.cs
- AdornerLayer.cs
- RequestCache.cs
- StaticSiteMapProvider.cs
- GeneralTransform3DGroup.cs
- InputBinder.cs
- WebPartDescription.cs
- SizeF.cs
- InputScopeManager.cs
- Rule.cs
- UIPropertyMetadata.cs
- LightweightCodeGenerator.cs
- FunctionCommandText.cs
- DTCTransactionManager.cs
- ProgressChangedEventArgs.cs
- SqlTypesSchemaImporter.cs
- DataControlCommands.cs
- WebEventTraceProvider.cs
- DbProviderFactories.cs
- BitmapMetadataBlob.cs
- MeasurementDCInfo.cs
- XmlSchemaSimpleTypeUnion.cs
- Main.cs
- DataGridDetailsPresenterAutomationPeer.cs
- NavigationWindowAutomationPeer.cs
- TextRange.cs
- DbParameterHelper.cs
- XmlSchemaSimpleTypeRestriction.cs
- ListBoxItemAutomationPeer.cs
- _Rfc2616CacheValidators.cs
- TextHintingModeValidation.cs
- EncryptedPackage.cs
- Recipient.cs
- RightsManagementPermission.cs
- BindingListCollectionView.cs
- ObjectNotFoundException.cs
- TextBox.cs
- FreezableCollection.cs
- ContainerUIElement3D.cs
- LambdaCompiler.ControlFlow.cs
- TextSelectionProcessor.cs
- WebPartMenu.cs
- EnvironmentPermission.cs
- RectangleConverter.cs
- DataControlLinkButton.cs
- LogRecordSequence.cs
- XmlWhitespace.cs
- IsolatedStorageFile.cs
- SplitContainer.cs
- AuthenticationException.cs
- ParameterInfo.cs
- RemoteEndpointMessageProperty.cs
- CapiHashAlgorithm.cs
- WebException.cs
- SettingsPropertyWrongTypeException.cs
- fixedPageContentExtractor.cs
- ISAPIWorkerRequest.cs
- TransformProviderWrapper.cs
- Suspend.cs
- ControlBindingsConverter.cs
- ToolStripPanelDesigner.cs
- RightsManagementPermission.cs
- InputElement.cs
- FileEnumerator.cs
- SharedDp.cs
- PageTheme.cs
- SQLBinary.cs
- CacheHelper.cs
- Misc.cs
- XmlSchemaSimpleContentRestriction.cs
- ByteStream.cs
- ToolStripArrowRenderEventArgs.cs