コード例 #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);
            }
        }
コード例 #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);
            }
        }