/// <summary> /// Generates an object from its XML representation. /// </summary> /// <param name="reader">The <see cref="T:System.Xml.XmlReader"/> stream from which the object is deserialized.</param> public void ReadXml(System.Xml.XmlReader reader) { try { _ConsistencyMap.Clear(); reader.Read(); while (reader.NodeType != XmlNodeType.EndElement) { if (reader.Name != "ConsistencyCheckRegion") { Logger.LogError("The 'ConsistencyCheckRegion' element is missing"); } reader.MoveToNextAttribute(); if (reader.Name != "Region") { Logger.LogError("The 'Region' attribute is missing"); } string region = reader.Value; reader.Read(); Dictionary <ConsistencyType, bool> dictType = new Dictionary <ConsistencyType, bool>(); while (reader.NodeType != XmlNodeType.EndElement) { if (reader.Name != "Consistency") { Logger.LogError("The 'ConsistencyCheckRegion' element is missing"); } reader.MoveToNextAttribute(); if (reader.Name != "Type") { Logger.LogError("The 'Type' attribute is missing"); } string type = reader.Value; reader.MoveToNextAttribute(); if (reader.Name != "Value") { Logger.LogError("The 'Value' attribute is missing"); } string value = reader.Value; ConsistencyType consType = (ConsistencyType)Enum.Parse(typeof(ConsistencyType), type, false); dictType[consType] = Convert.ToBoolean(value); reader.Read(); } ConsistencyCheckRegion consRegion = (ConsistencyCheckRegion)Enum.Parse(typeof(ConsistencyCheckRegion), region, false); _ConsistencyMap[consRegion] = dictType; reader.Read(); } reader.Read(); } catch (Exception ex) { Logger.LogCritical("ReadXml() throws an exception: ", ex); } }
/// <summary> /// Initializes a new instance of the <see cref="QueryRequestData"/> class /// </summary> /// <param name="selectStringBlock">The SELECT statement.</param> /// <param name="consistencyType">The consistency type used for the query.</param> /// <param name="timeout">The timeout value in milliseconds.</param> /// <param name="queryPageSize">The number of records per page.</param> /// <param name="queryType">The query type</param> public QueryRequestData(string selectStringBlock, ConsistencyType consistencyType, long timeout, int?queryPageSize, QueryType?queryType) { SelectStringBlock = selectStringBlock; ConsistencyType = consistencyType; Timeout = timeout; QueryPageSize = queryPageSize; QueryType = queryType; }
/// <summary> /// Sends a Query Request /// </summary> /// <param name="selectStringBlock">The SELECT statement.</param> /// <param name="consistencyType">The consistency type used for the query.</param> /// <param name="timeout">The timeout value in milliseconds.</param> /// <param name="queryPageSize">The number of records per page.</param> /// <param name="queryType">The query type</param> /// <param name="messageID">The messageID to be used. If not present, random one will be generated.</param> /// <param name="header">The header to be used in the message. If not present, default one will be generated.</param> public void SendQueryRequest10(string selectStringBlock, ConsistencyType consistencyType, long?timeout = null, int?queryPageSize = null, QueryType?queryType = null, string messageID = null, MessageHeader header = null) { if (timeout == null) { timeout = this.timeout; } MessageData data = MessageManager.GetQueryRequest(selectStringBlock, consistencyType, (long)timeout, queryPageSize, queryType); MessageHeader messageHeader = header ?? MessageManager.GetHeader(userName, messageID, DataType.QueryRequest); SendMessage(messageHeader, data); }
public QueryRequestData Deserialize(ref MessagePackReader reader, MessagePackSerializerOptions options) { int size = reader.ReadArrayHeader(); string select = reader.ReadString(); ConsistencyType consistency = (ConsistencyType)Enum.Parse(typeof(ConsistencyType), reader.ReadString(), true); long timeout = reader.ReadInt64(); int?querypagesize = null; int?querytype = null; if (size == 5) { querypagesize = reader.ReadInt32(); querytype = reader.ReadInt32(); } return(new QueryRequestData(select, consistency, timeout, querypagesize, (QueryType)querytype)); }
public NiGeometryData() { groupId = (int)0; numVertices = (ushort)0; bsMaxVertices = (ushort)0; keepFlags = (byte)0; compressFlags = (byte)0; hasVertices = 1; vectorFlags = (VectorFlags)0; bsVectorFlags = (BSVectorFlags)0; materialCrc = (uint)0; hasNormals = false; radius = 0.0f; hasVertexColors = false; numUvSets = (ushort)0; hasUv = false; consistencyFlags = ConsistencyType.CT_MUTABLE; additionalData = null; }
/// <summary> /// Legt fest, ob ein bestimmter Konsistenzalgorithmus genutzt wird oder nicht. /// </summary> /// <param name="region">Zeitpunkt, wo der Algorithmus ausgeführt werden könnte..</param> /// <param name="type">Bestimmt die Art des Konsistenzalgorithmuses.</param> /// <param name="active">if set to <c>true</c> [active].</param> public void SetCheckConsistencyActive(ConsistencyCheckRegion region, ConsistencyType type, bool active) { _ConsistencyMap[region][type] = active; }
/// <summary> /// Gibt zurück, ob der Konsistenzalgorithmus genutzt wird oder nicht. /// </summary> /// <param name="region">Zeitpunkt, wo der Algorithmus ausgeführt werden könnte.</param> /// <param name="type">Bestimmt die Art des Konsistenzalgorithmuses.</param> /// <returns>true or false</returns> public bool GetCheckConsistencyActive(ConsistencyCheckRegion region, ConsistencyType type) { return(_ConsistencyMap[region][type]); }
/// <summary> /// Initializes a new instance of the <see cref="QueryRequestData"/> class /// </summary> /// <param name="selectStringBlock">The SELECT statement.</param> /// <param name="consistencyType">The consistency type used for the query.</param> /// <param name="timeout">The timeout value in milliseconds.</param> public QueryRequestData(string selectStringBlock, ConsistencyType consistencyType, long timeout) : this(selectStringBlock, consistencyType, timeout, null, null) { }
/// <summary> /// Create a QueryRequest type data part. /// </summary> /// <param name="selectStringBlock">The SELECT statement.</param> /// <param name="consistencyType">The consistency type used for the query.</param> /// <param name="timeout">The timeout value in milliseconds.</param> /// <param name="queryPageSize">The number of records per page.</param> /// <param name="queryType">The query type</param> /// <returns>The created QueryRequestData object.</returns> public static QueryRequestData GetQueryRequest(string selectStringBlock, ConsistencyType consistencyType, long timeout, int?queryPageSize = null, QueryType?queryType = null) { return(new QueryRequestData(selectStringBlock, consistencyType, timeout, queryPageSize, queryType)); }