Example #1
0
        //_________________________________________________________________________________________________________
        //_________________________________________________________________________________________________________
        private void mEditMacro_Click(object sender, EventArgs e)
        {
            string sMacroPath = MacroHelper.GetSelectedMacroPath(cLstMacros);

            if (Control.ModifierKeys == Keys.Control)
            {
                sMacroPath = MacroHelper.NewMacro((File.Exists(sMacroPath) ? "" : sMacroPath));
                MacroHelper.LoadMacroList(cLstMacros);
            }

            try { System.Diagnostics.Process.Start(sMacroPath); }
            catch (Exception) { }
        }
Example #2
0
        //_________________________________________________________________________________________________________
        //_________________________________________________________________________________________________________
        private void mExecCustomMenu_Click(object sender, EventArgs e)
        {
            ToolStripMenuItem MnuItem    = (ToolStripMenuItem)sender;
            string            sMacroName = MacroHelper.GetSelectedMacroPath(MnuItem.Tag.ToString());

            if (!File.Exists(sMacroName))
            {
                return;
            }

            mExecMacro.Enabled = false;

            MacroHelper.Running        = false;
            MacroHelper.ExecName       = "";
            MacroHelper.NextScriptName = "";
            MacroHelper.MustCallBack   = false;

            if (mh == null)
            {
                mh = new MacroHelper(this, dgValues);
            }
            mh.ExecMacro(sMacroName);
            //mExecMacro.Enabled = true; // It is not activated till the end of macro execution
        }
Example #3
0
        //_________________________________________________________________________________________________________
        //_________________________________________________________________________________________________________
        private bool LoadConfig()
        {
            if (Initialized && Control.ModifierKeys != Keys.Shift)
            {
                return(true);                                                  // If it is already initialized and Keys.Shift is not pressed, return
            }
            if (!File.Exists(XlxConfig))
            {
                return(false);                              //!File.Exists(XlxConfig) && !File.Exists(@"F:\" + XlxConfig)
            }
            Config.InitConfig(XlxConfig, DatasourcesSheet); //File.Exists(XlxConfig) ? XlxConfig : @"F:\" + XlxConfig
            GridHelper.InitializeDataGridView(dgObjs);
            GridHelper.InitializeDataGridView(dgAux);
            GridHelper.InitializeDataGridView(dgValues, true);
            GridHelper.InitializeDataGridView(oDetails.dgv);
            // Scrollbars
            dgObjs.ScrollBars = ScrollBars.Vertical;
            dgAux.ScrollBars  = ScrollBars.None;

            LogHelper.Msg("Connecting Data Sources");
            this.Refresh();
            oDSrc = new DSources(Config.tFDatos, Config.tAttributes);
            GridHelper.InitGrid(dgObjs, Config.lObjCols);
            GridHelper.InitGrid(dgAux, Config.lAuxCols, null, 1);
            GridHelper.InitGrid(dgValues, Config.lValuesCols, Config.dAtribs);
            GridHelper.MarkRows(dgValues, SelectedRows);

            cObjClass.Items.Clear();
            cObjClass.Items.AddRange(ExtensionHelper.GetNewObjectClasses());
            if (cObjClass.Items.Count > 0)
            {
                cObjClass.SelectedIndex = 0;
            }
            cBU.Items.Clear();
            cBU.Items.AddRange(Config.dConfig["ADSource Alias"].Split(';'));
            if (cBU.Items.Count > 0)
            {
                cBU.SelectedIndex = 0;
            }
            mProfilesOptions.Items.Clear();
            mProfilesOptions.Items.AddRange(Config.dConfig["Profile Options"].Split(';'));
            if (mProfilesOptions.Items.Count > 0)
            {
                mProfilesOptions.SelectedIndex = 0;
            }
            // Optional: Change with of dropdownlist with a functionality of available in MacroHelper
            MacroHelper.ChangeListBoxWidth(cObjClass);
            MacroHelper.ChangeListBoxWidth(cBU);
            MacroHelper.ChangeListBoxWidth(mProfilesOptions);
            // Profiles config
            dWorkers = new Dictionary <string, cWorker>();
            dWorkers.Add("1", new cWorker(null, null, lbPfStatus1, null));
            dWorkers.Add("2", new cWorker(null, null, lbPfStatus2, null));
            dWorkers.Add("3", new cWorker(null, null, lbPfStatus3, null));
            dWorkers.Add("4", new cWorker(null, null, lbPfStatus4, null));
            dWorkers.Add("5", new cWorker(null, null, lbPfStatus5, null));
            dWorkers.Add("6", new cWorker(null, null, lbPfStatus6, null));

            // Load servers info
            FIMServers.LoadServers(dWorkers);

            Initialized = true;
            return(true);
        }