Example #1
0
        public void Travel(IReadVisitor visitor, Relation graph)
        {
            Guid?v0;

            if (visitor.TryVisitValue(_argsId0, out v0) && v0.HasValue)
            {
                graph.Id = v0.Value;
            }

            String v1;

            if (visitor.TryVisitValue(_argsName1, out v1))
            {
                graph.Name = v1;
            }

            String v2;

            if (visitor.TryVisitValue(_argsDescription2, out v2))
            {
                graph.Description = v2;
            }

            Int32?v3;

            if (visitor.TryVisitValue(_argsValue3, out v3) && v3.HasValue)
            {
                graph.Value = v3.Value;
            }
        }
Example #2
0
        public void Travel(IReadVisitor visitor, Identifier graph)
        {
            int?v0;

            if (visitor.TryVisitValue(_argsId0, out v0) && v0.HasValue)
            {
                graph.Id = v0.Value;
            }

            int?v1;

            if (visitor.TryVisitValue(_argsType1, out v1) && v1.HasValue)
            {
                graph.Type = (ApplicationType)v1.Value;
            }
        }
Example #3
0
        public void Travel(IReadVisitor visitor, MultidimensionalArrayGraph graph)
        {
            ValueState state;

            state = visitor.TryVisit(_argsValue);
            if (state != ValueState.NotFound)
            {
                if (state == ValueState.Found)
                {
                    ICollection <ICollection <int> > c = new List <ICollection <int> >();
                    while (visitor.TryVisit(VisitArgs.CollectionInCollection) == ValueState.Found)
                    {
                        ICollection <int> cv = new List <int>();

                        int?cvv;
                        while (visitor.TryVisitValue(VisitArgs.CollectionItem, out cvv) && cvv.HasValue)
                        {
                            cv.Add(cvv.Value);
                        }

                        visitor.Leave(VisitArgs.CollectionInCollection);
                        c.Add(cv);
                    }
                    graph.Value = ArrayProvider.To2DArray(c);

                    visitor.Leave(_argsValue);
                }
                else
                {
                    graph.Value = null;
                }
            }
        }
Example #4
0
        public void Visit(object graph, IReadVisitor visitor)
        {
            Int16?value;

            if (visitor.TryVisitValue(_args, out value) && value.HasValue)
            {
                _property.Ref.SetValue(graph, value.Value);
            }
        }
        public void Travel(IReadVisitor visitor, NullableValuesEntity graph)
        {
            int?num;

            if (visitor.TryVisitValue(_argsMayInt2, out num))
            {
                graph.MayInt = num;
            }
        }
Example #6
0
 public override bool TryVisitValue(IReadVisitor visitor, VisitArgs args, out Guid value)
 {
     if (visitor.TryVisitValue(args, out Guid? nullable))
     {
         value = nullable ?? default;
         return(true);
     }
     value = default;
     return(false);
 }
Example #7
0
        public void Travel(IReadVisitor visitor, Category graph)
        {
            String v0;

            if (visitor.TryVisitValue(_argsName0, out v0))
            {
                graph.Name = v0;
            }

            String v1;

            if (visitor.TryVisitValue(_argsDescription1, out v1))
            {
                graph.Description = v1;
            }

            byte[] v2;
            if (visitor.TryVisitValue(_argsImage2, out v2))
            {
                graph.Image = v2;
            }
        }
Example #8
0
 public void Visit(object graph, IReadVisitor visitor)
 {
     Int16? value;
     if (visitor.TryVisitValue(_args, out value) && value.HasValue)
         _property.Ref.SetValue(graph, value.Value);
 }
Example #9
0
        public void Travel(IReadVisitor visitor, DataBlock graph)
        {
            Guid?v0;

            if (visitor.TryVisitValue(_argsId, out v0) && v0.HasValue)
            {
                graph.Id = v0.Value;
            }

            String v1;

            if (visitor.TryVisitValue(_argsString, out v1))
            {
                graph.String = v1;
            }

            Int16?v2;

            if (visitor.TryVisitValue(_argsInt16, out v2) && v2.HasValue)
            {
                graph.Int16 = v2.Value;
            }

            Int32?v3;

            if (visitor.TryVisitValue(_argsInt32, out v3) && v3.HasValue)
            {
                graph.Int32 = v3.Value;
            }

            Int64?v4;

            if (visitor.TryVisitValue(_argsInt64, out v4) && v4.HasValue)
            {
                graph.Int64 = v4.Value;
            }

            UInt16?v5;

            if (visitor.TryVisitValue(_argsUInt16, out v5) && v5.HasValue)
            {
                graph.UInt16 = v5.Value;
            }

            UInt32?v6;

            if (visitor.TryVisitValue(_argsUInt32, out v6) && v6.HasValue)
            {
                graph.UInt32 = v6.Value;
            }

            UInt64?v7;

            if (visitor.TryVisitValue(_argsUInt64, out v7) && v7.HasValue)
            {
                graph.UInt64 = v7.Value;
            }

            Single?v8;

            if (visitor.TryVisitValue(_argsSingle, out v8) && v8.HasValue)
            {
                graph.Single = v8.Value;
            }

            Double?v9;

            if (visitor.TryVisitValue(_argsDouble, out v9) && v9.HasValue)
            {
                graph.Double = v9.Value;
            }

            TimeSpan?v10;

            if (visitor.TryVisitValue(_argsTimeSpan, out v10) && v10.HasValue)
            {
                graph.TimeSpan = v10.Value;
            }

            Decimal?v11;

            if (visitor.TryVisitValue(_argsDecimal, out v11) && v11.HasValue)
            {
                graph.Decimal = v11.Value;
            }

            DateTime?v12;

            if (visitor.TryVisitValue(_argsDateTime, out v12) && v12.HasValue)
            {
                graph.DateTime = v12.Value;
            }

            Byte?v13;

            if (visitor.TryVisitValue(_argsByte, out v13) && v13.HasValue)
            {
                graph.Byte = v13.Value;
            }

            Boolean?v14;

            if (visitor.TryVisitValue(_argsBoolean, out v14) && v14.HasValue)
            {
                graph.Boolean = v14.Value;
            }

            Byte[] v15;
            if (visitor.TryVisitValue(_argsBlob, out v15))
            {
                graph.Blob = v15;
            }

            ValueState state;

            state = visitor.TryVisit(_argsMessages);
            if (state != ValueState.NotFound)
            {
                if (state == ValueState.Found)
                {
                    var    c = new List <string>();
                    string cv;
                    while (visitor.TryVisitValue(VisitArgs.CollectionItem, out cv) && cv != null)
                    {
                        c.Add(cv);
                    }
                    graph.Messages = c;

                    visitor.Leave(_argsMessages);
                }
                else
                {
                    graph.Messages = null;
                }
            }

            state = visitor.TryVisit(_argsStamps);
            if (state != ValueState.NotFound)
            {
                if (state == ValueState.Found)
                {
                    var      c = new List <DateTime>();
                    DateTime?cv;
                    while (visitor.TryVisitValue(VisitArgs.CollectionItem, out cv) && cv.HasValue)
                    {
                        c.Add(cv.Value);
                    }
                    graph.Stamps = c;

                    visitor.Leave(_argsStamps);
                }
                else
                {
                    graph.Stamps = null;
                }
            }

            state = visitor.TryVisit(_argsRelation);
            if (state != ValueState.NotFound)
            {
                if (state == ValueState.Found)
                {
                    var c = new Relation();
                    _travellerRelation0.Travel(visitor, c);
                    graph.Relation = c;

                    visitor.Leave(_argsRelation);
                }
                else
                {
                    graph.Relation = null;
                }
            }

            state = visitor.TryVisit(_argsDummyRelation);
            if (state != ValueState.NotFound)
            {
                if (state == ValueState.Found)
                {
                    var c = new Relation();
                    _travellerRelation0.Travel(visitor, c);
                    graph.DummyRelation = c;

                    visitor.Leave(_argsDummyRelation);
                }
                else
                {
                    graph.DummyRelation = null;
                }
            }

            state = visitor.TryVisit(_argsSecondaryRelations);
            if (state != ValueState.NotFound)
            {
                if (state == ValueState.Found)
                {
                    var c = new List <Relation>();
                    while (visitor.TryVisit(VisitArgs.CollectionItem) == ValueState.Found)
                    {
                        var cv = new Relation();
                        _travellerRelation0.Travel(visitor, cv);
                        visitor.Leave(VisitArgs.CollectionItem);
                        c.Add(cv);
                    }
                    graph.SecondaryRelations = c;

                    visitor.Leave(_argsSecondaryRelations);
                }
                else
                {
                    graph.SecondaryRelations = null;
                }
            }

            state = visitor.TryVisit(_argsIndexedValues);
            if (state != ValueState.NotFound)
            {
                if (state == ValueState.Found)
                {
                    IDictionary <string, int> c = new Dictionary <string, int>();
                    string ck;
                    while (visitor.TryVisitValue(VisitArgs.DictionaryKey, out ck) && ck != null)
                    {
                        int?cv;
                        if (visitor.TryVisitValue(VisitArgs.DictionaryValue, out cv) && cv.HasValue)
                        {
                            c.Add(ck, cv.Value);
                        }
                        else
                        {
                            throw InvalidGraphException.NoDictionaryValue("IndexedValues");
                        }
                    }
                    graph.IndexedValues = (Dictionary <string, int>)c;

                    visitor.Leave(_argsIndexedValues);
                }
                else
                {
                    graph.IndexedValues = null;
                }
            }

            state = visitor.TryVisit(_argsCategories);
            if (state != ValueState.NotFound)
            {
                if (state == ValueState.Found)
                {
                    IDictionary <Identifier, Category> c = new Dictionary <Identifier, Category>();
                    while (visitor.TryVisit(VisitArgs.DictionaryKey) == ValueState.Found)
                    {
                        var ck = new Identifier();
                        _travellerIdentifier1.Travel(visitor, ck);
                        visitor.Leave(VisitArgs.DictionaryKey);

                        if (visitor.TryVisit(VisitArgs.DictionaryValue) == ValueState.Found)
                        {
                            var cv = new Category();
                            _travellerCategory2.Travel(visitor, cv);
                            visitor.Leave(VisitArgs.DictionaryValue);

                            c.Add(ck, cv);
                        }
                        else
                        {
                            throw InvalidGraphException.NoDictionaryValue("Categories");
                        }
                    }
                    graph.Categories = (Dictionary <Identifier, Category>)c;

                    visitor.Leave(_argsCategories);
                }
                else
                {
                    graph.IndexedValues = null;
                }
            }
        }
Example #10
0
 public override bool TryVisitValue(IReadVisitor visitor, VisitArgs args, out byte[] value)
 {
     return(visitor.TryVisitValue(args, out value));
 }