コード例 #1
0
        public void AddCommandListener <TR>(CommandReceived <TR> callback, IChannel channel)
        {
            IRTCallback rtCallback = new RTCallback <TR>(callback, result =>
            {
                try
                {
                    Command <TR> command = new Command <TR>();

                    UserInfo userInfo = new UserInfo();

                    command.UserInfo = userInfo;

                    userInfo.ConnectionId = WeborbSerializationHelper.AsString(result, "connectionId");
                    userInfo.UserId       = WeborbSerializationHelper.AsString(result, "userId");

                    command.Type = WeborbSerializationHelper.AsString(result, "type");

                    IAdaptingType data = WeborbSerializationHelper.AsAdaptingType(result, "data");

                    command.Data = (TR)data.adapt(typeof(TR));
                    callback(command);
                }
                catch (System.Exception e)
                {
                    channel.ErrorHandler?.Invoke(RTErrorType.COMMAND, new BackendlessFault(e));
                }
            }, fault =>
            {
                channel.ErrorHandler?.Invoke(RTErrorType.COMMAND, fault);
            });

            AddCommandListener(rtCallback);
        }
コード例 #2
0
        public Object createObject(IAdaptingType iAdaptingType)
        {
            if (iAdaptingType is NamedObject)
            {
                iAdaptingType = ((NamedObject)iAdaptingType).TypedObject;
            }

            if (iAdaptingType.GetType() == typeof(NullType))
            {
                return(null);
            }

            if (iAdaptingType is AnonymousObject)
            {
                Dictionary <object, object> properties = (Dictionary <object, object>)iAdaptingType.defaultAdapt();
                String geoJson = (String)properties["geoJson"];

                if (geoJson == null)
                {
                    return(null);
                }

                String   geomClass = (String)properties["geomClass"];
                int      srsId     = (int)properties["srsId"];
                Geometry geometry  = new GeometryDTO(geomClass, srsId, geoJson).ToGeometry <Geometry>();

                return(geometry);
            }
            else
            {
                throw new System.Exception("Unknown type");
            }
        }
コード例 #3
0
        public void AddObject( IAdaptingType key, Type type, Object value )
        {
            if (!cache.ContainsKey(key))
                cache[key] = new Dictionary<Type, object>();

            cache[key][type] = value;
        }
コード例 #4
0
ファイル: Serializer.cs プロジェクト: fuhye/.NET-SDK
        public static object FromBytes(byte[] bytes, int type, bool doNotAdapt)
        {
            switch (type)
            {
            case AMF0:
            case AMF3:
                using (MemoryStream stream = new MemoryStream(bytes))
                {
                    using (FlashorbBinaryReader reader = new FlashorbBinaryReader(stream))
                    {
                        IAdaptingType adpatingType = Weborb.Protocols.Amf.RequestParser.readData(reader, type == AMF0 ? 0 : 3);

                        if (doNotAdapt)
                        {
                            return(adpatingType);
                        }
                        else
                        {
                            return(adpatingType.defaultAdapt());
                        }
                    }
                }

            case JSON:
                using (MemoryStream stream = new MemoryStream(bytes))
                {
                    StreamReader streamReader = new StreamReader(stream, Encoding.UTF8);

                    using (JsonTextReader jsonReader = new JsonTextReader(streamReader))
                    {
                        jsonReader.Read();
                        IAdaptingType jsonType = Weborb.Protocols.JsonRPC.RequestParser.Read(jsonReader);

                        if (doNotAdapt)
                        {
                            return(jsonType);
                        }
                        else
                        {
                            return(jsonType.defaultAdapt());
                        }
                    }
                }

#if (!UNIVERSALW8 && !SILVERLIGHT && !PURE_CLIENT_LIB && !WINDOWS_PHONE8)
            case WOLF:

                using (MemoryStream stream = new MemoryStream(bytes))
                {
                    Weborb.Protocols.Wolf.RequestParser parser = Weborb.Protocols.Wolf.RequestParser.GetInstance();
                    Request requestObj = parser.Parse(stream);
                    return(requestObj.getRequestBodyData());
                }
                break;
#endif
            default:
                throw new Exception("Unknown formatting type");
            }
        }
コード例 #5
0
        private void ProcessAMFResponse <T>(IAsyncResult asyncResult)
        {
            try
            {
                AsyncStreamSetInfo <T> asyncStreamSetInfo = (AsyncStreamSetInfo <T>)asyncResult.AsyncState;

                if (asyncStreamSetInfo.responseThreadConfigurator != null)
                {
                    asyncStreamSetInfo.responseThreadConfigurator();
                }

                HttpWebRequest  request  = asyncStreamSetInfo.request;
                HttpWebResponse response = (HttpWebResponse)request.EndGetResponse(asyncResult);

                if (Cookies != null)
                {
                    foreach (Cookie cookie in response.Cookies)
                    {
                        Cookies.Add(new Uri(GatewayUrl), cookie);
                    }
                }

                Stream        streamResponse = response.GetResponseStream();
                long          curTime        = DateTime.Now.Ticks;
                long          roundTrip      = (curTime - asyncStreamSetInfo.messageSentTime) / TimeSpan.TicksPerMillisecond;
                RequestParser parser         = new RequestParser();
                Request       responseObject = parser.readMessage(streamResponse);
                object[]      responseData   = (object[])responseObject.getRequestBodyData();
                V3Message     v3             = (V3Message)((IAdaptingType)responseData[0]).defaultAdapt();

                if (v3.isError)
                {
                    ErrMessage errorMessage = (ErrMessage)v3;
                    Fault      fault        = new Fault(errorMessage.faultString, errorMessage.faultDetail, errorMessage.faultCode);

                    if (asyncStreamSetInfo.responder != null)
                    {
                        asyncStreamSetInfo.responder.ErrorHandler(fault);
                    }

                    return;
                }

                IAdaptingType body   = (IAdaptingType)((AnonymousObject)((NamedObject)responseData[0]).TypedObject).Properties["body"];
                T             result = (T)body.adapt(typeof(T));

                if (asyncStreamSetInfo.responder != null)
                {
                    asyncStreamSetInfo.responder.ResponseHandler(result);
                }

                //  ProcessV3Message( v3, asyncStreamSetInfo.responder );
            }
            catch (Exception e)
            {
                AsyncStreamSetInfo <T> asyncStreamSetInfo = (AsyncStreamSetInfo <T>)asyncResult.AsyncState;
                ProccessException(e, asyncStreamSetInfo.responder);
            }
        }
コード例 #6
0
        public void AddObject(IAdaptingType key, Type type, Object value)
        {
            if (!cache.ContainsKey(key))
            {
                cache[key] = new Dictionary <Type, object>();
            }

            cache[key][type] = value;
        }
コード例 #7
0
ファイル: ParseContext.cs プロジェクト: fuhye/.NET-SDK
        public void addReference(IAdaptingType type)
        {
            if (ignore)
            {
                return;
            }

            references.Add(type);
        }
コード例 #8
0
        public Object GetObject( IAdaptingType key )
        {
            return GetObject( key, key.getDefaultType() );
            /*
            foreach (Object item in cache[key].Values)
                return item;

            throw new Exception("Object not exists in reference cache");
             */
        }
コード例 #9
0
ファイル: ParseContext.cs プロジェクト: fuhye/.NET-SDK
        public void addReference(IAdaptingType adaptingType, int index)
        {
            if (ignore)
            {
                return;
            }

            references.Capacity = index + 1;
            references[index]   = adaptingType;
        }
コード例 #10
0
        public IAdaptingType read(FlashorbBinaryReader reader, ParseContext parseContext)
        {
            int refId = reader.ReadVarInteger();

            if ((refId & 0x1) == 0)
            {
                return(parseContext.getReference(refId >> 1));
            }

            int           arraySize    = refId >> 1;
            IAdaptingType adaptingType = null;
            object        container    = null;

            while (true)
            {
                string str = ReaderUtils.readString(reader, parseContext);

                if (str == null || str.Length == 0)
                {
                    break;
                }

                if (container == null)
                {
                    container    = new Dictionary <object, object>();
                    adaptingType = new AnonymousObject((IDictionary)container);
                    parseContext.addReference(adaptingType);
                }

                object obj = RequestParser.readData(reader, parseContext);
                ((IDictionary)container)[str] = obj;
            }

            if (adaptingType == null)
            {
                container    = new object[arraySize];
                adaptingType = new ArrayType((object[])container);
                parseContext.addReference(adaptingType);

                for (int i = 0; i < arraySize; i++)
                {
                    ((object[])container)[i] = RequestParser.readData(reader, parseContext);
                }
            }
            else
            {
                for (int i = 0; i < arraySize; i++)
                {
                    object obj = RequestParser.readData(reader, parseContext);
                    ((IDictionary)container)[i.ToString()] = obj;
                }
            }

            return(adaptingType);
        }
コード例 #11
0
        public Object GetObject(IAdaptingType key)
        {
            return(GetObject(key, key.getDefaultType()));

            /*
             * foreach (Object item in cache[key].Values)
             *  return item;
             *
             * throw new Exception("Object not exists in reference cache");
             */
        }
コード例 #12
0
		public object createObject( IAdaptingType argument )
		{
			BodyHolder bodyObj = new BodyHolder();
      Object arg = argument;

      if( argument is ArrayType )
        arg = ((ArrayType) argument).getArray();

      bodyObj.body = new Object[] { arg };
      return bodyObj;
		}
コード例 #13
0
        public Object GetObject( IAdaptingType key, Type type )
        {
            if (cache[key].ContainsKey(type))
                return cache[key][type];

            foreach (Type item in cache[key].Keys)
                if (type.IsAssignableFrom(item))
                    return cache[key][item];

            throw new Exception("Object not exists in reference cache");
        }
コード例 #14
0
ファイル: ArrayReader.cs プロジェクト: Georotzen/.NET-SDK-1
		public IAdaptingType read( FlashorbBinaryReader reader, ParseContext parseContext )
		{
			int length = reader.ReadInteger();
			IAdaptingType[] array = new IAdaptingType[ length ];
			ArrayType arrayType = new ArrayType( array );
			parseContext.addReference( arrayType );

			for( int i = 0; i < length; i++ )
				array[ i ] = RequestParser.readData( reader, parseContext );

			return arrayType;
		}
コード例 #15
0
        internal static void ReportObjectUnderFlow(object obj, System.Collections.IDictionary props)
        {
            IDictionary <string, object> properties = new Dictionary <string, object>();

            foreach (object key in props.Keys)
            {
                IAdaptingType adaptingType = (IAdaptingType)props[key];
                properties[(string)key] = adaptingType.defaultAdapt();
            }

            objectStore.Add(obj, properties);
        }
コード例 #16
0
        internal static IAdaptingType Deserialize(byte[] arg)
        {
            IAdaptingType adaptingType = (IAdaptingType)Serializer.FromBytes(arg, Serializer.JSON, true);

            if (adaptingType is CacheableAdaptingTypeWrapper)
            {
                return(((CacheableAdaptingTypeWrapper)adaptingType).getType());
            }
            else
            {
                return(adaptingType);
            }
        }
コード例 #17
0
        public object createObject(IAdaptingType argument)
        {
            BodyHolder bodyObj = new BodyHolder();
            Object     arg     = argument;

            if (argument is ArrayType)
            {
                arg = ((ArrayType)argument).getArray();
            }

            bodyObj.body = new Object[] { arg };
            return(bodyObj);
        }
コード例 #18
0
    public object createObject( IAdaptingType argument )
    {
      if( argument is NamedObject )
        argument = ( (NamedObject) argument ).TypedObject;

      if( argument is NullType )
        return null;

      Dictionary<string, object> props = (Dictionary<string, object>) argument.adapt( typeof( Dictionary<string, object> ) );
      BackendlessUser backendlessUser = new BackendlessUser();
      backendlessUser.PutProperties( props );
      return backendlessUser;
    }
コード例 #19
0
        public bool HasObject(IAdaptingType key, Type type)
        {
            if( cache.ContainsKey(key) )
            {
                if (cache[key].ContainsKey(type))
                    return true;

                foreach (Type item in cache[key].Keys)
                    if (type.IsAssignableFrom(item))
                        return true;
            }

            return false;
        }
コード例 #20
0
        protected void ReceivedMessage <T>(AckMessage message)
        {
            object responder = GetResponder(message.clientId.ToString());

            if (responder == null)
            {
                return;
            }
            object[] arr = (object[])((ArrayType)message.body.body).getArray();
            foreach (var o in arr)
            {
                IAdaptingType adaptingType = (IAdaptingType)o;
                GetResponder <T>(message.clientId.ToString()).ResponseHandler((T)adaptingType.adapt(typeof(T)));
            }
        }
コード例 #21
0
        public bool Equals(object _obj, Dictionary <DictionaryEntry, bool> visitedPairs)
        {
            IAdaptingType obj = _obj as IAdaptingType;

            if (obj == null)
            {
                return(false);
            }

            if (Object.ReferenceEquals(this, _obj))
            {
                return(true);
            }

            return(obj.Equals(realType, visitedPairs));
        }
コード例 #22
0
        public IAdaptingType read(FlashorbBinaryReader reader, ParseContext parseContext)
        {
            int length = reader.ReadInteger();

            IAdaptingType[] array     = new IAdaptingType[length];
            ArrayType       arrayType = new ArrayType(array);

            parseContext.addReference(arrayType);

            for (int i = 0; i < length; i++)
            {
                array[i] = RequestParser.readData(reader, parseContext);
            }

            return(arrayType);
        }
コード例 #23
0
ファイル: RefObject.cs プロジェクト: ramilbgd/.NET-SDK
        public object adapt(Type type, ReferenceCache refCache)
        {
            if (Object != null)
            {
                bool          isCachable = Object is ICacheableAdaptingType;
                IAdaptingType cacheKey   = isCachable ? (Object as ICacheableAdaptingType).getCacheKey() : Object;

                if (refCache.HasObject(cacheKey, type))
                {
                    return(refCache.GetObject(cacheKey, type));
                }

                return(isCachable ? (Object as ICacheableAdaptingType).adapt(type, refCache) : Object.adapt(type));
            }

            return(null);
        }
コード例 #24
0
		public IAdaptingType read( FlashorbBinaryReader reader, ParseContext parseContext )
		{
			int refId = reader.ReadVarInteger();

			if( (refId & 0x1) == 0 )
				return (ArrayType) parseContext.getReference( refId >> 1 );

			byte[] bytes = reader.ReadBytes( refId >> 1 );
            IAdaptingType[] objArray = new IAdaptingType[bytes.Length];

            for (int i = 0; i < bytes.Length; i++)
                objArray[i] = new NumberObject( bytes[i] );

			ArrayType arrayType = new ArrayType( objArray );
			parseContext.addReference( arrayType );
			return arrayType;
		}
コード例 #25
0
        public Object GetObject(IAdaptingType key, Type type)
        {
            if (cache[key].ContainsKey(type))
            {
                return(cache[key][type]);
            }

            foreach (Type item in cache[key].Keys)
            {
                if (type.IsAssignableFrom(item))
                {
                    return(cache[key][item]);
                }
            }

            throw new Exception("Object not exists in reference cache");
        }
コード例 #26
0
ファイル: RefObject.cs プロジェクト: ramilbgd/.NET-SDK
        public object defaultAdapt(ReferenceCache refCache)
        {
            if (Object != null)
            {
                bool          isCachable = Object is ICacheableAdaptingType;
                IAdaptingType cacheKey   = isCachable ? (Object as ICacheableAdaptingType).getCacheKey() : Object;

                if (refCache.HasObject(cacheKey))
                {
                    return(refCache.GetObject(cacheKey));
                }

                return(isCachable? (Object as ICacheableAdaptingType).defaultAdapt(refCache) : Object.defaultAdapt());
            }

            return(null);
        }
コード例 #27
0
        public object createObject(IAdaptingType argument)
        {
            if (argument is NamedObject)
            {
                argument = ((NamedObject)argument).TypedObject;
            }

            if (argument is NullType)
            {
                return(null);
            }

            Dictionary <string, object> props           = (Dictionary <string, object>)argument.adapt(typeof(Dictionary <string, object>));
            BackendlessUser             backendlessUser = new BackendlessUser();

            backendlessUser.PutProperties(props);
            return(backendlessUser);
        }
コード例 #28
0
        public new void ResponseHandler(AsyncMessage asyncMessage)
        {
            IAdaptingType[] bodys = asyncMessage.GetBody();
            foreach (IAdaptingType adaptingType in bodys)
            {
                object message = adaptingType.defaultAdapt();
                base.ResponseHandler(message);
            }
            return;

#if !(FULL_BUILD)
            IAdaptingType body = (IAdaptingType)asyncMessage.body;
#else
            IAdaptingType body = (IAdaptingType)((object[])(asyncMessage.body.body))[0];
#endif
            object adaptedMessage = body.defaultAdapt();
            base.ResponseHandler(adaptedMessage);
        }
コード例 #29
0
        internal static AnonymousObject Cast(IAdaptingType obj)
        {
            AnonymousObject anonymousObject;

            if (obj is AnonymousObject)
            {
                anonymousObject = (AnonymousObject)obj;
            }
            else if (obj is CacheableAdaptingTypeWrapper)
            {
                anonymousObject = (AnonymousObject)((CacheableAdaptingTypeWrapper)obj).getType();
            }
            else
            {
                throw new System.Exception("Object must be of or contain the AnonymousObject type");
            }
            return(anonymousObject);
        }
コード例 #30
0
        public bool HasObject(IAdaptingType key, Type type)
        {
            if (cache.ContainsKey(key))
            {
                if (cache[key].ContainsKey(type))
                {
                    return(true);
                }

                foreach (Type item in cache[key].Keys)
                {
                    if (type.IsAssignableFrom(item))
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }
コード例 #31
0
 protected void RecieveMessages(string SubTopic, string Selector, string clientId)
 {
     try
     {
         CommandMessage message = new CommandMessage();
         message.operation = CommandMessage.POLL_OPERATION;
         Subscription.InitCommandMessage(message, SubTopic, Selector, IdInfo, clientId);
         SendRequest(message, null, null, new Responder <V3Message>(
                         result =>
         {
             if (result != null)
             {
                 if (!(result is AsyncMessage) && result.body.body is ArrayType)
                 {
                     object[] arr = (object[])((ArrayType)result.body.body).getArray();
                     foreach (object o in arr)
                     {
                         IAdaptingType adaptingType = (IAdaptingType)o;
                         base.ReceivedMessage((AsyncMessage)adaptingType.adapt(typeof(AsyncMessage)));
                     }
                 }
                 else
                 {
                     base.ReceivedMessage((AsyncMessage)result);
                 }
             }
         },
                         fault => /*(ISubscribeResponder)GetResponder(clientId).ErrorHandler(fault)*/ { }), null);
     }
     catch (Exception)
     {
         try
         {
             //GetResponder<T>().ErrorHandler(new Fault(Subscription.ReceiveMessagesError, e.Message));
         }
         catch (Exception)
         {
         }
     }
 }
コード例 #32
0
        public IAdaptingType read(FlashorbBinaryReader reader, ParseContext parseContext)
        {
            int refId = reader.ReadVarInteger();

            if ((refId & 0x1) == 0)
            {
                return((ArrayType)parseContext.getReference(refId >> 1));
            }

            byte[]          bytes    = reader.ReadBytes(refId >> 1);
            IAdaptingType[] objArray = new IAdaptingType[bytes.Length];

            for (int i = 0; i < bytes.Length; i++)
            {
                objArray[i] = new NumberObject(bytes[i]);
            }

            ArrayType arrayType = new ArrayType(objArray);

            parseContext.addReference(arrayType);
            return(arrayType);
        }
コード例 #33
0
ファイル: Body.cs プロジェクト: ramilbgd/.NET-SDK
        public Body(string serviceURI, string responseURI, int length, object dataObject)
        {
            this.serviceURI  = serviceURI;
            this.responseURI = responseURI;

            if (dataObject is IAdaptingType)
            {
                IAdaptingType adaptingType = (IAdaptingType)dataObject;

                if (adaptingType is ArrayType)
                {
                    this.dataObject = ((ArrayType)adaptingType).getArray();
                }
                else
                {
                    this.dataObject = new Object[] { dataObject }
                };
            }
            else
            {
                this.dataObject = dataObject;
            }
        }
コード例 #34
0
        private IRTRequest HandleResult <T>(Object[] args, IDictionary <String, T> requestMap, String resultKey) where T : IRTRequest
        {
            if (args == null || args.Length < 1)
            {
                Log.log(Backendless.BACKENDLESSLOG, "subscription result is null or empty");
                return(null);
            }

            AnonymousObject result = (AnonymousObject)WeborbSerializationHelper.Deserialize((byte[])args[0]);

            String id = WeborbSerializationHelper.AsString(result, "id");

            Log.log(Backendless.BACKENDLESSLOG, String.Format("Got result for subscription {0}", id));

            IRTRequest request = requestMap[id];

            if (request == null)
            {
                Log.log(Backendless.BACKENDLESSLOG, String.Format("There is no handler for subscription {0}", id));
                return(null);
            }

            Object error = WeborbSerializationHelper.AsObject(result, "error");

            if (error != null)
            {
                Log.log(Backendless.BACKENDLESSLOG, String.Format("got error {0}", error));
                BackendlessFault fault = new BackendlessFault(error.ToString());
                request.Callback.errorHandler(fault);
                return(request);
            }

            IAdaptingType data = WeborbSerializationHelper.AsAdaptingType(result, resultKey);

            request.Callback.responseHandler(data);
            return(request);
        }
コード例 #35
0
ファイル: ObjectFactories.cs プロジェクト: Mohamie/.NET-SDK
        public object _CreateArgumentObject(Type type, IAdaptingType argument)
        {
            String typeName = type.FullName;

            if (Log.isLogging(LoggingConstants.DEBUG))
            {
                Log.log(LoggingConstants.DEBUG, "checking argument factory for " + typeName);
            }

            if (!argumentObjectFactories.ContainsKey(typeName))
            {
                /*
                 * if( type.IsInterface || type.IsAbstract )
                 * {
                 *  if( Log.isLogging( LoggingConstants.DEBUG ) )
                 *      Log.log( LoggingConstants.DEBUG, "type is an interface or abstract/static" );
                 *
                 *  Type mappedType = Weborb.Types.Types.GetAbstractClassMapping( type );
                 *
                 *  if( mappedType != null )
                 *      return ObjectFactories.CreateServiceObject( mappedType );
                 * }*/

                return(null);
            }

            IArgumentObjectFactory objectFactory;

            argumentObjectFactories.TryGetValue(typeName, out objectFactory);

            if (Log.isLogging(LoggingConstants.DEBUG))
            {
                Log.log(LoggingConstants.DEBUG, "will use argument factory " + objectFactory.ToString());
            }

            return(objectFactory.createObject(argument));
        }
コード例 #36
0
ファイル: Serializer.cs プロジェクト: ramilbgd/.NET-SDK
        public static object FromBytes(byte[] bytes, int type, bool doNotAdapt)
        {
#if (!UNIVERSALW8 && !SILVERLIGHT && !PURE_CLIENT_LIB && !WINDOWS_PHONE8)
            if (type == AMF0 || type == AMF3)
            {
#endif
            using (MemoryStream stream = new MemoryStream(bytes))
            {
                using (FlashorbBinaryReader reader = new FlashorbBinaryReader(stream))
                {
                    IAdaptingType adpatingType = Weborb.Protocols.Amf.RequestParser.readData(reader, type == AMF0 ? 0 : 3);

                    if (doNotAdapt)
                    {
                        return(adpatingType);
                    }
                    else
                    {
                        return(adpatingType.defaultAdapt());
                    }
                }
            }
#if (!UNIVERSALW8 && !SILVERLIGHT && !PURE_CLIENT_LIB && !WINDOWS_PHONE8)
        }

        else
        {
            using (MemoryStream stream = new MemoryStream(bytes))
            {
                Weborb.Protocols.Wolf.RequestParser parser = Weborb.Protocols.Wolf.RequestParser.GetInstance();
                Request requestObj = parser.Parse(stream);
                return(requestObj.getRequestBodyData());
            }
        }
#endif
        }
コード例 #37
0
		public object _CreateArgumentObject( Type type, IAdaptingType argument )
		{
            String typeName = type.FullName;

            if( Log.isLogging( LoggingConstants.DEBUG ) )
                Log.log( LoggingConstants.DEBUG, "checking argument factory for " + typeName );

            if( !argumentObjectFactories.ContainsKey( typeName ) )
            {
                /*
                if( type.IsInterface || type.IsAbstract )
                {
                    if( Log.isLogging( LoggingConstants.DEBUG ) )
                        Log.log( LoggingConstants.DEBUG, "type is an interface or abstract/static" );

                    Type mappedType = Weborb.Types.Types.GetAbstractClassMapping( type );

                    if( mappedType != null )
                        return ObjectFactories.CreateServiceObject( mappedType );
                }*/

                return null;
            }

			IArgumentObjectFactory objectFactory;
            argumentObjectFactories.TryGetValue( typeName, out objectFactory );

            if( Log.isLogging( LoggingConstants.DEBUG ) )
                Log.log( LoggingConstants.DEBUG, "will use argument factory " + objectFactory.ToString() );

            return objectFactory.createObject( argument );
		}
コード例 #38
0
ファイル: ParseContext.cs プロジェクト: Georotzen/.NET-SDK-1
 public void addReference( IAdaptingType adaptingType, int index )
 {
     references.Capacity = index + 1;
     references[ index ] = adaptingType;
 }
コード例 #39
0
ファイル: ParseContext.cs プロジェクト: Georotzen/.NET-SDK-1
    public void addReference( IAdaptingType type )
		{
			references.Add( type );
		}
コード例 #40
0
 public void setType( IAdaptingType type )
   {
   this.realType = type;
   }
コード例 #41
0
ファイル: Header.cs プロジェクト: Georotzen/.NET-SDK-1
		public Header( String headerName, bool mustUnderstand, int length, IAdaptingType dataObject )
		{
			this.headerName = headerName;
			this.mustUnderstand = mustUnderstand;
			this.headerValue = dataObject;
		}
コード例 #42
0
ファイル: RefObject.cs プロジェクト: Georotzen/.NET-SDK-1
 public RefObject( int refId, IAdaptingType refObject )
 {
   Id = refId;
   Object = refObject;
 }
コード例 #43
0
 public bool HasObject(IAdaptingType key)
 {
     return HasObject( key, key.getDefaultType() );
     //return cache.ContainsKey(key) && cache.Count > 0;
 }
コード例 #44
0
ファイル: NamedObject.cs プロジェクト: Georotzen/.NET-SDK-1
 public NamedObject( string objectName, IAdaptingType typedObject )
   {
   this.objectName = objectName;
   this.typedObject = typedObject;
   this.mappedType = Types.Types.getServerTypeForClientClass( objectName );
   }
コード例 #45
0
ファイル: ObjectFactories.cs プロジェクト: Mohamie/.NET-SDK
 public static object CreateArgumentObject(Type type, IAdaptingType argument)
 {
     return(ORBConfig.GetInstance().getObjectFactories()._CreateArgumentObject(type, argument));
 }
コード例 #46
0
 public static object CreateArgumentObject( string typeName, IAdaptingType argument )
 {
     Type type = TypeLoader.LoadType( typeName );
     return ORBConfig.GetInstance().getObjectFactories()._CreateArgumentObject( type, argument );
 }
コード例 #47
0
 public static object CreateArgumentObject( Type type, IAdaptingType argument )
 {
     return ORBConfig.GetInstance().getObjectFactories()._CreateArgumentObject( type, argument );
 }
コード例 #48
0
ファイル: ObjectFactories.cs プロジェクト: Mohamie/.NET-SDK
        public static object CreateArgumentObject(String typeName, IAdaptingType argument)
        {
            Type type = TypeLoader.LoadType(typeName);

            return(ORBConfig.GetInstance().getObjectFactories()._CreateArgumentObject(type, argument));
        }
コード例 #49
0
 public void AddObject(IAdaptingType adapter, Object value)
 {
     AddObject(adapter, adapter.getDefaultType(), value);
 }
コード例 #50
0
ファイル: ParseContext.cs プロジェクト: Georotzen/.NET-SDK-1
 public void setParsedObject( int index, IAdaptingType obj )
 {
   parsedObjects[ index ] = obj;
 }
コード例 #51
0
ファイル: ParseContext.cs プロジェクト: Georotzen/.NET-SDK-1
 public int addParsedObject( IAdaptingType obj )
 {
   parsedObjects.Add( obj );
   return parsedObjects.Count - 1;
 }