Exemple #1
0
        public GUICommandItem Clone(Control sender)
        {
            GUICommandItem new_instance = new GUICommandItem(this.CommandMode, this.CommandName, this.DisplayName, this.CommandType, null, this.ToolTip);


            //Values
            if (this.Values != null)
            {
                new_instance.Values = new string[this.Values.Length];

                for (int i = 0; i < this.Values.Length; i++)
                {
                    new_instance.Values[i] = this.Values[i];
                }
            }

            new_instance.Checked = this.Checked;

            new_instance.BgColor     = this.BgColor;
            new_instance.ShadowColor = this.ShadowColor;

            new_instance.UnChecked_BgColor     = this.UnChecked_BgColor;
            new_instance.UnChecked_ShadowColor = this.UnChecked_ShadowColor;

            return(new_instance);
        }
Exemple #2
0
        public static GUICommandItem GetCmdModeName(string recv_cmd, string[] default_values, Control sender)
        {
            GUICommandItem new_item = new GUICommandItem();

            //bool is_korean = false;

            if (default_values != null)
            {
                new_item.Values = default_values;
            }

            string default_target_name0 = HelloApps.GUI.GUIUtils.GetSafeArrayValue(default_values, 0);
            string default_target_name1 = HelloApps.GUI.GUIUtils.GetSafeArrayValue(default_values, 1);
            string default_target_name2 = HelloApps.GUI.GUIUtils.GetSafeArrayValue(default_values, 2);
            string default_target_name3 = HelloApps.GUI.GUIUtils.GetSafeArrayValue(default_values, 3);
            string default_target_name4 = HelloApps.GUI.GUIUtils.GetSafeArrayValue(default_values, 4);
            string default_target_name5 = HelloApps.GUI.GUIUtils.GetSafeArrayValue(default_values, 5);

            if (recv_cmd == "Paste")
            {
                new_item.CommandMode = BlockListType.Paste;
                new_item.CommandName = recv_cmd;
            }
            else if (recv_cmd == "EmptyLine")
            {
                new_item.CommandMode = BlockListType.Item;
                new_item.CommandName = recv_cmd;
                new_item.CommandType = CommandTypes.EmptyLine;
            }
            else
            {
                new_item.CommandMode = BlockListType.Item;
                new_item.CommandName = "Expression";
                new_item.DisplayName = new_item.CommandName;
                new_item.CommandType = CommandTypes.Expr1;


                if (!string.IsNullOrEmpty(recv_cmd))
                {
                    HelloApps.GUI.GUIUtils.SetSafeArrayValue(new_item.Values, 0, recv_cmd);
                }


                new_item.BgColor     = new SolidBrush(Color.FromArgb(0, 128, 0));
                new_item.ShadowColor = new SolidBrush(Color.FromArgb(0, 98, 0));
            }



            new_item.CommandMode = BlockListType.Item;
            new_item.CommandName = "Expression";
            new_item.DisplayName = new_item.CommandName;
            new_item.CommandType = CommandTypes.Expr1;


            if (!string.IsNullOrEmpty(recv_cmd))
            {
                HelloApps.GUI.GUIUtils.SetSafeArrayValue(new_item.Values, 0, recv_cmd);
            }


            new_item.BgColor     = new SolidBrush(Color.FromArgb(0, 128, 0));
            new_item.ShadowColor = new SolidBrush(Color.FromArgb(0, 98, 0));

            return(new_item);
        }