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


C# Fields.FieldType类代码示例

本文整理汇总了C#中Greenshot.Drawing.Fields.FieldType的典型用法代码示例。如果您正苦于以下问题:C# FieldType类的具体用法?C# FieldType怎么用?C# FieldType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


FieldType类属于Greenshot.Drawing.Fields命名空间,在下文中一共展示了FieldType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateField

        /// <param name="requestingType">Type of the class for which to create the field</param>
        /// <param name="fieldType">FieldType of the field to construct</param>
        /// <param name="scope">FieldType of the field to construct</param>
        /// <returns>a new Field of the given fieldType, with the scope of it's value being restricted to the Type scope</returns>
        public Field CreateField(Type requestingType, FieldType fieldType, object preferredDefaultValue)
        {
            string requestingTypeName = requestingType.Name;
            string requestedField = requestingTypeName + "." + fieldType.Name;
            object fieldValue = preferredDefaultValue;

            // Check if the configuration exists
            if (LastUsedFieldValues == null)
            {
                LastUsedFieldValues = new Dictionary<string, object>();
            }

            // Check if settings for the requesting type exist, if not create!
            if (LastUsedFieldValues.ContainsKey(requestedField))
            {
                // Check if a value is set (not null)!
                if (LastUsedFieldValues[requestedField] != null)
                {
                    fieldValue = LastUsedFieldValues[requestedField];
                }
                else
                {
                    // Overwrite null value
                    LastUsedFieldValues[requestedField] = fieldValue;
                }
            }
            else
            {
                LastUsedFieldValues.Add(requestedField, fieldValue);
            }
            Field returnField = new Field(fieldType, requestingType);
            returnField.Value = fieldValue;
            return returnField;
        }
开发者ID:Jusonex,项目名称:ShareX,代码行数:38,代码来源:EditorConfiguration.cs

示例2: GetField

		public new Field GetField(FieldType fieldType) {
			Field ret = null;
			if(base.HasField(fieldType)) {
				ret = base.GetField(fieldType);
			} else {
				foreach(IFieldHolder fh in Children) {
					if(fh.HasField(fieldType)) {
						ret = fh.GetField(fieldType);
						break;
					}
				}
			}
			if(ret == null) {
				throw new ArgumentException("Field '"+fieldType+"' does not exist in " + GetType());
			}
			return ret;
		}
开发者ID:logtcn,项目名称:greenshot,代码行数:17,代码来源:AbstractFieldHolderWithChildren.cs

示例3: GetFieldValueAsDecimal

 public decimal GetFieldValueAsDecimal(FieldType fieldType)
 {
     return Convert.ToDecimal(GetFieldValue(fieldType));
 }
开发者ID:BallisticLingonberries,项目名称:ShareX,代码行数:4,代码来源:AbstractFieldHolder.cs

示例4: GetFieldValueAsBool

 public bool GetFieldValueAsBool(FieldType fieldType)
 {
     return (bool)GetFieldValue(fieldType);
 }
开发者ID:eservicepartner,项目名称:espUrl,代码行数:4,代码来源:AbstractFieldHolder.cs

示例5: HasFieldValue

 public new bool HasFieldValue(FieldType fieldType)
 {
     Field f = GetField(fieldType);
     return f != null && f.HasValue;
 }
开发者ID:Grifs99,项目名称:ShareX,代码行数:5,代码来源:AbstractFieldHolderWithChildren.cs

示例6: SetFieldValue

 public void SetFieldValue(FieldType fieldType, object value)
 {
     try
     {
         fieldsByType[fieldType].Value = value;
     }
     catch (KeyNotFoundException e)
     {
         throw new ArgumentException("Field '" + fieldType + "' does not exist in " + GetType(), e);
     }
 }
开发者ID:BallisticLingonberries,项目名称:ShareX,代码行数:11,代码来源:AbstractFieldHolder.cs

示例7: HasField

 public bool HasField(FieldType fieldType)
 {
     return fieldsByType.ContainsKey(fieldType);
 }
开发者ID:BallisticLingonberries,项目名称:ShareX,代码行数:4,代码来源:AbstractFieldHolder.cs

示例8: GetFieldValueAsBool

 public bool GetFieldValueAsBool(FieldType fieldType)
 {
     return Convert.ToBoolean(GetFieldValue(fieldType));
 }
开发者ID:BallisticLingonberries,项目名称:ShareX,代码行数:4,代码来源:AbstractFieldHolder.cs

示例9: Field

 /// <summary>
 /// Constructs a new Field instance, usually you should be using FieldFactory
 /// to create Fields.
 /// </summary>
 /// <param name="fieldType">FieldType of the Field to be created</param>
 /// <param name="scope">The scope to which the value of this Field is relevant.
 /// Depending on the scope the Field's value may be shared for other elements
 /// containing the same FieldType for defaulting to the last used value.
 /// When scope is set to a Type (e.g. typeof(RectangleContainer)), its value
 /// should not be reused for FieldHolders of another Type (e.g. typeof(EllipseContainer))
 /// </param>
 public Field(FieldType fieldType, Type scope)
 {
     FieldType = fieldType;
     Scope = scope.Name;
 }
开发者ID:BallisticLingonberries,项目名称:ShareX,代码行数:16,代码来源:Field.cs

示例10: GetFieldValueAsString

 public string GetFieldValueAsString(FieldType fieldType)
 {
     return (string)GetFieldValue(fieldType);
 }
开发者ID:eservicepartner,项目名称:espUrl,代码行数:4,代码来源:AbstractFieldHolder.cs

示例11: GetFieldValueAsInt

 public int GetFieldValueAsInt(FieldType fieldType)
 {
     return (int)GetFieldValue(fieldType);
 }
开发者ID:eservicepartner,项目名称:espUrl,代码行数:4,代码来源:AbstractFieldHolder.cs

示例12: GetFieldValueAsFloat

 public float GetFieldValueAsFloat(FieldType fieldType)
 {
     return (float)GetFieldValue(fieldType);
 }
开发者ID:eservicepartner,项目名称:espUrl,代码行数:4,代码来源:AbstractFieldHolder.cs

示例13: GetFieldValueAsDouble

 public double GetFieldValueAsDouble(FieldType fieldType)
 {
     return (double)GetFieldValue(fieldType);
 }
开发者ID:eservicepartner,项目名称:espUrl,代码行数:4,代码来源:AbstractFieldHolder.cs

示例14: GetFieldValueAsDecimal

 public decimal GetFieldValueAsDecimal(FieldType fieldType)
 {
     return (decimal)GetFieldValue(fieldType);
 }
开发者ID:eservicepartner,项目名称:espUrl,代码行数:4,代码来源:AbstractFieldHolder.cs

示例15: GetFieldValueAsDouble

 public double GetFieldValueAsDouble(FieldType fieldType)
 {
     return Convert.ToDouble(GetFieldValue(fieldType));
 }
开发者ID:BallisticLingonberries,项目名称:ShareX,代码行数:4,代码来源:AbstractFieldHolder.cs


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