Example #1
0
        public static PlugPropertyInfo Serialize(PresetPlug plug, IOType io)
        {
            var info = new PlugPropertyInfo();

            info.Guid         = plug.Guid;
            info.PropertyType = plug.Property.GetGenericType().ToSerializableType();
            info.DefaultValue = plug.Property.Value.Serialize();
            info.Name         = plug.Property.Name;
            info.IoType       = io;
            return(info);
        }
Example #2
0
        /// <summary>
        /// 任意の出力プラグTを追加します。
        /// </summary>
        /// <param name="plugName"></param>
        /// <param name="defaultValue"></param>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        public NodeService AddOutputPlug <T>(string plugName, T defaultValue)
        {
            var plug = new PresetPlug(new Property <T>()
            {
                Name  = plugName,
                Value = defaultValue,
            });

            _model.OutputPlugs.Add(plug);
            return(this);
        }