コード例 #1
0
 public PluginInformation(PluginKind kind, Type type, string displayName, string description)
 {
     Kind        = kind;
     Type        = type;
     DisplayName = displayName;
     Description = description;
 }
コード例 #2
0
        public PluginInformation(PluginKind kind, Type type)
        {
            var displayNameAttributes = type.GetCustomAttributes(typeof(DisplayNameAttribute), false) as DisplayNameAttribute[];
            var descriptionAttributes = type.GetCustomAttributes(typeof(DescriptionAttribute), false) as DescriptionAttribute[];

            Kind        = kind;
            Type        = type;
            DisplayName = string.Intern(displayNameAttributes.Length > 0 ? displayNameAttributes[0].DisplayName : type.Name);
            Description = descriptionAttributes.Length > 0 ? descriptionAttributes[0].Description : null;
        }
コード例 #3
0
 public void LoadPlugin(PluginKind pluginKind)
 {
     try
     {
         var plugin = PluginFactory.Create(pluginKind);
         plugin.Run();
     }
     catch (Exception exception)
     {
         Console.WriteLine(exception.ToString());
         Console.WriteLine();
     }
 }
コード例 #4
0
        public static IPlugin Create(PluginKind plugin)
        {
            switch (plugin)
            {
            case PluginKind.Interaction:
                return(new Interaction());

            case PluginKind.ExceptionFilterAttackSample:
                return(new ExceptionFilterAttackSample());

            default:
                throw new ArgumentOutOfRangeException("plugin", plugin, null);
            }
        }
コード例 #5
0
ファイル: PluginInfo.cs プロジェクト: zebulonj/pulumi
 internal PluginInfo(
     string name,
     string?path,
     PluginKind kind,
     string?version,
     long size,
     DateTimeOffset installTime,
     DateTimeOffset lastUsedTime,
     string?serverUrl)
 {
     this.Name         = name;
     this.Path         = path;
     this.Kind         = kind;
     this.Version      = version;
     this.Size         = size;
     this.InstallTime  = installTime;
     this.LastUsedTime = lastUsedTime;
     this.ServerUrl    = serverUrl;
 }
コード例 #6
0
 /// <summary>
 /// Removes a plugin from the Workspace matching the specified name and version.
 /// </summary>
 /// <param name="name">The optional name of the plugin.</param>
 /// <param name="versionRange">The optional semver range to check when removing plugins matching the given name e.g. "1.0.0", ">1.0.0".</param>
 /// <param name="kind">The kind of plugin e.g. "resource".</param>
 /// <param name="cancellationToken">A cancellation token.</param>
 public abstract Task RemovePluginAsync(string?name = null, string?versionRange = null, PluginKind kind = PluginKind.Resource, CancellationToken cancellationToken = default);
コード例 #7
0
 /// <summary>
 /// Installs a plugin in the Workspace, for example to use cloud providers like AWS or GCP.
 /// </summary>
 /// <param name="name">The name of the plugin.</param>
 /// <param name="version">The version of the plugin e.g. "v1.0.0".</param>
 /// <param name="kind">The kind of plugin e.g. "resource".</param>
 /// <param name="cancellationToken">A cancellation token.</param>
 public abstract Task InstallPluginAsync(string name, string version, PluginKind kind = PluginKind.Resource, CancellationToken cancellationToken = default);
コード例 #8
0
 /// <summary>
 /// Installs a plugin in the Workspace, for example to use cloud providers like AWS or GCP.
 /// </summary>
 /// <param name="name">The name of the plugin.</param>
 /// <param name="version">The version of the plugin e.g. "v1.0.0".</param>
 /// <param name="kind">The kind of plugin e.g. "resource".</param>
 /// <param name="cancellationToken">A cancellation token.</param>
 public Task InstallPluginAsync(string name, string version, PluginKind kind, CancellationToken cancellationToken)
 => this.InstallPluginAsync(name, version, kind: kind, options: null, cancellationToken: cancellationToken);
コード例 #9
0
 public void createPluginInfo(Type pt, string version, PluginKind kind)
 {
     _pluginInfo = new PluginInfo(pt, version, kind);
 }
コード例 #10
0
 //Constructors
 public PluginInfo(Type pt, string version, PluginKind kind)
 {
     _pluginType = pt;
     _version    = version;
     _kind       = kind;
 }