Пример #1
0
 internal SerializableConditionalExpression(ZetboxStreamReader binReader, StreamSerializationContext ctx, InterfaceType.Factory iftFactory)
     : base(binReader, ctx, iftFactory)
 {
     Test    = SerializableExpression.FromStream(binReader, ctx, iftFactory);
     IfTrue  = SerializableExpression.FromStream(binReader, ctx, iftFactory);
     IfFalse = SerializableExpression.FromStream(binReader, ctx, iftFactory);
 }
Пример #2
0
        internal static SerializableMemberInfo FromStream(ZetboxStreamReader binReader)
        {
            var type = binReader.ReadByte();

            switch (type)
            {
            case 0:
                return(new SerializableMemberInfo()
                {
                    Name = binReader.ReadString(),
                    Type = binReader.ReadSerializableType(),
                });

            case 1:
                return(new SerializableConstructorInfo()
                {
                    Name = binReader.ReadString(),
                    Type = binReader.ReadSerializableType(),
                    ParameterTypes = SerializableExpression.ReadTypeArray(binReader)
                });

            default:
                throw new NotImplementedException(String.Format("unrecognized SerializableMemberInfoType [{0}]", type));
            }
        }
Пример #3
0
        internal SerializableConstantExpression(ZetboxStreamReader binReader, StreamSerializationContext ctx, InterfaceType.Factory iftFactory)
            : base(binReader, ctx, iftFactory)
        {
            object val;

            binReader.Read(out val, Type);
            Value = val;
        }
Пример #4
0
        /// <summary>
        /// reads a CompoundObject from the specified stream. Since CompoundObject have no
        /// own identity the ParentObject has to be constructed somewhere else
        /// using external means, e.g. by examining the position in the stream.
        /// </summary>
        /// <param name="sr">the stream to read from</param>
        public virtual IEnumerable <IPersistenceObject> FromStream(ZetboxStreamReader sr)
        {
            if (sr == null)
            {
                throw new ArgumentNullException("sr");
            }

            return(null);
        }
Пример #5
0
        internal SerializableCompoundExpression(ZetboxStreamReader binReader, StreamSerializationContext ctx, InterfaceType.Factory iftFactory)
            : base(binReader, ctx, iftFactory)
        {
            var children = new List <SerializableExpression>();

            while (binReader.ReadBoolean())
            {
                children.Add(SerializableExpression.FromStream(binReader, ctx, iftFactory));
            }
            this.Children = children.ToArray();
        }
Пример #6
0
        internal SerializableNewExpression(ZetboxStreamReader binReader, StreamSerializationContext ctx, InterfaceType.Factory iftFactory)
            : base(binReader, ctx, iftFactory)
        {
            Constructor = (SerializableConstructorInfo)SerializableMemberInfo.FromStream(binReader);

            var members = new List <SerializableMemberInfo>();

            while (binReader.ReadBoolean())
            {
                members.Add(SerializableMemberInfo.FromStream(binReader));
            }
            this.Members = members.ToArray();
        }
Пример #7
0
        internal SerializableExpression(ZetboxStreamReader binReader, StreamSerializationContext ctx, InterfaceType.Factory iftFactory)
        {
            this.iftFactory = iftFactory;

            SerializableType t;

            binReader.Read(out t);
            this.SerializableType = t;

            int nt;

            binReader.Read(out nt);
            NodeType = nt;
        }
Пример #8
0
        /// <summary>
        /// Base method for deserializing this Object.
        /// </summary>
        /// <param name="sr">Stream to serialize from</param>
        public virtual IEnumerable <IPersistenceObject> FromStream(ZetboxStreamReader sr)
        {
            if (sr == null)
            {
                throw new ArgumentNullException("sr");
            }
            if (this.IsAttached)
            {
                throw new InvalidOperationException("Deserializing attached objects is not allowed");
            }

            sr.ReadConverter(i => this.ID = i);
            return(null);
        }
Пример #9
0
        internal SerializableMethodCallExpression(ZetboxStreamReader binReader, StreamSerializationContext ctx, InterfaceType.Factory iftFactory)
            : base(binReader, ctx, iftFactory)
        {
            var hasObject = binReader.ReadBoolean();

            if (hasObject)
            {
                ObjectExpression = SerializableExpression.FromStream(binReader, ctx, iftFactory);
            }

            MethodName             = binReader.ReadString();
            SerializableMethodType = binReader.ReadSerializableType();
            ParameterTypes         = ReadTypeArray(binReader);
            GenericArguments       = ReadTypeArray(binReader);
        }
Пример #10
0
        public override IEnumerable <IPersistenceObject> FromStream(Zetbox.API.ZetboxStreamReader binStream)
        {
            var baseResult = base.FromStream(binStream);
            var result     = new List <IPersistenceObject>();

            // it may be only an empty shell to stand-in for unreadable data
            if (CurrentAccessRights != Zetbox.API.AccessRights.None)
            {
            } // if (CurrentAccessRights != Zetbox.API.AccessRights.None)
            return(baseResult == null
                ? result.Count == 0
                    ? null
                    : result
                : baseResult.Concat(result));
        }
Пример #11
0
        public override IEnumerable <IPersistenceObject> FromStream(Zetbox.API.ZetboxStreamReader binStream)
        {
            var baseResult = base.FromStream(binStream);
            var result     = new List <IPersistenceObject>();

            // it may be only an empty shell to stand-in for unreadable data
            if (CurrentAccessRights != Zetbox.API.AccessRights.None)
            {
                this._fk_DefaultPropertyViewModelDescriptor = binStream.ReadNullableInt32();
            } // if (CurrentAccessRights != Zetbox.API.AccessRights.None)
            return(baseResult == null
                ? result.Count == 0
                    ? null
                    : result
                : baseResult.Concat(result));
        }
Пример #12
0
        public override IEnumerable <IPersistenceObject> FromStream(Zetbox.API.ZetboxStreamReader binStream)
        {
            var baseResult = base.FromStream(binStream);
            var result     = new List <IPersistenceObject>();

            // it may be only an empty shell to stand-in for unreadable data
            if (CurrentAccessRights != Zetbox.API.AccessRights.None)
            {
                ((Zetbox.App.Calendar.DayOfWeekCalendarRule) this).DayOfWeek = (Zetbox.App.Base.DayOfWeek)binStream.ReadNullableInt32();
            } // if (CurrentAccessRights != Zetbox.API.AccessRights.None)
            return(baseResult == null
                ? result.Count == 0
                    ? null
                    : result
                : baseResult.Concat(result));
        }
Пример #13
0
        public override IEnumerable <IPersistenceObject> FromStream(Zetbox.API.ZetboxStreamReader binStream)
        {
            var baseResult = base.FromStream(binStream);
            var result     = new List <IPersistenceObject>();

            // it may be only an empty shell to stand-in for unreadable data
            if (CurrentAccessRights != Zetbox.API.AccessRights.None)
            {
                Inputs_was_eagerLoaded = binStream.ReadBoolean();
                binStream.Read(out this._fk_ReferencedClass);
            } // if (CurrentAccessRights != Zetbox.API.AccessRights.None)
            return(baseResult == null
                ? result.Count == 0
                    ? null
                    : result
                : baseResult.Concat(result));
        }
Пример #14
0
        internal static SerializableExpression FromStream(ZetboxStreamReader binStream, StreamSerializationContext ctx, InterfaceType.Factory iftFactory)
        {
            var type = (SerializableExpressionType)binStream.ReadByte();

            switch (type)
            {
            case SerializableExpressionType.Binary:
                return(new SerializableBinaryExpression(binStream, ctx, iftFactory));

            case SerializableExpressionType.Unary:
                return(new SerializableUnaryExpression(binStream, ctx, iftFactory));

            case SerializableExpressionType.Constant:
                return(new SerializableConstantExpression(binStream, ctx, iftFactory));

            case SerializableExpressionType.Member:
                return(new SerializableMemberExpression(binStream, ctx, iftFactory));

            case SerializableExpressionType.MethodCall:
                return(new SerializableMethodCallExpression(binStream, ctx, iftFactory));

            case SerializableExpressionType.Lambda:
                return(new SerializableLambdaExpression(binStream, ctx, iftFactory));

            case SerializableExpressionType.Parameter:
                var parameterGuid = new Guid(binStream.ReadString());
                if (ctx.Parameter.ContainsKey(parameterGuid))
                {
                    return(ctx.Parameter[parameterGuid]);
                }
                else
                {
                    return(ctx.Parameter[parameterGuid] = new SerializableParameterExpression(binStream, ctx, iftFactory, parameterGuid));
                }

            case SerializableExpressionType.New:
                return(new SerializableNewExpression(binStream, ctx, iftFactory));

            case SerializableExpressionType.Conditional:
                return(new SerializableConditionalExpression(binStream, ctx, iftFactory));

            default:
                throw new NotImplementedException(string.Format("Unknown SerializableExpressionType encountered: [{0}]", type));
            }
        }
Пример #15
0
        public override IEnumerable <IPersistenceObject> FromStream(Zetbox.API.ZetboxStreamReader binStream)
        {
            var baseResult = base.FromStream(binStream);
            var result     = new List <IPersistenceObject>();

            // it may be only an empty shell to stand-in for unreadable data
            if (CurrentAccessRights != Zetbox.API.AccessRights.None)
            {
                this.Proxy.EagerLoading     = binStream.ReadBoolean();
                this.Proxy.IsInlineEditable = binStream.ReadNullableBoolean();
                binStream.Read(out this._fk_RelationEnd);
            } // if (CurrentAccessRights != Zetbox.API.AccessRights.None)
            return(baseResult == null
                ? result.Count == 0
                    ? null
                    : result
                : baseResult.Concat(result));
        }
Пример #16
0
        public override IEnumerable <IPersistenceObject> FromStream(Zetbox.API.ZetboxStreamReader binStream)
        {
            var baseResult = base.FromStream(binStream);
            var result     = new List <IPersistenceObject>();

            // it may be only an empty shell to stand-in for unreadable data
            if (CurrentAccessRights != Zetbox.API.AccessRights.None)
            {
                this.Proxy.Description = binStream.ReadString();
                binStream.Read(out this._fk_Method);
                binStream.Read(out this._fk_Property);
            } // if (CurrentAccessRights != Zetbox.API.AccessRights.None)
            return(baseResult == null
                ? result.Count == 0
                    ? null
                    : result
                : baseResult.Concat(result));
        }
Пример #17
0
        public override IEnumerable <IPersistenceObject> FromStream(Zetbox.API.ZetboxStreamReader binStream)
        {
            var baseResult = base.FromStream(binStream);
            var result     = new List <IPersistenceObject>();

            // it may be only an empty shell to stand-in for unreadable data
            if (CurrentAccessRights != Zetbox.API.AccessRights.None)
            {
                binStream.Read(out this._fk_OneEnd);
                this.Proxy.NEnds_pos = binStream.ReadNullableInt32();
                this.Proxy.OtherInt  = binStream.ReadNullableInt32();
            } // if (CurrentAccessRights != Zetbox.API.AccessRights.None)
            return(baseResult == null
                ? result.Count == 0
                    ? null
                    : result
                : baseResult.Concat(result));
        }
Пример #18
0
        public override IEnumerable <IPersistenceObject> FromStream(Zetbox.API.ZetboxStreamReader binStream)
        {
            var baseResult = base.FromStream(binStream);
            var result     = new List <IPersistenceObject>();

            // it may be only an empty shell to stand-in for unreadable data
            if (CurrentAccessRights != Zetbox.API.AccessRights.None)
            {
                binStream.Read(out this._fk_CompoundObjectDefinition);
                this.Proxy.HasPersistentOrder = binStream.ReadBoolean();
                this.Proxy.IsList             = binStream.ReadBoolean();
            } // if (CurrentAccessRights != Zetbox.API.AccessRights.None)
            return(baseResult == null
                ? result.Count == 0
                    ? null
                    : result
                : baseResult.Concat(result));
        }
Пример #19
0
        public override IEnumerable <IPersistenceObject> FromStream(Zetbox.API.ZetboxStreamReader binStream)
        {
            var baseResult = base.FromStream(binStream);
            var result     = new List <IPersistenceObject>();

            // it may be only an empty shell to stand-in for unreadable data
            if (CurrentAccessRights != Zetbox.API.AccessRights.None)
            {
                binStream.Read(out this._fk_DisplayedTypeAssembly);
                this._DisplayedTypeFullName = binStream.ReadString();
                this._DisplayName           = binStream.ReadString();
                binStream.Read(out this._fk_VisualTree);
            } // if (CurrentAccessRights != Zetbox.API.AccessRights.None)
            return(baseResult == null
                ? result.Count == 0
                    ? null
                    : result
                : baseResult.Concat(result));
        }
Пример #20
0
        public override IEnumerable <IPersistenceObject> FromStream(Zetbox.API.ZetboxStreamReader binStream)
        {
            var baseResult = base.FromStream(binStream);
            var result     = new List <IPersistenceObject>();

            // it may be only an empty shell to stand-in for unreadable data
            if (CurrentAccessRights != Zetbox.API.AccessRights.None)
            {
                this._MyIntProperty = binStream.ReadNullableInt32();
                binStream.Read(out this._fk_ObjectProp);
                this._StringProp = binStream.ReadString();
                ((Zetbox.App.Test.TestObjClass) this).TestEnumProp = (Zetbox.App.Test.TestEnum)binStream.ReadNullableInt32();
            } // if (CurrentAccessRights != Zetbox.API.AccessRights.None)
            return(baseResult == null
                ? result.Count == 0
                    ? null
                    : result
                : baseResult.Concat(result));
        }
Пример #21
0
        public override IEnumerable <IPersistenceObject> FromStream(Zetbox.API.ZetboxStreamReader binStream)
        {
            var baseResult = base.FromStream(binStream);
            var result     = new List <IPersistenceObject>();

            // it may be only an empty shell to stand-in for unreadable data
            if (CurrentAccessRights != Zetbox.API.AccessRights.None)
            {
                this._Destination     = binStream.ReadString();
                this._DestinationRows = binStream.ReadInt32();
                this._Source          = binStream.ReadString();
                this._SourceRows      = binStream.ReadInt32();
                this._Timestamp       = binStream.ReadDateTime();
            } // if (CurrentAccessRights != Zetbox.API.AccessRights.None)
            return(baseResult == null
                ? result.Count == 0
                    ? null
                    : result
                : baseResult.Concat(result));
        }
Пример #22
0
        public override IEnumerable <IPersistenceObject> FromStream(Zetbox.API.ZetboxStreamReader binStream)
        {
            var baseResult = base.FromStream(binStream);
            var result     = new List <IPersistenceObject>();

            // it may be only an empty shell to stand-in for unreadable data
            if (CurrentAccessRights != Zetbox.API.AccessRights.None)
            {
                this._Frage              = binStream.ReadString();
                this._fk_Fragebogen      = binStream.ReadNullableInt32();
                this._gute_Antworten_pos = binStream.ReadNullableInt32();
                this._FragenNummer       = binStream.ReadInt32();
                this._GegebeneAntwort    = binStream.ReadNullableInt32();
            } // if (CurrentAccessRights != Zetbox.API.AccessRights.None)
            return(baseResult == null
                ? result.Count == 0
                    ? null
                    : result
                : baseResult.Concat(result));
        }
Пример #23
0
        public override IEnumerable <IPersistenceObject> FromStream(Zetbox.API.ZetboxStreamReader binStream)
        {
            var baseResult = base.FromStream(binStream);
            var result     = new List <IPersistenceObject>();

            // it may be only an empty shell to stand-in for unreadable data
            if (CurrentAccessRights != Zetbox.API.AccessRights.None)
            {
                this._HasPersistentOrder  = binStream.ReadBoolean();
                this._ImplementorRoleName = binStream.ReadString();
                this._IsList                   = binStream.ReadBoolean();
                this._ItemRoleName             = binStream.ReadString();
                this._fk_ReferencedObjectClass = binStream.ReadNullableInt32();
                this._Verb = binStream.ReadString();
            } // if (CurrentAccessRights != Zetbox.API.AccessRights.None)
            return(baseResult == null
                ? result.Count == 0
                    ? null
                    : result
                : baseResult.Concat(result));
        }
Пример #24
0
        public override IEnumerable <IPersistenceObject> FromStream(Zetbox.API.ZetboxStreamReader binStream)
        {
            var baseResult = base.FromStream(binStream);
            var result     = new List <IPersistenceObject>();

            // it may be only an empty shell to stand-in for unreadable data
            if (CurrentAccessRights != Zetbox.API.AccessRights.None)
            {
                this._TestBool = binStream.ReadNullableBoolean();
                this._fk_TestCustomObjects_Nav     = binStream.ReadNullableInt32();
                this._fk_TestCustomObjects_One_Nav = binStream.ReadNullableInt32();
                this._TestDateTime = binStream.ReadNullableDateTime();
                ((Zetbox.App.Test.Muhblah) this).TestEnum = (Zetbox.App.Test.TestEnum)binStream.ReadNullableInt32();
                this._TestString = binStream.ReadString();
            } // if (CurrentAccessRights != Zetbox.API.AccessRights.None)
            return(baseResult == null
                ? result.Count == 0
                    ? null
                    : result
                : baseResult.Concat(result));
        }
Пример #25
0
        public override IEnumerable <IPersistenceObject> FromStream(Zetbox.API.ZetboxStreamReader binStream)
        {
            var baseResult = base.FromStream(binStream);
            var result     = new List <IPersistenceObject>();

            // it may be only an empty shell to stand-in for unreadable data
            if (CurrentAccessRights != Zetbox.API.AccessRights.None)
            {
                this._fk_FalseIcon = binStream.ReadNullableInt32();
                this._FalseLabel   = binStream.ReadString();
                this._fk_NullIcon  = binStream.ReadNullableInt32();
                this._NullLabel    = binStream.ReadString();
                this._fk_TrueIcon  = binStream.ReadNullableInt32();
                this._TrueLabel    = binStream.ReadString();
            } // if (CurrentAccessRights != Zetbox.API.AccessRights.None)
            return(baseResult == null
                ? result.Count == 0
                    ? null
                    : result
                : baseResult.Concat(result));
        }
Пример #26
0
        public override IEnumerable <IPersistenceObject> FromStream(Zetbox.API.ZetboxStreamReader binStream)
        {
            var baseResult = base.FromStream(binStream);
            var result     = new List <IPersistenceObject>();

            // it may be only an empty shell to stand-in for unreadable data
            if (CurrentAccessRights != Zetbox.API.AccessRights.None)
            {
                this.Proxy.Date      = binStream.ReadDateTime();
                this.Proxy.Exception = binStream.ReadString();
                this.Proxy.Level     = binStream.ReadString();
                this.Proxy.Logger    = binStream.ReadString();
                this.Proxy.Message   = binStream.ReadString();
                this.Proxy.Thread    = binStream.ReadString();
            } // if (CurrentAccessRights != Zetbox.API.AccessRights.None)
            return(baseResult == null
                ? result.Count == 0
                    ? null
                    : result
                : baseResult.Concat(result));
        }
Пример #27
0
        public override IEnumerable <IPersistenceObject> FromStream(Zetbox.API.ZetboxStreamReader binStream)
        {
            var baseResult = base.FromStream(binStream);
            var result     = new List <IPersistenceObject>();

            // it may be only an empty shell to stand-in for unreadable data
            if (CurrentAccessRights != Zetbox.API.AccessRights.None)
            {
                this._isExportGuidSet = binStream.ReadBoolean();
                if (this._isExportGuidSet)
                {
                    this._ExportGuid = binStream.ReadGuid();
                }
                binStream.Read(out this._fk_Module);
                this._Name = binStream.ReadString();
            } // if (CurrentAccessRights != Zetbox.API.AccessRights.None)
            return(baseResult == null
                ? result.Count == 0
                    ? null
                    : result
                : baseResult.Concat(result));
        }
Пример #28
0
 internal SerializableLambdaExpression(ZetboxStreamReader binReader, StreamSerializationContext ctx, InterfaceType.Factory iftFactory)
     : base(binReader, ctx, iftFactory)
 {
 }
Пример #29
0
 internal SerializableMemberExpression(ZetboxStreamReader binReader, StreamSerializationContext ctx, InterfaceType.Factory iftFactory)
     : base(binReader, ctx, iftFactory)
 {
     MemberName = binReader.ReadString();
 }
Пример #30
0
 internal SerializableParameterExpression(ZetboxStreamReader binReader, StreamSerializationContext ctx, InterfaceType.Factory iftFactory, Guid parameterGuid)
     : base(binReader, ctx, iftFactory)
 {
     this.Name = binReader.ReadString();
     this.Guid = parameterGuid;
 }