Exemplo n.º 1
0
            public ContentId Deserialize(Omnix.Serialization.RocketPack.RocketPackReader r, int rank)
            {
                if (rank > 256)
                {
                    throw new System.FormatException();
                }

                // Read property count
                uint propertyCount = r.GetUInt32();

                ContentType p_type = (ContentType)0;
                string      p_path = string.Empty;

                for (; propertyCount > 0; propertyCount--)
                {
                    uint id = r.GetUInt32();
                    switch (id)
                    {
                    case 0:     // Type
                    {
                        p_type = (ContentType)r.GetUInt64();
                        break;
                    }

                    case 1:     // Path
                    {
                        p_path = r.GetString(1024);
                        break;
                    }
                    }
                }

                return(new ContentId(p_type, p_path));
            }
Exemplo n.º 2
0
            public OmniAddress Deserialize(Omnix.Serialization.RocketPack.RocketPackReader r, int rank)
            {
                if (rank > 256)
                {
                    throw new System.FormatException();
                }

                // Read property count
                uint propertyCount = r.GetUInt32();

                string p_value = string.Empty;

                for (; propertyCount > 0; propertyCount--)
                {
                    uint id = r.GetUInt32();
                    switch (id)
                    {
                    case 0:     // Value
                    {
                        p_value = r.GetString(8192);
                        break;
                    }
                    }
                }

                return(new OmniAddress(p_value));
            }
Exemplo n.º 3
0
            public LxnaOptions Deserialize(Omnix.Serialization.RocketPack.RocketPackReader r, int rank)
            {
                if (rank > 256)
                {
                    throw new System.FormatException();
                }

                // Read property count
                uint propertyCount = r.GetUInt32();

                string p_configDirectoryPath = string.Empty;

                for (; propertyCount > 0; propertyCount--)
                {
                    uint id = r.GetUInt32();
                    switch (id)
                    {
                    case 0:     // ConfigDirectoryPath
                    {
                        p_configDirectoryPath = r.GetString(1024);
                        break;
                    }
                    }
                }

                return(new LxnaOptions(p_configDirectoryPath));
            }
Exemplo n.º 4
0
            public OmniSignature Deserialize(Omnix.Serialization.RocketPack.RocketPackReader r, int rank)
            {
                if (rank > 256)
                {
                    throw new System.FormatException();
                }

                // Read property count
                uint propertyCount = r.GetUInt32();

                string   p_name = string.Empty;
                OmniHash p_hash = OmniHash.Empty;

                for (; propertyCount > 0; propertyCount--)
                {
                    uint id = r.GetUInt32();
                    switch (id)
                    {
                    case 0:     // Name
                    {
                        p_name = r.GetString(32);
                        break;
                    }

                    case 1:     // Hash
                    {
                        p_hash = OmniHash.Formatter.Deserialize(r, rank + 1);
                        break;
                    }
                    }
                }

                return(new OmniSignature(p_name, p_hash));
            }
Exemplo n.º 5
0
            public OmniRpcErrorMessage Deserialize(Omnix.Serialization.RocketPack.RocketPackReader r, int rank)
            {
                if (rank > 256)
                {
                    throw new System.FormatException();
                }

                // Read property count
                uint propertyCount = r.GetUInt32();

                string p_type       = string.Empty;
                string p_message    = string.Empty;
                string p_stackTrace = string.Empty;

                for (; propertyCount > 0; propertyCount--)
                {
                    uint id = r.GetUInt32();
                    switch (id)
                    {
                    case 0:     // Type
                    {
                        p_type = r.GetString(8192);
                        break;
                    }

                    case 1:     // Message
                    {
                        p_message = r.GetString(8192);
                        break;
                    }

                    case 2:     // StackTrace
                    {
                        p_stackTrace = r.GetString(8192);
                        break;
                    }
                    }
                }

                return(new OmniRpcErrorMessage(p_type, p_message, p_stackTrace));
            }
Exemplo n.º 6
0
            public OmniDigitalSignature Deserialize(Omnix.Serialization.RocketPack.RocketPackReader r, int rank)
            {
                if (rank > 256)
                {
                    throw new System.FormatException();
                }

                // Read property count
                uint propertyCount = r.GetUInt32();

                string p_name = string.Empty;
                OmniDigitalSignatureAlgorithmType p_algorithmType = (OmniDigitalSignatureAlgorithmType)0;

                System.ReadOnlyMemory <byte> p_publicKey  = System.ReadOnlyMemory <byte> .Empty;
                System.ReadOnlyMemory <byte> p_privateKey = System.ReadOnlyMemory <byte> .Empty;

                for (; propertyCount > 0; propertyCount--)
                {
                    uint id = r.GetUInt32();
                    switch (id)
                    {
                    case 0:     // Name
                    {
                        p_name = r.GetString(32);
                        break;
                    }

                    case 1:     // AlgorithmType
                    {
                        p_algorithmType = (OmniDigitalSignatureAlgorithmType)r.GetUInt64();
                        break;
                    }

                    case 2:     // PublicKey
                    {
                        p_publicKey = r.GetMemory(8192);
                        break;
                    }

                    case 3:     // PrivateKey
                    {
                        p_privateKey = r.GetMemory(8192);
                        break;
                    }
                    }
                }

                return(new OmniDigitalSignature(p_name, p_algorithmType, p_publicKey, p_privateKey));
            }
Exemplo n.º 7
0
            public FileId Deserialize(Omnix.Serialization.RocketPack.RocketPackReader r, int rank)
            {
                if (rank > 256)
                {
                    throw new System.FormatException();
                }

                // Read property count
                uint propertyCount = r.GetUInt32();

                string p_path   = string.Empty;
                ulong  p_length = 0;

                Omnix.Serialization.RocketPack.Timestamp p_lastWriteTime = Omnix.Serialization.RocketPack.Timestamp.Zero;

                for (; propertyCount > 0; propertyCount--)
                {
                    uint id = r.GetUInt32();
                    switch (id)
                    {
                    case 0:     // Path
                    {
                        p_path = r.GetString(1024);
                        break;
                    }

                    case 1:     // Length
                    {
                        p_length = r.GetUInt64();
                        break;
                    }

                    case 2:     // LastWriteTime
                    {
                        p_lastWriteTime = r.GetTimestamp();
                        break;
                    }
                    }
                }

                return(new FileId(p_path, p_length, p_lastWriteTime));
            }