This repository was archived by the owner on Nov 7, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfolder.cs
More file actions
executable file
·83 lines (73 loc) · 2.31 KB
/
folder.cs
File metadata and controls
executable file
·83 lines (73 loc) · 2.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/*---------------------------------------------------------------------
Copyright (C) Microsoft Corporation. All rights reserved.
This source code is intended only as a supplement to Microsoft
Development Tools and/or on-line documentation. See these other
materials for detailed information regarding Microsoft code samples.
THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
PARTICULAR PURPOSE.
----------------------------------------------------------------------- *
* File: Folder.cs
*
* Purpose: Managed representation of the IFolder interface
*
* Copyright (c) Microsoft, 2001-2002
*
* Notes:
* This is a wrapper around an ItemCollection
*
*/
namespace PocketOutlook
{
using System;
using System.Runtime.InteropServices;
public class Folder
{
private Application m_application;
private IntPtr m_pIFolder;
internal Folder(Application application, IntPtr pIFolder)
{
m_application = application;
m_pIFolder = pIFolder;
}
public ItemCollection Items
{
get
{
IntPtr pItemCollection = new IntPtr(0);
long hResult = do_get_Items(m_pIFolder, ref pItemCollection);
try
{
PocketOutlook.CheckHRESULT( (int) hResult);
}
catch (Exception)
{
PocketOutlook.ReleaseCOMPtr(pItemCollection);
throw;
}
return new ItemCollection(m_application, this.DefaultItemType, ref pItemCollection);
}
}
public int DefaultItemType
{
get
{
int tItemType = 0;
PocketOutlook.CheckHRESULT(do_get_DefaultItemType(m_pIFolder, ref tItemType));
return tItemType;
}
}
public Application Application
{
get
{
return m_application;
}
}
[DllImport("PocketOutlook.dll", EntryPoint="IFolder_get_Items")]
private static extern int do_get_Items(IntPtr pIFolder, ref IntPtr pItemCollection);
[DllImport("PocketOutlook.dll", EntryPoint="IFolder_get_DefaultItemType")]
private static extern int do_get_DefaultItemType(IntPtr pIFolder, ref int tItemType);
}
}