예제 #1
0
        public bool SetPluginRequirement(Interfaces.IPlugin plugin, bool requiredByProject)
        {
            var name = plugin.FriendlyName;

            var requiredPlugins = GlueState.Self.CurrentGlueProject.PluginData.RequiredPlugins;

            bool didChange = false;

            if (requiredByProject && requiredPlugins.Any(item => item.Name == name) == false)
            {
                var pluginToAdd = new PluginRequirement
                {
                    Name    = name,
                    Version = plugin.Version.ToString()
                };

                requiredPlugins.Add(pluginToAdd);
                didChange = true;
            }
            else if (requiredByProject == false && requiredPlugins.Any(item => item.Name == name))
            {
                var toRemove = requiredPlugins.First(item => item.Name == name);
                requiredPlugins.Remove(toRemove);
                didChange = true;
            }

            return(didChange);
        }
예제 #2
0
 public DebugLogEventArgs(Data.DebugLogLevel level, Interfaces.IPlugin p, Exception e, string msg)
 {
     Plugin    = p;
     Message   = msg;
     Level     = level;
     Exception = e;
 }
예제 #3
0
        public MyView(Interfaces.IPlugin aPlugin, WebserviceClient webservice, Interfaces.IPluginHost aHost)
        {
            InitializeComponent();

            _aPlugin = aPlugin;
            _webservice = webservice;
            _aHost = aHost;
            textBoxStatus.Text = "Disconnected";
        }
예제 #4
0
        public bool GetPluginRequirement(Interfaces.IPlugin plugin)
        {
            var name = plugin.FriendlyName;

            var requiredPlugins = GlueState.Self.CurrentGlueProject.PluginData.RequiredPlugins;

            var isRequired = requiredPlugins.Any(item => item.Name == name);

            return(isRequired);
        }
예제 #5
0
        public Plugin(Interfaces.IPlugin aPlugin)
        {
            _aPlugin = aPlugin;
            InitializeComponent();
            pluginwindow.Title = aPlugin.Name;

            //this.Height = myPlugin.WindowHeight;
            //this.Width = myPlugin.WindowWidth;

            //Clear the current panel of any other plugin controls...
            //Note: this only affects visuals.. doesn't close the instance of the plugin
            //pluginCanvas.Children.Clear();

            //Finally, add the usercontrol to the panel... Tadah!
            pluginCanvas.Children.Add(aPlugin.MainInterface);
        }
예제 #6
0
        /// <summary>
        /// 将某一个插件的信息添加到配置文件
        /// </summary>
        private void AddPluginElement(XmlDocument m_Doc, Interfaces.IPlugin iPlugin, string pluginKey, XmlElement parent, bool loadingConfig)
        {
            XmlElement   newPlugin      = m_Doc.CreateElement("Plugin");
            XmlAttribute settingsString = m_Doc.CreateAttribute("SettingsString");
            XmlAttribute keyXml         = m_Doc.CreateAttribute("Key");
            string       setString      = "";

            if (loadingConfig == false)
            {
                iPlugin.ProjectSaving(ProjectFileName, ref setString);
            }

            settingsString.InnerText = setString;
            keyXml.InnerText         = pluginKey;

            newPlugin.Attributes.Append(settingsString);
            newPlugin.Attributes.Append(keyXml);

            parent.AppendChild(newPlugin);
        }
 public void OnUserAction(Interfaces.IPlugin sender, Interfaces.IRecordEvent e)
 {
     StopRecordPlugins();
     AutomationHelper.syncContext.Post(o =>
     {
         Interfaces.GenericTools.restore(Interfaces.GenericTools.mainWindow);
         foreach (var p in Interfaces.Plugins.recordPlugins)
         {
             if (p.Name != sender.Name)
             {
                 if (p.parseUserAction(ref e))
                 {
                     continue;
                 }
             }
         }
         Selector   = e.Selector.ToString();
         EntityName = e.UIElement.ToString();
         NotifyPropertyChanged("EntityName");
     }, null);
 }
예제 #8
0
 public void OnUserAction(Interfaces.IPlugin sender, Interfaces.IRecordEvent e)
 {
     StopRecordPlugins();
     AutomationHelper.syncContext.Post(o =>
     {
         Interfaces.GenericTools.restore(Interfaces.GenericTools.mainWindow);
         foreach (var p in Interfaces.Plugins.recordPlugins)
         {
             if (p.Name != sender.Name)
             {
                 if (p.parseUserAction(ref e))
                 {
                     continue;
                 }
             }
         }
         ModelItem.Properties["Selector"].SetValue(new InArgument <string>()
         {
             Expression = new Literal <string>(e.Selector.ToString())
         });
     }, null);
 }
예제 #9
0
 public void OnUserAction(Interfaces.IPlugin sender, Interfaces.IRecordEvent e)
 {
 }