本文整理汇总了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;
}
示例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;
}
示例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;
}
}