internal override void FixGhInput(Param_ScriptVariable param, bool alsoSetIfNecessary = true)
        {
            param.NickName = Decodes_PythonComponent.cleanNickname(param.NickName);
            param.NickName = param.NickName.Replace("_" + Decodes_PythonComponent.attributes_suffix, "_baduser");
            if (String.Compare(param.NickName, "code", StringComparison.InvariantCultureIgnoreCase) == 0)
            {
                param.NickName = "baduser";
            }

            param.Name = param.NickName; // set name to nickname, omitting array brackets (added below)

            //if (param.Access == GH_ParamAccess.list) NickName = "[" + NickName + "]";

            if (string.IsNullOrEmpty(Description))
            {
                Description = string.Format("Script variable {0}", Name);
            }
            param.Optional  = true;
            param.ShowHints = true;

            param.Hints = Decodes_PythonComponent.GetHints();
            if (param.TypeHint == null)
            {
                param.TypeHint = param.Hints[0];
            }
        }
Esempio n. 2
0
        public void FixGhInput()
        {
            NickName = cleanNickname(NickName);
            NickName = NickName.Replace("_" + Decodes_PythonComponent.attributes_suffix, "_baduser");
            if (String.Compare(NickName, "code", StringComparison.InvariantCultureIgnoreCase) == 0)
            {
                NickName = "baduser";
            }

            Name = NickName; // set name to nickname, omitting array brackets (added below)

            if (Access == GH_ParamAccess.list)
            {
                NickName = "[" + NickName + "]";
            }

            if (string.IsNullOrEmpty(Description))
            {
                Description = string.Format("Script variable {0}", Name);
            }
            Optional  = true;
            ShowHints = true;

            Hints = Decodes_PythonComponent.GetHints();
            if (TypeHint == null)
            {
                TypeHint = Hints[0];
            }
        }