Esempio n. 1
0
        public bool AddOption(string factory, string sEventID, Color clEventColor)
        {
            try
            {
                clsEventColor objEvent = new clsEventColor(sEventID, clEventColor);

                int i;
                for (i = 0; i <= this.Count - 1; i++)
                {
                    if (((clsOptionData)this[i]).GetOptionData(clsOptionData.Options.Factory, "").ToString() == factory)
                    {
                        ((clsOptionData)this[i]).SetOptionData(objEvent, clsOptionData.Options.EventColor);
                        return(true);
                    }
                }
                clsOptionData OptionData = new clsOptionData(factory);
                OptionData.SetOptionData(objEvent, clsOptionData.Options.EventColor);
                this.Add(OptionData);

                return(true);
            }
            catch (Exception ex)
            {
                CmnFunction.ShowMsgBox("clsGlobalOptions.AddOptions()" + "\r\n" + ex.Message, "FMB Client", MessageBoxButtons.OK, 1);
                return(false);
            }
        }
Esempio n. 2
0
        public Color GetOptions(string factory, string sEventID)
        {
            try
            {
                clsOptionData OptionData = GetItem(factory);
                if (OptionData != null)
                {
                    object OOptions = OptionData.GetOptionData(clsOptionData.Options.EventColor, sEventID);
                    if (OOptions != null)
                    {
                        clsEventColor Options = (clsEventColor)OOptions;
                        return((Color)Options.GetEventColor());
                    }
                    else
                    {
                        return(Color.Empty);
                    }

                    //clsEventColor Options = (clsEventColor)OptionData.GetOptionData(clsOptionData.Options.EventColor, sEventID);
                    //if (Options != null)
                    //{
                    //    return ((Color)Options.GetEventColor());
                    //}
                }
                if ((GetItem("SYSTEM").GetOptionData(clsOptionData.Options.EventColor, sEventID)) != null)
                {
                    return((Color)(GetItem("SYSTEM").GetOptionData(clsOptionData.Options.EventColor, sEventID)));
                }
                else
                {
                    return(Color.Empty);
                }
            }
            catch (Exception ex)
            {
                CmnFunction.ShowMsgBox("clsGlobalOptions.GetOptions()" + "\r\n" + ex.Message, "FMB Client", MessageBoxButtons.OK, 1);
                return(Color.Empty);
            }
        }
Esempio n. 3
0
        public object GetOptions(string factory, clsOptionData.Options opt)
        {
            try
            {
                clsOptionData OptionData = GetItem(factory);
                if (OptionData != null)
                {
                    object Options = OptionData.GetOptionData(opt, "");
                    if (Options != null)
                    {
                        return(Options);
                    }
                }

                return(GetItem("SYSTEM").GetOptionData(opt, ""));
            }
            catch (Exception ex)
            {
                CmnFunction.ShowMsgBox("clsGlobalOptions.GetOptions()" + "\r\n" + ex.Message, "FMB Client", MessageBoxButtons.OK, 1);
                return(false);
            }
        }
Esempio n. 4
0
        public bool AddOptions(clsOptionData options)
        {
            try
            {
                int i;
                for (i = 0; i <= this.Count - 1; i++)
                {
                    if (((clsOptionData)this[i]).GetOptionData(clsOptionData.Options.Factory, "").ToString() == options.GetOptionData(clsOptionData.Options.Factory, "").ToString())
                    {
                        this.RemoveAt(i);
                        break;
                    }
                }
                this.Add(options);

                return(true);
            }
            catch (Exception ex)
            {
                CmnFunction.ShowMsgBox("clsGlobalOptions.AddOptions()" + "\r\n" + ex.Message, "FMB Client", MessageBoxButtons.OK, 1);
                return(false);
            }
        }