Ejemplo n.º 1
0
        public override void write( object obj, IProtocolFormatter writer )
		{
            //IDictionary propertyBag = (IDictionary) obj;
            IDictionary props = (IDictionary) obj;
            string clientClass = GetClientClass(props);
#if FULL_BUILD
            props = new SortedList(props);
#endif
            writer.GetObjectSerializer().WriteObject( clientClass, props, writer );
		}
Ejemplo n.º 2
0
        public override void write(object obj, IProtocolFormatter writer)
        {
            //IDictionary propertyBag = (IDictionary) obj;
            IDictionary props       = (IDictionary)obj;
            string      clientClass = GetClientClass(props);

#if FULL_BUILD
            props = new SortedList(props);
#endif
            writer.GetObjectSerializer().WriteObject(clientClass, props, writer);
        }
Ejemplo n.º 3
0
 public override void write( object obj, IProtocolFormatter formatter )
 {
     ServiceException exception = (ServiceException)obj;
     Dictionary<String, Object> objectFields = new Dictionary<String, Object>();
     objectFields[ "description" ] = exception.description;
     objectFields[ "details" ] = exception.details;
     objectFields[ "type" ] = exception.type;
     objectFields[ "code" ] = exception.code;
     String className = exception.exceptionName;
     formatter.GetObjectSerializer().WriteObject( className, objectFields, formatter );
 }
Ejemplo n.º 4
0
        public override void write(object obj, IProtocolFormatter formatter)
        {
            ServiceException            exception    = (ServiceException)obj;
            Dictionary <String, Object> objectFields = new Dictionary <String, Object>();

            objectFields["description"] = exception.description;
            objectFields["details"]     = exception.details;
            objectFields["type"]        = exception.type;
            objectFields["code"]        = exception.code;
            String className = exception.exceptionName;

            formatter.GetObjectSerializer().WriteObject(className, objectFields, formatter);
        }
Ejemplo n.º 5
0
        public override void write( object obj, IProtocolFormatter writer )
        {
            IWebORBArrayCollection collection = (IWebORBArrayCollection) obj;
            List<Object> array = new List<Object>();
            IEnumerator en = collection.GetEnumerator();

            while( en.MoveNext() )
                array.Add( en.Current );

            Dictionary<String, object> fields = new Dictionary<String, object>();
            fields[ "source" ] = array.ToArray();
            writer.GetObjectSerializer().WriteObject( "flex.messaging.io.ArrayCollection", fields, writer );
        }
Ejemplo n.º 6
0
        public override void write(object obj, IProtocolFormatter writer)
        {
            IWebORBArrayCollection collection = (IWebORBArrayCollection)obj;
            List <Object>          array      = new List <Object>();
            IEnumerator            en         = collection.GetEnumerator();

            while (en.MoveNext())
            {
                array.Add(en.Current);
            }

            Dictionary <String, object> fields = new Dictionary <String, object>();

            fields["source"] = array.ToArray();
            writer.GetObjectSerializer().WriteObject("flex.messaging.io.ArrayCollection", fields, writer);
        }
Ejemplo n.º 7
0
    protected override void onWriteObject( object obj, string className, IDictionary objectFields, IProtocolFormatter writer )
    {
      IDictionary<string, object> underflowData = UnderflowStore.GetObjectUnderflow( obj );

      if( underflowData != null )
      {
        int lastIndex = className.LastIndexOf( '.' );

        if( lastIndex > -1 )
          className = className.Substring( lastIndex + 1 );

        foreach( string key in underflowData.Keys )
          if( !objectFields.Contains( key ) && underflowData[ key ] != null )
            objectFields[ key ] = underflowData[ key ];
      }

      writer.GetObjectSerializer().WriteObject( className, objectFields, writer );
    }
Ejemplo n.º 8
0
    protected override void onWriteObject( object obj, string className, IDictionary objectFields, IProtocolFormatter writer )
    {
      IDictionary<string, object> underflowData = UnderflowStore.GetObjectUnderflow( obj );

      if( underflowData != null )
      {
        int lastIndex = className.LastIndexOf( '.' );

        if( lastIndex > -1 )
          className = className.Substring( lastIndex + 1 );

        foreach( string key in underflowData.Keys )
          if( !objectFields.Contains( key ) && underflowData[ key ] != null )
            objectFields[ key ] = underflowData[ key ];
      }

      if( !className.StartsWith( "flex.messaging.messages" ) && !className.StartsWith( "com.backendless" ) )
      {
        if( objectFields.Contains( "___class" ) )
          className = (String) objectFields[ "___class" ];
        else
        {
          int dotIndex = className.LastIndexOf( '+' );

          if( dotIndex == -1 )
            dotIndex = className.LastIndexOf( '.' );

          if( dotIndex > -1 )
            className = className.Substring( dotIndex + 1 );

          objectFields.Add( "___class", className );
        }

        className = null;
      }

      writer.GetObjectSerializer().WriteObject( className, objectFields, writer );
    }
Ejemplo n.º 9
0
        public override void write( object obj, IProtocolFormatter formatter )
		{
			TypedObject typedObject = (TypedObject) obj;
			formatter.GetObjectSerializer().WriteObject( typedObject.typeName, typedObject.objectData, formatter );
		}
Ejemplo n.º 10
0
        public override void write(object obj, IProtocolFormatter formatter)
        {
            TypedObject typedObject = (TypedObject)obj;

            formatter.GetObjectSerializer().WriteObject(typedObject.typeName, typedObject.objectData, formatter);
        }
Ejemplo n.º 11
0
 protected virtual void onWriteObject(Object obj, string className, IDictionary objectFields, IProtocolFormatter writer)
 {
     writer.GetObjectSerializer().WriteObject(className, objectFields, writer);
 }