本文整理汇总了C#中IFileSystem.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# IFileSystem.GetType方法的具体用法?C# IFileSystem.GetType怎么用?C# IFileSystem.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IFileSystem
的用法示例。
在下文中一共展示了IFileSystem.GetType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Move
public static void Move(this IFileSystem sourceFileSystem, FileSystemPath sourcePath, IFileSystem destinationFileSystem, FileSystemPath destinationPath)
{
IEntityMover mover;
if (!EntityMovers.Registration.TryGetSupported(sourceFileSystem.GetType(), destinationFileSystem.GetType(), out mover))
throw new ArgumentException("The specified combination of file-systems is not supported.");
mover.Move(sourceFileSystem, sourcePath, destinationFileSystem, destinationPath);
}
示例2: ReplicationStorageFileSystemN2
public ReplicationStorageFileSystemN2(ContentActivator activator, IFileSystemFactory fsfactory, IDefinitionManager definitions, IPersister persister)
{
_activator = activator;
_definitions = definitions;
_persister = persister;
string value = (ConfigurationManager.AppSettings["XmlReplication"] ?? "false").ToLowerInvariant();
if (value.Equals("slave") || value.Equals("master"))
{
// only initialize if replication is active
var storageConfig = (FileSystemNamespace) Enum.Parse(typeof (FileSystemNamespace),
ConfigurationManager.AppSettings["AzureReplicationStorageContainerName"] ?? "ReplicationStorageDebug");
_fs = fsfactory.Create(storageConfig);
if (_fs.GetType().Name.Contains("Azure"))
_path = "/_Xml_Sync_"; // TODO maybe should add TablePrefix?
}
}
示例3: SubdirectoryFileSystem
/// <summary>
/// Initializes a new instance of the <see cref="SubdirectoryFileSystem"/> class
/// </summary>
/// <param name="parentFileSystem">The file system to represent a subdirectory of.</param>
/// <param name="dataStorePath">The (data store) path of the directory to represent.</param>
public SubdirectoryFileSystem( IFileSystem parentFileSystem, string dataStorePath )
{
try
{
if( parentFileSystem.NullReference() )
throw new ArgumentNullException().StoreFileLine();
if( !DataStore.IsValidPath(dataStorePath) ) // empty string is acceptable!
throw new ArgumentException().StoreFileLine();
this.parentFileSystem = parentFileSystem;
this.subDirPath = dataStorePath;
}
catch( Exception ex )
{
ex.StoreFileLine();
ex.Store("parentFileSystemType", parentFileSystem.NullReference() ? null : parentFileSystem.GetType());
ex.Store("dataStorePath", dataStorePath);
throw;
}
}