Example #1
0
 public System.Type GetPluginBaseType(PluginType pluginType)
 {
     if (pluginType == PluginType.UserProvider)
         return typeof(UserProvider);
     else
         throw new ArgumentException(string.Format("Unknown plugin type - {0}", (object)pluginType));
 }
 //
 public PluginExtendedAttribute(PluginType T, PluginMode M)
 {
     if (T == PluginType.FPDriver && M == PluginMode.MultiLoader)
         throw new Exception("Type FPDriver can't be used in multiloader plugin");
     _Type = T;
     _Mode = M;
 }
Example #3
0
        public PluginTitleWidget(PluginType type)
        {
            PluginType = type;

            label = new Label()
            {
                Text = type.GetName(),
                TextColor = type.GetColor(),
                Font = Font.WithScaledSize(2d),
                HeightRequest = 30,
                WidthRequest = 400,
            };

            MarginTop = 8;

            HeightRequest = 30;
            WidthRequest = 400;

            AddChild(label, 0, 0);

            if (App.InitOpacityAnimation != null)
            {
                Opacity = 0;
                App.InitOpacityAnimation(this);
            }
        }
Example #4
0
        public AddPluginWidget(PluginType type)
        {
            PluginType = type;
            HeightRequest = PluginWidget.Size.Height;
            WidthRequest = PluginWidget.Size.Width;

            Margin = PluginWidget.Margin;

            Cursor = CursorType.Hand;

            Label l = new Label("Add new " + type.GetName());
            //l.TextColor = type.GetColor();

            l.TextAlignment = Alignment.Center;

            AddChild(l, new Rectangle(0, 0, PluginWidget.Size.Width, PluginWidget.Size.Height));

            BackgroundColor = type.GetBGColor();

            if (App.InitDropShadow != null)
                App.InitDropShadow(this);

            if (App.InitOpacityAnimation != null)
            {
                Opacity = 0;
                App.InitOpacityAnimation(this);
            }
        }
Example #5
0
        public PluginFileManager( Guid abcPluginGuid, PluginType abcPluginType, string pluginPath = null )
        {
            // Plug-in paths setup.
            _pluginDownloadPath = RemotePluginPath + abcPluginGuid + PluginExtention;
            _pluginTempPath = Path.Combine( GetPluginDirectory( abcPluginType ), TempDirectory, abcPluginGuid.ToString() ) + GetPluginExtention( abcPluginType );
            _pluginPath = pluginPath ?? Path.Combine( GetPluginDirectory( abcPluginType ), abcPluginGuid.ToString() ) + GetPluginExtention( abcPluginType );

            _pluginfileInfo = new FileInfo( _pluginTempPath );

            if ( !Directory.Exists( _pluginTempPath ) )
            {
                Directory.CreateDirectory( _pluginfileInfo.DirectoryName );
            }

            _webClient = new WebClient();
            _webClient.DownloadFileCompleted += ( sender, args ) =>
            {
                // When download is completed and performed properly move to final destination, otherwise delete.
                if ( args.Error == null && !args.Cancelled )
                {
                    _pluginfileInfo.MoveTo( Path.Combine( _pluginfileInfo.Directory.Parent.FullName, _pluginfileInfo.Name ) );
                }
                else
                {
                    File.Delete( _pluginTempPath );
                }
            };
        }
 public DSPPluginInfo(PluginType pluginType, string path, string name)
 {
   _IsBlackListed = IsBlackListedPlugin(name);
   _DSPPluginType = pluginType;
   _FilePath = path;
   _Name = name;
 }
Example #7
0
 public PluginDescriptor(string name, string path, PluginType type, string parameters)
 {
     Name = name;
     Path = path;
     Type = type;
     Parameters = parameters;
 }
 public PluginAttribute(PluginType pluginType, string name, string author, string version, string description) {
     PluginType = pluginType;
     Name = name;
     Author = author;
     Version = version;
     Description = description;
 }
Example #9
0
 public MacroEntry(string pluginName,PluginType type, string mementoName)
 {
     this.pluginName = pluginName;
     this.type = type;
     this.mementoName = mementoName;
     this.macroEntries = new ObservableCollection<MacroEntry>();
 }
Example #10
0
		public Plugin(IntPtr systemHandle, PluginType type, int id, string fileName, uint version)
		{
			this.systemHandle = systemHandle;
			this.type = type;
			this.id = id;
			this.fileName = fileName;
			this.version = version;
		}
Example #11
0
 public XmlNodeList GetAllPluginData(PluginType type)
 {
     var node = RootNode.SelectNodes(string.Format("PlugIn[@type='{0}']", type));
     if (node != null && node.Count == 0 && type == PluginType.Output) {
         node = GetAllPluginData();
     }
     return node;
 }
Example #12
0
        private void GetInfo(out PluginType type, out string name, out uint version)
        {
            PLUGINTYPE ptype;
            StringBuilder nameBuilder = new StringBuilder(128);
            _system.getPluginInfo(Handle, out ptype, nameBuilder, nameBuilder.Capacity, out version).Check();

            name = nameBuilder.ToString();
            type = (PluginType)ptype;
        }
Example #13
0
        public XmlNodeList GetAllPluginData(PluginType type, bool enabledOnly)
        {
            var node = RootNode.SelectNodes(string.Format("PlugIn[@enabled='{0}' and @type='{1}']", enabledOnly, type));
            if (node != null && node.Count == 0 && type == PluginType.Output) {
                node = RootNode.SelectNodes(string.Format("PlugIn[@enabled='{0}']", enabledOnly));
            }

            return node;
        }
Example #14
0
 public PluginInfo(PluginType pluginType, string typeName, string assemblyName)
 {
     this.PluginType   = pluginType;
     this.TypeName     = typeName;
     this.AssemblyName = assemblyName;
     this.Enabled      = true;
     this.x86          = true;
     this.x64          = true;
     this.Loaded       = false;
 }
Example #15
0
 /// <remarks/>
 public void LoadServerInfoAsync(PluginType pluginType, object userState)
 {
     if ((this.LoadServerInfoOperationCompleted == null))
     {
         this.LoadServerInfoOperationCompleted = new System.Threading.SendOrPostCallback(this.OnLoadServerInfoOperationCompleted);
     }
     this.InvokeAsync("LoadServerInfo", new object[] {
         pluginType
     }, this.LoadServerInfoOperationCompleted, userState);
 }
Example #16
0
        public PluginInfo(PluginType type, string family, string name)
        {
            Guard.EnumValueIsDefined(typeof (PluginType), type, "type");
            Guard.ArgumentNotNullOrEmptyString(family, "family");
            Guard.ArgumentNotNullOrEmptyString(name, "name");

            _family = family;
            _name = name;
            _type = type;
        }
Example #17
0
        public XmlNodeList GetAllPluginData(PluginType type)
        {
            var node = RootNode.SelectNodes(string.Format("PlugIn[@type='{0}']", type));

            if (node != null && node.Count == 0 && type == PluginType.Output)
            {
                node = GetAllPluginData();
            }
            return(node);
        }
 public PluginInformation(PluginAttribute pluginAtt, string path, string pluginID, string typeFullName) {
     Author = pluginAtt.Author;
     Name = pluginAtt.Name;
     Version = pluginAtt.Version;
     Description = pluginAtt.Description;
     PluginType = pluginAtt.PluginType;
     Path = path;
     PluginID = pluginID;
     TypeFullName = typeFullName;
 }
        /// <summary>
        /// Creates a new instance of the <see cref="PluginAssemblyInfo"/>.
        /// </summary>
        public PluginAssemblyInfo(UnityProjectInfo unityProjectInfo, Guid guid, string fullPath, PluginType type)
            : base(unityProjectInfo, guid, new Uri(fullPath), Path.GetFileNameWithoutExtension(fullPath))
        {
            Type = type;

            if (Type == PluginType.Managed)
            {
                ParseYAMLFile();
            }
        }
Example #20
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="PluginAssembly"/> class.
 /// </summary>
 /// <param name="name">The name of the Plugin.</param>
 /// <param name="fqn">The Fully Qualified Name of the Plugin.</param>
 /// <param name="version">The version of the Plugin.</param>
 /// <param name="pluginType">The type of Plugin.</param>
 /// <param name="fingerprint">The cryptographic fingerprint of the Plugin.</param>
 /// <param name="type">The Type of the Plugin contained within the Plugin assembly.</param>
 /// <param name="assembly">The Plugin assembly.</param>
 public PluginAssembly(string name, string fqn, string version, PluginType pluginType, string fingerprint, Type type, Assembly assembly)
 {
     Name        = name;
     FQN         = fqn;
     Version     = Version;
     PluginType  = pluginType;
     Fingerprint = fingerprint;
     Type        = type;
     Assembly    = assembly;
 }
Example #21
0
		public PluginInfo(PluginType pluginType, string typeName, string assemblyName)
		{
			this.PluginType = pluginType;
			this.TypeName = typeName;
			this.AssemblyName = assemblyName;
			this.Enabled = true;
			this.x86 = true;
			this.x64 = true;
			this.Loaded = false;
		}
Example #22
0
        public List <XmlNode> GetAllPluginData(PluginType type)
        {
            IEnumerable <XmlNode> nodes = RootNode.SelectNodes(string.Format("PlugIn[@type='{0}']", type)).Cast <XmlNode>();

            if (type == PluginType.Output)
            {
                nodes = nodes.Concat(RootNode.SelectNodes("PlugIn[not(@type)]").Cast <XmlNode>());
            }
            return(nodes.ToList());
        }
 public PluginTypeRegistration(PluginAssemblyRegistration pluginAssemblyRegistration, Type type)
 {
     PluginAssemblyRegistration = pluginAssemblyRegistration;
     PluginType = new PluginType {
         TypeName = type.FullName, FriendlyName = type.FullName
     };
     Type = type;
     PluginStepRegistrations = new List <PluginStepRegistration>();
     pluginAssemblyRegistration.PluginAssembly.PropertyChanged += PluginAssembly_PropertyChanged;
 }
        public PluginCollection(IntPtr systemHandle, PluginType type, bool initialize)
        {
            this.systemHandle = systemHandle;
            this.type         = type;

            if (initialize)
            {
                Refresh();
            }
        }
Example #25
0
        private void GetInfo(out PluginType type, out string name, out uint version)
        {
            PLUGINTYPE    ptype;
            StringBuilder nameBuilder = new StringBuilder(128);

            _system.getPluginInfo(Handle, out ptype, nameBuilder, nameBuilder.Capacity, out version).Check();

            name = nameBuilder.ToString();
            type = (PluginType)ptype;
        }
        /// <summary>
        /// Creates a new instance of the <see cref="PluginAssemblyInfo"/>.
        /// </summary>
        public PluginAssemblyInfo(IEnumerable <CompilationPlatformInfo> availablePlatforms, Guid guid, string fullPath, PluginType type)
            : base(availablePlatforms, guid, new Uri(fullPath), Path.GetFileNameWithoutExtension(fullPath))
        {
            Type = type;

            if (Type == PluginType.Managed)
            {
                ParseYAMLFile();
            }
        }
Example #27
0
        private void RegisterPluginSteps(IEnumerable <Type> pluginTypes, PluginAssembly plugin)
        {
            var sdkPluginTypes = ServiceLocator.Queries.GetPluginTypes(_ctx, plugin);

            foreach (var pluginType in pluginTypes)
            {
                // Search for the CrmPluginStepAttribute
                var        pluginAttributes = pluginType.GetCustomAttributesData().Where(a => a.AttributeType.Name == typeof(CrmPluginRegistrationAttribute).Name);
                PluginType sdkPluginType    = null;
                if (pluginAttributes.Count() > 0)
                {
                    var pluginStepAttribute = pluginAttributes.First().CreateFromData() as CrmPluginRegistrationAttribute;
                    // Check if the type is registered
                    sdkPluginType = sdkPluginTypes.Where(t => t.TypeName == pluginType.FullName).FirstOrDefault();

                    if (sdkPluginType == null)
                    {
                        sdkPluginType = new PluginType();
                    }

                    // Update values
                    sdkPluginType.Name             = pluginType.FullName;
                    sdkPluginType.PluginAssemblyId = plugin.ToEntityReference();
                    sdkPluginType.TypeName         = pluginType.FullName;
                    sdkPluginType.FriendlyName     = pluginType.FullName;

                    if (sdkPluginType.Id == Guid.Empty)
                    {
                        _trace.WriteLine("Registering Type '{0}'", sdkPluginType.Name);
                        // Create
                        sdkPluginType.Id = _service.Create(sdkPluginType);
                    }
                    else
                    {
                        _trace.WriteLine("Updating Type '{0}'", sdkPluginType.Name);
                        // Update
                        _service.Update(sdkPluginType);
                    }

                    var existingSteps = GetExistingSteps(sdkPluginType);

                    foreach (var pluginAttribute in pluginAttributes)
                    {
                        RegisterStep(sdkPluginType, existingSteps, pluginAttribute);
                    }

                    // Remove remaining Existing steps
                    foreach (var step in existingSteps)
                    {
                        _trace.WriteLine("Deleting step '{0}'", step.Name, step.Stage);
                        _service.Delete(SdkMessageProcessingStep.EntityLogicalName, step.Id);
                    }
                }
            }
        }
Example #28
0
        private static void GetPluginClassNameCallback()
        {
            AppDomain  domain          = AppDomain.CurrentDomain;
            string     pluginDll       = (string)domain.GetData("pluginDll");
            PluginType pluginType      = (PluginType)domain.GetData("pluginType");
            string     pluginClassName = (string)domain.GetData("pluginClassName");
            Type       type            = GetPluginClass(pluginDll, pluginType, pluginClassName);
            string     result          = type == null ? null : type.FullName;

            domain.SetData("pluginClassName", result);
        }
Example #29
0
        public XmlNodeList GetAllPluginData(PluginType type, bool enabledOnly)
        {
            var node = RootNode.SelectNodes(string.Format("PlugIn[@enabled='{0}' and @type='{1}']", enabledOnly, type));

            if (node != null && node.Count == 0 && type == PluginType.Output)
            {
                node = RootNode.SelectNodes(string.Format("PlugIn[@enabled='{0}']", enabledOnly));
            }

            return(node);
        }
Example #30
0
        public static char GetTypecharFromEnum(PluginType T)
        {
            switch (T)
            {
            case PluginType.Coding:
                return('C');

            default:
                return('?');
            }
        }
Example #31
0
 public PluginInformation(PluginAttribute pluginAtt, string path, string pluginID, string typeFullName)
 {
     Author       = pluginAtt.Author;
     Name         = pluginAtt.Name;
     Version      = pluginAtt.Version;
     Description  = pluginAtt.Description;
     PluginType   = pluginAtt.PluginType;
     Path         = path;
     PluginID     = pluginID;
     TypeFullName = typeFullName;
 }
Example #32
0
        public static string GetTypenameFromEnum(PluginType T)
        {
            switch (T)
            {
            case PluginType.Coding:
                return("Coding");

            default:
                return("Unknown");
            }
        }
Example #33
0
 /// <summary>
 ///     Returns the plugins that are meant to be run at the specified stage
 /// </summary>
 /// <param name="plugins">All plugins loaded</param>
 /// <param name="type">The plugin type</param>
 /// <param name="stage">the process stage</param>
 /// <returns></returns>
 public static List <AbstractPlugin> GetPluginsForStage(
     List <AbstractPlugin> plugins,
     PluginType type,
     ProcessStage stage)
 {
     return(plugins.Where(
                x => BitMask.IsContainedInMask(( int )x.PluginTypeToggle, ( int )type, true) &&
                BitMask.IsContainedInMask(( int )x.ProcessStages, ( int )stage, true)
                ).
            ToList());
 }
Example #34
0
 public IEnumerable <ITestPlugin> GetPlugins(PluginType pluginType = PluginType.Client)
 {
     if (pluginType == PluginType.External)
     {
         return(GetExternalPlugins());
     }
     else
     {
         return(GetClientPlugins());
     }
 }
Example #35
0
        public static string GetTypenameFromEnum(PluginType T)
        {
            switch (T)
            {
            case PluginType.Cryptography:
                return("Cryptography");

            default:
                return("Unknown");
            }
        }
        private void ToolbarButton9_Click(object sender, EventArgs e)
        {
            PluginType  type    = (PluginType)PluginConfigList[9];
            UserControl control = OpenTool(type, ToolbarButton9);

            if (control != null)
            {
                _controlsList.Add(control);
                AutoSize();
            }
        }
Example #37
0
 /// <summary>
 /// 根据插件类型获得未安装的插件列表
 /// </summary>
 /// <param name="pluginType">插件类型</param>
 /// <returns></returns>
 public static List<PluginInfo> GetUnInstalledPluginList(PluginType pluginType)
 {
     int type = (int)pluginType;
     List<PluginInfo> unInstalledPluginList = new List<PluginInfo>();
     foreach (PluginInfo pluginInfo in BMAPlugin.UnInstalledPluginList)
     {
         if (pluginInfo.Type == type)
             unInstalledPluginList.Add(pluginInfo);
     }
     return unInstalledPluginList;
 }
        private void DeletePluginType(PluginType pluginType)
        {
            var sdkMessageProcessingSteps = ServiceLocator.Queries.GetPluginSteps(_ctx, pluginType.TypeName);

            foreach (SdkMessageProcessingStep sdkmessageProcessingStep in sdkMessageProcessingSteps)
            {
                DeleteSdkMessageProcessingStep(sdkmessageProcessingStep);
            }

            _service.Delete(PluginType.EntityLogicalName, pluginType.Id);
        }
Example #39
0
 /// <remarks/>
 public void CheckTempFileAsync(string pluginName, PluginType pluginType, object userState)
 {
     if ((this.CheckTempFileOperationCompleted == null))
     {
         this.CheckTempFileOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCheckTempFileOperationCompleted);
     }
     this.InvokeAsync("CheckTempFile", new object[] {
         pluginName,
         pluginType
     }, this.CheckTempFileOperationCompleted, userState);
 }
Example #40
0
 public System.Type GetPluginBaseType(PluginType pluginType)
 {
     if (pluginType == PluginType.UserProvider)
     {
         return(typeof(UserProvider));
     }
     else
     {
         throw new ArgumentException(string.Format("Unknown plugin type - {0}", (object)pluginType));
     }
 }
Example #41
0
        public static Type GetTypeFromEnum(PluginType T)
        {
            switch (T)
            {
            case PluginType.Coding:
                return(typeof(ICodingPlugin));

            default:
                return(typeof(IPlugin));
            }
        }
        public CarfupStep(PluginType plugin, string environment)
        {
            Filter       = plugin.GetAliasedEntity <SdkMessageFilter>();
            Image        = plugin.GetAliasedEntity <SdkMessageProcessingStepImage>();
            Message      = plugin.GetAliasedEntity <SdkMessage>();
            Plugin       = plugin;
            Step         = plugin.GetAliasedEntity <SdkMessageProcessingStep>();
            SecureConfig = plugin.GetAliasedEntity <SdkMessageProcessingStepSecureConfig>();

            Environment = environment;
        }
Example #43
0
        public List <XmlNode> GetAllPluginData(PluginType type, bool enabledOnly)
        {
            IEnumerable <XmlNode> nodes = RootNode.SelectNodes(string.Format("PlugIn[@enabled='{0}' and @type='{1}']", enabledOnly, type)).Cast <XmlNode>();

            if (type == PluginType.Output)
            {
                nodes = nodes.Concat(RootNode.SelectNodes(string.Format("PlugIn[not(@type) and @enabled='{0}']", enabledOnly)).Cast <XmlNode>());
            }

            return(nodes.ToList());
        }
Example #44
0
 private void DownloadPlugin(string pluginURL, string fileName, PluginType pluginType)
 {
     if (pluginType == DiscordBotPluginManager.PluginType.COMMAND)
     {
         Process.Start("Patcher.exe", $"/dw=\"{pluginURL}\" /file=.\\Data\\Plugins\\Commands\\{fileName}");
     }
     if (pluginType == DiscordBotPluginManager.PluginType.ADDON)
     {
         Process.Start("Patcher.exe", $"/dw=\"{pluginURL}\" /file=.\\Data\\Plugins\\Addons\\{fileName}");
     }
 }
Example #45
0
 /// <remarks/>
 public void AddDownLoadsAsync(string pluginName, PluginType pluginType, object userState)
 {
     if ((this.AddDownLoadsOperationCompleted == null))
     {
         this.AddDownLoadsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddDownLoadsOperationCompleted);
     }
     this.InvokeAsync("AddDownLoads", new object[] {
         pluginName,
         pluginType
     }, this.AddDownLoadsOperationCompleted, userState);
 }
Example #46
0
        public static async Task <List <Plugin>?> GetPlugins(PluginType type)
        {
            var client = Api.Client;

            var rq = new RestRequest("api/plugins/{type}");

            rq.AddUrlSegment("type", type.ToString().ToLower());

            var r = await client.ExecuteGetAsync(rq);

            return(await r.GetResult <List <Plugin> >());
        }
Example #47
0
        public PluginResult Scan(dynamic scanObject, PluginType type)
        {
            bool canFight = _config.ComponentsState.FightWithThreats;

            switch (type)
            {
            case PluginType.File:
            {
                Dictionary <string, IBeSafeFilePlugin> plugins = _pluginUtils.GetPluginsInfo <IBeSafeFilePlugin>(_config.PluginsPath);
                if (plugins.Any())
                {
                    return(SecureVolumePluginRegulator.Instance().Scan(plugins, scanObject, canFight));
                }
            }
            break;

            case PluginType.Registry:
            {
                Dictionary <string, IBeSafeRegistryPlugin> plugins = _pluginUtils.GetPluginsInfo <IBeSafeRegistryPlugin>(_config.PluginsPath);
                if (plugins.Any())
                {
                    return(RegistryPluginRegulator.Instance().Scan(plugins, scanObject, canFight));
                }
            }
            break;

            case PluginType.Process:
            {
                Dictionary <string, IBeSafeProcessPlugin> plugins = _pluginUtils.GetPluginsInfo <IBeSafeProcessPlugin>(_config.PluginsPath);
                if (plugins.Any())
                {
                    return(ProcessPluginRegulator.Instance().Scan(plugins, scanObject, canFight));
                }
            }
            break;

            case PluginType.Module:
            {
                Dictionary <string, IBeSafeModulePlugin> plugins =
                    _pluginUtils.GetPluginsInfo <IBeSafeModulePlugin>(_config.PluginsPath);
                if (plugins.Any())
                {
                    return(ModulePluginRegulator.Instance().Scan(plugins, scanObject, canFight));
                }
            }
            break;

            default:
                return(null);
            }

            return(null);
        }
Example #48
0
 /// <summary>
 /// 根据插件类型获得安装的插件列表
 /// </summary>
 /// <param name="pluginType">插件类型</param>
 /// <returns></returns>
 public static List<PluginInfo> GetInstalledPluginList(PluginType pluginType)
 {
     switch (pluginType)
     {
         case PluginType.OAuthPlugin:
             return BMAPlugin.OAuthPluginList;
         case PluginType.PayPlugin:
             return BMAPlugin.PayPluginList;
         default:
             return new List<PluginInfo>();
     }
 }
        /// <summary>
        /// Add required js and html for a specific plugin to the index generator
        /// </summary>
        /// <param name="_scriptName">string containing the name of the plugins javascript files</param>
        /// <param name="_type">class of plugin.  Different classes require different placement in the homepage</param>
        /// <param name="_local">are all the resources for this plugin hosted on the Netduino, or off site?</param>
        public void AddPlugin(string _scriptName, PluginType _type)
        {
            // Add header js block
            StringBuilder script = new StringBuilder();
            script.Append("<script src=\"");
            if (!m_useLocal)
                script.Append(m_hostUrl);
            else
                script.Append("plugins/");
            script.Append(_scriptName);
            if (!m_useLocal)
                script.Append(".min");
            script.Append(".js\" type=\"text/javascript\"></script>");
            using (FileStream fs = new FileStream(Settings.FragmentFolder + m_headerScriptFileName, FileMode.Append))
            {
                byte[] text = script.ToBytes();
                fs.Write(text, 0, text.Length);
                fs.Flush();
            }

            // Add footer JS Calls
            script = new StringBuilder();
            script.Append("$(");
            script.Append(_scriptName);
            script.Append("Init);");
            using (FileStream fs = new FileStream(Settings.FragmentFolder + m_scriptCallFileName, FileMode.Append))
            {
                byte[] text = script.ToBytes();
                fs.Write(text, 0, text.Length);
                fs.Flush();
            }

            // keep plugin name to pull html fragment later
            switch (_type)
            {
                case PluginType.Input:
                    m_inputPlugins.Add(_scriptName);
                    break;
                case PluginType.Output:
                    m_outputPlugins.Add(_scriptName);
                    break;
                case PluginType.Control:
                    m_controlPlugins.Add(_scriptName);
                    break;
                default:
                    break;
            }
            Debug.GC(true);
        }
Example #50
0
        public AddPluginWidget(PluginType type, string title = null)
        {
            PluginType = type;

            Cursor = CursorType.Hand;

            Label l = new Label(title ?? "Add new " + type.GetName());
            //l.TextColor = type.GetColor();

            l.TextAlignment = Alignment.Center;

            AddChild(l, new Rectangle(0, 0, WidthRequest, HeightRequest));

            //BackgroundColor = type.GetBGColor();

            HasBorder = false;
            HasBorderLineDash = true;
        }
Example #51
0
        public void Initialize( string pluginFolderPath, PluginType pluginType, string fileFilter )
        {
            // Plug-in containers have to be initialized on the other domain in order to enable "on the fly" plug-in swapping.
            switch ( pluginType )
            {
                case PluginType.Persistence:
                    SafeContainerCreation( () => _pluginContainer = new PluginPersistenceProvider( pluginFolderPath ) );
                    break;
                case PluginType.Interruption:
                    SafeContainerCreation( () => _pluginContainer = new PluginInterruptionTrigger( pluginFolderPath ) );
                    break;
                case PluginType.Vdm:
                    SafeContainerCreation( () => _pluginContainer = new PluginVdmSettings( pluginFolderPath ) );
                    break;
            }

            var watcher = new PluginWatcher( pluginFolderPath, fileFilter );
            watcher.Created += ( sender, args ) => ExecuteSta( () => InstallPugin( GetGuidDromAssembly( args.FullPath ), args.FullPath, true ) );
            watcher.Deleted += ( sender, args ) => ExecuteSta( () => UninstallPugin( GetGuidDromAssembly( args.FullPath ), args.FullPath ) );
            watcher.Error += ( sender, args ) => Error( watcher, new PluginErrorEventArgs( new Exception( WatcherErrorMessage ), null ) );
        }
 public PluginAttribute(PluginType pluginType, Type tProvider, int iKey = -1) {
     PluginType = pluginType;
     if(tProvider.IsSubclassOf(typeof(LocalizedStringProvider))) {
         try {
             LocalizedStringProvider provider = (LocalizedStringProvider)Activator.CreateInstance(tProvider);
             provider.SetKey(iKey);
             Author = provider.Author;
             Name = provider.Name;
             Description = provider.Description;
         }
         catch(MissingMethodException) {
             Author = string.Empty;
             Name = "Name missing";
             Description = "Default constuctor of LocalizedStringProvider is missing. \nContact the author of this plugin.";
         }
     }
     else {
         Author = string.Empty;
         Name = "Name missing";
         Description = "The type is not subclass of LocalizedStringProvider. \nContact the author of this plugin.";
     }
 }
Example #53
0
        public PluginTitleWidget(PluginType type)
        {
            PluginType = type;

            label = new Label()
            {
                Text = type.GetName(),
                TextColor = type.GetColor(),
                Font = Xwt.Drawing.Font.FromName("Segoe UI Light 30"), // Font.WithScaledSize(2d),
                HeightRequest = 40,
                WidthRequest = 400,
            };

            MarginTop = 8;

            MarginBottom = -8;

            HeightRequest = 40;
            WidthRequest = 400;

            AddChild(label, 0, 0);
        }
Example #54
0
 public Plugin(PluginType type, string name)
 {
     this.type = type;
     this.name = name;
 }
Example #55
0
 internal static void ReloadPlugin(PluginType Type, string Name, string PluginFileName)
 {
     string FileName = "";
     switch (Type)
     {
         case PluginType.Passive:
             FileName = Config.RootDir + "\\plugins\\passive\\" + PluginFileName;
             lock (PassivePlugin.Collection)
             {
                 PassivePlugin.Remove(Name);
                 LoadPlugin(FileName);
             }
             break;
         case PluginType.Active:
             FileName = Config.RootDir + "\\plugins\\active\\" + PluginFileName;
             lock (ActivePlugin.Collection)
             {
                 ActivePlugin.Remove(Name);
                 LoadPlugin(FileName);
             }
             break;
         case PluginType.Format:
             FileName = Config.RootDir + "\\plugins\\format\\" + PluginFileName;
             lock (FormatPlugin.Collection)
             {
                 FormatPlugin.Remove(Name);
                 LoadPlugin(FileName);
                 IronUI.UpdateAllFormatPluginRows();
             }
             break;
         case PluginType.Session:
             FileName = Config.RootDir + "\\plugins\\session\\" + PluginFileName;
             lock (SessionPlugin.Collection)
             {
                 SessionPlugin.Remove(Name);
                 LoadPlugin(FileName);
             }
             break;
     }
     IronUI.UpdateAllFormatPluginRows();
     IronUI.UpdateAllActivePluginRows();
     IronUI.BuildPluginTree();
 }
Example #56
0
 private static extern ErrorCode GetPluginInfo(IntPtr system, int Handle, ref PluginType Plugintype, ref byte name, int namelen, ref int version);
Example #57
0
 private static extern ErrorCode GetPluginInfo(IntPtr system, uint handle, ref PluginType plugintype, StringBuilder name, int namelen, ref uint version);
Example #58
0
 private static extern ErrorCode GetPluginHandle(IntPtr system, PluginType Plugintype, int Index, ref int Handle);
Example #59
0
 private static extern ErrorCode GetPluginHandle(IntPtr system, PluginType plugintype, int index, ref uint handle);
Example #60
0
 private static extern ErrorCode GetNumPlugins(IntPtr system, PluginType plugintype, ref int numplugins);