当前位置: 首页>>代码示例>>C#>>正文


C# PropertyItem.ContainsKey方法代码示例

本文整理汇总了C#中PropertyItem.ContainsKey方法的典型用法代码示例。如果您正苦于以下问题:C# PropertyItem.ContainsKey方法的具体用法?C# PropertyItem.ContainsKey怎么用?C# PropertyItem.ContainsKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PropertyItem的用法示例。


在下文中一共展示了PropertyItem.ContainsKey方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Make

        //public IDynamicControl Make(PropertyItem define)
        //{
        //    return null;
        //}
        public CustomProperty Make(PropertyItem define)
        {
            String defaultValue = "";
            try
            {
                defaultValue = define[_XMLTag.g_AttributionVariable];
            }
            catch (Exception ex)
            {
            }

            CustomProperty property = new CustomProperty(define.Name, defaultValue, false, CustomPropertysManager.Instance.Category, define.Caption, true);
            property.Name = define.Name;
            String strValueDomain = "";
            if (define.ContainsKey(CustomPropertysManager.Instance.ValueDomain))
            {
                strValueDomain = define[CustomPropertysManager.Instance.ValueDomain];
            }
            property.Choices = new CustomChoices(strValueDomain.Split(';'), false);
            return property;
        }
开发者ID:tiankongldp,项目名称:goldenmonkey,代码行数:25,代码来源:MakerListBox.cs

示例2: Make

        public CustomProperty Make(PropertyItem define)
        {
            //String defaultValue = define["default"];
            //if (String.IsNullOrEmpty(defaultValue))
            //{
            //    defaultValue = "";
            //}

            Int32 size = 1;
            if (define.ContainsKey(_XMLTag.g_AttributionMaxlen))
            {
                String maxLen = define[_XMLTag.g_AttributionMaxlen];
                if (!String.IsNullOrEmpty(maxLen))
                {
                    size = Int32.Parse(maxLen);
                }
            }

            String itemType = "";
            if (define.ContainsKey(_XMLTag.g_AttributionItemType))
            {
                itemType = define[_XMLTag.g_AttributionItemType];
            }
            else if (define.ContainsKey(_XMLTag.g_AttributionType))
            {
                itemType = define[_XMLTag.g_AttributionType];
                String[] strs = itemType.Split('.');
                if (2 == strs.Length)
                {
                    itemType = strs[1];
                }
            }

            String defaultValue = "";
            if (define.ContainsKey(_XMLTag.g_AttributionVariable))
            {
                defaultValue = define[_XMLTag.g_AttributionVariable];
            }

            TypeConverter typeConverter = null;
            CustomProperty property = null;
            if (String.IsNullOrEmpty(itemType))
            {
                //String[] defaultValue = new String[4];
                //defaultValue[0] = define["default"];
                property = new CustomProperty(define.Name, Toolkit.ToStringArray(defaultValue), false, CustomPropertysManager.Instance.Category, define.Caption, true);
                property.CustomTypeConverter = new ArrayConverter();
            }
            else
            {
                switch (itemType)
                {
                    case "Int32":
                        {

                            Int32[] intArray = new Int32[size];
                            Toolkit.CopyArray(intArray, Toolkit.ToInt32Array(defaultValue));
                            property = new CustomProperty(define.Name, intArray, false, CustomPropertysManager.Instance.Category, define.Caption, true);
                            property.CustomTypeConverter = new ArrayConverter();
                        }
                        break;
                    case "String":
                        {
                            String[] stringArray = new String[size];
                            Toolkit.CopyArray(stringArray, Toolkit.ToStringArray(defaultValue));
                            property = new CustomProperty(define.Name, stringArray, false, CustomPropertysManager.Instance.Category, define.Caption, true);
                            property.CustomTypeConverter = new ArrayConverter();
                            //StringArrayConverter();
                        }
                        break;
                    case "Single":
                        {
                            Single[] singleArray = new Single[size];
                            Toolkit.CopyArray(singleArray, Toolkit.ToSingleArray(defaultValue));
                            property = new CustomProperty(define.Name, singleArray, false, CustomPropertysManager.Instance.Category, define.Caption, true);
                            property.CustomTypeConverter = new ArrayConverter();
                        }
                        break;
                    default:
                        {
                            String[] stringArray = new String[size];
                            Toolkit.CopyArray(stringArray, Toolkit.ToStringArray(defaultValue));
                            property = new CustomProperty(define.Name, stringArray, false, CustomPropertysManager.Instance.Category, define.Caption, true);
                            property.CustomTypeConverter = new ArrayConverter();
                        }
                        break;
                }
            }

            //String[] defaultValue = new String[4];
            //defaultValue[0] = define["default"]; ;

            //CustomProperty property = new CustomProperty(define.Name, defaultValue, false, CustomPropertysManager.Instance.Category, define.Caption, true);
            property.Name = define.Name;
            //            property.CustomTypeConverter = typeConverter;
            return property;
        }
开发者ID:tiankongldp,项目名称:goldenmonkey,代码行数:97,代码来源:MakerArrayEditor.cs

示例3: Make

        //public PropertyItem Define
        //{
        //    set
        //    {
        //        _define = value;
        //    }
        //}
        public CustomProperty Make(PropertyItem define)
        {
            try
            {
                //String defaultValue = define["default"];
                //if (String.IsNullOrEmpty(defaultValue))
                //{
                //    defaultValue = "";
                //}

                //String [] defaultValue = new String[4];

                String defaultValue = String.Empty;
                //if (define.ContainsKey(_XMLTag.g_AttributionDefault))
                //{
                //    defaultValue = define[_XMLTag.g_AttributionDefault];
                //}
                if (define.ContainsKey(_XMLTag.g_AttributionVariable))
                {
                    defaultValue = define[_XMLTag.g_AttributionVariable];
                }

                String caption = define.Caption;
                if (String.IsNullOrEmpty(caption))
                {
                    caption = define.Name;
                }

                CustomProperty property = new CustomProperty(define.Name, defaultValue, false, CustomPropertysManager.Instance.Category, caption, true);

                property.Name = define.Name;
                //property.CustomTypeConverter = new StringConverter();

                //property.CustomTypeConverter = new System.Web.UI.WebControls.StringArrayConverter();
                //property.CustomTypeConverter = new ArrayConverter();
                return property;

                String itemType = define["ItemType"];
                //if (String.IsNullOrEmpty(defaultValue))
                //{
                //    property.CustomTypeConverter = new StringConverter();
                //}
                //else
                //{
                //    switch (itemType)
                //    {
                //        case "Int32":
                //            {
                //                //property.CustomTypeConverter = new Int32Converter();
                //                property.CustomTypeConverter = new TypeConverterArray();
                //            }
                //            break;
                //        case "String":
                //            {
                //                property.CustomTypeConverter = new StringConverter();
                //                //StringArrayConverter();
                //            }
                //            break;
                //        case "Single":
                //            {
                //                property.CustomTypeConverter = new SingleConverter();
                //            }
                //            break;
                //        default:
                //            {
                //                property.CustomTypeConverter = new StringConverter();
                //            }
                //            break;
                //    }
                //}

                //property.CustomTypeConverter = new Int32Converter();
                //property.CustomEditor = new

                return property;
            }
            catch (Exception ex)
            {
                Toolkit.DEBUG_TRACE("Monkey.Processing.UI.GeneralPropertyGridControl.FillGridsPropertyGroups Exception:" + ex.Message + "\n");
                return null;
            }
        }
开发者ID:tiankongldp,项目名称:goldenmonkey,代码行数:89,代码来源:MakerTextBox.cs


注:本文中的PropertyItem.ContainsKey方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。