protected override void WriteScalar(ref ObjectContext objectContext, ScalarEventInfo scalar)
 {
     // TODO: if ParameterKey is written to an object, It will not serialized a tag
     scalar.Tag = null;
     scalar.IsPlainImplicit = true;
     base.WriteScalar(ref objectContext, scalar);
 }
示例#2
0
		public override void Emit(ScalarEventInfo eventInfo)
		{
			eventInfo.IsPlainImplicit = true;
			eventInfo.Style = ScalarStyle.Plain;

			var typeCode = eventInfo.SourceValue != null
				? Type.GetTypeCode(eventInfo.SourceType)
				: TypeCode.Empty;

			switch (typeCode)
			{
				case TypeCode.String:
				case TypeCode.Char:
					eventInfo.Style = ScalarStyle.DoubleQuoted;
					break;
				case TypeCode.Empty:
					eventInfo.RenderedValue = "null";
					break;
			}

			base.Emit(eventInfo);
		}
示例#3
0
        public override void Emit(ScalarEventInfo eventInfo)
        {
            eventInfo.IsPlainImplicit = true;
            eventInfo.Style           = ScalarStyle.Plain;

            var typeCode = eventInfo.SourceValue != null
                ? Type.GetTypeCode(eventInfo.SourceType)
                : TypeCode.Empty;

            switch (typeCode)
            {
            case TypeCode.String:
            case TypeCode.Char:
                eventInfo.Style = ScalarStyle.DoubleQuoted;
                break;

            case TypeCode.Empty:
                eventInfo.RenderedValue = "null";
                break;
            }

            base.Emit(eventInfo);
        }
 public override void Emit(ScalarEventInfo eventInfo)
 {
     events.Add(eventInfo);
 }
示例#5
0
 public override void Emit(ScalarEventInfo eventInfo)
 {
     events.Add(eventInfo);
 }
示例#6
0
 void IEventEmitter.Emit(ScalarEventInfo eventInfo)
 {
     emitter.Emit(new Scalar(eventInfo.Anchor, eventInfo.Tag, eventInfo.RenderedValue, eventInfo.Style, eventInfo.IsPlainImplicit, eventInfo.IsQuotedImplicit));
 }
示例#7
0
 public virtual void Emit(ScalarEventInfo eventInfo)
 {
     nextEmitter.Emit(eventInfo);
 }
 void IEventEmitter.Emit(ScalarEventInfo eventInfo)
 {
     emitter.Emit(new Scalar(eventInfo.Anchor, eventInfo.Tag, eventInfo.RenderedValue, eventInfo.Style, eventInfo.IsPlainImplicit, eventInfo.IsQuotedImplicit));
 }
 public virtual void Emit(ScalarEventInfo eventInfo)
 {
     nextEmitter.Emit(eventInfo);
 }