public override bool Equals(object obj) { if (obj is RepresentationType) { RepresentationType that = ( RepresentationType )obj; if (!string.ReferenceEquals(this.ValueName, null)) { if (ValueName.Equals(that.ValueName)) { if (!string.ReferenceEquals(this.ListName, null)) { return(ListName.Equals(that.ListName)); } else { return(string.ReferenceEquals(that.ListName, null)); } } } else if (!string.ReferenceEquals(this.ListName, null)) { return(string.ReferenceEquals(that.ValueName, null) && ListName.Equals(that.ListName)); } } return(false); }
internal ParameterRepresentation(string name, Type type, bool optional, string description, bool list) : base(RepresentationType.PluginParameter) { this.Name = name; this.Optional = optional; this.List = list; this.ParamType = RepresentationType.Extended(type); this.Description = description; }
internal virtual ListWriter SerializeList(RepresentationType type) { if (string.ReferenceEquals(type.ListName, null)) { throw new System.InvalidOperationException("Invalid list type: " + type); } return(SerializeList(type.ListName)); }
internal void PutNumber(string key, Number value) { if (value is double? || value is float?) { Writer.writeFloatingPointNumber(RepresentationType.ValueOf(value.GetType()), key, value.doubleValue()); } else { CheckThatItIsBuiltInType(value); Writer.writeInteger(RepresentationType.ValueOf(value.GetType()), key, value.longValue()); } }
private Representation HandleIterable(System.Collections.IEnumerable data) { //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final java.util.List<Representation> results = new java.util.ArrayList<>(); IList <Representation> results = new List <Representation>(); foreach (Object value in data) { Representation rep = GetRepresentation(value); results.Add(rep); } RepresentationType representationType = GetType(results); return(new ListRepresentation(representationType, results)); }
private ValueRepresentation(RepresentationType type, object value) : base(type) { this._value = value; }
private ListRepresentation toListRepresentation <T1>(RepresentationType type, PropertyArray <T1> array) { return(new ListRepresentation(type, dispatch(array))); }
public ExtensionPointRepresentation(string name, Type extended, string description) : base(RepresentationType.PluginDescription) { this._name = name; this._description = description; this._extended = RepresentationType.Extended(extended); }
internal virtual MappingWriter SerializeMapping(RepresentationType type) { return(SerializeMapping(type.ValueName)); }
internal virtual string SerializeValue(RepresentationType type, object value) { return(SerializeValue(type.ValueName, value)); }