コード例 #1
0
        private void ModeB(Object sender, EventArgs e)
        {
            ClearInput();
            ModeIndex = 1;

            Param_Colour param = new Param_Colour();

            param.Name        = "Color";
            param.NickName    = "C";
            param.Description = "---";
            param.Access      = GH_ParamAccess.item;
            param.SetPersistentData(Color.Black);
            param.Optional = true;

            Params.RegisterInputParam(param, 1);

            Param_Number paramA = new Param_Number();

            paramA.Name        = "Value";
            paramA.NickName    = "T";
            paramA.Description = "---";
            paramA.Access      = GH_ParamAccess.item;
            paramA.SetPersistentData(1);
            paramA.Optional = true;

            Params.RegisterInputParam(paramA, 2);

            Params.OnParametersChanged();

            UpdateMessage();
            ExpireSolution(true);
        }
コード例 #2
0
ファイル: Crop.cs プロジェクト: shapediver/Aviary
        private void paramColor(int index, string name, string nickName, string description, GH_ParamAccess access, System.Drawing.Color Value)
        {
            if ((Params.Input.Count - 1) < index)
            {
                Params.RegisterInputParam(new Param_Colour(), index);
                Params.OnParametersChanged();
            }
            else
            {
                if (Params.Input[index].GetType() != new Param_Colour().GetType())
                {
                    Params.Input[index].RemoveAllSources();
                    Params.Input[index] = new Param_Colour();
                    Params.OnParametersChanged();
                }
            }

            Params.Input[index].ClearData();

            Param_Colour param = (Param_Colour)Params.Input[index];

            param.PersistentData.ClearData();
            param.PersistentData.Clear();
            param.SetPersistentData(Value);
            SetParamProperties(index, name, nickName, description, access);
        }