/// <summary>
        ///
        /// </summary>
        /// <param name="source"></param>
        /// <param name="guiInfo"></param>
        /// <returns></returns>
        public static InputTextToolElement Create(object source, MemberGuiInfo guiInfo)
        {
            var isMultiLine = guiInfo.Options.ContainsKey("isMultiLine") ? (bool)guiInfo.Options["isMultiLine"] : false;
            var maxLength   = guiInfo.Options.ContainsKey("maxLength") ? (int)guiInfo.Options["maxLength"] : 1024;

            return(new InputTextToolElement(guiInfo.Name, source, guiInfo.PropertyName, isMultiLine, maxLength));
        }
示例#2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="source"></param>
        /// <param name="guiInfo"></param>
        /// <returns></returns>
        public static IntToolElement Create(object source, MemberGuiInfo guiInfo)
        {
            var speed = guiInfo.Options.ContainsKey("speed") ? (float)guiInfo.Options["speed"] : 1;
            var min   = guiInfo.Options.ContainsKey("min") ? (int)guiInfo.Options["min"] : -100;
            var max   = guiInfo.Options.ContainsKey("max") ? (int)guiInfo.Options["max"] : 100;

            return(new IntToolElement(guiInfo.Name, source, guiInfo.PropertyName, speed, min, max));
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="source"></param>
        /// <param name="guiInfo"></param>
        /// <returns></returns>
        public static PathToolElement Create(object source, MemberGuiInfo guiInfo)
        {
            var isDirectory = guiInfo.Options.ContainsKey("isDirectory") ? (bool)guiInfo.Options["isDirectory"] : false;
            var filter      = guiInfo.Options.ContainsKey("filter") ? (string)guiInfo.Options["filter"] : "";
            var defaultPath = guiInfo.Options.ContainsKey("defaultPath") ? (string)guiInfo.Options["defaultPath"] : "";
            var maxLength   = guiInfo.Options.ContainsKey("maxLength") ? (int)guiInfo.Options["maxLength"] : 1024;
            var rootDirectoryPathPropertyName = guiInfo.Options.ContainsKey("rootDirectoryPathPropertyName") ? (string)guiInfo.Options["rootDirectoryPathPropertyName"] : null;

            return(new PathToolElement(guiInfo.Name, source, guiInfo.PropertyName, isDirectory, filter, defaultPath, maxLength, rootDirectoryPathPropertyName));
        }
        /// <summary>
        /// <see cref="ToolElementTreeFactory.ObjectMapping"/>から<see cref="ColorToolElement"/>を作成します。
        /// </summary>
        /// <param name="source">バインディング対象</param>
        /// <param name="guiInfo"></param>
        /// <returns></returns>
        public static ColorToolElement Create(object source, MemberGuiInfo guiInfo)
        {
            var flags = guiInfo.Options.ContainsKey("flags") ? (ToolColorEditFlags)guiInfo.Options["flags"] : ToolColorEditFlags.AlphaBar;

            return(new ColorToolElement(guiInfo.Name, source, guiInfo.PropertyName, flags));
        }
 /// <summary>
 /// <see cref="MemberGuiInfo"/>から<see cref="BoolToolElement"/>を作成します。
 /// </summary>
 /// <param name="source">バインディング対象</param>
 /// <param name="guiInfo"></param>
 /// <returns></returns>
 public static BoolToolElement Create(object source, MemberGuiInfo guiInfo)
 {
     return(new BoolToolElement(guiInfo.Name, source, guiInfo.PropertyName));
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="source"></param>
 /// <param name="guiInfo"></param>
 /// <param name="toolElementTreeFactory"></param>
 /// <returns></returns>
 public static GroupToolElement Create(object source, MemberGuiInfo guiInfo, IToolElementTreeFactory toolElementTreeFactory)
 {
     return(new GroupToolElement(guiInfo.Name, source, guiInfo.PropertyName, toolElementTreeFactory));
 }