public DvAllowedValueRange(DvDataType dataType, double minValue, double maxValue, double?step) { _minValue = minValue; _maxValue = maxValue; _dataType = dataType; _step = step; }
public DvAllowedValueRange(DvDataType dataType, double minValue, double maxValue, double? step) { _minValue = minValue; _maxValue = maxValue; _dataType = dataType; _step = step; }
/// <summary> /// Creates the UPnP service description for this service. /// </summary> /// <param name="config">Endpoint configuration for that the SCPD document should be created.</param> /// <param name="serverData">Global server data structure.</param> /// <returns>UPnP service description document.</returns> public string BuildSCPDDocument(EndpointConfiguration config, ServerData serverData) { StringBuilder result = new StringBuilder(10000); using (StringWriterWithEncoding stringWriter = new StringWriterWithEncoding(result, UPnPConsts.UTF8_NO_BOM)) using (XmlWriter writer = XmlWriter.Create(stringWriter, UPnPConfiguration.DEFAULT_XML_WRITER_SETTINGS)) { writer.WriteStartDocument(); writer.WriteStartElement(string.Empty, "scpd", UPnPConsts.NS_SERVICE_DESCRIPTION); // Datatype schema namespaces uint ct = 0; HashSet <string> schemaURIs = new HashSet <string>(); foreach (DvStateVariable stateVariable in _stateVariables.Values) { DvDataType dataType = stateVariable.DataType; if (dataType is DvExtendedDataType) { string schemaURI = ((DvExtendedDataType)dataType).SchemaURI; if (schemaURIs.Contains(schemaURI)) { continue; } schemaURIs.Add(schemaURI); writer.WriteAttributeString("xmlns", "dt" + ct++, null, schemaURI); } } writer.WriteAttributeString("configId", config.ConfigId.ToString()); writer.WriteStartElement("specVersion"); writer.WriteElementString("major", UPnPConsts.UPNP_VERSION_MAJOR.ToString()); writer.WriteElementString("minor", UPnPConsts.UPNP_VERSION_MINOR.ToString()); writer.WriteEndElement(); // specVersion ICollection <DvAction> actions = _actions.Values; if (actions.Count > 0) { writer.WriteStartElement("actionList"); foreach (DvAction action in actions) { action.AddSCPDDescriptionForAction(writer); } writer.WriteEndElement(); // actionList } writer.WriteStartElement("serviceStateTable"); foreach (DvStateVariable stateVariable in _stateVariables.Values) { stateVariable.AddSCPDDescriptionForStateVariable(writer); } writer.WriteEndElement(); // serviceStateTable writer.WriteEndElement(); // scpd writer.WriteEndDocument(); writer.Close(); } return(result.ToString()); }
public DvAllowedValueRange(DvDataType dataType, double minValue, double maxValue) : this(dataType, minValue, maxValue, null) { }
/// <summary> /// Creates a new instance of <see cref="DvStateVariable"/>. /// </summary> /// <param name="name">Name of the variable.</param> /// <param name="dataType">Data type of the variable.</param> public DvStateVariable(string name, DvDataType dataType) { _name = name; _dataType = dataType; }