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;
            }
        }
Beispiel #2
0
 public StateVariable(string name,
                      string dataType,
                      AllowedValueRange allowedValueRange,
                      StateVariableOptions options)
     : this(name, dataType, options)
 {
     AllowedValueRange = allowedValueRange;
 }
Beispiel #3
0
        public override bool Equals(object obj)
        {
            AllowedValueRange range = obj as AllowedValueRange;

            return(range == this);
        }
Beispiel #4
0
 public StateVariable(string name, string dataType, AllowedValueRange allowedValueRange)
     : this(name, dataType, allowedValueRange, null)
 {
 }
        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;
            }
        }