Example #1
0
 public Field(IFieldType fieldType, Guid? id = null, string name = "")
 {
     FieldType = fieldType;
     Id = id ?? Guid.NewGuid();
     Name = name;
     if (string.IsNullOrWhiteSpace(Name)) {
         Name = FieldType.Key.ToString();
     }
 }
Example #2
0
 public FieldDeprecationChanged(IGraphType objectType, IFieldType oldField, IFieldType newField) : base(Criticality.NonBreaking)
 {
     this.objectType = objectType;
     this.oldField   = oldField;
     this.newField   = newField;
 }
Example #3
0
 public FieldAdded(ObjectGraphType objectType, IFieldType field) : base(Criticality.NonBreaking)
 {
     this.field      = field;
     this.objectType = objectType;
 }
Example #4
0
 /// <summary>
 /// Encodes the attribute value from a format that Rock understands to a format for Avalanche.
 /// Useful for more complex values such as an address.
 /// </summary>
 /// <param name="fieldType"></param>
 /// <param name="attribute"></param>
 /// <param name="value"></param>
 /// <returns></returns>
 public virtual string EncodeValue(IFieldType fieldType, AttributeCache attribute, string value, bool isReadOnly = false)
 {
     //Default is to passthrough the value
     return(value);
 }
Example #5
0
 /// <inheritdoc/>
 public virtual Task <bool> AllowArgument(IFieldType field, QueryArgument argument) => Allowed;
Example #6
0
 /// <inheritdoc/>
 public override Task <bool> AllowField(IGraphType parent, IFieldType field) => Allowed;
Example #7
0
        public new bool HasFieldValue(IFieldType fieldType)
        {
            var f = GetField(fieldType);

            return(f != null && f.HasValue);
        }
Example #8
0
 public bool HasFieldValue(IFieldType fieldType)
 {
     return(HasField(fieldType) && _fieldsByType[fieldType].HasValue);
 }
Example #9
0
 partial void FieldType_SetCondition(ref IFieldDefinition instance, ref IFieldType setValue);
 /// <inheritdoc/>
 public virtual IComparer <QueryArgument>?ArgumentComparer(IFieldType field) => null;
 /// <inheritdoc/>
 public virtual IComparer <QueryArgument> ArgumentComparer(IFieldType field) => _instance3;
Example #12
0
 public virtual Task <bool> AllowArgument(IFieldType field, QueryArgument argument)
 {
     return(Task.FromResult(true));
 }
Example #13
0
 public virtual Task <bool> AllowField(IGraphType parent, IFieldType field)
 {
     return(Task.FromResult(true));
 }
Example #14
0
 public PasswordField(IFieldType fieldType, Guid? id = null, string name = "")
     : base(fieldType, id, name)
 {
 }
        public static string ToCapitalizedCSharpType(IFieldType fieldType)
        {
            string s = ToCSharpType(fieldType);

            return(s.Substring(0, 1).ToUpper() + s.Substring(1));
        }
Example #16
0
 public PasswordField(IFieldType fieldType, Guid?id = null, string name = "")
     : base(fieldType, id, name)
 {
 }
Example #17
0
 public bool HasField(IFieldType fieldType)
 {
     return(_fieldsByType.ContainsKey(fieldType));
 }
Example #18
0
 public object GetFieldValue(IFieldType fieldType)
 {
     return(GetField(fieldType)?.Value);
 }
Example #19
0
 public void AddField(Type requestingType, IFieldType fieldType, object fieldValue)
 {
     AddField(EditorConfig.CreateField(requestingType, fieldType, fieldValue));
 }
Example #20
0
 public string GetFieldValueAsString(IFieldType fieldType)
 {
     return(Convert.ToString(GetFieldValue(fieldType)));
 }
Example #21
0
 public DateTimeObjectField(IFieldType fieldType, TElementType element)
     : base(fieldType, element)
 {
 }
Example #22
0
 public int GetFieldValueAsInt(IFieldType fieldType)
 {
     return(Convert.ToInt32(GetFieldValue(fieldType)));
 }
Example #23
0
 /// <inheritdoc/>
 public virtual Task <bool> AllowField(IGraphType parent, IFieldType field) => parent.IsIntrospectionType() && field.Name == "appliedDirectives" ? Forbidden : Allowed;
Example #24
0
 public decimal GetFieldValueAsDecimal(IFieldType fieldType)
 {
     return(Convert.ToDecimal(GetFieldValue(fieldType)));
 }
Example #25
0
 public abstract FormElementItem Convert(IFieldType fieldType, AttributeCache attribute);
Example #26
0
 public double GetFieldValueAsDouble(IFieldType fieldType)
 {
     return(Convert.ToDouble(GetFieldValue(fieldType)));
 }
Example #27
0
 /// <summary>
 /// Decodes the attribute value from Avalanche into a format Rock can use.
 /// Useful for more complex values such as an address.
 /// </summary>
 /// <param name="fieldType"></param>
 /// <param name="attribute"></param>
 /// <param name="value"></param>
 /// <returns></returns>
 public virtual string DecodeValue(IFieldType fieldType, AttributeCache attribute, string value)
 {
     //Default is to passthrough the value
     return(value);
 }
Example #28
0
 public float GetFieldValueAsFloat(IFieldType fieldType)
 {
     return(Convert.ToSingle(GetFieldValue(fieldType)));
 }
Example #29
0
 public InputFieldRemoved(IGraphType objectType, IFieldType field) : base(Criticality.Breaking)
 {
     this.objectType = objectType;
     this.field      = field;
 }
Example #30
0
 public bool GetFieldValueAsBool(IFieldType fieldType)
 {
     return(Convert.ToBoolean(GetFieldValue(fieldType)));
 }
Example #31
0
 public Color GetFieldValueAsColor(IFieldType fieldType, Color defaultColor = default)
 {
     return((Color)(GetFieldValue(fieldType) ?? defaultColor));
 }
 public UnitizedObjectEditFieldBase(IFieldType fieldType, TElementType element)
     : base(fieldType, element)
 {
 }