示例#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));
            }
        }
 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*/));
        }