Ejemplo n.º 1
0
        /// <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);
            }
        }
Ejemplo n.º 2
0
 /// <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;
 }
Ejemplo n.º 3
0
        /// <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);
        }
Ejemplo n.º 4
0
        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));
        }
Ejemplo n.º 5
0
 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;
 }
Ejemplo n.º 6
0
 /// <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;
 }
Ejemplo n.º 7
0
 /// <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]);
 }
Ejemplo n.º 8
0
 /// <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)
 {
 }
Ejemplo n.º 9
0
 /// <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));
 }