public int[] AsyncWriteItems(int[] serverIds, object[] values, int transactionId, out int cancelId)
        {
            cancelId = 0;
            if (@group == null)
            {
                throw new ObjectDisposedException("Group");
            }
            if (asyncIO == null)
            {
                throw new NotSupportedException();
            }
            serverIds.ArgumentNotNull("serverIds");
            if (serverIds.Length == 0)
            {
                return(new int[0]);
            }

            using (var writer = new ItemValueWriter(values))
            {
                int    tmp;
                IntPtr errorsPtr;
                asyncIO.Write((uint)serverIds.Length, serverIds, writer.Values, transactionId, out tmp, out errorsPtr);

                cancelId = tmp;
                return(ItemResultReader.Read(serverIds.Length, errorsPtr));
            }
        }
        public int[] SyncWriteItems(int[] serverIds, object[] values)
        {
            if (@group == null)
            {
                throw new ObjectDisposedException("Group");
            }
            serverIds.ArgumentNotNull("serverIds");
            values.ArgumentNotNull("values");
            if (serverIds.Length == 0)
            {
                return(new int[0]);
            }

            using (var writer = new ItemValueWriter(values))
            {
                IntPtr errorsPtr;
                syncIO.Write((uint)serverIds.Length, serverIds, writer.Values, out errorsPtr);

                return(ItemResultReader.Read(serverIds.Length, errorsPtr));
            }
        }
Пример #3
0
        public int[] AsyncWriteItems(int[] serverIds, object[] values, int transactionId, out int cancelId)
        {
            cancelId = 0;
			if(@group == null)
				throw new ObjectDisposedException("Group");
			if(asyncIO == null)
				throw new NotSupportedException();
			serverIds.ArgumentNotNull("serverIds");
            if (serverIds.Length == 0)
                return new int[0];

            using(var writer = new ItemValueWriter(values))
            {
                int tmp;
                IntPtr errorsPtr;
                asyncIO.Write((uint)serverIds.Length, serverIds, writer.Values, transactionId, out tmp, out errorsPtr);

                cancelId = tmp;
                return ItemResultReader.Read(serverIds.Length, errorsPtr);
            }
        }
Пример #4
0
        public int[] SyncWriteItems(int[] serverIds, object[] values)
		{
			if(@group == null)
				throw new ObjectDisposedException("Group");
			serverIds.ArgumentNotNull("serverIds");
			values.ArgumentNotNull("values");
			if(serverIds.Length == 0)
				return new int[0];

			using(var writer = new ItemValueWriter(values))
			{
                IntPtr errorsPtr;
                syncIO.Write((uint)serverIds.Length, serverIds, writer.Values, out errorsPtr);

                return ItemResultReader.Read(serverIds.Length, errorsPtr);
			}
		}