当前位置: 首页>>代码示例>>C#>>正文


C# Automation.ProviderInfo类代码示例

本文整理汇总了C#中System.Management.Automation.ProviderInfo的典型用法代码示例。如果您正苦于以下问题:C# ProviderInfo类的具体用法?C# ProviderInfo怎么用?C# ProviderInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ProviderInfo类属于System.Management.Automation命名空间,在下文中一共展示了ProviderInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PSDriveInfo

 public PSDriveInfo(string name, ProviderInfo provider, string root, string description, PSCredential credential)
 {
     this.credentials = PSCredential.Empty;
     if (name == null)
     {
         throw PSTraceSource.NewArgumentNullException("name");
     }
     if (provider == null)
     {
         throw PSTraceSource.NewArgumentNullException("provider");
     }
     if (root == null)
     {
         throw PSTraceSource.NewArgumentNullException("root");
     }
     this.name = name;
     this.provider = provider;
     this.root = root;
     this.description = description;
     if (credential != null)
     {
         this.credentials = credential;
     }
     this.currentWorkingDirectory = string.Empty;
     this.Trace();
 }
开发者ID:nickchal,项目名称:pash,代码行数:26,代码来源:PSDriveInfo.cs

示例2: Start

        /// <summary>
        /// Starts the specified provider. This method is called by the Windows PowerShell runtime to initialize the
        /// provider when the provider is loaded into a session.
        /// </summary>
        /// <param name="providerInfo">
        /// A <see cref="ProviderInfo"/> object that describes the provider to be initialized.
        /// </param>
        /// <returns>A <see cref="ProviderInfo"/> object that contains information about the provider.</returns>
        protected override ProviderInfo Start(ProviderInfo providerInfo)
        {
            // Increase console window size
            this.IncreaseWindowSize(120, 50);

            return base.Start(providerInfo);
        }
开发者ID:jean,项目名称:OrchardPs,代码行数:15,代码来源:OrchardProvider.cs

示例3: ValidateDirectory

        public static void ValidateDirectory(ProviderInfo provider, string directory)
        {
            validateFileSystemPath(provider, directory);

            if (!Directory.Exists(directory))
            {
                Exception exception;

                if (File.Exists(directory))
                {
                    exception = new InvalidOperationException($"{directory} is not a directory.");
                    ExceptionHelper.SetUpException(
                                                   ref exception,
                                                   ERR_NO_DIRECTORY,
                                                   ErrorCategory.InvalidOperation,
                                                   directory);
                }
                else
                {
                    exception =
                        new FileNotFoundException(
                            $"The directory {directory} could not be found.");
                    ExceptionHelper.SetUpException(
                                                   ref exception,
                                                   ERR_NO_DIRECTORY,
                                                   ErrorCategory.InvalidData,
                                                   directory);
                }

                throw exception;
            }
        }
开发者ID:CenturionFox,项目名称:attribute-common,代码行数:32,代码来源:FileUtility.cs

示例4: PathInfo

 internal PathInfo(PSDriveInfo drive, ProviderInfo provider, Path path, SessionState sessionState)
 {
     Drive = drive;
     Provider = provider;
     _path = path;
     _sessionState = sessionState;
 }
开发者ID:Ventero,项目名称:Pash,代码行数:7,代码来源:PathInfo.cs

示例5: UniversalProviderInfo

        protected UniversalProviderInfo(ProviderInfo providerInfo) : base(providerInfo) {
            try {
                PropertySheet = PropertySheet.Parse(@"@import ""pstab.properties"";", "default");
            } catch (Exception) {

                PropertySheet = new PropertySheet();
            }
            
        }
开发者ID:roomaroo,项目名称:coapp.powershell,代码行数:9,代码来源:UniversalProviderInfo.cs

示例6: PSDriveInfo

 public PSDriveInfo(string name, ProviderInfo provider, string root, string description, PSCredential credential)
 {
     Name = name;
     Provider = provider;
     Root = root;
     Description = description;
     Credential = credential;
     CurrentLocation = string.Empty;
 }
开发者ID:Ventero,项目名称:Pash,代码行数:9,代码来源:PSDriveInfo.cs

示例7: AzureDriveInfo

 public AzureDriveInfo(Rule aliasRule, ProviderInfo providerInfo, PSCredential psCredential = null)
     : base(GetDriveInfo(aliasRule, providerInfo, psCredential))
 {
     Path = new Path {
         Account = aliasRule.HasProperty("key") ? aliasRule["key"].Value : aliasRule.Parameter,
         Container = aliasRule.HasProperty("container") ? aliasRule["container"].Value : "",
         SubPath = aliasRule.HasProperty("root") ? aliasRule["root"].Value.Replace('/', '\\').Replace("\\\\", "\\").Trim('\\') : "",
     };
     Path.Validate();
     Secret = aliasRule.HasProperty("secret") ? aliasRule["secret"].Value : psCredential != null ? psCredential.Password.ToString() : null;
 }
开发者ID:ericschultz,项目名称:devtools,代码行数:11,代码来源:AzureDriveInfo.cs

示例8: ProviderInfo

 protected ProviderInfo(ProviderInfo providerInfo)
 {
     _sessionState = providerInfo._sessionState;
     PSSnapIn = providerInfo.PSSnapIn;
     Name = providerInfo.Name;
     Description = providerInfo.Description;
     Home = providerInfo.Home;
     ImplementingType = providerInfo.ImplementingType;
     Capabilities = providerInfo.Capabilities;
     HelpFile = providerInfo.HelpFile;
 }
开发者ID:b333z,项目名称:Pash,代码行数:11,代码来源:ProviderInfo.cs

示例9: GetProviderAssemblyPath

 private static string GetProviderAssemblyPath(ProviderInfo providerInfo)
 {
     if (providerInfo == null)
     {
         return null;
     }
     if (providerInfo.ImplementingType == null)
     {
         return null;
     }
     return Path.GetDirectoryName(providerInfo.ImplementingType.Assembly.Location);
 }
开发者ID:nickchal,项目名称:pash,代码行数:12,代码来源:ProviderHelpProvider.cs

示例10: GetLocationResolver

 public static ILocationResolver GetLocationResolver(ProviderInfo providerInfo) {
     var result = providerInfo as ILocationResolver;
     if (result == null) {
         if (providerInfo.Name == "FileSystem") {
             return new FilesystemLocationProvider(providerInfo);
         }
     }
     if (result == null) {
         throw new ClrPlusException("Unable to create location resolver for {0}".format(providerInfo.Name));
     }
     return result;
 }
开发者ID:roomaroo,项目名称:coapp.powershell,代码行数:12,代码来源:CopyItemExCmdlet.cs

示例11: base

 internal DirectoryServiceDriveInfo
 (
     String name,
     ProviderInfo provider,
     String description,
     PSCredential credential,
     DirectoryRootInfo rootInfo
 )
     : base(name, provider, name + ':', description, credential)
 {
     _rootInfo = rootInfo;
 }
开发者ID:nickchal,项目名称:pash,代码行数:12,代码来源:DirectoryServiceDriveInfo.cs

示例12: validateFileSystemPath

 private static void validateFileSystemPath(ProviderInfo provider, string directory)
 {
     if (!isFileSystemPath(provider))
     {
         Exception exception = new ArgumentException("The syntax of the command is incorrect.");
         ExceptionHelper.SetUpException(
                                        ref exception,
                                        ERR_BAD_PROVIDER,
                                        ErrorCategory.InvalidArgument,
                                        directory);
         throw exception;
     }
 }
开发者ID:CenturionFox,项目名称:attribute-common,代码行数:13,代码来源:FileUtility.cs

示例13: Start

 protected override ProviderInfo Start(ProviderInfo sitecoreProviderInfo)
 {
     try
     {
         sitecoreProviderInfo.Description = "Sitcore Content Provider";
         providerInfo = sitecoreProviderInfo;
         LogInfo("Executing Start(string providerInfo='{0}')", sitecoreProviderInfo.Name);
         return sitecoreProviderInfo;
     }
     catch (Exception ex)
     {
         LogError(ex, "Error while executing Start(string providerInfo='{0}')", sitecoreProviderInfo.Name);
         throw;
     }
 }
开发者ID:sobek85,项目名称:Console,代码行数:15,代码来源:PsSitecoreItemProvider.Maintenance.cs

示例14: ProviderInfo

 protected ProviderInfo(ProviderInfo providerInfo)
 {
     this.helpFile = "";
     if (providerInfo == null)
     {
         throw PSTraceSource.NewArgumentNullException("providerInfo");
     }
     this.name = providerInfo.Name;
     this.implementingType = providerInfo.ImplementingType;
     this.capabilities = providerInfo.capabilities;
     this.description = providerInfo.description;
     this.hiddenDrive = providerInfo.hiddenDrive;
     this.home = providerInfo.home;
     this.helpFile = providerInfo.helpFile;
     this.pssnapin = providerInfo.pssnapin;
     this.sessionState = providerInfo.sessionState;
 }
开发者ID:nickchal,项目名称:pash,代码行数:17,代码来源:ProviderInfo.cs

示例15: PathInfo

 internal PathInfo(PSDriveInfo drive, ProviderInfo provider, string path, SessionState sessionState)
 {
     if (provider == null)
     {
         throw PSTraceSource.NewArgumentNullException("provider");
     }
     if (path == null)
     {
         throw PSTraceSource.NewArgumentNullException("path");
     }
     if (sessionState == null)
     {
         throw PSTraceSource.NewArgumentNullException("sessionState");
     }
     this.drive = drive;
     this.provider = provider;
     this.path = path;
     this.sessionState = sessionState;
 }
开发者ID:nickchal,项目名称:pash,代码行数:19,代码来源:PathInfo.cs


注:本文中的System.Management.Automation.ProviderInfo类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。