예제 #1
0
 public static void _Load(ClientObject clientObject, LoadOption loadOption)
 {
     clientObject.Context.Load(clientObject, loadOption);
 }
 public InstantiateActionResultHandler(ClientObject clientObject)
 {
     this.m_clientObject = clientObject;
 }
예제 #3
0
 public static void _AddActionResultHandler(ClientObject clientObj, Action action, IResultHandler resultHandler)
 {
     clientObj.Context._PendingRequest.AddActionResultHandler(action, resultHandler);
 }
예제 #4
0
        public static ObjectPath _CreateChildItemObjectPathUsingIndexerOrGetItemAt(bool hasIndexerMethod, ClientRequestContext context, ClientObject parent, JToken childItem, int index)
        {
            var id = childItem[Constants.Id];

            if (Utility._IsNullOrUndefined(id))
            {
                id = childItem[Constants.IdPrivate];
            }

            if (hasIndexerMethod && !Utility._IsNullOrUndefined(id))
            {
                return(ObjectPathFactory._CreateChildItemObjectPathUsingIndexer(context, parent, childItem));
            }
            else
            {
                return(ObjectPathFactory._CreateChildItemObjectPathUsingGetItemAt(context, parent, childItem, index));
            }
        }
예제 #5
0
 public void Load(ClientObject clientObject)
 {
     this.Load(clientObject, null);
 }
예제 #6
0
        public static ObjectPath _CreateMethodObjectPath(ClientRequestContext context, ClientObject parent, string methodName, OperationType operationType, object[] args, bool isCollection, bool isInvalidAfterRequest)
        {
            ObjectPathInfo objectPathInfo = new ObjectPathInfo()
            {
                Id                 = context._NextId(),
                ObjectPathType     = ObjectPathType.Method,
                Name               = methodName,
                ParentObjectPathId = parent._ObjectPath.ObjectPathInfo.Id,
                ArgumentInfo       = new ArgumentInfo()
            };
            List <ObjectPath> argumentObjectPaths = Utility.SetMethodArguments(context, objectPathInfo.ArgumentInfo, args);
            ObjectPath        ret = new ObjectPath(objectPathInfo, parent._ObjectPath, isCollection, isInvalidAfterRequest);

            ret.ArgumentObjectPaths = argumentObjectPaths;
            ret.IsWriteOperation    = (operationType != OperationType.Read);
            return(ret);
        }
예제 #7
0
        public static ObjectPath _CreateIndexerObjectPath(ClientRequestContext context, ClientObject parent, object[] args)
        {
            ObjectPathInfo objectPathInfo = new ObjectPathInfo()
            {
                Id                 = context._NextId(),
                ObjectPathType     = ObjectPathType.Indexer,
                Name               = "",
                ParentObjectPathId = parent._ObjectPath.ObjectPathInfo.Id,
                ArgumentInfo       = new ArgumentInfo()
            };

            objectPathInfo.ArgumentInfo.Arguments = args;
            return(new ObjectPath(objectPathInfo, parent._ObjectPath, false /*isCollection*/, false /*isInvalidAfterRequest*/));
        }
예제 #8
0
        public static ObjectPath _CreatePropertyObjectPath(ClientRequestContext context, ClientObject parent, string propertyName, bool isCollection, bool isInvalidAfterRequest)
        {
            ObjectPathInfo objectPathInfo = new ObjectPathInfo()
            {
                Id                 = context._NextId(),
                ObjectPathType     = ObjectPathType.Property,
                Name               = propertyName,
                ParentObjectPathId = parent._ObjectPath.ObjectPathInfo.Id,
            };

            return(new ObjectPath(objectPathInfo, parent._ObjectPath, isCollection, isInvalidAfterRequest));
        }
예제 #9
0
        public static ObjectPath _CreateChildItemObjectPathUsingGetItemAt(ClientRequestContext context, ClientObject parent, JToken childItem, int index)
        {
            JToken indexFromServer = childItem[Constants.Index];

            if (!Utility._IsNullOrUndefined(indexFromServer))
            {
                index = indexFromServer.Value <int>();
            }

            ObjectPathInfo objectPathInfo = new ObjectPathInfo()
            {
                Id                 = context._NextId(),
                ObjectPathType     = ObjectPathType.Method,
                Name               = Constants.GetItemAt,
                ParentObjectPathId = parent._ObjectPath.ObjectPathInfo.Id,
                ArgumentInfo       = new ArgumentInfo()
            };

            objectPathInfo.ArgumentInfo.Arguments = new object[] { index };
            return(new ObjectPath(objectPathInfo, parent._ObjectPath, false /*isCollection*/, false /*isInvalidAfterRequest*/));
        }
예제 #10
0
        public static ObjectPath _CreateChildItemObjectPathUsingIndexer(ClientRequestContext context, ClientObject parent, JToken childItem)
        {
            var id = childItem[Constants.Id];

            if (Utility._IsNullOrUndefined(id))
            {
                id = childItem[Constants.IdPrivate];
            }

            ObjectPathInfo objectPathInfo = new ObjectPathInfo()
            {
                Id                 = context._NextId(),
                ObjectPathType     = ObjectPathType.Indexer,
                Name               = "",
                ParentObjectPathId = parent._ObjectPath.ObjectPathInfo.Id,
                ArgumentInfo       = new ArgumentInfo()
            };

            objectPathInfo.ArgumentInfo.Arguments = new object[] { id };
            return(new ObjectPath(objectPathInfo, parent._ObjectPath, false /*isCollection*/, false /*isInvalidAfterRequest*/));
        }