Example #1
0
        public void T13_Struct1_PilePointer()
        {
            using (var ms = new MemoryStream())
            {
                var s = new SlimSerializer();

                var s1 = new NFX.ApplicationModel.Pile.PilePointer(10, 231, 223421);

                s.Serialize(ms, s1);
                ms.Seek(0, SeekOrigin.Begin);

                var s2 = (NFX.ApplicationModel.Pile.PilePointer)s.Deserialize(ms);

                Console.WriteLine(NFX.Serialization.JSON.JSONWriter.Write(s1));
                Console.WriteLine(NFX.Serialization.JSON.JSONWriter.Write(s2));

                Assert.IsTrue(s1 == s2);
            }
        }
Example #2
0
        public void PilePointer()
        {
            using (var ms = new MemoryStream())
            {
                var r = SlimFormat.Instance.MakeReadingStreamer();
                var w = SlimFormat.Instance.MakeWritingStreamer();

                r.BindStream(ms);
                w.BindStream(ms);

                var pp = new NFX.ApplicationModel.Pile.PilePointer(10, 20, 30);

                w.Write(pp);

                ms.Seek(0, SeekOrigin.Begin);

                Assert.AreEqual(pp, r.ReadPilePointer());
            }
        }
Example #3
0
        public void PilePointer()
        {
            using(var ms = new MemoryStream())
                        {
                            var r = SlimFormat.Instance.MakeReadingStreamer();
                            var w = SlimFormat.Instance.MakeWritingStreamer();

                            r.BindStream(ms);
                            w.BindStream(ms);

                            var pp = new NFX.ApplicationModel.Pile.PilePointer(10,20,30);

                            w.Write(pp);

                            ms.Seek(0, SeekOrigin.Begin);

                            Assert.AreEqual(pp, r.ReadPilePointer());
                        }
        }
Example #4
0
 public abstract void Write(NFX.ApplicationModel.Pile.PilePointer value);
Example #5
0
 public static void Write(WritingStreamer streamer, ulong name, NFX.ApplicationModel.Pile.PilePointer value)
 {
     streamer.Write(name);
     streamer.Write((byte)DataType.PilePointer);
     streamer.Write(value);
 }
Example #6
0
 public override void Write(NFX.ApplicationModel.Pile.PilePointer value)
 {
     this.Write(value.NodeID);
     this.Write(value.Segment);
     this.Write(value.Address);
 }