public PluginInformation(PluginKind kind, Type type, string displayName, string description) { Kind = kind; Type = type; DisplayName = displayName; Description = description; }
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; }
public void LoadPlugin(PluginKind pluginKind) { try { var plugin = PluginFactory.Create(pluginKind); plugin.Run(); } catch (Exception exception) { Console.WriteLine(exception.ToString()); Console.WriteLine(); } }
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); } }
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; }
/// <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);
/// <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);
/// <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);
public void createPluginInfo(Type pt, string version, PluginKind kind) { _pluginInfo = new PluginInfo(pt, version, kind); }
//Constructors public PluginInfo(Type pt, string version, PluginKind kind) { _pluginType = pt; _version = version; _kind = kind; }