Ejemplo n.º 1
0
        protected virtual void DeserializePropertyElement(XmlReader reader)
        {
            if (reader == null)
            {
                throw new ArgumentNullException("reader");
            }

            switch (reader.Name)
            {
            case "name":
                Name = reader.ReadString().Trim();
                break;

            case "dataType":
                DataType = reader.ReadString().Trim();
                Type     = controller.DeserializeDataType(DataType);
                break;

            case "defaultValue":
                DefaultValue = reader.ReadString();
                break;

            case "allowedValueList":
                DeserializeAllowedValues(reader);
                break;

            case "allowedValueRange":
                AllowedValueRange = new AllowedValueRange(Type, reader.ReadSubtree());
                break;

            default: // This is a workaround for Mono bug 334752
                reader.Skip();
                break;
            }
        }
Ejemplo n.º 2
0
 public StateVariable(string name,
                      string dataType,
                      AllowedValueRange allowedValueRange,
                      StateVariableOptions options)
     : this(name, dataType, options)
 {
     AllowedValueRange = allowedValueRange;
 }
Ejemplo n.º 3
0
        public override bool Equals(object obj)
        {
            AllowedValueRange range = obj as AllowedValueRange;

            return(range == this);
        }
Ejemplo n.º 4
0
 public StateVariable(string name, string dataType, AllowedValueRange allowedValueRange)
     : this(name, dataType, allowedValueRange, null)
 {
 }
Ejemplo n.º 5
0
        protected virtual void DeserializePropertyElement(XmlReader reader)
        {
            if (reader == null) throw new ArgumentNullException ("reader");

            switch (reader.Name) {
            case "name":
                Name = reader.ReadString ().Trim ();
                break;
            case "dataType":
                DataType = reader.ReadString ().Trim ();
                Type = controller.DeserializeDataType (DataType);
                break;
            case "defaultValue":
                DefaultValue = reader.ReadString ();
                break;
            case "allowedValueList":
                DeserializeAllowedValues (reader);
                break;
            case "allowedValueRange":
                AllowedValueRange = new AllowedValueRange (Type, reader.ReadSubtree ());
                break;
            default: // This is a workaround for Mono bug 334752
                reader.Skip ();
                break;
            }
        }