Пример #1
0
        //_________________________________________________________________________________________________________
        //_________________________________________________________________________________________________________
        public static ResultProfile RunProfile(string sAlias, string sProfile)
        {
            ResultProfile r = new ResultProfile();

            r.r = "Servers not available or " + sAlias + " not found";
            if (!FIMServers.Loaded || !Config.dProfiles.ContainsKey(sAlias))
            {
                return(r);
            }

            foreach (string s in FIMServers.Keys)
            {
                if (FIMServers.Item(s).label == Config.dProfiles[sAlias]["AliasSrv"].ToString())
                {
                    for (int i = 0; i < FIMServers.Item(s).MAs.Count; i++)
                    {
                        if (FIMServers.Item(s).MAs[i].profileKey == sAlias && Config.dProfiles[sAlias].Table.Columns.Contains(sProfile))
                        {
                            ConnectServer(FIMServers.Item(s));
                            return(RunProfile(FIMServers.Item(s), i, Config.dProfiles[sAlias][sProfile].ToString()));
                        }
                    }
                }
            }

            r.r = "Profile " + sProfile + " not found";
            return(r);
        }
Пример #2
0
        //_________________________________________________________________________________________________________
        //_________________________________________________________________________________________________________
        internal void mRunMAProfiles_Click(object sender, EventArgs e)
        {
            int i = 1;

            // If LoadData is pending, return without errors
            if (!FIMServers.Loaded)
            {
                cTimerNext.Enabled = true;// Enable a timer to allow pending refresh before continue with macro
                return;
            }
            mRunMAProfiles.Enabled = false;
            foreach (string s in FIMServers.Keys)
            {
                FIMServers.Item(s).num   = GetMax(cMaxRunProfiles);
                FIMServers.Item(s).runPf = mProfilesOptions.Text;
                if (i <= 6)
                {
                    dWorkers["" + i].oFIMServer = FIMServers.Item(s);
                    dWorkers["" + i++].Run(FIMServers.Item(s));
                }
            }
        }