118
118
return new MsgStore (StoreHandle);
121
public Table GetMsgStoresTable(int flags) {
122
IntPtr TableHandle = IntPtr.Zero;
125
int hr = CMapi_Session_GetMsgStoresTable (cobj, (uint) flags, out TableHandle);
127
if(TableHandle != IntPtr.Zero) {
128
table = new Table (TableHandle);
130
Transmogrify.CheckHResult (hr);
135
public MsgStore OpenMsgStore(uint uiParam, byte[] entryId, NMapiGuid interFace, OpenStoreFlags flags) {
136
using (MemContext MemCtx = new MemContext ()) {
137
IntPtr storeHandle = IntPtr.Zero;
138
IntPtr ifHandle = Transmogrify.GuidToPtr (interFace, MemCtx);
141
int hr = CMapi_Session_OpenMsgStore (cobj, uiParam, (uint) entryId.Length, entryId, ifHandle, (uint) flags, out storeHandle);
142
Transmogrify.CheckHResult (hr);
144
if(storeHandle != IntPtr.Zero) {
145
ret = new MsgStore(storeHandle);
121
152
public IMsgStore OpenStore (OpenStoreFlags flags, string user, bool isPublic) {
123
154
if (CMapi.IsNative == false) {
124
155
return OpenStoreUMapi (isPublic);
128
int hr = CMapi_Session_GetMsgStoresTable (cobj, 0, out TableHandle);
129
Transmogrify.CheckHResult (hr);
131
Table table = new Table (TableHandle);
158
Table table = GetMsgStoresTable(0);
134
161
PropertyTag[] cols = PropertyTag.ArrayFromIntegers (Property.EntryId,
154
181
throw new MapiNoSupportException ("Didn't found exactly one store, found " + RowSet.Count + " stores");
158
hr = CMapi_Session_OpenMsgStore (cobj, 0, (uint) StoreId.Length, StoreId, IntPtr.Zero, (uint) flags, out storeHandle);
159
Transmogrify.CheckHResult (hr);
160
return new MsgStore (storeHandle);
184
return OpenMsgStore(0, StoreId, null, flags);
162
185
} catch (Exception e) {
164
187
throw new NotSupportedException ("Error opening Message Store", e);