コード例 #1
0
ファイル: NspiClient.cs プロジェクト: YHZX2013/exchange_diff
        public NspiStatus GetProps(NspiGetPropsFlags flags, IList <PropTag> propTags, out PropRow row)
        {
            int[] intArrayFromPropTagArray = NspiClient.GetIntArrayFromPropTagArray(propTags);
            this.MarshalStatToNative();
            SafeRpcMemoryHandle rowHandle;
            NspiStatus          props = this.client.GetProps(flags, this.statHandle.DangerousGetHandle(), intArrayFromPropTagArray, out rowHandle);

            this.MarshalNativeToStat();
            row = NspiClient.GetRowAndDisposeHandle(rowHandle);
            return(props);
        }
コード例 #2
0
ファイル: NspiClient.cs プロジェクト: YHZX2013/exchange_diff
        public NspiStatus QueryRows(NspiQueryRowsFlags flags, int[] mids, int count, IList <PropTag> propTags, out PropRowSet rowset)
        {
            int[] intArrayFromPropTagArray = NspiClient.GetIntArrayFromPropTagArray(propTags);
            this.MarshalStatToNative();
            SafeRpcMemoryHandle rowsetHandle;
            NspiStatus          result = this.client.QueryRows(flags, this.statHandle.DangerousGetHandle(), mids, count, intArrayFromPropTagArray, out rowsetHandle);

            this.MarshalNativeToStat();
            rowset = NspiClient.GetRowSetAndDisposeHandle(rowsetHandle);
            return(result);
        }
コード例 #3
0
ファイル: NspiClient.cs プロジェクト: YHZX2013/exchange_diff
        public NspiStatus ModProps(IList <PropTag> propTags, PropRow row)
        {
            int[]      intArrayFromPropTagArray = NspiClient.GetIntArrayFromPropTagArray(propTags);
            NspiStatus result;

            using (SafeRpcMemoryHandle safeRpcMemoryHandle = new SafeRpcMemoryHandle(row.GetBytesToMarshal()))
            {
                SafeRpcMemoryHandle safeRpcMemoryHandle2 = NspiMarshal.MarshalPropValueCollection(row.Properties);
                row.MarshalledPropertiesHandle = safeRpcMemoryHandle2;
                safeRpcMemoryHandle.AddAssociatedHandle(safeRpcMemoryHandle2);
                row.MarshalToNative(safeRpcMemoryHandle);
                this.MarshalStatToNative();
                NspiStatus nspiStatus = this.client.ModProps(this.statHandle.DangerousGetHandle(), intArrayFromPropTagArray, safeRpcMemoryHandle.DangerousGetHandle());
                this.MarshalNativeToStat();
                result = nspiStatus;
            }
            return(result);
        }
コード例 #4
0
ファイル: NspiClient.cs プロジェクト: YHZX2013/exchange_diff
        public NspiStatus SeekEntries(PropValue propValue, int[] mids, IList <PropTag> propTags, out PropRowSet rowset)
        {
            int[]             intArrayFromPropTagArray = NspiClient.GetIntArrayFromPropTagArray(propTags);
            IList <PropValue> list = new List <PropValue>();

            list.Add(propValue);
            NspiStatus result;

            using (SafeRpcMemoryHandle safeRpcMemoryHandle = new SafeRpcMemoryHandle(propValue.GetBytesToMarshal()))
            {
                PropValue.MarshalToNative(list, safeRpcMemoryHandle);
                this.MarshalStatToNative();
                SafeRpcMemoryHandle rowsetHandle;
                NspiStatus          nspiStatus = this.client.SeekEntries(this.statHandle.DangerousGetHandle(), safeRpcMemoryHandle.DangerousGetHandle(), mids, intArrayFromPropTagArray, out rowsetHandle);
                this.MarshalNativeToStat();
                rowset = NspiClient.GetRowSetAndDisposeHandle(rowsetHandle);
                result = nspiStatus;
            }
            return(result);
        }
コード例 #5
0
ファイル: NspiClient.cs プロジェクト: YHZX2013/exchange_diff
        public NspiStatus GetMatches(Restriction restriction, object propName, int maxRows, IList <PropTag> propTags, out int[] mids, out PropRowSet rowset)
        {
            NspiStatus result;

            using (SafeRpcMemoryHandle safeRpcMemoryHandle = new SafeRpcMemoryHandle())
            {
                if (restriction != null)
                {
                    safeRpcMemoryHandle.Allocate(restriction.GetBytesToMarshalNspi());
                    restriction.MarshalToNativeNspi(safeRpcMemoryHandle);
                }
                int[] intArrayFromPropTagArray = NspiClient.GetIntArrayFromPropTagArray(propTags);
                this.MarshalStatToNative();
                SafeRpcMemoryHandle rowsetHandle;
                NspiStatus          matches = this.client.GetMatches(this.statHandle.DangerousGetHandle(), safeRpcMemoryHandle.DangerousGetHandle(), IntPtr.Zero, maxRows, intArrayFromPropTagArray, out mids, out rowsetHandle);
                this.MarshalNativeToStat();
                rowset = NspiClient.GetRowSetAndDisposeHandle(rowsetHandle);
                result = matches;
            }
            return(result);
        }
コード例 #6
0
ファイル: NspiClient.cs プロジェクト: YHZX2013/exchange_diff
        public NspiStatus ResolveNames(byte[][] names, IList <PropTag> propTags, out ResolveResult[] results, out PropRowSet rowset)
        {
            int[] intArrayFromPropTagArray = NspiClient.GetIntArrayFromPropTagArray(propTags);
            this.MarshalStatToNative();
            int[] array;
            SafeRpcMemoryHandle rowsetHandle;
            NspiStatus          result = this.client.ResolveNames(this.statHandle.DangerousGetHandle(), intArrayFromPropTagArray, names, out array, out rowsetHandle);

            this.MarshalNativeToStat();
            rowset = NspiClient.GetRowSetAndDisposeHandle(rowsetHandle);
            if (array != null)
            {
                results = new ResolveResult[array.Length];
                for (int i = 0; i < array.Length; i++)
                {
                    results[i] = (ResolveResult)array[i];
                }
            }
            else
            {
                results = null;
            }
            return(result);
        }