PageRenderTime 35ms CodeModel.GetById 28ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/Visual Studio 2008/CSWebBrowserWithProxy/INTERNET_PER_CONN_OPTION.cs

#
C# | 78 lines | 40 code | 6 blank | 32 comment | 0 complexity | fb7d0a74147c9b74e3a2fb5c810f712c MD5 | raw file
 1/****************************** Module Header ******************************\
 2 Module Name:  INTERNET_PER_CONN_OPTION.cs
 3 Project:      CSWebBrowserWithProxy
 4 Copyright (c) Microsoft Corporation.
 5 
 6 This file defines the struct INTERNET_PER_CONN_OPTION and constants used by it.
 7 The struct INTERNET_PER_CONN_OPTION contains the value of an option that to be 
 8 set to internet settings.
 9 Visit http://msdn.microsoft.com/en-us/library/aa385145(VS.85).aspx to get the 
10 detailed description.
11 
12 This source is subject to the Microsoft Public License.
13 See http://www.microsoft.com/opensource/licenses.mspx#Ms-PL.
14 All other rights reserved.
15 
16 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, 
17 EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED 
18 WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
19\***************************************************************************/
20
21using System.Runtime.InteropServices;
22
23namespace CSWebBrowserWithProxy
24{
25
26    /// <summary>
27    /// Constants used in INTERNET_PER_CONN_OPTION_OptionUnion struct.
28    /// </summary>
29    public enum INTERNET_PER_CONN_OptionEnum
30    {
31        INTERNET_PER_CONN_FLAGS = 1,
32        INTERNET_PER_CONN_PROXY_SERVER = 2,
33        INTERNET_PER_CONN_PROXY_BYPASS = 3,
34        INTERNET_PER_CONN_AUTOCONFIG_URL = 4,
35        INTERNET_PER_CONN_AUTODISCOVERY_FLAGS = 5,
36        INTERNET_PER_CONN_AUTOCONFIG_SECONDARY_URL = 6,
37        INTERNET_PER_CONN_AUTOCONFIG_RELOAD_DELAY_MINS = 7,
38        INTERNET_PER_CONN_AUTOCONFIG_LAST_DETECT_TIME = 8,
39        INTERNET_PER_CONN_AUTOCONFIG_LAST_DETECT_URL = 9,
40        INTERNET_PER_CONN_FLAGS_UI = 10
41    }
42
43    /// <summary>
44    /// Constants used in INTERNET_PER_CONN_OPTON struct.
45    /// </summary>
46    public enum INTERNET_OPTION_PER_CONN_FLAGS
47    {
48        PROXY_TYPE_DIRECT = 0x00000001,   // direct to net
49        PROXY_TYPE_PROXY = 0x00000002,   // via named proxy
50        PROXY_TYPE_AUTO_PROXY_URL = 0x00000004,   // autoproxy URL
51        PROXY_TYPE_AUTO_DETECT = 0x00000008   // use autoproxy detection
52    }
53    
54    /// <summary>
55    /// Used in INTERNET_PER_CONN_OPTION.
56    /// When create a instance of OptionUnion, only one filed will be used.
57    /// The StructLayout and FieldOffset attributes could help to decrease the struct size.
58    /// </summary>
59    [StructLayout(LayoutKind.Explicit)]
60    public struct INTERNET_PER_CONN_OPTION_OptionUnion
61    {
62        // A value in INTERNET_OPTION_PER_CONN_FLAGS.
63        [FieldOffset(0)]
64        public int dwValue;
65        [FieldOffset(0)]
66        public System.IntPtr pszValue;
67        [FieldOffset(0)]
68        public System.Runtime.InteropServices.ComTypes.FILETIME ftValue;
69    }
70
71    [StructLayout(LayoutKind.Sequential)]
72    public struct INTERNET_PER_CONN_OPTION
73    {
74        // A value in INTERNET_PER_CONN_OptionEnum.
75        public int dwOption;
76        public INTERNET_PER_CONN_OPTION_OptionUnion Value;
77    }
78}