Example #1
0
 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);
 }
Example #2
0
 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;
 }
Example #3
0
 internal virtual ListWriter SerializeList(RepresentationType type)
 {
     if (string.ReferenceEquals(type.ListName, null))
     {
         throw new System.InvalidOperationException("Invalid list type: " + type);
     }
     return(SerializeList(type.ListName));
 }
Example #4
0
 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());
     }
 }
Example #5
0
        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));
        }
Example #6
0
 private ValueRepresentation(RepresentationType type, object value) : base(type)
 {
     this._value = value;
 }
Example #7
0
 private ListRepresentation toListRepresentation <T1>(RepresentationType type, PropertyArray <T1> array)
 {
     return(new ListRepresentation(type, dispatch(array)));
 }
Example #8
0
 public ExtensionPointRepresentation(string name, Type extended, string description) : base(RepresentationType.PluginDescription)
 {
     this._name        = name;
     this._description = description;
     this._extended    = RepresentationType.Extended(extended);
 }
Example #9
0
 internal virtual MappingWriter SerializeMapping(RepresentationType type)
 {
     return(SerializeMapping(type.ValueName));
 }
Example #10
0
 internal virtual string SerializeValue(RepresentationType type, object value)
 {
     return(SerializeValue(type.ValueName, value));
 }