예제 #1
0
        public void RegisterOutputParam(IGH_Param param, string name, string nickName, string description)
        {
            param.Name        = name;
            param.NickName    = nickName;
            param.Description = description;
            ExtendedPlug extendedPlug = new ExtendedPlug(param);

            outputs.Add(extendedPlug);
        }
예제 #2
0
        public void RegisterInputParam(IGH_Param param, string name, string nickName, string description, GH_ParamAccess access, IGH_Goo defaultValue)
        {
            param.Name        = name;
            param.NickName    = nickName;
            param.Description = description;
            param.Access      = access;
            try
            {
                if (defaultValue != null && typeof(IGH_Goo).IsAssignableFrom(param.GetType()))
                {
                    //Type genericType = GetGenericType(typeof(GH_PersistentParam), ((object)param).GetType());
                    Type genericType = GetGenericType(typeof(GH_PersistentParam <>), ((object)param).GetType());
                    if (genericType != null)
                    {
                        Type[] genericArguments = genericType.GetGenericArguments();
                        if (genericArguments.Length != 0)
                        {
                            Type type = genericArguments[0];
                            genericType.GetMethod("SetPersistentData", BindingFlags.Instance | BindingFlags.Public, null, new Type[1]
                            {
                                genericArguments[0]
                            }, null).Invoke(param, new object[1]
                            {
                                defaultValue
                            });
                        }
                    }
                }
            }
            catch (Exception)
            {
            }
            ExtendedPlug extendedPlug = new ExtendedPlug(param);

            extendedPlug.Unit = this;
            inputs.Add(extendedPlug);
        }
예제 #3
0
 public void RegisterOutputPlug(ExtendedPlug plug)
 {
     plug.IsMenu = true;
     outputs.Add(plug);
 }