Example #1
0
        public FruaTlbViewer(FruaTlbFile file, PluginParameter args)
        {
            if (args.Filename.ToUpper().Contains("8X8"))
            {
                _wallTlb = true;
            }

            _file              = file;
            _pictureBox        = new PictureBox();
            _pictureBox.Paint += PictureBoxPaint;
            ContainerWidth     = args.ContainerWidth;
            Zoom       = args.Zoom;
            _container = new UserControl {
                Dock = DockStyle.Fill
            };
            _container.AutoScroll = true;
            var exportButton = new Button();

            exportButton.Text        = "Export to Wall Template";
            exportButton.AutoSize    = true;
            exportButton.MouseClick += wallTemplateExportForm;

            if (_wallTlb)
            {
                _container.Controls.Add(exportButton);
            }
            _container.Controls.Add(_pictureBox);
        }
Example #2
0
        public PanelShellManager(PluginParameter data)
        {
            InitUi();

            // 注册事件
            ShellManager.GetDataTableCompletedToDo += ShellManagerGetDataTableCompletedToDo;
            ShellManager.DeleteCompletedToDo       += ShellManagerDeleteCompletedToDo;
            ShellManager.InsertCompletedToDo       += ShellManagerInsertCompletedToDo;
            ShellManager.UpdateCompletedToDo       += ShellManagerUpdateCompletedToDo;

            // 载入shell数据
            LoadWebshellData();

            // 添加插件到右键菜单
            foreach (var plugin in PluginProvider.GetPlugins())
            {
                // IsShowInRightContext
                if (plugin.PluginSetting.LoadPath.ToLower() == "shellmanager")
                {
                    string title = plugin.PluginInfo.Name;

                    // 添加到Tsmi_Plugins中
                    var pluginItem = new ButtonMenuItem();
                    pluginItem.ID     = title;
                    pluginItem.Text   = title;
                    pluginItem.Click += pluginItem_Click;
                    pluginItem.Tag    = plugin;

                    _rightMenuWebshell.Items.Add(pluginItem);
                }
            }
        }
        public IPlugin CreateUsing(PluginParameter args)
        {
            var file = new FruaSavedGameFile(args);

            Viewer = new FruaSavedGameFileViewer(file, args);
            return(this);
        }
Example #4
0
        void pluginItem_Click(object sender, EventArgs e)
        {
            if (_gridViewShell.SelectedItems.Any())
            {
                var item = sender as MenuItem;
                if (item != null)
                {
                    var plugin = item.Tag as IPlugin;

                    var shell = (Shell)_gridViewShell.SelectedItem;
                    shell.TimeOut = 8000;

                    var param = new PluginParameter();
                    param.AddParameter("shell", shell);

                    if (plugin is IControlPlugin)
                    {
                        object view = (plugin as IControlPlugin).Show(param);
                        //创建新的tab标签
                        //设置标题为FileManager|TargetId
                        string title = plugin.PluginInfo.Name + "|" + shell.TargetId;
                        ShellManager.Host.Ui.OpenTabPage(title, view);
                    }
                    else if (plugin is IFormPlugin)
                    {
                        var form = (Form)(plugin as IFormPlugin).Show(param);
                        form.Show();
                    }
                }
            }
        }
Example #5
0
        public IPlugin CreateUsing(PluginParameter args)
        {
            var file = new BinaryFile(args.Filename);

            Viewer = new HexFileViewer(file, args);
            return(this);
        }
Example #6
0
        public IPlugin CreateUsing(PluginParameter args)
        {
            var file = new FruaGameDataFile(args.Filename);

            Viewer = new FruaGameDataFileViewer(file.GetGameData());
            return(this);
        }
        public IPlugin CreateUsing(PluginParameter args)
        {
            var file = new TextFile(args.Filename);

            Viewer = new TextFileViewer(file, args.ContainerWidth);
            return(this);
        }
 public FruaGlbFileViewer(FruaGlbFile file, PluginParameter args)
 {
     _file          = file;
     _args          = args;
     ContainerWidth = args.ContainerWidth;
     Zoom           = args.Zoom;
 }
Example #9
0
        public PanelDbManager(IHost host, PluginParameter data)
        {
            _host         = host;
            _shellData    = (Shell)data[0];
            _shellSqlConn = GetShellSqlConn();

            // init StrRes to translate string
            StrRes.SetHost(_host);
            Init();

            //绑定事件
            _dbManager = new DbManager(_host, _shellData, _shellSqlConn.type);
            _dbManager.ConnectDbCompletedToDo       += DbManagerConnectDbCompletedToDo;
            _dbManager.GetDbNameCompletedToDo       += DbManagerGetDbNameCompletedToDo;
            _dbManager.GetDbTableNameCompletedToDo  += DbManagerGetTableNameCompletedToDo;
            _dbManager.GetColumnTypeCompletedToDo   += DbManagerGetColumnTypeCompletedToDo;
            _dbManager.ExecuteReaderCompletedToDo   += DbManagerExecuteReaderCompletedToDo;
            _dbManager.ExecuteNonQueryCompletedToDo += DbManagerExecuteNonQueryCompletedToDo;

            RefreshServerStatus(false);


            if (string.IsNullOrEmpty(_shellSqlConn.type) || string.IsNullOrEmpty(_shellSqlConn.conn))
            {
                MessageBox.Show("shell's sqlConnection is null or space");
            }
            else
            {
                //连接数据库
                _dbManager.ConnectDb(_shellSqlConn.conn);
            }
        }
        public IPlugin CreateUsing(PluginParameter args)
        {
            var file = new FruaCharacterFile(args.Filename);

            Viewer = new FruaCharacterViewer(file, args);
            return(this);
        }
Example #11
0
 public FruaGlbFileViewer(FruaGlbFile file, PluginParameter args)
 {
     _file = file;
     _args = args;
     ContainerWidth = args.ContainerWidth;
     Zoom = args.Zoom;
 }
Example #12
0
        public IPlugin CreateUsing(PluginParameter args)
        {
            var file = DaxEclCache.GetEclFile(args.Filename);

            Viewer = new EclFileViewer(file);
            return(this);
        }
        public IPlugin CreateUsing(PluginParameter args)
        {
            var file = new FruaVaultFile(args.Filename);

            Viewer = new FruaVaultFileViewer(file);
            return(this);
        }
Example #14
0
        public DoNetPluginTest(IHost host, PluginParameter data)
        {
            _host      = host;
            _shellData = (Shell)data[0];

            Init();
            ShowShellTypeDataInLable(_shellData);
        }
Example #15
0
        public DeveloperTool(IHost host, PluginParameter data)
        {
            Init();

            _host = host;

            LoadServices();
        }
Example #16
0
 public FruaCharacterViewer(FruaCharacterFile file, PluginParameter parameters)
 {
     _file = file;
     Zoom = parameters.Zoom;
     ContainerWidth = parameters.ContainerWidth;
     if (_file.formatType == "item template")
         displayItemTypeName = true;
 }
Example #17
0
        public IPlugin CreateUsing(PluginParameter args)
        {
            var filename = Path.GetFileName(args.Filename);
            _file = new DaxWallDefFile(args.Filename);
            Viewer = new DaxWallDefViewer(_file.wallsets, _file._blockIds, args.Zoom, args.ContainerWidth);


            return this;
        }
Example #18
0
        public PanelEncoder(IHost host, PluginParameter data)
        {
            Init();

            _host = host;

            _radioButtonEncode.Checked = true;
            LoadServices();
        }
Example #19
0
        public static string ToSha1(PluginParameter args)
        {
            var  str          = args[0];
            SHA1 sha1         = new SHA1CryptoServiceProvider();
            var  bytesSha1Out = sha1.ComputeHash(Encoding.UTF8.GetBytes(str));
            var  strSha1Out   = BitConverter.ToString(bytesSha1Out);

            return(strSha1Out.Replace("-", ""));
        }
Example #20
0
        public static string ToMd5_16(PluginParameter args)
        {
            var str = args[0];
            var mD5CryptoServiceProvider = new MD5CryptoServiceProvider();
            var tmp = BitConverter.ToString(mD5CryptoServiceProvider.ComputeHash(Encoding.UTF8.GetBytes(str)), 4, 8);

            tmp = tmp.Replace("-", "");
            return(tmp);
        }
        public IPlugin CreateUsing(PluginParameter args)
        {
            var filename = Path.GetFileName(args.Filename);

            _file  = new DaxWallDefFile(args.Filename);
            Viewer = new DaxWallDefViewer(_file.wallsets, _file._blockIds, args.Zoom, args.ContainerWidth);


            return(this);
        }
Example #22
0
        public IPlugin CreateUsing(PluginParameter args)
        {
            var filename = Path.GetFileName(args.Filename);
            var display35ImagesPerRow = filename != null && (filename.ToUpper().StartsWith("8X8D"));
            var displayBorder = filename != null && filename.ToUpper().StartsWith("SPRIT");

            _file = new DaxImageFile(args.Filename);
            Viewer = new DaxImageViewer(_file.GetBitmaps(), args.Zoom, args.ContainerWidth, display35ImagesPerRow, displayBorder, _file.GetBitmapIds());
            return this;
        }
 public FruaCharacterViewer(FruaCharacterFile file, PluginParameter parameters)
 {
     _file          = file;
     Zoom           = parameters.Zoom;
     ContainerWidth = parameters.ContainerWidth;
     if (_file.formatType == "item template")
     {
         displayItemTypeName = true;
     }
 }
Example #24
0
        public PanelShellCmder(IHost host, PluginParameter data)
        {
            Init();
            _host      = host;
            _shellData = (Shell)data[0];

            _consoleBoxCmder.CommandEntered += ConsoleBoxCmderCommandEntered;
            _consoleBoxCmder.Prompt          = "AltmanCmder";
            ConnectOneShell();
        }
        public IPlugin CreateUsing(PluginParameter args)
        {
            var filename = Path.GetFileName(args.Filename);
            var display35ImagesPerRow = filename != null && (filename.ToUpper().StartsWith("8X8D"));
            var displayBorder         = filename != null && filename.ToUpper().StartsWith("SPRIT");

            _file  = new DaxImageFile(args.Filename);
            Viewer = new DaxImageViewer(_file.GetBitmaps(), args.Zoom, args.ContainerWidth, display35ImagesPerRow, displayBorder, _file.GetBitmapIds(), _file);
            return(this);
        }
Example #26
0
        public static string ToUrlEncodeAll(PluginParameter args)
        {
            var str   = args[0];
            var sb    = new StringBuilder();
            var bytes = Encoding.UTF8.GetBytes(str);

            foreach (var b in bytes)
            {
                sb.Append("%" + Convert.ToString(b, 16));
            }
            return(sb.ToString().ToUpper());
        }
Example #27
0
        /// <summary>
        /// Shows the options dialog.
        /// </summary>
        /// <param name="hParentWnd">Handle to parent window.</param>
        /// <param name="parameters">The parameter string.</param>
        /// <returns>The new parameter string.</returns>
        public string ShowOptionsDialog(IntPtr hParentWnd, string parameters)
        {
            PluginParameter parameter = new PluginParameter(parameters);

            OptionsForm options = new OptionsForm(parameter, ConfiguredProviders.Select(typeMapping => typeMapping.Name));

            if (options.ShowDialog() == DialogResult.OK)
            {
                return(options.Parameter.ParameterString());
            }

            return(parameters);
        }
Example #28
0
        public static string Base64_Decode(PluginParameter args)
        {
            var str = args[0];

            try
            {
                var bytes = Convert.FromBase64String(str);
                return(Encoding.Default.GetString(bytes));
            }
            catch
            {
                return("FromBase64 Fail");
            }
        }
Example #29
0
        public PanelPluginManager(IHost host, PluginParameter data)
        {
            this._host = host;

            // init StrRes to translate string
            StrRes.SetHost(_host);
            Init();

            _updateXmlPath    = Path.Combine(_host.App.AppPluginDir, new PluginInfo().Name, "update.xml");
            _updateXmlUrl     = ReadConfigXml();
            _installedPlugins = PluginProvider.GetPlugins();
            DownloadUpdateXml();
            LoadInstalledPlugins();
        }
Example #30
0
        /// <summary>
        /// Updates the plugin settings.
        /// </summary>
        /// <param name="project">The project.</param>
        /// <param name="plugin">The plugin.</param>
        /// <returns></returns>
        public static Project UpdatePluginSettings(Project project, IGeneratorTemplate plugin)
        {
            _logger.Trace("ProjectController.UpdatePluginSettings()");

            if (project.Properties == null)
            {
                project.Properties = new ProjectProperties();
            }

            var    type = plugin.GetType();
            string guid = ((GuidAttribute)(type.Assembly.GetCustomAttributes(typeof(GuidAttribute), true)[0])).Value;

            var pluginAssembly = project.Properties.Plugins.FirstOrDefault(p => p.Guid.Equals(guid, StringComparison.InvariantCultureIgnoreCase));

            if (pluginAssembly == null)
            {
                pluginAssembly      = new ProjectPropertiesPlugin();
                pluginAssembly.Guid = guid;
                project.Properties.Plugins.Add(pluginAssembly);
            }

            if (pluginAssembly.Parameters == null)
            {
                pluginAssembly.Parameters = new List <PluginParameter>();
            }

            // Remove all default values from plugin parameters
            pluginAssembly.Parameters.RemoveAll(p => plugin.Settings.Any(s => s.Key.Equals(p.Code, StringComparison.InvariantCultureIgnoreCase) && s.UseDefault));

            // Check all non-default parameters
            foreach (PluginSettingValue settingValue in plugin.Settings.Where(s => !s.UseDefault))
            {
                var parameter = pluginAssembly.Parameters.FirstOrDefault(c => c.Code.Equals(settingValue.Key, StringComparison.InvariantCultureIgnoreCase));
                if (parameter == null)
                {
                    parameter = new PluginParameter();
                    pluginAssembly.Parameters.Add(parameter);
                }

                parameter.Code  = settingValue.Key;
                parameter.Value = settingValue.Value;
                parameter.Type  = settingValue.Type;
            }

            return(project);
        }
Example #31
0
        public static string ToHex(PluginParameter args)
        {
            var str = args[0];

            if (str == "")
            {
                return("");
            }
            var bytes = Encoding.UTF8.GetBytes(str);
            var tmp   = "";

            for (var i = 0; i < bytes.Length; i++)
            {
                tmp = tmp + bytes[i].ToString("X");
            }
            return(tmp);
        }
Example #32
0
        public static string ToMd5_32(PluginParameter args)
        {
            var str = args[0];

            var md5   = MD5.Create();
            var bytes = Encoding.UTF8.GetBytes(str);
            var array = md5.ComputeHash(bytes);

            md5.Clear();

            var tmp = "";

            foreach (var b in array)
            {
                tmp += b.ToString("X2");
            }
            return(tmp);
        }
Example #33
0
        /// <summary>
        /// Initializes a new instance of the <see cref="OptionsForm"/> class.
        /// </summary>
        /// <param name="parameter">The parameter.</param>
        /// <param name="dataProviderNames">The data provider names.</param>
        public OptionsForm(PluginParameter parameter, IEnumerable <string> dataProviderNames)
            : base()
        {
            InitializeComponent();

            this.Parameter = parameter;

            if (parameter.BugtrackUri != null)
            {
                this.textBoxProjectUri.Text = parameter.BugtrackUri.AbsoluteUri;
            }

            if (!String.IsNullOrEmpty(parameter.UserName))
            {
                textBoxUser.Text = parameter.UserName;
            }

            if (!String.IsNullOrEmpty(parameter.Password))
            {
                textBoxPass.Text = parameter.Password;
            }

            radioButtonSupplied.Checked = !String.IsNullOrEmpty(parameter.UserName) || !String.IsNullOrEmpty(parameter.UserName);

            if (parameter.UseCurrentUser.HasValue)
            {
                radioButtonCurrentUser.Checked = parameter.UseCurrentUser.Value;
            }

            if (String.IsNullOrEmpty(parameter.UserName) & String.IsNullOrEmpty(parameter.UserName) && !parameter.UseCurrentUser.HasValue)
            {
                radioButtonNoCredentials.Checked = true;
            }

            foreach (string dataProviderName in dataProviderNames)
            {
                int idx = comboBoxDataProvider.Items.Add(dataProviderName);
                if (StringComparer.InvariantCultureIgnoreCase.Compare(dataProviderName, parameter.DataProvider) == 0)
                {
                    comboBoxDataProvider.SelectedIndex = idx;
                }
            }
        }
Example #34
0
        public static string FromUrlEncode(PluginParameter args)
        {
            var str = args[0];

            try
            {
                if (Regex.IsMatch(
                        HttpUtility.UrlDecode(str, Encoding.GetEncoding("iso-8859-1")),
                        @"^(?:[\x00-\x7f]|[\xe0-\xef][\x80-\xbf]{2})+$"))
                {
                    return(HttpUtility.UrlDecode(str, Encoding.GetEncoding("UTF-8")));
                }
                return(HttpUtility.UrlDecode(str, Encoding.GetEncoding("GB2312")));
            }
            catch
            {
                return("FromUrlEncode Fail");
            }
        }
Example #35
0
        public FruaTlbViewer(FruaTlbFile file, PluginParameter args)
        {
            if (args.Filename.ToUpper().Contains("8X8"))
                _wallTlb = true;

            _file = file;
            _pictureBox = new PictureBox();
            _pictureBox.Paint += PictureBoxPaint;
            ContainerWidth = args.ContainerWidth;
            Zoom = args.Zoom;
            _container = new UserControl{ Dock = DockStyle.Fill };
            _container.AutoScroll = true;
            var exportButton = new Button();
            exportButton.Text = "Export to Wall Template";
            exportButton.AutoSize = true;
            exportButton.MouseClick += wallTemplateExportForm;

            if (_wallTlb)
                _container.Controls.Add(exportButton);
            _container.Controls.Add(_pictureBox);

         }
Example #36
0
 public IPlugin CreateUsing(PluginParameter args)
 {
     var file = new FruaSavedGameFile(args);
     Viewer = new FruaSavedGameFileViewer(file, args);
     return this;
 }
Example #37
0
 public IPlugin CreateUsing(PluginParameter args)
 {
     var file = new TextFile(args.Filename);
     Viewer = new TextFileViewer(file, args.ContainerWidth);
     return this;
 }
Example #38
0
 public IPlugin CreateUsing(PluginParameter args)
 {
     _file = new FruaTlbFile(args.Filename);
     Viewer = new FruaTlbViewer(_file, args);
     return this;
 }
Example #39
0
 public IPlugin CreateUsing(PluginParameter args)
 {
     var file = new FruaVaultFile(args.Filename);
     Viewer = new FruaVaultFileViewer(file);
     return this;
 }
 public FruaSavedGameFileViewer(FruaSavedGameFile file, PluginParameter args)
 {
     _file = file;
     ContainerWidth = args.ContainerWidth;
     Zoom = args.Zoom;
 }
Example #41
0
 public IPlugin CreateUsing(PluginParameter args)
 {
     Viewer = new ImageFileViewer(args.Filename, args.ContainerWidth);
     return this;
 }
Example #42
0
 public IPlugin CreateUsing(PluginParameter args)
 {
     var file = new FruaCharacterFile(args.Filename);
     Viewer = new FruaCharacterViewer(file, args);
     return this;
 }
Example #43
0
 public HexFileViewer(GoldBoxFile goldBoxFile, PluginParameter args)
 {
     _goldBoxFile = goldBoxFile;
     _fileName = args.Filename;
     ContainerWidth = args.ContainerWidth;
 }
Example #44
0
 public IPlugin CreateUsing(PluginParameter args)
 {
     var file = new BinaryFile(args.Filename);
     Viewer = new HexFileViewer(file, args);
     return this;
 }
Example #45
0
 public FruaSavedGameFile(PluginParameter parameters)
 {
     _path = parameters.Filename;
 }