static internal PrimitiveBuiltins Create(uint position)
        {
            var result = new PrimitiveBuiltins();

            Populate(result, position);
            return(result);
        }
示例#2
0
        public static string Dump(PrimitiveBuiltins value)
        {
            var assistant = new AssistantDumper();

            Dump(assistant, value);
            return(assistant.ToString());
        }
 static internal void Populate(PrimitiveBuiltins value, uint position)
 {
     value.ByteProperty      = AssistantSequenceGenerator.CreateByte(position + 0);
     value.ShortByteProperty = AssistantSequenceGenerator.CreateShortByte(position + 1);
     value.IntProperty       = AssistantSequenceGenerator.CreateInt(position + 2);
     value.UIntProperty      = AssistantSequenceGenerator.CreateUInt(position + 3);
     value.ShortProperty     = AssistantSequenceGenerator.CreateShort(position + 4);
     value.UShortProperty    = AssistantSequenceGenerator.CreateUShort(position + 5);
     value.LongProperty      = AssistantSequenceGenerator.CreateLong(position + 6);
     value.ULongProperty     = AssistantSequenceGenerator.CreateULong(position + 7);
     value.FloatPropertyOne  = AssistantSequenceGenerator.CreateFloat(position + 8);
     value.FloatPropertyTwo  = AssistantSequenceGenerator.CreateFloat(position + 9);
     value.DoublePropertyOne = AssistantSequenceGenerator.CreateDouble(position + 10);
     value.DoublePropertyTwo = AssistantSequenceGenerator.CreateDouble(position + 11);
     value.CharProperty      = AssistantSequenceGenerator.CreateChar(position + 12);
     value.BoolProperty      = AssistantSequenceGenerator.CreateBool(position + 13);
     value.DecimalProperty   = AssistantSequenceGenerator.CreateDecimal(position + 14);
 }
示例#4
0
        static internal void Dump(AssistantDumper assistant, PrimitiveBuiltins value, bool withSeparator = false)
        {
            assistant.IncrementDepth();
            if (assistant.MaximumDepthExceeded())
            {
                return;
            }

            assistant.AddStartObject();
            assistant.AddType("CSharpRefImpl.CSharpModel.PrimitiveBuiltins", true /*withSeparator*/);
            if (value == null)
            {
                assistant.Add("data", "<null>");
                assistant.AddEndObject();
                return;
            }

            assistant.AddKey("data");
            assistant.AddPairSeparator();
            assistant.AddStartObject();
            assistant.Add("ByteProperty", value.ByteProperty, true /*withSeparator*/);
            assistant.Add("ShortByteProperty", value.ShortByteProperty, true /*withSeparator*/);
            assistant.Add("IntProperty", value.IntProperty, true /*withSeparator*/);
            assistant.Add("UIntProperty", value.UIntProperty, true /*withSeparator*/);
            assistant.Add("ShortProperty", value.ShortProperty, true /*withSeparator*/);
            assistant.Add("UShortProperty", value.UShortProperty, true /*withSeparator*/);
            assistant.Add("LongProperty", value.LongProperty, true /*withSeparator*/);
            assistant.Add("ULongProperty", value.ULongProperty, true /*withSeparator*/);
            assistant.Add("FloatPropertyOne", value.FloatPropertyOne, true /*withSeparator*/);
            assistant.Add("FloatPropertyTwo", value.FloatPropertyTwo, true /*withSeparator*/);
            assistant.Add("DoublePropertyOne", value.DoublePropertyOne, true /*withSeparator*/);
            assistant.Add("DoublePropertyTwo", value.DoublePropertyTwo, true /*withSeparator*/);
            assistant.Add("CharProperty", value.CharProperty, true /*withSeparator*/);
            assistant.Add("BoolProperty", value.BoolProperty, true /*withSeparator*/);
            assistant.Add("DecimalProperty", value.DecimalProperty);
            assistant.AddEndObject(); // data
            assistant.AddEndObject(); // main object
            assistant.HandleMemberSeparator(withSeparator);

            assistant.DecrementDepth();
        }