ResolveGraph() public method

resolving the graph based on the value of the graph switch
public ResolveGraph ( object obj ) : void
obj object
return void
示例#1
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="obj"></param>
 /// <param name="binaryWriter"></param>
 /// <param name="translationContext"></param>
 public override void Serialize(object obj, BinaryWriter binaryWriter, TranslationContext translationContext)
 {
     translationContext.ResolveGraph(obj);
     ClassDescriptor rootObjectClassDescriptor = ClassDescriptor.GetClassDescriptor(obj.GetType());
     try
     {
         Serialize(obj, rootObjectClassDescriptor.PseudoFieldDescriptor, binaryWriter, translationContext);
     }
     catch (Exception ex)
     {
         throw new SimplTranslationException("IO exception occured: ", ex);
     }
 }
示例#2
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="textWriter"></param>
        /// <param name="translationContext"></param>
        public override void Serialize(object obj, TextWriter textWriter, TranslationContext translationContext)
        {
            translationContext.ResolveGraph(obj);
            ClassDescriptor rootObjectClassDescriptor = ClassDescriptor.GetClassDescriptor(obj.GetType());
            try
            {
                WriteStart(textWriter);

                Serialize(obj, rootObjectClassDescriptor.PseudoFieldDescriptor, textWriter, translationContext, true);

                WriteClose(textWriter);
            }
            catch (Exception ex)
            {
                throw new SimplTranslationException("IO exception occured: ", ex);
            }
        }