├── InTheHand.Windows.Forms
├── SendKeys.cs
├── Properties
│ └── AssemblyInfo.cs
├── IWin32Window.cs
├── MethodInvoker.cs
├── PowerLineStatus.cs
├── Button.cs
├── BatteryChargeStatus.cs
├── Help.cs
├── TabControl.cs
└── ProgressBar.cs
├── InTheHand.IO
├── Properties
│ └── AssemblyInfo.cs
├── WatcherChangeTypes.cs
├── IsolatedStorage
│ └── IsolatedStorageException.cs
├── RenamedEventArgs.cs
├── NotifyFilters.cs
└── FileSystemEventArgs.cs
├── InTheHand.Phone
├── Properties
│ └── AssemblyInfo.cs
├── Tasks
│ ├── TaskResult.cs
│ ├── EmailResult.cs
│ ├── PhoneNumberResult.cs
│ ├── SmsComposeTask.cs
│ ├── MediaPlayerLauncher.cs
│ ├── TaskEventArgs.cs
│ ├── PhotoResult.cs
│ ├── WebBrowserTask.cs
│ ├── ChooserBase.cs
│ ├── EmailComposeTask.cs
│ ├── EmailAddressChooserTask.cs
│ ├── PhoneNumberChooserTask.cs
│ └── CameraCaptureTask.cs
├── Devices
│ ├── DeviceType.cs
│ └── Environment.cs
└── Info
│ └── PowerSource.cs
├── InTheHand.Windows
├── Properties
│ └── AssemblyInfo.cs
├── MessageBoxButton.cs
├── MessageBoxResult.cs
├── MessageBoxImage.cs
└── InTheHand.Windows.csproj
├── InTheHand.Net
├── Properties
│ └── AssemblyInfo.cs
├── INTERNET_STATUS.cs
├── WebRequest.cs
└── Mime
│ └── MediaTypeNames.cs
├── InTheHand.Device.Location
├── Properties
│ └── AssemblyInfo.cs
├── GeoPositionStatus.cs
├── GeoPosition.cs
├── ICivicAddressResolver.cs
└── IGeoCoordinateResolver.cs
├── InTheHand.Security.Cryptography
├── Properties
│ ├── AssemblyInfo.cs
│ └── Resources.Designer.cs
└── InTheHand.Security.Cryptography.csproj
├── InTheHand.Net.ConnectionManager
├── Properties
│ └── AssemblyInfo.cs
├── ConnectionStatusChangedEventArgs.cs
├── Destination.cs
├── ConnectionPriority.cs
└── ConnectionStatus.cs
├── InTheHand.WindowsMobile.Net
├── Properties
│ └── AssemblyInfo.cs
└── InTheHand.WindowsMobile.Net.csproj
├── InTheHand.Net.NetworkInformation
├── Properties
│ ├── AssemblyInfo.cs
│ └── Resources.Designer.cs
├── OperationalStatus.cs
├── NetBiosNodeType.cs
├── NetworkInformationException.cs
├── PingException.cs
├── MulticastIPAddressInformation.cs
├── TcpState.cs
├── TcpConnectionInformation.cs
├── IPAddressInformation.cs
├── PingReply.cs
└── UnicastIPAddressInformation.cs
├── InTheHand.WindowsMobile.Configuration
├── Properties
│ └── AssemblyInfo.cs
├── NativeMethods.cs
├── TrustLevel.cs
└── InTheHand.WindowsMobile.Configuration.csproj
├── InTheHand.Diagnostics
├── Properties
│ └── AssemblyInfo.cs
├── ProcessModule.cs
└── InTheHand.Diagnostics.csproj
├── InTheHand.Drawing
├── Properties
│ └── AssemblyInfo.cs
├── Drawing2D
│ └── LinearGradientMode.cs
├── ColorTranslator.cs
├── RECT.cs
├── Icon.cs
└── SystemFonts.cs
├── InTheHand
├── Threading
│ ├── WaitHandleCannotBeOpenedException.cs
│ └── Thread.cs
├── Text
│ └── Encoding.cs
├── Collections
│ ├── Specialized
│ │ ├── NotifyCollectionChangedAction.cs
│ │ └── INotifyCollectionChanged.cs
│ └── ArrayListHelper.cs
├── Globalization
│ └── TextInfo.cs
├── IntPtr.cs
├── Decimal.cs
├── Guid.cs
├── Runtime
│ └── InteropServices
│ │ └── SYSTEMTIME.cs
├── String.cs
├── Reflection
│ └── Assembly.cs
├── ComponentModel
│ ├── RunWorkerCompletedEventArgs.cs
│ └── DoWorkEventArgs.cs
├── Properties
│ └── AssemblyInfo.cs
├── WindowsCE
│ └── Forms
│ │ └── SystemSettings.cs
├── Type.cs
└── IO
│ └── Stream.cs
├── LICENSE
├── README.md
└── SharedAssemblyInfo.cs
/InTheHand.Windows.Forms/SendKeys.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/inthehand/compactframework/HEAD/InTheHand.Windows.Forms/SendKeys.cs
--------------------------------------------------------------------------------
/InTheHand.IO/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("InTheHand.IO")]
9 | [assembly: AssemblyDescription("IO for Windows Embedded")]
10 |
11 |
--------------------------------------------------------------------------------
/InTheHand.Phone/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("InTheHand.Phone")]
9 | [assembly: AssemblyDescription("Phone APIs for the .NET Compact Framework")]
--------------------------------------------------------------------------------
/InTheHand.Windows/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("InTheHand.Windows")]
9 | [assembly: AssemblyDescription("Windows for the .NET Compact Framework")]
--------------------------------------------------------------------------------
/InTheHand.Net/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("InTheHand.Net")]
9 | [assembly: AssemblyDescription("Networking extensions for the .NET Compact Framework")]
--------------------------------------------------------------------------------
/InTheHand.Device.Location/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("InTheHand.Device.Location")]
9 | [assembly: AssemblyDescription("Geolocation for the .NET Compact Framework")]
--------------------------------------------------------------------------------
/InTheHand.Security.Cryptography/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("InTheHand.Security.Cryptography")]
9 | [assembly: AssemblyDescription("Security for the .NET Compact Framework")]
--------------------------------------------------------------------------------
/InTheHand.Windows.Forms/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("InTheHand.Windows.Forms")]
9 | [assembly: AssemblyDescription("WinForms controls and classes for the .NET Compact Framework")]
--------------------------------------------------------------------------------
/InTheHand.Net.ConnectionManager/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("InTheHand.Net.ConnectionManager")]
9 | [assembly: AssemblyDescription("Connection Manager API for the .NET Compact Framework")]
--------------------------------------------------------------------------------
/InTheHand.WindowsMobile.Net/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("InTheHand.WindowsMobile.Net")]
9 | [assembly: AssemblyDescription("Windows Mobile specific networking APIs for .NET Compact Framework")]
--------------------------------------------------------------------------------
/InTheHand.Net.NetworkInformation/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("InTheHand.Net.NetworkInformation")]
9 | [assembly: AssemblyDescription("Network Information for the .NET Compact Framework")]
10 |
--------------------------------------------------------------------------------
/InTheHand.WindowsMobile.Configuration/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("InTheHand.WindowsMobile.Configuration")]
9 | [assembly: AssemblyDescription("Windows Mobile Configuration for the .NET Compact Framework")]
--------------------------------------------------------------------------------
/InTheHand.Windows.Forms/IWin32Window.cs:
--------------------------------------------------------------------------------
1 | // In The Hand - .NET Components for Mobility
2 | //
3 | // InTheHand.Windows.Forms.IWin32Window
4 | //
5 | // Copyright (c) 2007-2012 In The Hand Ltd, All rights reserved.
6 |
7 | using System;
8 |
9 | namespace InTheHand.Windows.Forms
10 | {
11 | ///
12 | /// Provides an interface to expose Win32 HWND handles.
13 | ///
14 | public interface IWin32Window
15 | {
16 | ///
17 | /// Gets the handle to the window represented by the implementer.
18 | ///
19 | /// A handle to the window represented by the implementer.
20 | /// Depending on the implementer, the value of the Handle property could change during the life of the window.
21 | IntPtr Handle { get; }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/InTheHand.Windows.Forms/MethodInvoker.cs:
--------------------------------------------------------------------------------
1 | // In The Hand - .NET Components for Mobility
2 | //
3 | // InTheHand.Windows.Forms.MethodInvoker
4 | //
5 | // Copyright (c) 2007-2012 In The Hand Ltd, All rights reserved.
6 |
7 | using System;
8 | using System.Windows.Forms;
9 |
10 |
11 | namespace InTheHand.Windows.Forms
12 | {
13 | ///
14 | /// Represents a delegate that can execute any method in managed code that is declared void and takes no parameters.
15 | ///
16 | /// MethodInvoker provides a simple delegate that is used to invoke a method with a void parameter list.
17 | /// This delegate can be used when making calls to a control's method, or when you need a simple delegate but do not want to define one yourself.
18 | public delegate void MethodInvoker();
19 | }
--------------------------------------------------------------------------------
/InTheHand.Diagnostics/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("InTheHand.Diagnostics")]
9 | [assembly: AssemblyDescription("Diagnostics for the .NET Compact Framework")]
10 |
11 | [assembly: InternalsVisibleTo("InTheHand.Phone, PublicKey=002400000480000094000000060200000024000052534131000400000100010029d499ba127ccaf5cf437aa425461810bb0412dae927733df396adb06b7815c87534cee2a3bd86230bd347e072a92d1a1c08e77ecb3ed0c6e1de4fed625aa06774f5ef8a186d36e0aaad129993e5eae7b31223575867c659c108615b07797059a8aabd31395ff42baf24b0bbee86cbf8b9ecb4e887127a90fcbd7bb2569207ae")]
12 |
--------------------------------------------------------------------------------
/InTheHand.Drawing/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("InTheHand.Drawing")]
9 | [assembly: AssemblyDescription("Drawing extensions for the .NET Compact Framework")]
10 |
11 | [assembly: InternalsVisibleTo("InTheHand.Windows.Forms, PublicKey=002400000480000094000000060200000024000052534131000400000100010029d499ba127ccaf5cf437aa425461810bb0412dae927733df396adb06b7815c87534cee2a3bd86230bd347e072a92d1a1c08e77ecb3ed0c6e1de4fed625aa06774f5ef8a186d36e0aaad129993e5eae7b31223575867c659c108615b07797059a8aabd31395ff42baf24b0bbee86cbf8b9ecb4e887127a90fcbd7bb2569207ae")]
12 |
--------------------------------------------------------------------------------
/InTheHand.Windows.Forms/PowerLineStatus.cs:
--------------------------------------------------------------------------------
1 | // In The Hand - .NET Components for Mobility
2 | //
3 | // InTheHand.Windows.Forms.PowerLineStatus
4 | //
5 | // Copyright (c) 2002-2010 In The Hand Ltd, All rights reserved.
6 |
7 | using System;
8 |
9 | namespace InTheHand.Windows.Forms
10 | {
11 | ///
12 | /// Specifies the system power status.
13 | ///
14 | public enum PowerLineStatus : byte
15 | {
16 | ///
17 | /// The system is offline.
18 | ///
19 | Offline = 0x00,
20 |
21 | ///
22 | /// The system is online.
23 | ///
24 | Online = 0x01,
25 |
26 | ///
27 | /// The system is on backup power.
28 | ///
29 | BackupPower = 0x02,
30 |
31 | ///
32 | /// The power status of the system is unknown.
33 | ///
34 | Unknown = 0xFF,
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/InTheHand.Phone/Tasks/TaskResult.cs:
--------------------------------------------------------------------------------
1 | // In The Hand - .NET Components for Mobility
2 | //
3 | // InTheHand.Phone.Tasks.TaskResult
4 | //
5 | // Copyright (c) 2010-12 In The Hand Ltd, All rights reserved.
6 |
7 | using System;
8 | using System.Runtime.InteropServices;
9 |
10 | namespace InTheHand.Phone.Tasks
11 | {
12 | ///
13 | /// Describes the success status of a chooser operation.
14 | ///
15 | public enum TaskResult
16 | {
17 | ///
18 | /// No success status was returned from the chooser operation.
19 | ///
20 | None,
21 |
22 | ///
23 | /// The chooser operation was successful.
24 | ///
25 | OK,
26 |
27 | ///
28 | /// The chooser operation was cancelled by the user.
29 | ///
30 | Cancel,
31 | }
32 | }
--------------------------------------------------------------------------------
/InTheHand/Threading/WaitHandleCannotBeOpenedException.cs:
--------------------------------------------------------------------------------
1 | // In The Hand - .NET Components for Mobility
2 | //
3 | // InTheHand.Threading.WaitHandleCannotBeOpenedException
4 | //
5 | // Copyright (c) 2003-2009 In The Hand Ltd, All rights reserved.
6 |
7 | #region Using directives
8 |
9 | using System;
10 |
11 | #endregion
12 |
13 | namespace InTheHand.Threading
14 | {
15 | ///
16 | /// The exception that is thrown when an attempt is made to open a system named sychronization event that does not exist.
17 | ///
18 | /// Instances of the class can represent named system synchronization objects.
19 | /// When you use the method to open a named system object that does not exist, a WaitHandleCannotBeOpenedException is thrown.
20 | public sealed class WaitHandleCannotBeOpenedException : ApplicationException
21 | {
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/InTheHand.Phone/Devices/DeviceType.cs:
--------------------------------------------------------------------------------
1 | // --------------------------------------------------------------------------------------------------------------------
2 | //
3 | // Copyright (c) 2010-14 In The Hand Ltd. All Rights Reserved.
4 | //
5 | // Peter Foot
6 | // --------------------------------------------------------------------------------------------------------------------
7 |
8 | namespace InTheHand.Devices
9 | {
10 | ///
11 | /// Defines the device type values used by the property.
12 | ///
13 | public enum DeviceType
14 | {
15 | ///
16 | /// The device type is a device emulator.
17 | ///
18 | Emulator,
19 |
20 | ///
21 | /// The device type is an actual device.
22 | ///
23 | Device,
24 | }
25 | }
--------------------------------------------------------------------------------
/InTheHand.Windows.Forms/Button.cs:
--------------------------------------------------------------------------------
1 | // In The Hand - .NET Components for Mobility
2 | //
3 | // InTheHand.Windows.Forms.Button
4 | //
5 | // Copyright (c) 2007-2012 In The Hand Ltd, All rights reserved.
6 |
7 | using System;
8 | using System.Drawing;
9 | using InTheHand.Runtime.InteropServices;
10 | using InTheHand.Drawing;
11 | using System.Windows.Forms;
12 |
13 | namespace InTheHand.Windows.Forms
14 | {
15 | ///
16 | /// Extension methods for .
17 | ///
18 | public static class ButtonInTheHand
19 | {
20 | private const int BS_MULTILINE = 0x00002000;
21 |
22 | ///
23 | /// Supports multi-line text on the Button control (to match default behaviour on the desktop).
24 | ///
25 | /// The button to update.
26 | public static void SetMultiline(this ButtonBase button)
27 | {
28 | ControlInTheHand.ModifyStyles(button.Handle, BS_MULTILINE, 0);
29 | }
30 |
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/InTheHand.Phone/Info/PowerSource.cs:
--------------------------------------------------------------------------------
1 | // --------------------------------------------------------------------------------------------------------------------
2 | //
3 | // Copyright (c) 2010-14 In The Hand Ltd. All Rights Reserved.
4 | //
5 | // Peter Foot
6 | // --------------------------------------------------------------------------------------------------------------------
7 |
8 | namespace InTheHand.Phone.Info
9 | {
10 | ///
11 | /// Indicates if the device is currently running on battery power or is plugged in to an external power supply.
12 | ///
13 | public enum PowerSource
14 | {
15 | ///
16 | /// The device is running on battery power.
17 | ///
18 | Battery = 0,
19 |
20 | ///
21 | /// The device is plugged in to an external power source, such as being docked to a computer or connected to a power supply.
22 | ///
23 | External = 1,
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/InTheHand/Text/Encoding.cs:
--------------------------------------------------------------------------------
1 | // In The Hand - .NET Components for Mobility
2 | //
3 | // InTheHand.Text.Encoding
4 | //
5 | // Copyright (c) 2010-2014 In The Hand Ltd, All rights reserved.
6 |
7 | using System;
8 | using System.Runtime.InteropServices;
9 | using System.Text;
10 |
11 | namespace InTheHand.Text
12 | {
13 | ///
14 | /// Provides extension methods for .
15 | ///
16 | public static class EncodingInTheHand
17 | {
18 | ///
19 | /// Decodes all the bytes in the specified byte array into a string
20 | ///
21 | /// The .
22 | /// The byte array containing the sequence of bytes to decode.
23 | /// A containing the results of decoding the specified sequence of bytes.
24 | public static string GetString(this Encoding e, byte[] bytes)
25 | {
26 | return e.GetString(bytes, 0, bytes.Length);
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 In The Hand Ltd
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/InTheHand.WindowsMobile.Configuration/NativeMethods.cs:
--------------------------------------------------------------------------------
1 | // In The Hand - .NET Components for Mobility
2 | //
3 | // InTheHand.WindowsMobile.Configuration.NativeMethods
4 | //
5 | // Copyright (c) 2003-2012 In The Hand Ltd, All rights reserved.
6 |
7 | using System;
8 | using System.Runtime.InteropServices;
9 |
10 | namespace InTheHand.WindowsMobile.Configuration
11 | {
12 | internal static class NativeMethods
13 | {
14 | [DllImport("aygshell", EntryPoint = "DMProcessConfigXML")]
15 | internal static extern uint ProcessConfigXML(string wXMLin, CFGFLAG flags, ref IntPtr wXMLout);
16 |
17 |
18 | [DllImport("coredll", EntryPoint = "free", SetLastError = true)]
19 | internal static extern void free(IntPtr ptr);
20 |
21 | [Flags()]
22 | internal enum CFGFLAG
23 | {
24 | PROCESS = 0x0001,
25 | METADATA = 0x0002,
26 | }
27 |
28 | [DllImport("aygshell", EntryPoint = "QueryPolicy")]
29 | internal static extern int QueryPolicy(SecurityPolicy policyId, out int policyValue);
30 |
31 | [DllImport("coredll", EntryPoint = "CeGetCurrentTrust")]
32 | internal static extern TrustLevel GetCurrentTrust();
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/InTheHand/Collections/Specialized/NotifyCollectionChangedAction.cs:
--------------------------------------------------------------------------------
1 | // In The Hand - .NET Components for Mobility
2 | //
3 | // InTheHand.Collections.Specialized.NotifyCollectionChangedAction
4 | //
5 | // Copyright (c) 2010-2014 In The Hand Ltd, All rights reserved.
6 |
7 | namespace System.Collections.Specialized
8 | {
9 | ///
10 | /// Describes the action that caused a event.
11 | ///
12 | public enum NotifyCollectionChangedAction
13 | {
14 | ///
15 | /// One or more items were added to the collection.
16 | ///
17 | Add,
18 |
19 | ///
20 | /// One or more items were removed from the collection.
21 | ///
22 | Remove,
23 |
24 | ///
25 | /// One or more items were replaced in the collection.
26 | ///
27 | Replace,
28 |
29 | ///
30 | /// One or more items were moved within the collection.
31 | ///
32 | Move,
33 |
34 | ///
35 | /// The content of the collection changed dramatically.
36 | ///
37 | Reset
38 | }
39 | }
--------------------------------------------------------------------------------
/InTheHand.WindowsMobile.Configuration/TrustLevel.cs:
--------------------------------------------------------------------------------
1 | // In The Hand - .NET Components for Mobility
2 | //
3 | // InTheHand.WindowsMobile.Configuration.TrustLevel
4 | //
5 | // Copyright (c) 2003-2010 In The Hand Ltd, All rights reserved.
6 |
7 | using System;
8 | using System.Xml;
9 | using System.Runtime.InteropServices;
10 |
11 | namespace InTheHand.WindowsMobile.Configuration
12 | {
13 | ///
14 | /// Indicates the level of trust for a process.
15 | ///
16 | ///
17 | /// Platforms Supported
18 | /// - Windows MobileWindows Mobile Version 5.0 and later
19 | ///
20 | ///
21 | public enum TrustLevel
22 | {
23 | ///
24 | /// The OEM does not trust this module.
25 | ///
26 | NoTrust = 0,
27 |
28 | ///
29 | /// The OEM trusts the module to run, but restricts the module from making certain function calls.
30 | ///
31 | Restricted = 1,
32 |
33 | ///
34 | /// The OEM trusts the module to perform any OS function calls.
35 | ///
36 | Trusted = 2,
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Compact Framework
2 | A set of APIs for Windows Mobile and Windows Embedded devices for .NET Compact Framework 3.5 and later.
3 |
4 | Originally released as a set of separate products for the .NET Compact Framework these libraries have been updated over time and converted from v2.0 to v3.5 of the runtime. They have been tested on a variety of platforms from Windows Mobile (including Windows Embedded Handheld 6.5) and other variants of Windows Embedded Compact (or CE as it is still more commonly known). Some features require OS specific functionality - for example Connection Manager was originally Windows Mobile specific but was later added to the core CE 6.0 and later versions. Check with the documentation to see which classes depend on particular OS components.
5 |
6 | The source projects are currently Visual Studio 2008 .NETCF 3.5 projects. Much of the code will compile equally on .NETCF 2.0. We're looking at adding Visual Studio 2013 projects to support Compact 2013 but you can build these yourself currently with the source. The existing binaries should work without modification on Compact 2013.
7 |
8 | The libraries were designed and developed by In The Hand Ltd. They have been made available to support ongoing development on Windows Embedded Compact and support for legacy Windows Mobile / Windows Embedded Handheld platforms.
9 |
--------------------------------------------------------------------------------
/InTheHand/Globalization/TextInfo.cs:
--------------------------------------------------------------------------------
1 | // In The Hand - .NET Components for Mobility
2 | //
3 | // InTheHand.Globalization.TextInfoInTheHand
4 | //
5 | // Copyright (c) 2012-14 In The Hand Ltd, All rights reserved.
6 |
7 | namespace InTheHand.Globalization
8 | {
9 | using System;
10 |
11 | ///
12 | /// Helper class for TextInfo.
13 | ///
14 | public static class TextInfoInTheHand
15 | {
16 | ///
17 | /// Gets a value indicating whether the TextInfo object represents a writing system where text flows from right to left.
18 | ///
19 | /// A TextInfo instance.
20 | /// true if text flows from right to left; otherwise, false.
21 | public static bool IsRightToLeft(this System.Globalization.TextInfo textInfo)
22 | {
23 | if (textInfo == null)
24 | {
25 | throw new ArgumentNullException("textInfo");
26 | }
27 |
28 | switch (textInfo.CultureName)
29 | {
30 | case "ar-SA":
31 | case "fa-IR":
32 | case "he-IL":
33 | return true;
34 | default:
35 | return false;
36 | }
37 | }
38 | }
39 | }
--------------------------------------------------------------------------------
/InTheHand.Phone/Tasks/EmailResult.cs:
--------------------------------------------------------------------------------
1 | // In The Hand - .NET Components for Mobility
2 | //
3 | // InTheHand.Phone.Tasks.EmailResult
4 | //
5 | // Copyright (c) 2010 In The Hand Ltd, All rights reserved.
6 |
7 | using System;
8 | using System.Runtime.InteropServices;
9 |
10 | namespace InTheHand.Phone.Tasks
11 | {
12 | ///
13 | /// Represents an email address returned from a call to the method of a object.
14 | ///
15 | public sealed class EmailResult : TaskEventArgs
16 | {
17 | ///
18 | /// Initializes a new instance of the class.
19 | ///
20 | public EmailResult() : base()
21 | {
22 | }
23 | ///
24 | /// Initializes a new instance of the class with the specified .
25 | ///
26 | ///
27 | public EmailResult(TaskResult taskResult) : base(taskResult)
28 | {
29 | }
30 |
31 | ///
32 | /// Gets the email address contained in the result.
33 | ///
34 | public string Email
35 | {
36 | get;
37 | set;
38 | }
39 | }
40 | }
--------------------------------------------------------------------------------
/InTheHand/Collections/Specialized/INotifyCollectionChanged.cs:
--------------------------------------------------------------------------------
1 | // In The Hand - .NET Components for Mobility
2 | //
3 | // InTheHand.Collections.Specialized.INotifyCollectionChanged
4 | //
5 | // Copyright (c) 2010-2014 In The Hand Ltd, All rights reserved.
6 |
7 | namespace System.Collections.Specialized
8 | {
9 | ///
10 | /// Notifies listeners of dynamic changes, such as when items get added and removed or the whole list is refreshed.
11 | ///
12 | /// You can enumerate over any collection that implements the interface.
13 | /// However, to set up dynamic bindings so that insertions or deletions in the collection update the UI automatically, the collection must implement the interface.
14 | /// This interface exposes the event that must be raised whenever the underlying collection changes.
15 | public interface INotifyCollectionChanged
16 | {
17 | ///
18 | /// Occurs when the collection changes.
19 | ///
20 | /// The event handler receives an argument of type ,which contains data that is related to this event.
21 | event NotifyCollectionChangedEventHandler CollectionChanged;
22 | }
23 | }
--------------------------------------------------------------------------------
/InTheHand.Windows.Forms/BatteryChargeStatus.cs:
--------------------------------------------------------------------------------
1 | // In The Hand - .NET Components for Mobility
2 | //
3 | // InTheHand.Windows.Forms.BatteryChargeStatus
4 | //
5 | // Copyright (c) 2002-2010 In The Hand Ltd, All rights reserved.
6 |
7 | using System;
8 |
9 | namespace InTheHand.Windows.Forms
10 | {
11 | ///
12 | /// Defines identifiers that indicate the current battery charge level or charging state information.
13 | ///
14 | /// This enumeration is used by the property of the class.
15 | [Flags()]
16 | public enum BatteryChargeStatus : byte
17 | {
18 | ///
19 | /// Indicates a high level of battery charge.
20 | ///
21 | High = 0x01,
22 |
23 | ///
24 | /// Indicates a low level of battery charge.
25 | ///
26 | Low = 0x02,
27 |
28 | ///
29 | /// Indicates a critically low level of battery charge.
30 | ///
31 | Critical = 0x04,
32 |
33 | ///
34 | /// Indicates a battery is charging.
35 | ///
36 | Charging = 0x08,
37 |
38 | ///
39 | /// Indicates that no battery is present.
40 | ///
41 | NoSystemBattery = 0x80,
42 |
43 | ///
44 | /// Indicates an unknown battery condition.
45 | ///
46 | Unknown = 0xFF,
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/InTheHand.Net.ConnectionManager/ConnectionStatusChangedEventArgs.cs:
--------------------------------------------------------------------------------
1 | // In The Hand - .NET Components for Mobility
2 | //
3 | // InTheHand.Net.ConnectionManager.ConnectionStatusChangedEventArgs
4 | //
5 | // Copyright (c) 2003-2010 In The Hand Ltd, All rights reserved.
6 |
7 | using System;
8 |
9 | namespace InTheHand.Net.ConnectionManager
10 | {
11 | ///
12 | /// Describes a method to handle the event.
13 | ///
14 | ///
15 | public delegate void ConnectionStatusChangedEventHandler(ConnectionStatusChangedEventArgs e);
16 |
17 | ///
18 | /// Contains information to accompany the event.
19 | ///
20 | public class ConnectionStatusChangedEventArgs : EventArgs
21 | {
22 | private ConnectionStatus connectionStatus;
23 |
24 | internal ConnectionStatusChangedEventArgs(ConnectionStatus status)
25 | {
26 | this.connectionStatus = status;
27 | }
28 |
29 | ///
30 | /// Gets the new .
31 | ///
32 | public ConnectionStatus ConnectionStatus
33 | {
34 | get
35 | {
36 | return connectionStatus;
37 | }
38 | }
39 | }
40 | }
--------------------------------------------------------------------------------
/InTheHand.Drawing/Drawing2D/LinearGradientMode.cs:
--------------------------------------------------------------------------------
1 | // --------------------------------------------------------------------------------------------------------------------
2 | //
3 | // Copyright (c) 2008-14 In The Hand Ltd. All Rights Reserved.
4 | //
5 | // Peter Foot
6 | // --------------------------------------------------------------------------------------------------------------------
7 |
8 | namespace InTheHand.Drawing.Drawing2D
9 | {
10 | ///
11 | /// Specifies the direction of a linear gradient.
12 | ///
13 | ///
14 | /// Platforms Supported
15 | /// - Windows MobileWindows Mobile Version 5.0 and later
16 | /// - Windows Embedded CompactWindows CE .NET 4.2 and later
17 | ///
18 | ///
19 | public enum LinearGradientMode
20 | {
21 | ///
22 | /// Specifies a gradient from left to right.
23 | ///
24 | Horizontal = 0x00000000,
25 |
26 | ///
27 | /// Specifies a gradient from top to bottom.
28 | ///
29 | Vertical = 0x00000001,
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/SharedAssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 | using System.Resources;
5 |
6 | // General Information about an assembly is controlled through the following
7 | // set of attributes. Change these attribute values to modify the information
8 | // associated with an assembly.
9 |
10 | [assembly: AssemblyConfiguration("Windows Embedded")]
11 |
12 | [assembly: AssemblyCompany("In The Hand Ltd")]
13 | [assembly: AssemblyProduct("Windows Embedded API")]
14 |
15 | [assembly: AssemblyCopyright("Copyright © In The Hand Ltd 2003-17")]
16 | [assembly: AssemblyTrademark("")]
17 | [assembly: AssemblyCulture("")]
18 |
19 | // Setting ComVisible to false makes the types in this assembly not visible
20 | // to COM components. If you need to access a type in this assembly from
21 | // COM, set the ComVisible attribute to true on that type.
22 | [assembly: ComVisible(false)]
23 | [assembly: System.CLSCompliant(true)]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Revision and Build Numbers
33 | // by using the '*' as shown below:
34 | [assembly: AssemblyVersion("7.9.0.0")]
35 | [assembly: AssemblyInformationalVersion("7.9.1111.0")]
36 | [assembly: NeutralResourcesLanguageAttribute("en-US")]
--------------------------------------------------------------------------------
/InTheHand/IntPtr.cs:
--------------------------------------------------------------------------------
1 | // In The Hand - .NET Components for Mobility
2 | //
3 | // InTheHand.IntPtr
4 | //
5 | // Copyright (c) 2010-2014 In The Hand Ltd, All rights reserved.
6 |
7 | using System;
8 |
9 | namespace InTheHand
10 | {
11 | ///
12 | /// Extends the functionality of .
13 | ///
14 | public static class IntPtrInTheHand
15 | {
16 | ///
17 | /// Adds an offset to the value of a pointer.
18 | ///
19 | /// The pointer to add the offset to.
20 | /// The offset to add.
21 | /// A new pointer that reflects the addition of offset to pointer.
22 | public static IntPtr Add(IntPtr pointer, int offset)
23 | {
24 | return new IntPtr(unchecked(pointer.ToInt32() + offset));
25 | }
26 |
27 | ///
28 | /// Subtracts an offset from the value of a pointer.
29 | ///
30 | /// The pointer to subtract the offset from.
31 | /// The pointer to subtract the offset from.
32 | /// A new pointer that reflects the subtraction of offset from pointer.
33 | public static IntPtr Subtract(IntPtr pointer, int offset)
34 | {
35 | return new IntPtr(unchecked(pointer.ToInt32() - offset));
36 | }
37 | }
38 | }
--------------------------------------------------------------------------------
/InTheHand.Phone/Tasks/PhoneNumberResult.cs:
--------------------------------------------------------------------------------
1 | // In The Hand - .NET Components for Mobility
2 | //
3 | // InTheHand.Phone.Tasks.PhoneNumberResult
4 | //
5 | // Copyright (c) 2010 In The Hand Ltd, All rights reserved.
6 |
7 | using System;
8 | using System.Runtime.InteropServices;
9 |
10 | namespace InTheHand.Phone.Tasks
11 | {
12 | ///
13 | /// Represents a phone number returned from a call to the method of a object.
14 | ///
15 | public sealed class PhoneNumberResult : TaskEventArgs
16 | {
17 | ///
18 | /// Initializes a new instance of the class.
19 | ///
20 | public PhoneNumberResult()
21 | : base()
22 | {
23 | }
24 | ///
25 | /// Initializes a new instance of the class with the specified .
26 | ///
27 | /// The TaskResult associated with the new .
28 | public PhoneNumberResult(TaskResult taskResult)
29 | : base(taskResult)
30 | {
31 | }
32 |
33 | ///
34 | /// The phone number contained in the result.
35 | ///
36 | public string PhoneNumber
37 | {
38 | get;
39 | set;
40 | }
41 | }
42 | }
--------------------------------------------------------------------------------
/InTheHand/Threading/Thread.cs:
--------------------------------------------------------------------------------
1 | // In The Hand - .NET Components for Mobility
2 | //
3 | // InTheHand.Threading.Thread
4 | //
5 | // Copyright (c) 2003-2012 In The Hand Ltd, All rights reserved.
6 |
7 | using System;
8 | using System.Runtime.InteropServices;
9 | using System.Threading;
10 |
11 | namespace InTheHand.Threading
12 | {
13 |
14 | ///
15 | /// Provides helper functions for the class.
16 | ///
17 | ///
18 | public static class ThreadInTheHand
19 | {
20 | ///
21 | /// Gets a value indicating the execution status of the specified thread.
22 | ///
23 | /// The specific thread.
24 | /// true if this thread has been started and has not terminated normally or aborted; otherwise, false.
25 | public static bool GetIsAlive(this Thread t)
26 | {
27 | int ec;
28 | bool success = gect(t.ManagedThreadId, out ec);
29 |
30 | if (ec == 0x00000103)
31 | {
32 | return true;
33 | }
34 | return false;
35 | }
36 |
37 |
38 | // Thread Helper
39 | [DllImport("coredll", EntryPoint = "GetExitCodeThread", SetLastError = true)]
40 | [return: MarshalAs(UnmanagedType.Bool)]
41 | private static extern bool gect(int hThread, out int lpExitCode);
42 |
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/InTheHand.Device.Location/GeoPositionStatus.cs:
--------------------------------------------------------------------------------
1 | // --------------------------------------------------------------------------------------------------------------------
2 | //
3 | // Copyright (c) 2010-14 In The Hand Ltd. All Rights Reserved.
4 | //
5 | // Peter Foot
6 | // --------------------------------------------------------------------------------------------------------------------
7 |
8 | namespace InTheHand.Device.Location
9 | {
10 | ///
11 | /// Indicates the ability of the location provider to provide location updates.
12 | ///
13 | public enum GeoPositionStatus
14 | {
15 | ///
16 | /// A location provider is ready to supply new data.
17 | ///
18 | Ready,
19 |
20 | ///
21 | /// The location provider is initializing.
22 | /// For example, a GPS still obtaining a fix has this status.
23 | ///
24 | Initializing,
25 |
26 | ///
27 | /// There are no devices than can currently resolve location.
28 | /// If the conditions for Disabled do not apply, has this status before it has been started and after it has been stopped.
29 | ///
30 | NoData,
31 |
32 | ///
33 | /// The location system feature has been disabled.
34 | ///
35 | Disabled,
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/InTheHand/Decimal.cs:
--------------------------------------------------------------------------------
1 | // In The Hand - .NET Components for Mobility
2 | //
3 | // InTheHand.Decimal
4 | //
5 | // Copyright (c) 2003-2014 In The Hand Ltd, All rights reserved.
6 |
7 | namespace InTheHand
8 | {
9 | using System;
10 |
11 | ///
12 | /// Provides helper methods to allow conversion of managed objects to and from their OLE Automation equivalents.
13 | ///
14 | ///
15 | public static class DecimalInTheHand
16 | {
17 | ///
18 | /// Converts the specified 64-bit signed integer, which contains an OLE Automation Currency value, to the equivalent value.
19 | ///
20 | /// An OLE Automation Currency value
21 | /// A that contains the equivalent of .
22 | public static decimal FromOACurrency(long cy)
23 | {
24 | return new decimal(cy)/ 10000;
25 | }
26 |
27 | ///
28 | /// Converts the specified value to the equivalent OLE Automation Currency value, which is contained in a 64-bit signed integer.
29 | ///
30 | /// A value
31 | /// A 64-bit signed integer that contains the OLE Automation equivalent of value.
32 | public static long ToOACurrency(decimal value)
33 | {
34 | return decimal.ToInt64((value * 10000));
35 | }
36 | }
37 | }
--------------------------------------------------------------------------------
/InTheHand/Guid.cs:
--------------------------------------------------------------------------------
1 | // In The Hand - .NET Components for Mobility
2 | //
3 | // InTheHand.Guid
4 | //
5 | // Copyright (c) 2003-2014 In The Hand Ltd, All rights reserved.
6 |
7 | using System;
8 | using System.Runtime.InteropServices;
9 |
10 | namespace InTheHand
11 | {
12 | ///
13 | /// Helper class for generating a globally unique identifier (GUID).
14 | ///
15 | ///
16 | /// This method uses the native COM sub-system to generate a Guid rather than a managed random number generator offering significantly better performance than Guid.NewGuid().
17 | public static class GuidInTheHand
18 | {
19 | ///
20 | /// Initializes a new instance of the class.
21 | ///
22 | /// A new object
23 | /// This is a convenient static method that you can call to get a new .
24 | /// There is a very low probability that the value of the new is all zeroes or equal to any other .
25 | public static Guid NewGuid()
26 | {
27 | System.Guid val;
28 |
29 | int hresult = CoCreateGuid(out val);
30 |
31 | Marshal.ThrowExceptionForHR(hresult);
32 |
33 | return val;
34 | }
35 |
36 | [DllImport("ole32", EntryPoint = "CoCreateGuid", SetLastError = false)]
37 | private static extern int CoCreateGuid(out System.Guid pguid);
38 | }
39 | }
--------------------------------------------------------------------------------
/InTheHand.Phone/Tasks/SmsComposeTask.cs:
--------------------------------------------------------------------------------
1 | // In The Hand - .NET Components for Mobility
2 | //
3 | // InTheHand.Phone.Tasks.SmsComposeTask
4 | //
5 | // Copyright (c) 2010-2012 In The Hand Ltd, All rights reserved.
6 |
7 | using System;
8 | using System.Runtime.InteropServices;
9 |
10 | namespace InTheHand.Phone.Tasks
11 | {
12 | ///
13 | /// Launches the Messaging application with a new SMS message displayed.
14 | ///
15 | ///
16 | /// Platforms Supported
17 | /// - Windows MobilePocket PC 2003 Phone Edition and later, Windows Mobile Version 5.0 and later
18 | /// - Windows EmbeddedWindows Embedded CE 6 and later
19 | ///
20 | ///
21 | public sealed class SmsComposeTask
22 | {
23 | ///
24 | /// Shows the Messaging application.
25 | ///
26 | public void Show()
27 | {
28 | NativeMethods.ComposeMessage(To, null, null, null, Body, null, "SMS", "IPM.SMStext");
29 | }
30 |
31 | ///
32 | /// Gets or sets the body text of the new SMS message.
33 | ///
34 | public string Body
35 | {
36 | get;
37 | set;
38 | }
39 |
40 | ///
41 | /// Gets or sets the recipient list for the new SMS message.
42 | ///
43 | public string To
44 | {
45 | get;
46 | set;
47 | }
48 | }
49 | }
--------------------------------------------------------------------------------
/InTheHand.Windows.Forms/Help.cs:
--------------------------------------------------------------------------------
1 | // In The Hand - .NET Components for Mobility
2 | //
3 | // InTheHand.Windows.Forms.Help
4 | //
5 | // Copyright (c) 2006-2012 In The Hand Ltd, All rights reserved.
6 |
7 | using Microsoft.Win32;
8 | using System.Diagnostics;
9 | using System;
10 | using System.IO;
11 | using System.Windows.Forms;
12 | using System.Reflection;
13 | using Microsoft.WindowsCE.Forms;
14 |
15 | namespace InTheHand.Windows.Forms
16 | {
17 | ///
18 | /// Provides Help support for all Windows Mobile platforms.
19 | ///
20 | ///
21 | public static class Help
22 | {
23 | ///
24 | /// Displays the contents of the Help file at the specified URL.
25 | ///
26 | /// Not used by the .NET Compact Framework
27 | /// The path and name of the Help file.
28 | /// Supports Windows Mobile Standard Edition using the default .html application.
29 | /// You can optionally specify the topic anchor within the file e.g. "MyApp.htm#MyTopic"
30 | public static void ShowHelp(Control parent, string url)
31 | {
32 |
33 | if (InTheHand.WindowsCE.Forms.SystemSettingsInTheHand.Platform == WinCEPlatform.Smartphone)
34 | {
35 | // open with web browser
36 | Process.Start(url, string.Empty);
37 | }
38 | else
39 | {
40 | // open with peghelp
41 | System.Windows.Forms.Help.ShowHelp(parent, url);
42 | }
43 | }
44 | }
45 | }
--------------------------------------------------------------------------------
/InTheHand.Phone/Tasks/MediaPlayerLauncher.cs:
--------------------------------------------------------------------------------
1 | // In The Hand - .NET Components for Mobility
2 | //
3 | // InTheHand.Phone.Tasks.MediaPlayerLauncher
4 | //
5 | // Copyright (c) 2011 In The Hand Ltd, All rights reserved.
6 |
7 | using System;
8 | using System.Runtime.InteropServices;
9 |
10 | namespace InTheHand.Phone.Tasks
11 | {
12 | ///
13 | /// Allows an application to launch the media player.
14 | ///
15 | ///
16 | /// Platforms Supported
17 | /// - Windows MobileWindows Mobile Version 5.0 and later
18 | ///
19 | ///
20 | public sealed class MediaPlayerLauncher
21 | {
22 | private const string mediaPlayerPath = "\\Windows\\WMPlayer.exe";
23 |
24 | ///
25 | /// Gets or sets the media played with the media player application.
26 | ///
27 | /// The URI of a media file.
28 | public Uri Media
29 | {
30 | get;
31 | set;
32 | }
33 |
34 | ///
35 | /// Shows the media player application.
36 | ///
37 | public void Show()
38 | {
39 | string path = null;
40 | if (Media.Scheme == "file")
41 | {
42 | //quote to allow for paths with strings
43 | path = "\"" + Media.LocalPath + "\"";
44 | }
45 | else
46 | {
47 | path = Media.ToString();
48 | }
49 |
50 | System.Diagnostics.Process.Start(mediaPlayerPath, path);
51 | }
52 | }
53 | }
--------------------------------------------------------------------------------
/InTheHand.Drawing/ColorTranslator.cs:
--------------------------------------------------------------------------------
1 | // --------------------------------------------------------------------------------------------------------------------
2 | //
3 | // Copyright (c) 2002-14 In The Hand Ltd. All Rights Reserved.
4 | //
5 | // Peter Foot
6 | // --------------------------------------------------------------------------------------------------------------------
7 |
8 | using System;
9 | using System.ComponentModel;
10 | using System.Drawing;
11 | using System.Runtime.InteropServices;
12 |
13 | namespace InTheHand.Drawing
14 | {
15 | ///
16 | /// Translates colors to and from GDI+ Color structures.
17 | ///
18 | public static class ColorTranslator
19 | {
20 | ///
21 | /// Translates a Windows color value to a GDI+ structure.
22 | ///
23 | /// The Windows color to translate.
24 | /// The structure that represents the translated Windows color.
25 | public static Color FromWin32(int win32Color)
26 | {
27 | return Color.FromArgb((win32Color & 0xFF), ((win32Color & 0xFF00) >> 8), ((win32Color & 0xFF0000) >> 16));
28 | }
29 |
30 | ///
31 | /// Translates the specified structure to a Windows color.
32 | ///
33 | /// The structure to translate.
34 | /// The Windows color value.
35 | public static int ToWin32(Color c)
36 | {
37 | return (int)c.R | ((int)c.G << 8) | ((int)c.B << 16);
38 | }
39 | }
40 | }
--------------------------------------------------------------------------------
/InTheHand.Net.NetworkInformation/OperationalStatus.cs:
--------------------------------------------------------------------------------
1 | // In The Hand - .NET Components for Mobility
2 | //
3 | // InTheHand.Net.NetworkInformation.OperationalStatus
4 | //
5 | // Copyright (c) 2003-2010 In The Hand Ltd, All rights reserved.
6 |
7 | namespace InTheHand.Net.NetworkInformation
8 | {
9 | ///
10 | /// Specifies the operational state of a network interface.
11 | ///
12 | public enum OperationalStatus
13 | {
14 | ///
15 | /// The network interface is up; it can transmit data packets.
16 | ///
17 | Up = 1,
18 |
19 | ///
20 | /// The network interface is unable to transmit data packets.
21 | ///
22 | Down = 2,
23 |
24 | ///
25 | /// The network interface is running tests.
26 | ///
27 | Testing = 3,
28 |
29 | ///
30 | /// The network interface status is not known.
31 | ///
32 | Unknown = 4,
33 |
34 | ///
35 | /// The network interface is not in a condition to transmit data packets; it is waiting for an external event.
36 | ///
37 | Dormant = 5,
38 |
39 | ///
40 | /// The network interface is unable to transmit data packets because of a missing component, typically a hardware component.
41 | ///
42 | NotPresent = 6,
43 |
44 | ///
45 | /// The network interface is unable to transmit data packets because it runs on top of one or more other interfaces, and at least one of these "lower layer" interfaces is down.
46 | ///
47 | LowerLayerDown = 7,
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/InTheHand.Phone/Tasks/TaskEventArgs.cs:
--------------------------------------------------------------------------------
1 | // In The Hand - .NET Components for Mobility
2 | //
3 | // InTheHand.Phone.Tasks.TaskEventArgs
4 | //
5 | // Copyright (c) 2010 In The Hand Ltd, All rights reserved.
6 |
7 | using System;
8 | using System.Runtime.InteropServices;
9 |
10 | namespace InTheHand.Phone.Tasks
11 | {
12 | ///
13 | /// The EventArgs used by the Completed event for all Choosers.
14 | ///
15 | public abstract class TaskEventArgs : EventArgs
16 | {
17 | ///
18 | /// Initializes a new instance of the class.
19 | ///
20 | public TaskEventArgs() { }
21 |
22 | ///
23 | /// Initializes a new instance of the class with the specified .
24 | ///
25 | /// The associated with the new .
26 | public TaskEventArgs(TaskResult taskResult)
27 | {
28 | this.TaskResult = taskResult;
29 | }
30 |
31 | ///
32 | /// The exception associated with the .
33 | ///
34 | public virtual Exception Error
35 | {
36 | get;
37 | set;
38 | }
39 |
40 | ///
41 | /// The associated with the .
42 | /// This indicates whether the task was completed successfully, if the user cancelled the task, or if no result information is available.
43 | ///
44 | public virtual TaskResult TaskResult
45 | {
46 | get;
47 | set;
48 | }
49 | }
50 | }
--------------------------------------------------------------------------------
/InTheHand/Runtime/InteropServices/SYSTEMTIME.cs:
--------------------------------------------------------------------------------
1 | // --------------------------------------------------------------------------------------------------------------------
2 | //
3 | // Copyright (c) 2003-14 In The Hand Ltd. All Rights Reserved.
4 | //
5 | // Peter Foot
6 | // --------------------------------------------------------------------------------------------------------------------
7 |
8 | namespace InTheHand.Runtime.InteropServices
9 | {
10 | using System;
11 | using System.Runtime.InteropServices;
12 |
13 | [StructLayout(LayoutKind.Sequential, Size = 16)]
14 | internal struct SYSTEMTIME
15 | {
16 | internal short year;
17 | internal short month;
18 | internal short dayOfWeek;
19 | internal short day;
20 | internal short hour;
21 | internal short minute;
22 | internal short second;
23 | internal short millisecond;
24 |
25 | public static SYSTEMTIME FromDateTime(DateTime dt)
26 | {
27 | SYSTEMTIME st = new SYSTEMTIME();
28 | st.year = (short)dt.Year;
29 | st.month = (short)dt.Month;
30 | st.day = (short)dt.Day;
31 | st.hour = (short)dt.Hour;
32 | st.minute = (short)dt.Minute;
33 | st.second = (short)dt.Second;
34 |
35 | return st;
36 | }
37 |
38 | internal DateTime ToDateTime(DateTimeKind kind)
39 | {
40 | if (year == 0 && month == 0 && day == 0 && hour == 0 && minute == 0 && second == 0)
41 | {
42 | return DateTime.MinValue;
43 | }
44 |
45 | return new DateTime(year, month, day, hour, minute, second, kind);
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/InTheHand.IO/WatcherChangeTypes.cs:
--------------------------------------------------------------------------------
1 | // --------------------------------------------------------------------------------------------------------------------
2 | //
3 | // Copyright (c) 2003-14 In The Hand Ltd. All Rights Reserved.
4 | //
5 | // Peter Foot
6 | // --------------------------------------------------------------------------------------------------------------------
7 |
8 | namespace InTheHand.IO
9 | {
10 | ///
11 | /// Changes that might occur to a file or directory.
12 | ///
13 | /// Each member is associated with an event in .
14 | /// For more information on the events, see , , and .
15 | public enum WatcherChangeTypes
16 | {
17 | ///
18 | /// The creation of a file or folder.
19 | ///
20 | Created = 1,
21 |
22 | ///
23 | /// The deletion of a file or folder.
24 | ///
25 | Deleted = 2,
26 |
27 | ///
28 | /// The change of a file or folder. The types of changes include: changes to size, attributes, security settings, last write, and last access time.
29 | ///
30 | Changed = 4,
31 |
32 | ///
33 | /// The renaming of a file or folder.
34 | ///
35 | Renamed = 8,
36 |
37 | ///
38 | /// The creation, deletion, change, or renaming of a file or folder.
39 | ///
40 | All = 15,
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/InTheHand.Net/INTERNET_STATUS.cs:
--------------------------------------------------------------------------------
1 | // --------------------------------------------------------------------------------------------------------------------
2 | //
3 | // Copyright (c) 2008-14 In The Hand Ltd. All Rights Reserved.
4 | //
5 | // Peter Foot
6 | // --------------------------------------------------------------------------------------------------------------------
7 |
8 | using System;
9 | using System.Net;
10 | using System.Text;
11 | using System.Runtime.InteropServices;
12 |
13 | namespace InTheHand.Net
14 | {
15 | internal enum INTERNET_STATUS
16 | {
17 | RESOLVING_NAME =10,
18 | NAME_RESOLVED =11,
19 | CONNECTING_TO_SERVER =20,
20 | CONNECTED_TO_SERVER =21,
21 | SENDING_REQUEST =30,
22 | REQUEST_SENT =31,
23 | RECEIVING_RESPONSE =40,
24 | RESPONSE_RECEIVED =41,
25 | CTL_RESPONSE_RECEIVED =42,
26 | PREFETCH =43,
27 | CLOSING_CONNECTION =50,
28 | CONNECTION_CLOSED =51,
29 | HANDLE_CREATED =60,
30 | HANDLE_CLOSING =70,
31 | DETECTING_PROXY =80,
32 | REQUEST_COMPLETE =100,
33 | REDIRECT =110,
34 | INTERMEDIATE_RESPONSE =120,
35 | USER_INPUT_REQUIRED =140,
36 | STATE_CHANGE =200,
37 | COOKIE_SENT =320,
38 | COOKIE_RECEIVED =321,
39 | COOKIE_STATE =322,
40 | COOKIE_SUPPRESSED =323,
41 | PRIVACY_IMPACTED =324,
42 | P3P_HEADER =325,
43 | P3P_POLICYREF =326,
44 | COOKIE_HISTORY =327,
45 | }
46 | }
--------------------------------------------------------------------------------
/InTheHand.Phone/Tasks/PhotoResult.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace InTheHand.Phone.Tasks
7 | {
8 | ///
9 | /// Represents a photo returned from a call to the Show method of a object or a object.
10 | ///
11 | public sealed class PhotoResult : TaskEventArgs
12 | {
13 | ///
14 | /// Initializes a new instance of the class.
15 | ///
16 | public PhotoResult()
17 | : base()
18 | {
19 | }
20 |
21 | ///
22 | /// Initializes a new instance of the class with the specified .
23 | ///
24 | ///
25 | public PhotoResult(TaskResult taskResult)
26 | : base(taskResult)
27 | {
28 | }
29 |
30 | ///
31 | /// Gets the containing the data for the photo.
32 | ///
33 | /// The data for the photo.
34 | public System.IO.Stream ChosenPhoto
35 | {
36 | get
37 | {
38 | if (OriginalFileName != null)
39 | {
40 | return new System.IO.FileStream(OriginalFileName, System.IO.FileMode.Open, System.IO.FileAccess.Read, System.IO.FileShare.Read);
41 | }
42 |
43 | return null;
44 | }
45 | }
46 | ///
47 | /// Gets the file name of the photo.
48 | ///
49 | /// The file name of the photo.
50 | public string OriginalFileName { set; get; }
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/InTheHand.Drawing/RECT.cs:
--------------------------------------------------------------------------------
1 | // --------------------------------------------------------------------------------------------------------------------
2 | //
3 | // Copyright (c) 2007-14 In The Hand Ltd. All Rights Reserved.
4 | //
5 | // Peter Foot
6 | // --------------------------------------------------------------------------------------------------------------------
7 |
8 | namespace InTheHand.Drawing
9 | {
10 | using System;
11 | using System.Drawing;
12 | using System.Globalization;
13 | using System.Runtime.InteropServices;
14 |
15 | [StructLayout(LayoutKind.Sequential)]
16 | internal struct RECT
17 | {
18 | public int left;
19 |
20 | public int top;
21 |
22 | public int right;
23 |
24 | public int bottom;
25 |
26 | internal RectangleF ToRectangleF()
27 | {
28 | return new RectangleF(this.left, this.top, this.right - this.left, this.bottom - this.top);
29 | }
30 |
31 | internal Rectangle ToRectangle()
32 | {
33 | return new Rectangle(this.left, this.top, this.right - this.left, this.bottom - this.top);
34 | }
35 |
36 | internal static RECT FromXYWH(int x, int y, int width, int height)
37 | {
38 | RECT r;
39 | r.left = x;
40 | r.top = y;
41 | r.right = x + width;
42 | r.bottom = y + height;
43 |
44 | return r;
45 | }
46 |
47 | public override string ToString()
48 | {
49 | return left.ToString(CultureInfo.InvariantCulture) + ", " + top.ToString(CultureInfo.InvariantCulture)
50 | + ", " + right.ToString(CultureInfo.InvariantCulture) + ", "
51 | + bottom.ToString(CultureInfo.InvariantCulture);
52 | }
53 | }
54 | }
--------------------------------------------------------------------------------
/InTheHand.Net.NetworkInformation/NetBiosNodeType.cs:
--------------------------------------------------------------------------------
1 | // In The Hand - .NET Components for Mobility
2 | //
3 | // InTheHand.Net.NetworkInformation.NetBiosNodeType
4 | //
5 | // Copyright (c) 2003-2014 In The Hand Ltd, All rights reserved.
6 |
7 | namespace InTheHand.Net.NetworkInformation
8 | {
9 | ///
10 | /// Specifies the Network Basic Input/Output System (NetBIOS) node type.
11 | ///
12 | /// The node type determines the way in which NetBIOS names are resolved to Internet Protocol (IP) addresses.
13 | /// The following table shows the name resolution method for each node type.
14 | ///
15 | /// Node typeResolve name to IP address
16 | /// BroadcastUses NetBIOS name queries.
17 | /// Peer2PeerUses a NetBIOS name server (NBNS), for example, Windows Internet Name Service (WINS).
18 | /// MixedAttempts to resolve by first using NetBIOS name queries and then using an NBNS.
19 | /// HybridAttempts to resolve by first using an NBNS and then using a NetBIOS name query.
20 | ///
21 | /// This enumeration is used to specify values for the property.
22 | public enum NetBiosNodeType
23 | {
24 | ///
25 | /// An unknown node type.
26 | ///
27 | Unknown = 0,
28 |
29 | ///
30 | /// A broadcast node.
31 | ///
32 | Broadcast = 1,
33 |
34 | ///
35 | /// A peer-to-peer node.
36 | ///
37 | Peer2Peer = 2,
38 |
39 | ///
40 | /// A mixed node.
41 | ///
42 | Mixed = 4,
43 |
44 | ///
45 | /// A hybrid node.
46 | ///
47 | Hybrid = 8,
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/InTheHand.IO/IsolatedStorage/IsolatedStorageException.cs:
--------------------------------------------------------------------------------
1 | // --------------------------------------------------------------------------------------------------------------------
2 | //
3 | // Copyright (c) 2003-14 In The Hand Ltd. All Rights Reserved.
4 | //
5 | // Peter Foot
6 | // --------------------------------------------------------------------------------------------------------------------
7 |
8 | namespace InTheHand.IO.IsolatedStorage
9 | {
10 | ///
11 | /// The exception that is thrown when an operation in isolated storage fails.
12 | ///
13 | public sealed class IsolatedStorageException : System.Exception
14 | {
15 | ///
16 | /// Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception.
17 | ///
18 | /// The error message that explains the reason for the exception.
19 | /// The exception that is the cause of the current exception. If the inner parameter is not null, the current exception is raised in a catch block that handles the inner exception.
20 | public IsolatedStorageException(string message, System.Exception inner) : base(message, inner) { }
21 |
22 | ///
23 | /// Initializes a new instance of the class with a specified error message.
24 | ///
25 | /// The error message that explains the reason for the exception.
26 | public IsolatedStorageException(string message) : base(message) { }
27 |
28 | ///
29 | /// Initializes a new instance of the class with default properties.
30 | ///
31 | public IsolatedStorageException() : base() { }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/InTheHand.Phone/Tasks/WebBrowserTask.cs:
--------------------------------------------------------------------------------
1 | // --------------------------------------------------------------------------------------------------------------------
2 | //
3 | // Copyright (c) 2010-14 In The Hand Ltd. All Rights Reserved.
4 | //
5 | // Peter Foot
6 | // --------------------------------------------------------------------------------------------------------------------
7 |
8 | using System;
9 | using System.Runtime.InteropServices;
10 |
11 | namespace InTheHand.Phone.Tasks
12 | {
13 | ///
14 | /// Allows an application to launch the web browser application.
15 | ///
16 | ///
17 | /// Platforms Supported
18 | /// - Windows MobilePocket PC 2003 and later, Windows Mobile Version 5.0 and later
19 | /// - Windows EmbeddedWindows CE 4.1 and later (Internet Explorer component required)
20 | ///
21 | ///
22 | public sealed class WebBrowserTask
23 | {
24 | ///
25 | /// Shows the web browser application.
26 | ///
27 | public void Show()
28 | {
29 | System.Diagnostics.Process.Start("\\windows\\iexplore.exe", _url);
30 | }
31 |
32 | private string _url;
33 |
34 | ///
35 | /// Gets or sets the URI to which the web browser application will navigate when it is launched.
36 | ///
37 | public Uri Uri
38 | {
39 | get
40 | {
41 | if (string.IsNullOrEmpty(_url))
42 | {
43 | return null;
44 | }
45 |
46 | return new Uri(_url);
47 | }
48 |
49 | set
50 | {
51 | _url = value.ToString();
52 | }
53 | }
54 | }
55 | }
--------------------------------------------------------------------------------
/InTheHand.Net.NetworkInformation/NetworkInformationException.cs:
--------------------------------------------------------------------------------
1 | // In The Hand - .NET Components for Mobility
2 | //
3 | // InTheHand.Net.NetworkInformation.NetworkInformationException
4 | //
5 | // Copyright (c) 2003-2010 In The Hand Ltd, All rights reserved.
6 |
7 | using System.ComponentModel;
8 | using System.Runtime.InteropServices;
9 |
10 | namespace InTheHand.Net.NetworkInformation
11 | {
12 | ///
13 | /// The exception that is thrown when an error occurs while retrieving network information.
14 | ///
15 | /// Types in the InTheHand.Net.NetworkInformation namespace throw this exception when a call to a Win32 function fails.
16 | /// The property contains the result returned by the function.
17 | public class NetworkInformationException : Win32Exception
18 | {
19 | ///
20 | /// Initializes a new instance of the class.
21 | ///
22 | public NetworkInformationException() : base(Marshal.GetLastWin32Error(), InTheHand.ComponentModel.Win32ExceptionInTheHand.GetErrorMessage(Marshal.GetLastWin32Error())) { }
23 | ///
24 | /// Initializes a new instance of the class with the specified error code.
25 | ///
26 | /// A Win32 error code.
27 | public NetworkInformationException(int errorCode) : base(errorCode, InTheHand.ComponentModel.Win32ExceptionInTheHand.GetErrorMessage(errorCode)) { }
28 |
29 | ///
30 | /// Gets the Win32 error code for this exception.
31 | ///
32 | /// The value of this property is set by the constructor.
33 | /// This property is overridden to return a Win32 error code instead of an HRESULT value.
34 | public override int ErrorCode
35 | {
36 | get
37 | {
38 | return base.NativeErrorCode;
39 | }
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/InTheHand.Phone/Devices/Environment.cs:
--------------------------------------------------------------------------------
1 | // --------------------------------------------------------------------------------------------------------------------
2 | //
3 | // Copyright (c) 2010-14 In The Hand Ltd. All Rights Reserved.
4 | //
5 | // Peter Foot
6 | // --------------------------------------------------------------------------------------------------------------------
7 |
8 | namespace InTheHand.Devices
9 | {
10 | ///
11 | /// Gives applications access to information about the environment in which they are running.
12 | ///
13 | public static class Environment
14 | {
15 | private static bool haveDeviceType = false;
16 | private static DeviceType deviceType;
17 |
18 | ///
19 | /// Gets the type of device on which the application is running.
20 | /// Use this property to determine if your application is running on an actual device or on the device emulator.
21 | ///
22 | public static DeviceType DeviceType
23 | {
24 | get
25 | {
26 | if (!haveDeviceType)
27 | {
28 | // determine if on emulator
29 | string oemInfo;
30 | bool success = InTheHand.NativeMethods.SystemParametersInfoString(NativeMethods.SPI.GETOEMINFO, out oemInfo);
31 | if (success)
32 | {
33 | switch (oemInfo)
34 | {
35 | case "Microsoft DeviceEmulator":
36 | deviceType = DeviceType.Emulator;
37 | break;
38 |
39 | default:
40 | deviceType = DeviceType.Device;
41 | break;
42 | }
43 |
44 | haveDeviceType = true;
45 | }
46 | }
47 |
48 | return deviceType;
49 | }
50 | }
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/InTheHand/String.cs:
--------------------------------------------------------------------------------
1 | // In The Hand - .NET Components for Mobility
2 | //
3 | // InTheHand.String
4 | //
5 | // Copyright (c) 2010-2014 In The Hand Ltd, All rights reserved.
6 |
7 | using System;
8 |
9 | namespace InTheHand
10 | {
11 | ///
12 | /// Provides extension methods for the type.
13 | ///
14 | public static class StringInTheHand
15 | {
16 | ///
17 | /// Returns a copy of the object converted to uppercase using the casing rules of the invariant culture.
18 | ///
19 | /// The value.
20 | /// A object in uppercase.
21 | /// If your application depends on the case of a string changing in a predictable way that is unaffected by the current culture, use the ToUpperInvariant method.
22 | /// The ToUpperInvariant method is equivalent to ToUpper(CultureInfo.InvariantCulture).
23 | public static string ToUpperInvariant(this string instance)
24 | {
25 | return instance.ToUpper(System.Globalization.CultureInfo.InvariantCulture);
26 | }
27 |
28 | ///
29 | /// Returns a copy of the object converted to lowercase using the casing rules of the invariant culture.
30 | ///
31 | /// The value.
32 | /// A object in lowercase.
33 | /// If your application depends on the case of a string changing in a predictable way that is unaffected by the current culture, use the ToLowerInvariant method.
34 | /// The ToLowerInvariant method is equivalent to ToLower(CultureInfo.InvariantCulture).
35 | public static string ToLowerInvariant(this string instance)
36 | {
37 | return instance.ToLower(System.Globalization.CultureInfo.InvariantCulture);
38 | }
39 | }
40 | }
--------------------------------------------------------------------------------
/InTheHand.Net.NetworkInformation/PingException.cs:
--------------------------------------------------------------------------------
1 | // In The Hand - .NET Components for Mobility
2 | //
3 | // InTheHand.Net.NetworkInformation.PingException
4 | //
5 | // Copyright (c) 2003-2014 In The Hand Ltd, All rights reserved.
6 |
7 | using System;
8 |
9 | namespace InTheHand.Net.NetworkInformation
10 | {
11 | ///
12 | /// The exception that is thrown when a method throws an exception.
13 | ///
14 | /// The Ping class throws this exception to indicate that while sending an Internet Control Message Protocol (ICMP) Echo request, a method called by the class threw an unhandled exception.
15 | /// Applications should check the inner exception of a object to identify the problem.
16 | /// The class does not throw this exception if the ICMP Echo request fails because of network, ICMP, or destination errors.
17 | /// For such errors, the class returns a object with the relevant value set in the property.
18 | [Serializable]
19 | public class PingException : InvalidOperationException
20 | {
21 | internal PingException()
22 | {
23 | }
24 |
25 | ///
26 | /// Initializes a new instance of the class using the specified message.
27 | ///
28 | /// A that describes the error.
29 | public PingException(string message) : base(message)
30 | {
31 | }
32 |
33 | ///
34 | /// Initializes a new instance of the class using the specified message and inner exception.
35 | ///
36 | /// A that describes the error.
37 | /// The exception that causes the current exception.
38 | public PingException(string message, Exception innerException)
39 | : base(message, innerException)
40 | {
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/InTheHand.Windows.Forms/TabControl.cs:
--------------------------------------------------------------------------------
1 | // In The Hand - .NET Components for Mobility
2 | //
3 | // InTheHand.Windows.Forms.TabControl
4 | //
5 | // Copyright (c) 2009-2012 In The Hand Ltd, All rights reserved.
6 |
7 | using System;
8 | using System.Runtime.InteropServices;
9 | using System.Windows.Forms;
10 |
11 | namespace InTheHand.Windows.Forms
12 | {
13 | ///
14 | /// Provides helper methods for the on Windows Mobile 6.5.
15 | ///
16 | ///
17 | /// Platforms Supported
18 | /// - Windows MobileWindows Mobile Version 6.5 and later
19 | ///
20 | ///
21 | public static class TabControlInTheHand
22 | {
23 | private const int TCS_TOOLTIPS = 0x4000;
24 |
25 | ///
26 | /// Updates the selected with the Windows Mobile 6.5 style.
27 | ///
28 | ///
29 | ///
30 | /// Platforms Supported
31 | /// - Windows MobileWindows Mobile Version 6.5 Professional or Classic Edition and later
32 | ///
33 | ///
34 | public static void EnableVisualStyles(this TabControl tabControl)
35 | {
36 | if (InTheHand.NativeMethods.IsMobile65)
37 | {
38 | //get handle of native control
39 | IntPtr hNativeTab = InTheHand.Windows.Forms.NativeMethods.GetWindow(tabControl.Handle, InTheHand.Windows.Forms.NativeMethods.GW.CHILD);
40 | //get current style flags
41 | int style = InTheHand.Windows.Forms.NativeMethods.GetWindowLong(hNativeTab, InTheHand.Windows.Forms.NativeMethods.GWL.STYLE).ToInt32();
42 | //add tooltips style
43 | style = InTheHand.Windows.Forms.NativeMethods.SetWindowLong(hNativeTab, InTheHand.Windows.Forms.NativeMethods.GWL.STYLE, style | 0x4000);
44 | }
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/InTheHand.IO/RenamedEventArgs.cs:
--------------------------------------------------------------------------------
1 | // --------------------------------------------------------------------------------------------------------------------
2 | //
3 | // Copyright (c) 2003-14 In The Hand Ltd. All Rights Reserved.
4 | //
5 | // Peter Foot
6 | // --------------------------------------------------------------------------------------------------------------------
7 |
8 | namespace InTheHand.IO
9 | {
10 | ///
11 | /// Provides data for the Renamed event.
12 | ///
13 | public sealed class RenamedEventArgs : FileSystemEventArgs
14 | {
15 | private string oldFullPath;
16 | private string oldName;
17 |
18 | ///
19 | /// Initializes a new instance of the RenamedEventArgs class.
20 | ///
21 | /// One of the WatcherChangeTypes values.
22 | /// The name of the affected file or directory.
23 | /// The name of the affected file or directory.
24 | /// The old name of the affected file or directory.
25 | public RenamedEventArgs(WatcherChangeTypes changeType, string directory, string name, string oldName)
26 | : base(changeType, directory, name)
27 | {
28 | if (!directory.EndsWith("\\"))
29 | {
30 | directory = directory + "\\";
31 | }
32 |
33 | this.oldFullPath = directory + oldName;
34 | this.oldName = oldName;
35 | }
36 |
37 | ///
38 | /// Gets the previous fully qualified path of the affected file or directory.
39 | ///
40 | public string OldFullPath
41 | {
42 | get
43 | {
44 | return oldFullPath;
45 | }
46 | }
47 |
48 | ///
49 | /// Gets the old name of the affected file or directory.
50 | ///
51 | public string OldName
52 | {
53 | get
54 | {
55 | return oldName;
56 | }
57 | }
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/InTheHand/Reflection/Assembly.cs:
--------------------------------------------------------------------------------
1 | // In The Hand - .NET Components for Mobility
2 | //
3 | // InTheHand.Reflection.Assembly
4 | //
5 | // Copyright (c) 2003-2014 In The Hand Ltd, All rights reserved.
6 |
7 | using System;
8 | using System.Runtime.InteropServices;
9 |
10 | namespace InTheHand.Reflection
11 | {
12 | ///
13 | /// Contains helper functions for the class.
14 | ///
15 | ///
16 | public static class AssemblyInTheHand
17 | {
18 | private static string moduleFileName;
19 | private static System.Reflection.Assembly entryAssembly;
20 |
21 | ///
22 | /// Gets the process executable.
23 | ///
24 | /// The that is the process executable.
25 | public static System.Reflection.Assembly GetEntryAssembly()
26 | {
27 | if (entryAssembly == null)
28 | {
29 | string assemblyPath = GetModuleFileName();
30 | entryAssembly = System.Reflection.Assembly.LoadFrom(assemblyPath);
31 | }
32 | return entryAssembly;
33 | }
34 |
35 | internal static string GetModuleFileName()
36 | {
37 | if (string.IsNullOrEmpty(moduleFileName))
38 | {
39 | byte[] buffer = new byte[InTheHand.EnvironmentInTheHand.MaxPath * 2];
40 | int chars = GetModuleFileName(IntPtr.Zero, buffer, InTheHand.EnvironmentInTheHand.MaxPath);
41 |
42 | if (chars > 0)
43 | {
44 | if (chars > InTheHand.EnvironmentInTheHand.MaxPath)
45 | {
46 | throw new System.IO.PathTooLongException(InTheHand.Properties.Resources.IO_PathTooLong);
47 | }
48 |
49 | moduleFileName = System.Text.Encoding.Unicode.GetString(buffer, 0, chars * 2);
50 | }
51 | }
52 | return moduleFileName;
53 | }
54 |
55 | //Reflection.Assembly
56 | [DllImport("coredll", EntryPoint = "GetModuleFileName")]
57 | private static extern int GetModuleFileName(IntPtr hModule, byte[] filename, int size);
58 | }
59 | }
--------------------------------------------------------------------------------
/InTheHand.Drawing/Icon.cs:
--------------------------------------------------------------------------------
1 | // --------------------------------------------------------------------------------------------------------------------
2 | //
3 | // Copyright (c) 2008-14 In The Hand Ltd. All Rights Reserved.
4 | //
5 | // Peter Foot
6 | // --------------------------------------------------------------------------------------------------------------------
7 |
8 | using System.Drawing;
9 | using System.Runtime.InteropServices;
10 |
11 | namespace InTheHand.Drawing
12 | {
13 | ///
14 | /// Provides supporting methods for .
15 | ///
16 | ///
17 | public static class IconInTheHand
18 | {
19 | ///
20 | /// Returns an icon representation of an image contained in the specified file.
21 | ///
22 | /// The path to the file that contains an image.
23 | /// The Icon representation of the image contained in the specified file.
24 | public static Icon ExtractAssociatedIcon(string filename)
25 | {
26 | return ExtractAssociatedIcon(filename, true);
27 | }
28 |
29 | ///
30 | /// Returns an icon representation of an image contained in the specified file.
31 | ///
32 | /// The path to the file that contains an image.
33 | /// Specifies whether to retrieve the large (Default) or small size icon.
34 | /// The Icon representation of the image contained in the specified file.
35 | public static Icon ExtractAssociatedIcon(string filename, bool largeIcon)
36 | {
37 | NativeMethods.SHFILEINFO shfi = new NativeMethods.SHFILEINFO();
38 | int result = NativeMethods.GetFileInfo(filename, 0, ref shfi, Marshal.SizeOf(shfi), NativeMethods.SHGFI.ICON | (largeIcon ? 0 : NativeMethods.SHGFI.SMALLICON));
39 | if (result == 0)
40 | {
41 | throw InTheHand.ComponentModel.Win32ExceptionInTheHand.Create();
42 | }
43 | return Icon.FromHandle(shfi.hIcon);
44 | }
45 | }
46 | }
--------------------------------------------------------------------------------
/InTheHand.Net/WebRequest.cs:
--------------------------------------------------------------------------------
1 | // --------------------------------------------------------------------------------------------------------------------
2 | //
3 | // Copyright (c) 2011-14 In The Hand Ltd. All Rights Reserved.
4 | //
5 | // Peter Foot
6 | // --------------------------------------------------------------------------------------------------------------------
7 |
8 | using System;
9 | using System.Net;
10 |
11 | namespace InTheHand.Net
12 | {
13 | ///
14 | /// Helper methods for .
15 | ///
16 | public static class WebRequestInTheHand
17 | {
18 | ///
19 | /// Initializes a new instance for the specified URI string.
20 | ///
21 | /// A URI string that identifies the Internet resource.
22 | /// An instance for the specific URI string.
23 | public static System.Net.HttpWebRequest CreateHttp(string requestUriString)
24 | {
25 | return (HttpWebRequest)WebRequest.Create(requestUriString);
26 | }
27 |
28 | ///
29 | /// Initializes a new instance for the specified URI.
30 | ///
31 | /// A URI that identifies the Internet resource.
32 | /// An instance for the specific URI.
33 | /// The request scheme specified in requestUri is the http or https scheme.
34 | /// requestUri is null.
35 | public static HttpWebRequest CreateHttp(Uri requestUri)
36 | {
37 | if (requestUri == null)
38 | {
39 | throw new ArgumentNullException("requestUri");
40 | }
41 |
42 | if (!requestUri.Scheme.Contains("http"))
43 | {
44 | throw new NotSupportedException();
45 | }
46 |
47 | return (HttpWebRequest)WebRequest.Create(requestUri);
48 | }
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/InTheHand.Windows/MessageBoxButton.cs:
--------------------------------------------------------------------------------
1 | // --------------------------------------------------------------------------------------------------------------------
2 | //
3 | // Copyright (c) 2010-14 In The Hand Ltd. All Rights Reserved.
4 | //
5 | // Peter Foot
6 | // --------------------------------------------------------------------------------------------------------------------
7 |
8 | namespace InTheHand.Windows
9 | {
10 | ///
11 | /// Specifies the buttons that are displayed on a message box.
12 | /// Used as an argument of the method.
13 | ///
14 | ///
15 | /// Platforms Supported
16 | /// - Windows MobilePocket PC 2003, Windows Mobile 5.0 and later
17 | /// - Windows PhoneWindows Phone 7 and later
18 | /// - Windows Embedded CompactWindows CE .NET 4.1 and later
19 | ///
20 | ///
21 | public enum MessageBoxButton
22 | {
23 | ///
24 | /// The message box displays an OK button.
25 | ///
26 | OK = 0,
27 |
28 | ///
29 | /// The message box displays OK and Cancel buttons.
30 | ///
31 | OKCancel = 1,
32 |
33 | ///
34 | /// The message box displays Abort, Retry and Ignore buttons.
35 | ///
36 | AbortRetryIgnore = 2,
37 |
38 | ///
39 | /// The message box displays Yes, No and Cancel buttons.
40 | ///
41 | YesNoCancel = 3,
42 |
43 | ///
44 | /// The message box displays Yes and No buttons.
45 | ///
46 | YesNo = 4,
47 |
48 | ///
49 | /// The message box displays Retry and Cancel buttons.
50 | ///
51 | RetryCancel = 5,
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/InTheHand/ComponentModel/RunWorkerCompletedEventArgs.cs:
--------------------------------------------------------------------------------
1 | // --------------------------------------------------------------------------------------------------------------------
2 | //
3 | // Copyright (c) 2004-14 In The Hand Ltd. All Rights Reserved.
4 | //
5 | // Peter Foot
6 | // --------------------------------------------------------------------------------------------------------------------
7 |
8 | using System.ComponentModel;
9 |
10 | namespace InTheHand.ComponentModel
11 | {
12 | ///
13 | /// Represents the method that will handle the event of a class.
14 | ///
15 | /// The source of the event.
16 | /// A that contains the event data.
17 | public delegate void RunWorkerCompletedEventHandler(object sender, RunWorkerCompletedEventArgs e);
18 |
19 | ///
20 | /// Provides data for the event.
21 | ///
22 | public sealed class RunWorkerCompletedEventArgs : AsyncCompletedEventArgs
23 | {
24 | private readonly object result;
25 |
26 | ///
27 | /// Initializes a new instance of the class.
28 | ///
29 | /// The result of an asynchronous operation.
30 | /// Any error that occurred during the asynchronous operation.
31 | /// A value indicating whether the asynchronous operation was canceled.
32 | public RunWorkerCompletedEventArgs(object result, System.Exception error, bool canceled)
33 | : base(error, canceled, null)
34 | {
35 | this.result = result;
36 | }
37 | ///
38 | /// Gets a value that represents the result of an asynchronous operation.
39 | ///
40 | public object Result
41 | {
42 | get
43 | {
44 | base.RaiseExceptionIfNecessary();
45 | return result;
46 | }
47 | }
48 |
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/InTheHand.IO/NotifyFilters.cs:
--------------------------------------------------------------------------------
1 | // --------------------------------------------------------------------------------------------------------------------
2 | //
3 | // Copyright (c) 2003-14 In The Hand Ltd. All Rights Reserved.
4 | //
5 | // Peter Foot
6 | // --------------------------------------------------------------------------------------------------------------------
7 |
8 | namespace InTheHand.IO
9 | {
10 | ///
11 | /// Specifies changes to watch for in a file or folder.
12 | ///
13 | /// You can combine the members of this enumeration to watch for more than one kind of change. For example, you can watch for changes in the size of a file or folder, and for changes in security settings. This raises an event anytime there is a change in size or security settings of a file or folder.
14 | ///
15 | ///
16 | ///
17 | ///
18 | ///
19 | ///
20 | public enum NotifyFilters
21 | {
22 | ///
23 | /// The name of the file.
24 | ///
25 | FileName = 1,
26 |
27 | ///
28 | /// The name of the directory.
29 | ///
30 | DirectoryName = 2,
31 |
32 | ///
33 | /// The attributes of the file or folder.
34 | ///
35 | Attributes = 4,
36 |
37 | ///
38 | /// The size of the file or folder.
39 | ///
40 | Size = 8,
41 |
42 | ///
43 | /// The date the file or folder last had anything written to it.
44 | ///
45 | LastWrite = 16,
46 |
47 | ///
48 | /// The date the file or folder was last opened.
49 | ///
50 | LastAccess = 32,
51 |
52 | ///
53 | /// The time the file or folder was created.
54 | ///
55 | CreationTime = 64,
56 |
57 | //
58 | // The security settings of the file or folder.
59 | //
60 | //Security = 256,
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/InTheHand.Windows/MessageBoxResult.cs:
--------------------------------------------------------------------------------
1 | // --------------------------------------------------------------------------------------------------------------------
2 | //
3 | // Copyright (c) 2010-14 In The Hand Ltd. All Rights Reserved.
4 | //
5 | // Peter Foot
6 | // --------------------------------------------------------------------------------------------------------------------
7 |
8 | namespace InTheHand.Windows
9 | {
10 | ///
11 | /// Specifies which message box button that a user clicks.
12 | /// MessageBoxResult is returned by the method.
13 | ///
14 | ///
15 | /// Platforms Supported
16 | /// - Windows MobilePocket PC 2003, Windows Mobile 5.0 and later
17 | /// - Windows PhoneWindows Phone 7 and later
18 | /// - Windows Embedded CompactWindows CE .NET 4.1 and later
19 | ///
20 | ///
21 | public enum MessageBoxResult
22 | {
23 | ///
24 | /// The message box returns no result.
25 | ///
26 | None = 0,
27 |
28 | ///
29 | /// The result value of the message box is OK.
30 | ///
31 | OK = 1,
32 |
33 | ///
34 | /// The result value of the message box is Cancel.
35 | ///
36 | Cancel = 2,
37 |
38 | ///
39 | /// The result value of the message box is Abort.
40 | ///
41 | Abort = 3,
42 |
43 | ///
44 | /// The result value of the message box is Retry.
45 | ///
46 | Retry = 4,
47 |
48 | ///
49 | /// The result value of the message box is Ignore.
50 | ///
51 | Ignore = 5,
52 |
53 | ///
54 | /// The result value of the message box is Yes.
55 | ///
56 | Yes = 6,
57 |
58 | ///
59 | /// The result value of the message box is No.
60 | ///
61 | No = 7,
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/InTheHand.Net.ConnectionManager/Destination.cs:
--------------------------------------------------------------------------------
1 | // In The Hand - .NET Components for Mobility
2 | //
3 | // InTheHand.Net.ConnectionManager.Destination
4 | //
5 | // Copyright (c) 2003-2010 In The Hand Ltd, All rights reserved.
6 |
7 | using System;
8 |
9 | namespace InTheHand.Net.ConnectionManager
10 | {
11 | ///
12 | /// Contains Guid values for standard destination networks.
13 | ///
14 | public static class Destination
15 | {
16 | ///
17 | /// The Internet.
18 | ///
19 | public static readonly Guid Internet = new Guid("{436EF144-B4FB-4863-A041-8F905A62C572}");
20 | ///
21 | /// The corporate network.
22 | ///
23 | public static readonly Guid Corporate = new Guid("{A1182988-0D73-439e-87AD-2A5B369F808B}");
24 | ///
25 | /// The WAP network.
26 | ///
27 | public static readonly Guid Wap = new Guid("{7022E968-5A97-4051-BC1C-C578E2FBA5D9}");
28 | ///
29 | /// The secure WAP network.
30 | ///
31 | public static readonly Guid SecureWap = new Guid("{F28D1F74-72BE-4394-A4A7-4E296219390C}");
32 | }
33 |
34 | ///
35 | /// Provides information about a specific network.
36 | ///
37 | public class DestinationInfo
38 | {
39 | private Guid guid;
40 | private string description;
41 | private bool secure;
42 |
43 | internal DestinationInfo(CONNMGR_DESTINATION_INFO info)
44 | {
45 | guid = info.guid;
46 | description = info.szDescription;
47 | secure = info.fSecure;
48 | }
49 |
50 | ///
51 | /// GUID associated with the network to which the connection is established.
52 | ///
53 | public Guid Guid
54 | {
55 | get
56 | {
57 | return guid;
58 | }
59 | }
60 |
61 | ///
62 | /// Description of the network.
63 | ///
64 | public string Description
65 | {
66 | get
67 | {
68 | return description;
69 | }
70 | }
71 |
72 | ///
73 | /// Specifies if multi-homing is allowed on the network.
74 | ///
75 | public bool Secure
76 | {
77 | get
78 | {
79 | return secure;
80 | }
81 | }
82 | }
83 | }
--------------------------------------------------------------------------------
/InTheHand.Phone/Tasks/ChooserBase.cs:
--------------------------------------------------------------------------------
1 | // In The Hand - .NET Components for Mobility
2 | //
3 | // InTheHand.Phone.Tasks.ChooserBase
4 | //
5 | // Copyright (c) 2010 In The Hand Ltd, All rights reserved.
6 |
7 | using System;
8 | using System.Runtime.InteropServices;
9 |
10 | namespace InTheHand.Phone.Tasks
11 | {
12 | ///
13 | /// The base class from which all choosers are derived.
14 | /// This class exposes a common function for showing the choosers and an event for handling the chooser result.
15 | ///
16 | /// The generic parameter for the EventArgs object for each type of chooser.
17 | public abstract class ChooserBase where TTaskEventArgs : TaskEventArgs
18 | {
19 | private bool showing = false;
20 |
21 | ///
22 | /// The EventArgs for the event.
23 | ///
24 | public TTaskEventArgs TaskEventArgs
25 | {
26 | get;
27 | set;
28 | }
29 |
30 | ///
31 | /// Launches and displays the chooser.
32 | ///
33 | public virtual void Show()
34 | {
35 | if (showing)
36 | {
37 | throw new InvalidOperationException();
38 | }
39 |
40 | showing = true;
41 | }
42 |
43 | ///
44 | /// Raises the event.
45 | ///
46 | /// The source of the event.
47 | /// The associated with the event.
48 | /// The delegate to be called when the event is raised.
49 | protected void FireCompleted(object sender, TTaskEventArgs e, Delegate fireThisHandlerOnly)
50 | {
51 | showing = false;
52 |
53 | TaskEventArgs = e;
54 |
55 | if (fireThisHandlerOnly != null)
56 | {
57 | // fire specific delegate
58 | ((EventHandler)fireThisHandlerOnly)(sender, e);
59 | }
60 | else
61 | {
62 | if (Completed != null)
63 | {
64 | Completed(sender, e);
65 | }
66 | }
67 | }
68 |
69 | ///
70 | /// Occurs when a chooser task is completed.
71 | ///
72 | public event EventHandler Completed;
73 | }
74 | }
--------------------------------------------------------------------------------
/InTheHand/ComponentModel/DoWorkEventArgs.cs:
--------------------------------------------------------------------------------
1 | // --------------------------------------------------------------------------------------------------------------------
2 | //
3 | // Copyright (c) 2004-14 In The Hand Ltd. All Rights Reserved.
4 | //
5 | // Peter Foot
6 | // --------------------------------------------------------------------------------------------------------------------
7 |
8 | namespace InTheHand.ComponentModel
9 | {
10 | ///
11 | /// Represents the method that will handle the DoWork event.
12 | ///
13 | /// The source of the event.
14 | /// A that contains the event data.
15 | /// When you create a delegate, you identify the method that will handle the event.
16 | /// To associate the event with your event handler, add an instance of the delegate to the event.
17 | /// The event-handler method is called whenever the event occurs, unless you remove the delegate.
18 | public delegate void DoWorkEventHandler(object sender, DoWorkEventArgs e);
19 |
20 | ///
21 | /// Provides data for the event handler.
22 | ///
23 | public sealed class DoWorkEventArgs : System.ComponentModel.CancelEventArgs
24 | {
25 | private readonly object argument;
26 | private object result;
27 |
28 | ///
29 | /// Initializes a new instance of the class.
30 | ///
31 | /// Specifies an argument for an asynchronous operation.
32 | public DoWorkEventArgs(object argument)
33 | {
34 | this.argument = argument;
35 | }
36 | ///
37 | /// Gets a value that represents the argument of an asynchronous operation.
38 | ///
39 | public object Argument
40 | {
41 | get
42 | {
43 | return argument;
44 | }
45 |
46 | }
47 | ///
48 | /// Gets or sets a value that represents the result of an asynchronous operation.
49 | ///
50 | public object Result
51 | {
52 | get
53 | {
54 | return result;
55 | }
56 | set
57 | {
58 | result = value;
59 | }
60 | }
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/InTheHand.Net.ConnectionManager/ConnectionPriority.cs:
--------------------------------------------------------------------------------
1 | // In The Hand - .NET Components for Mobility
2 | //
3 | // InTheHand.Net.ConnectionManager.ConnectionPriority
4 | //
5 | // Copyright (c) 2003-2010 In The Hand Ltd, All rights reserved.
6 |
7 | using System;
8 |
9 | namespace InTheHand.Net.ConnectionManager
10 | {
11 | ///
12 | /// Defines the priority of a connection request.
13 | ///
14 | [Flags()]
15 | public enum ConnectionPriority
16 | {
17 | ///
18 | /// Voice, highest priority, reserved for internal use only.
19 | ///
20 | Voice = 0x20000,
21 | ///
22 | /// User initiated action caused this request, and UI is
23 | /// currently pending on the creation of this connection.
24 | /// This is appropriate for an interactive browsing session,
25 | /// or if the user selects "MORE" at the bottom of a truncated
26 | /// mail message, etc.
27 | ///
28 | UserInteractive = 0x08000,
29 | ///
30 | /// User initiated connection which has recently become idle.
31 | /// A connection should be marked as idle when it is no longer the user's current task.
32 | ///
33 | UserBackground = 0x02000,
34 | ///
35 | /// Interactive user task which has been idle for an application specified time.
36 | /// The application should toggle the state between UserIdle and UserInteractive as the user uses the application.
37 | /// This helps ConnectionManager optimize responsiveness to the interactive application,
38 | /// while sharing the connection with background applications.
39 | ///
40 | UserIdle = 0x0800,
41 | ///
42 | /// High priority background connection.
43 | ///
44 | HighPriorityBackground = 0x0200,
45 | ///
46 | /// Idle priority background connection.
47 | ///
48 | IdleBackground = 0x0080,
49 | ///
50 | /// Connection is requested on behalf of an external entity, but is an interactive session (e.g. AT Command Interpreter)
51 | ///
52 | ExternalInteractive = 0x0020,
53 | ///
54 | /// Lowest priority.
55 | /// Only connects if another higher priority client is already using the same path.
56 | ///
57 | LowPriorityBackground = 0x0008,
58 | //CACHED = 0x0002,
59 | //ALWAYS_ON = 0x0001,
60 | }
61 | }
--------------------------------------------------------------------------------
/InTheHand.Net.NetworkInformation/MulticastIPAddressInformation.cs:
--------------------------------------------------------------------------------
1 | // In The Hand - .NET Components for Mobility
2 | //
3 | // InTheHand.Net.NetworkInformation.MulticastIPAddressInformation
4 | //
5 | // Copyright (c) 2010 In The Hand Ltd, All rights reserved.
6 |
7 | using System;
8 | using System.Collections;
9 | using System.Collections.Generic;
10 | using System.Collections.ObjectModel;
11 | using System.Runtime.InteropServices;
12 | using System.ComponentModel;
13 | using System.Net;
14 |
15 | namespace InTheHand.Net.NetworkInformation
16 | {
17 | ///
18 | /// Provides information about a network interface's multicast address.
19 | ///
20 | public sealed class MulticastIPAddressInformation : IPAddressInformation
21 | {
22 | private IP_ADAPTER_MULTICAST_ADDRESS iama;
23 |
24 | internal MulticastIPAddressInformation(IP_ADAPTER_MULTICAST_ADDRESS multicastAddress)
25 | {
26 | this.iama = multicastAddress;
27 | address = GetAddressFromSocketAddress(iama.Address.lpSockaddr);
28 | isDnsEligible = iama.Flags.HasFlag(IP_ADAPTER_ADDRESS.DNS_ELIGIBLE);
29 | isTransient = iama.Flags.HasFlag(IP_ADAPTER_ADDRESS.TRANSIENT);
30 | }
31 |
32 | /*public long AddressPreferredLifetime
33 | {
34 | get
35 | {
36 | return 0;
37 | }
38 | }
39 |
40 | public long AddressValidLifetime
41 | {
42 | get
43 | {
44 | return 0;
45 | }
46 | }
47 |
48 | public long DhcpLeaseLifetime
49 | {
50 | get
51 | {
52 | return 0;
53 | }
54 | }
55 |
56 | public DuplicateAddressDetectionState DuplicateAddressDetectionState
57 | {
58 | get
59 | {
60 | return DuplicateAddressDetectionState.Invalid;
61 | }
62 | }
63 |
64 | public PrefixOrigin PrefixOrigin
65 | {
66 | get
67 | {
68 | return PrefixOrigin.Other;
69 | }
70 | }
71 |
72 | public SuffixOrigin SuffixOrigin
73 | {
74 | get
75 | {
76 | return SuffixOrigin.Other;
77 | }
78 | }*/
79 | }
80 |
81 | [StructLayout(LayoutKind.Sequential)]
82 | internal struct IP_ADAPTER_MULTICAST_ADDRESS
83 | {
84 | internal int Length;
85 | internal IP_ADAPTER_ADDRESS Flags;
86 | internal IntPtr Next;
87 | internal SOCKET_ADDRESS Address;
88 | }
89 | }
--------------------------------------------------------------------------------
/InTheHand.Windows/MessageBoxImage.cs:
--------------------------------------------------------------------------------
1 | // --------------------------------------------------------------------------------------------------------------------
2 | //
3 | // Copyright (c) 2010-14 In The Hand Ltd. All Rights Reserved.
4 | //
5 | // Peter Foot
6 | // --------------------------------------------------------------------------------------------------------------------
7 |
8 | namespace InTheHand.Windows
9 | {
10 | ///
11 | /// Specifies the icon that is displayed by a message box.
12 | ///
13 | /// For Windows Phone this affects only the sound played.
14 | ///
15 | /// Platforms Supported
16 | /// - Windows MobilePocket PC 2003, Windows Mobile 5.0 and later
17 | /// - Windows PhoneWindows Phone 7 and later
18 | /// - Windows Embedded CompactWindows CE .NET 4.1 and later
19 | ///
20 | ///
21 | public enum MessageBoxImage
22 | {
23 | ///
24 | /// No icon is displayed. No sound is played.
25 | ///
26 | None = 0,
27 |
28 | ///
29 | /// The message box displays an error icon.
30 | ///
31 | Error = 0x10,
32 |
33 | ///
34 | /// The message box displays a hand icon.
35 | ///
36 | Hand = 0x10,
37 |
38 | ///
39 | /// The message box displays a stop icon.
40 | ///
41 | Stop = 0x10,
42 |
43 | ///
44 | /// The message box displays a question mark icon.
45 | ///
46 | Question = 0x20,
47 |
48 | ///
49 | /// The message box displays a warning icon.
50 | /// Equivalent to the default MessageBox behaviour on Windows Phone.
51 | ///
52 | Warning = 0x30,
53 |
54 | ///
55 | /// The message box displays an exclamation mark icon.
56 | ///
57 | Exclamation = 0x30,
58 |
59 | ///
60 | /// The message box displays an information icon.
61 | ///
62 | Information = 0x40,
63 |
64 | ///
65 | /// The message box displays an asterisk icon.
66 | ///
67 | Asterisk = 0x40,
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/InTheHand.Device.Location/GeoPosition.cs:
--------------------------------------------------------------------------------
1 | // --------------------------------------------------------------------------------------------------------------------
2 | //
3 | // Copyright (c) 2010-14 In The Hand Ltd. All Rights Reserved.
4 | //
5 | // Peter Foot
6 | // --------------------------------------------------------------------------------------------------------------------
7 |
8 | namespace InTheHand.Device.Location
9 | {
10 | ///
11 | /// Contains location data of a type specified by the type parameter of the class.
12 | ///
13 | /// The type of the location data.
14 | /// Equivalent to System.Device.Location.GeoPosition<T> in the .NET Framework 4
15 | public class GeoPosition
16 | {
17 | DateTimeOffset timestamp;
18 | T position;
19 |
20 | ///
21 | /// Initializes a new instance of the class.
22 | ///
23 | public GeoPosition()
24 | {
25 | }
26 |
27 | ///
28 | /// Initializes a new instance of the class with a timestamp and position.
29 | ///
30 | /// The time the location data was obtained.
31 | /// The location data to use to initialize the object.
32 | public GeoPosition(DateTimeOffset timestamp, T position)
33 | {
34 | this.timestamp = timestamp;
35 | this.position = position;
36 | }
37 |
38 | ///
39 | /// Gets or sets the location data for the object.
40 | ///
41 | /// An object of type T that contains the location data for the object.
42 | public T Location
43 | {
44 | get
45 | {
46 | return position;
47 | }
48 | set
49 | {
50 | position = value;
51 | }
52 | }
53 |
54 | ///
55 | /// Gets or sets the time when the location data was obtained.
56 | ///
57 | /// Gets or sets the time when the location data was obtained.
58 | public DateTimeOffset Timestamp
59 | {
60 | get
61 | {
62 | return timestamp;
63 | }
64 | set
65 | {
66 | timestamp = value;
67 | }
68 | }
69 | }
70 | }
--------------------------------------------------------------------------------
/InTheHand/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("InTheHand")]
9 | [assembly: AssemblyDescription("Extensions for the .NET Compact Framework")]
10 |
11 | [assembly: InternalsVisibleTo("InTheHand.Device.Location, PublicKey=002400000480000094000000060200000024000052534131000400000100010029d499ba127ccaf5cf437aa425461810bb0412dae927733df396adb06b7815c87534cee2a3bd86230bd347e072a92d1a1c08e77ecb3ed0c6e1de4fed625aa06774f5ef8a186d36e0aaad129993e5eae7b31223575867c659c108615b07797059a8aabd31395ff42baf24b0bbee86cbf8b9ecb4e887127a90fcbd7bb2569207ae")]
12 | [assembly: InternalsVisibleTo("InTheHand.Drawing, PublicKey=002400000480000094000000060200000024000052534131000400000100010029d499ba127ccaf5cf437aa425461810bb0412dae927733df396adb06b7815c87534cee2a3bd86230bd347e072a92d1a1c08e77ecb3ed0c6e1de4fed625aa06774f5ef8a186d36e0aaad129993e5eae7b31223575867c659c108615b07797059a8aabd31395ff42baf24b0bbee86cbf8b9ecb4e887127a90fcbd7bb2569207ae")]
13 | [assembly: InternalsVisibleTo("InTheHand.Net.ConnectionManager, PublicKey=002400000480000094000000060200000024000052534131000400000100010029d499ba127ccaf5cf437aa425461810bb0412dae927733df396adb06b7815c87534cee2a3bd86230bd347e072a92d1a1c08e77ecb3ed0c6e1de4fed625aa06774f5ef8a186d36e0aaad129993e5eae7b31223575867c659c108615b07797059a8aabd31395ff42baf24b0bbee86cbf8b9ecb4e887127a90fcbd7bb2569207ae")]
14 | [assembly: InternalsVisibleTo("InTheHand.Net.NetworkInformation, PublicKey=002400000480000094000000060200000024000052534131000400000100010029d499ba127ccaf5cf437aa425461810bb0412dae927733df396adb06b7815c87534cee2a3bd86230bd347e072a92d1a1c08e77ecb3ed0c6e1de4fed625aa06774f5ef8a186d36e0aaad129993e5eae7b31223575867c659c108615b07797059a8aabd31395ff42baf24b0bbee86cbf8b9ecb4e887127a90fcbd7bb2569207ae")]
15 | [assembly: InternalsVisibleTo("InTheHand.Phone, PublicKey=002400000480000094000000060200000024000052534131000400000100010029d499ba127ccaf5cf437aa425461810bb0412dae927733df396adb06b7815c87534cee2a3bd86230bd347e072a92d1a1c08e77ecb3ed0c6e1de4fed625aa06774f5ef8a186d36e0aaad129993e5eae7b31223575867c659c108615b07797059a8aabd31395ff42baf24b0bbee86cbf8b9ecb4e887127a90fcbd7bb2569207ae")]
16 | [assembly: InternalsVisibleTo("InTheHand.Windows.Forms, PublicKey=002400000480000094000000060200000024000052534131000400000100010029d499ba127ccaf5cf437aa425461810bb0412dae927733df396adb06b7815c87534cee2a3bd86230bd347e072a92d1a1c08e77ecb3ed0c6e1de4fed625aa06774f5ef8a186d36e0aaad129993e5eae7b31223575867c659c108615b07797059a8aabd31395ff42baf24b0bbee86cbf8b9ecb4e887127a90fcbd7bb2569207ae")]
17 |
--------------------------------------------------------------------------------
/InTheHand.Phone/Tasks/EmailComposeTask.cs:
--------------------------------------------------------------------------------
1 | // In The Hand - .NET Components for Mobility
2 | //
3 | // InTheHand.Phone.Tasks.EmailComposeTask
4 | //
5 | // Copyright (c) 2010-12 In The Hand Ltd, All rights reserved.
6 |
7 | using System;
8 | using System.Runtime.InteropServices;
9 |
10 | namespace InTheHand.Phone.Tasks
11 | {
12 | ///
13 | /// Allows an application to launch the email application with a new message displayed.
14 | /// Use this to allow users to send email from your application.
15 | ///
16 | ///
17 | /// Platforms Supported
18 | /// - Windows MobilePocket PC 2003 and later, Windows Mobile Version 5.0 and later
19 | /// - Windows EmbeddedWindows CE 4.1 and later
20 | ///
21 | ///
22 | public sealed class EmailComposeTask
23 | {
24 | ///
25 | /// Shows the email application with a new message displayed.
26 | ///
27 | public void Show()
28 | {
29 | NativeMethods.ComposeMessage(To, Cc, Bcc, Subject, Body, null, null, "IPM.Note");
30 | }
31 |
32 | ///
33 | /// The body of the new email message.
34 | ///
35 | /// The Body property does not support HTML formatting.
36 | /// If the content assigned to the Body property happens to work with the codepage that maps to the current locale settings for the device, it will be sent using that codepage.
37 | /// If the codepage mapped to the current locale setting cannot render the content, UTF-8 encoding will be used.
38 | public string Body
39 | {
40 | get;
41 | set;
42 | }
43 |
44 | ///
45 | /// The recipients on the To line of the new email message.
46 | ///
47 | public string To
48 | {
49 | get;
50 | set;
51 | }
52 |
53 | ///
54 | /// The recipients on the cc line of the new email message.
55 | ///
56 | public string Cc
57 | {
58 | get;
59 | set;
60 | }
61 |
62 | ///
63 | /// Gets or sets the recipients on the Bcc line of the new email message.
64 | ///
65 | public string Bcc
66 | {
67 | get;
68 | set;
69 | }
70 |
71 | ///
72 | /// The subject of the new email message.
73 | ///
74 | public string Subject
75 | {
76 | get;
77 | set;
78 | }
79 | }
80 | }
--------------------------------------------------------------------------------
/InTheHand.Drawing/SystemFonts.cs:
--------------------------------------------------------------------------------
1 | // --------------------------------------------------------------------------------------------------------------------
2 | //
3 | // Copyright (c) 2009-14 In The Hand Ltd. All Rights Reserved.
4 | //
5 | // Peter Foot
6 | // --------------------------------------------------------------------------------------------------------------------
7 |
8 | using System;
9 | using System.Drawing;
10 | using System.Runtime.InteropServices;
11 | using Microsoft.WindowsCE.Forms;
12 |
13 | namespace InTheHand.Drawing
14 | {
15 | ///
16 | /// Specifies the fonts used to display text in Windows display elements.
17 | ///
18 | /// Equivalent to System.Drawing.SystemFonts
19 | public static class SystemFonts
20 | {
21 | private static int FontSizePixels
22 | {
23 | get
24 | {
25 | int fontSizePixel;
26 | int req;
27 | int hresult = NativeMethods.GetUIMetrics(NativeMethods.SHUIMETRIC.FONTSIZE_PIXEL, out fontSizePixel, 4, out req);
28 | if (hresult != 0)
29 | {
30 | return 28;
31 | }
32 |
33 | return fontSizePixel;
34 | }
35 | }
36 |
37 | ///
38 | /// Gets the default font that applications can use for dialog boxes and forms.
39 | ///
40 | /// The default of the system.
41 | /// The value returned will vary depending on UI metrics and culture of the operating system.
42 | public static Font DefaultFont
43 | {
44 | get
45 | {
46 | Microsoft.WindowsCE.Forms.LogFont lf = new Microsoft.WindowsCE.Forms.LogFont();
47 | lf.PitchAndFamily = Microsoft.WindowsCE.Forms.LogFontPitchAndFamily.Default;
48 | lf.Height = -FontSizePixels;
49 | lf.Quality = Microsoft.WindowsCE.Forms.LogFontQuality.ClearType;
50 |
51 | return Font.FromLogFont(lf);
52 | }
53 | }
54 |
55 | ///
56 | /// Gets a that is used to display text in the title bars of windows.
57 | ///
58 | /// A that is used to display text in the title bars of windows.
59 | public static Font CaptionFont
60 | {
61 | get
62 | {
63 | float fontSize = 10;
64 | if (InTheHand.WindowsCE.Forms.SystemSettingsInTheHand.Platform == WinCEPlatform.PocketPC)
65 | {
66 | fontSize = 8;
67 | }
68 |
69 | return new Font(FontFamily.GenericSansSerif, fontSize, FontStyle.Bold);
70 | }
71 | }
72 | }
73 | }
--------------------------------------------------------------------------------
/InTheHand.Phone/Tasks/EmailAddressChooserTask.cs:
--------------------------------------------------------------------------------
1 | // In The Hand - .NET Components for Mobility
2 | //
3 | // InTheHand.Phone.Tasks.EmailAddressChooserTask
4 | //
5 | // Copyright (c) 2010-2012 In The Hand Ltd, All rights reserved.
6 |
7 | using System;
8 | using System.Runtime.InteropServices;
9 |
10 | namespace InTheHand.Phone.Tasks
11 | {
12 | ///
13 | /// Allows an application to launch the Contacts application.
14 | /// Use this to obtain the email address of a contact selected by the user.
15 | ///
16 | ///
17 | /// Platforms Supported
18 | /// - Windows MobileWindows Mobile Version 5.0 and later
19 | /// - Windows Embedded CompactWindows Embedded Compact 7
20 | ///
21 | ///
22 | public sealed class EmailAddressChooserTask : ChooserBase
23 | {
24 | private const int ALL_EMAIL = 0x1801001f;
25 | ///
26 | /// Shows the email address chooser application.
27 | ///
28 | public new void Show()
29 | {
30 | System.Threading.ThreadPool.QueueUserWorkItem(new System.Threading.WaitCallback(Worker), null);
31 | base.Show();
32 | }
33 |
34 | private void Worker(object state)
35 | {
36 | EmailResult er = new EmailResult();
37 | NativeMethods.CHOOSECONTACT cc = new NativeMethods.CHOOSECONTACT();
38 |
39 | try
40 | {
41 | cc.cbSize = Marshal.SizeOf(cc);
42 | cc.dwFlags = NativeMethods.CCF.RETURNPROPERTYVALUE | NativeMethods.CCF.HIDENEW;
43 | cc.cRequiredProperties = 1;
44 | cc.rgpropidRequiredProperties = Marshal.AllocHGlobal(4);
45 | Marshal.WriteInt32(cc.rgpropidRequiredProperties, ALL_EMAIL);
46 |
47 | int hresult = NativeMethods.ChooseContact(ref cc);
48 |
49 | switch (hresult)
50 | {
51 | case 0:
52 | er.Email = Marshal.PtrToStringUni(cc.bstrPropertyValueSelected);
53 | er.TaskResult = TaskResult.OK;
54 | break;
55 |
56 | case unchecked((int)0x80004004):
57 | er.TaskResult = TaskResult.Cancel;
58 | break;
59 | }
60 |
61 | }
62 | catch (Exception ex)
63 | {
64 | er.TaskResult = TaskResult.None;
65 | er.Error = ex;
66 | }
67 | finally
68 | {
69 | if (cc.rgpropidRequiredProperties != IntPtr.Zero)
70 | {
71 | Marshal.FreeHGlobal(cc.rgpropidRequiredProperties);
72 | cc.rgpropidRequiredProperties = IntPtr.Zero;
73 | }
74 | }
75 |
76 | base.FireCompleted(this, er, null);
77 | }
78 | }
79 | }
--------------------------------------------------------------------------------
/InTheHand.Net.NetworkInformation/TcpState.cs:
--------------------------------------------------------------------------------
1 | // In The Hand - .NET Components for Mobility
2 | //
3 | // InTheHand.Net.NetworkInformation.TcpState
4 | //
5 | // Copyright (c) 2007-2010 In The Hand Ltd, All rights reserved.
6 |
7 | namespace InTheHand.Net.NetworkInformation
8 | {
9 | ///
10 | /// Specifies the states of a Transmission Control Protocol (TCP) connection.
11 | ///
12 | public enum TcpState
13 | {
14 | ///
15 | /// The TCP connection state is unknown.
16 | ///
17 | Unknown = 0,
18 | ///
19 | /// The TCP connection is closed.
20 | ///
21 | Closed,
22 | ///
23 | /// The local endpoint of the TCP connection is listening for a connection request from any remote endpoint.
24 | ///
25 | Listen,
26 | ///
27 | /// The local endpoint of the TCP connection has sent the remote endpoint a segment header with the synchronize (SYN) control bit set and is waiting for a matching connection request.
28 | ///
29 | SynSent,
30 | ///
31 | /// The local endpoint of the TCP connection has sent and received a connection request and is waiting for an acknowledgment.
32 | ///
33 | SynReceived,
34 | ///
35 | /// The TCP handshake is complete.
36 | /// The connection has been established and data can be sent.
37 | ///
38 | Established,
39 | ///
40 | /// The local endpoint of the TCP connection is waiting for a connection termination request from the remote endpoint or for an acknowledgement of the connection termination request sent previously.
41 | ///
42 | FinWait1,
43 | ///
44 | /// The local endpoint of the TCP connection is waiting for a connection termination request from the remote endpoint.
45 | ///
46 | FinWait2,
47 | ///
48 | /// The local endpoint of the TCP connection is waiting for a connection termination request from the local user.
49 | ///
50 | CloseWait,
51 | ///
52 | /// The local endpoint of the TCP connection is waiting for an acknowledgement of the connection termination request sent previously.
53 | ///
54 | Closing,
55 | ///
56 | /// The local endpoint of the TCP connection is waiting for the final acknowledgement of the connection termination request sent previously.
57 | ///
58 | LastAck,
59 | ///
60 | /// The local endpoint of the TCP connection is waiting for enough time to pass to ensure that the remote endpoint received the acknowledgement of its connection termination request.
61 | ///
62 | TimeWait,
63 | ///
64 | /// The transmission control buffer (TCB) for the TCP connection is being deleted.
65 | ///
66 | DeleteTcb
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/InTheHand.Security.Cryptography/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:2.0.50727.8009
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace InTheHand.Security.Cryptography.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
23 | internal class Resources {
24 |
25 | private static global::System.Resources.ResourceManager resourceMan;
26 |
27 | private static global::System.Globalization.CultureInfo resourceCulture;
28 |
29 | internal Resources() {
30 | }
31 |
32 | ///
33 | /// Returns the cached ResourceManager instance used by this class.
34 | ///
35 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
36 | internal static global::System.Resources.ResourceManager ResourceManager {
37 | get {
38 | if (object.ReferenceEquals(resourceMan, null)) {
39 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("InTheHand.Security.Cryptography.Properties.Resources", typeof(Resources).Assembly);
40 | resourceMan = temp;
41 | }
42 | return resourceMan;
43 | }
44 | }
45 |
46 | ///
47 | /// Overrides the current thread's CurrentUICulture property for all
48 | /// resource lookups using this strongly typed resource class.
49 | ///
50 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
51 | internal static global::System.Globalization.CultureInfo Culture {
52 | get {
53 | return resourceCulture;
54 | }
55 | set {
56 | resourceCulture = value;
57 | }
58 | }
59 |
60 | ///
61 | /// Looks up a localized string similar to The specified cipher mode is not valid for this algorithm..
62 | ///
63 | internal static string Cryptography_InvalidCipherMode {
64 | get {
65 | return ResourceManager.GetString("Cryptography_InvalidCipherMode", resourceCulture);
66 | }
67 | }
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/InTheHand.Net.NetworkInformation/TcpConnectionInformation.cs:
--------------------------------------------------------------------------------
1 | // In The Hand - .NET Components for Mobility
2 | //
3 | // InTheHand.Net.NetworkInformation.TcpConnectionInformation
4 | //
5 | // Copyright (c) 2007-2010 In The Hand Ltd, All rights reserved.
6 |
7 | using System.Net;
8 | using System.Runtime.InteropServices;
9 |
10 | namespace InTheHand.Net.NetworkInformation
11 | {
12 | ///
13 | /// Provides information about the Transmission Control Protocol (TCP) connections on the local computer.
14 | ///
15 | public sealed class TcpConnectionInformation
16 | {
17 | private IPEndPoint localEndPoint;
18 | private IPEndPoint remoteEndPoint;
19 | private TcpState state;
20 |
21 | internal TcpConnectionInformation(MIB_TCPROW row)
22 | {
23 | this.state = (TcpState)row.dwState;
24 | int localPort = (int)(((row.dwLocalPort & 0xff000000) >> 8) | ((row.dwLocalPort & 0xff0000) << 8) | ((row.dwLocalPort & 0xFF00) >> 8) | ((row.dwLocalPort & 0xff) << 8));//((ushort)Marshal.ReadInt16(bufferPtr, 8 + (i * 8)) >> 8) | (ushort)Marshal.ReadInt16(bufferPtr, 10 + (i * 8)); row.dwLocalPort;// (((row.localPort3 << 0x18) | (row.localPort4 << 0x10)) | (row.localPort1 << 8)) | row.localPort2;
25 | int remotePort = (int)((this.state == TcpState.Listen) ? 0 : (int)(((row.dwRemotePort & 0xff000000) >> 8) | ((row.dwRemotePort & 0xff0000) << 8) | ((row.dwRemotePort & 0xFF00) >> 8) | ((row.dwRemotePort & 0xff) << 8)));//((row.dwRemotePort & 0xFFFF0000) >> 16) | ((row.dwRemotePort & 0xffff) << 16));// ((((row.remotePort3 << 0x18) | (row.remotePort4 << 0x10)) | (row.remotePort1 << 8)) | row.remotePort2);
26 | this.localEndPoint = new IPEndPoint((long) row.dwLocalAddr, localPort);
27 | this.remoteEndPoint = new IPEndPoint((long) row.dwRemoteAddr, remotePort);
28 | }
29 |
30 | ///
31 | /// Gets the local endpoint of a Transmission Control Protocol (TCP) connection.
32 | ///
33 | public IPEndPoint LocalEndPoint
34 | {
35 | get
36 | {
37 | return this.localEndPoint;
38 | }
39 | }
40 |
41 | ///
42 | /// Gets the remote endpoint of a Transmission Control Protocol (TCP) connection.
43 | ///
44 | public IPEndPoint RemoteEndPoint
45 | {
46 | get
47 | {
48 | return this.remoteEndPoint;
49 | }
50 | }
51 |
52 | ///
53 | /// Gets the state of this Transmission Control Protocol (TCP) connection.
54 | ///
55 | public TcpState State
56 | {
57 | get
58 | {
59 | return this.state;
60 | }
61 | }
62 | }
63 |
64 |
65 |
66 | [StructLayout(LayoutKind.Sequential, Size=20)]
67 | internal struct MIB_TCPROW
68 | {
69 | internal uint dwState;
70 | internal uint dwLocalAddr;
71 | internal uint dwLocalPort;
72 | internal uint dwRemoteAddr;
73 | internal uint dwRemotePort;
74 | }
75 |
76 |
77 | }
78 |
--------------------------------------------------------------------------------
/InTheHand/WindowsCE/Forms/SystemSettings.cs:
--------------------------------------------------------------------------------
1 | // In The Hand - .NET Components for Mobility
2 | //
3 | // InTheHand.WindowsCE.Forms.SystemSettings
4 | //
5 | // Copyright (c) 2003-2014 In The Hand Ltd, All rights reserved.
6 |
7 | using System.Runtime.InteropServices;
8 | using Microsoft.WindowsCE.Forms;
9 |
10 | namespace InTheHand.WindowsCE.Forms
11 | {
12 | ///
13 | /// Provides access to user interface and native Windows CE operating system settings on a device.
14 | ///
15 | ///
16 | public static class SystemSettingsInTheHand
17 | {
18 | private static WinCEPlatform platform = (WinCEPlatform)(-1);
19 |
20 | ///
21 | /// Gets the well-known Windows CE based operating system of the device.
22 | ///
23 | /// A enumeration value that specifies the device platform.
24 | public static WinCEPlatform Platform
25 | {
26 | get
27 | {
28 |
29 | if (platform == (WinCEPlatform)(-1))
30 | {
31 | if (System.Environment.OSVersion.Version.Major > 5)
32 | {
33 | platform = WinCEPlatform.WinCEGeneric;
34 | }
35 | else
36 | {
37 | // This API is useful for Windows Mobile but throws an OS exception on CE6 and above because it is deprecated
38 | // But in those cases we know it's WinCEGeneric!
39 | string typeString = null;
40 | bool success = InTheHand.NativeMethods.SystemParametersInfoString(InTheHand.NativeMethods.SPI.GETPLATFORMTYPE, out typeString);
41 | if (success)
42 | {
43 | switch (typeString)
44 | {
45 | case "PocketPC":
46 | platform = WinCEPlatform.PocketPC;
47 | break;
48 | case "SmartPhone":
49 | platform = WinCEPlatform.Smartphone;
50 | break;
51 | default:
52 | platform = WinCEPlatform.WinCEGeneric;
53 | break;
54 | }
55 | }
56 | else
57 | {
58 | // on security error return Smartphone
59 | if (Marshal.GetLastWin32Error() == 0x5)
60 | {
61 | platform = WinCEPlatform.Smartphone;
62 | }
63 | else
64 | {
65 | platform = WinCEPlatform.WinCEGeneric;
66 | }
67 | }
68 | }
69 | }
70 | return platform;
71 | }
72 | }
73 | }
74 | }
--------------------------------------------------------------------------------
/InTheHand.Net.ConnectionManager/ConnectionStatus.cs:
--------------------------------------------------------------------------------
1 | // In The Hand - .NET Components for Mobility
2 | //
3 | // InTheHand.Net.ConnectionStatus
4 | //
5 | // Copyright (c) 2003-2010 In The Hand Ltd, All rights reserved.
6 |
7 | using System;
8 |
9 | namespace InTheHand.Net
10 | {
11 | ///
12 | /// Contains the possible connection status values.
13 | ///
14 | public enum ConnectionStatus
15 | {
16 | ///
17 | /// Connection state is unknown.
18 | ///
19 | Unknown = 0x00,
20 | ///
21 | /// Device is connected to the required destination network.
22 | ///
23 | Connected = 0x10,
24 | ///
25 | /// Connection is currently suspended.
26 | ///
27 | Suspended = 0x11,
28 |
29 | ///
30 | /// Connection has been disconnected.
31 | ///
32 | Disconnected = 0x20,
33 | ///
34 | /// Connection attempt failed.
35 | ///
36 | ConnectionFailed = 0x21,
37 | ///
38 | /// Connection attempt was cancelled by the user
39 | ///
40 | ConnectionCancelled = 0x22,
41 | ///
42 | /// Connection is disabled.
43 | ///
44 | ConnectionDisabled = 0x23,
45 | ///
46 | /// Connection Manager couldn't find a path to the required destination network.
47 | ///
48 | NoPathToDestination = 0x24,
49 | ///
50 | /// Device is waiting for an available connection path.
51 | ///
52 | WaitingForPath = 0x25,
53 | ///
54 | /// Device is waiting for phone hardware.
55 | ///
56 | WaitingForPhone = 0x26,
57 | ///
58 | /// Phone hardware is off.
59 | ///
60 | PhoneOff = 0x27,
61 | ///
62 | /// Another connection request has an exclusive connection at a higher priority.
63 | ///
64 | ExclusiveConflict = 0x28,
65 | ///
66 | /// No resources available to perform connection.
67 | ///
68 | NoResources = 0x29,
69 | ///
70 | /// Link failed.
71 | ///
72 | ConnectionLinkFailed = 0x2A,
73 | ///
74 | /// Authentication failed while connecting.
75 | ///
76 | AuthenticationFailed = 0x2B,
77 |
78 | ///
79 | /// Waiting for the connection.
80 | ///
81 | WaitingConnection = 0x40,
82 | ///
83 | /// Waiting for a required resource.
84 | ///
85 | WaitingForResource = 0x41,
86 | ///
87 | /// Waiting for a required network.
88 | ///
89 | WaitingForNetwork = 0x42,
90 | ///
91 | /// Waiting to disconnect.
92 | ///
93 | WaitingDisconnection = 0x80,
94 | ///
95 | /// Waiting to abort the connection.
96 | ///
97 | WaitingConnectionAbort = 0x81,
98 | }
99 | }
--------------------------------------------------------------------------------
/InTheHand.Net.NetworkInformation/IPAddressInformation.cs:
--------------------------------------------------------------------------------
1 | // In The Hand - .NET Components for Mobility
2 | //
3 | // InTheHand.Net.NetworkInformation.IPAddressInformation
4 | //
5 | // Copyright (c) 2010 In The Hand Ltd, All rights reserved.
6 |
7 | using System;
8 | using System.Collections;
9 | using System.Collections.Generic;
10 | using System.Collections.ObjectModel;
11 | using System.Runtime.InteropServices;
12 | using System.ComponentModel;
13 | using System.Net;
14 |
15 | namespace InTheHand.Net.NetworkInformation
16 | {
17 | ///
18 | /// Provides information about a network interface address.
19 | ///
20 | public class IPAddressInformation
21 | {
22 | private IP_ADAPTER_ANYCAST_ADDRESS iaaa;
23 |
24 | internal IPAddressInformation() { }
25 |
26 | internal IPAddressInformation(IP_ADAPTER_ANYCAST_ADDRESS anycastAddress)
27 | {
28 | iaaa = anycastAddress;
29 | address = GetAddressFromSocketAddress(iaaa.Address.lpSockaddr);
30 | isDnsEligible = iaaa.Flags.HasFlag(IP_ADAPTER_ADDRESS.DNS_ELIGIBLE);
31 | isTransient = iaaa.Flags.HasFlag(IP_ADAPTER_ADDRESS.TRANSIENT);
32 | }
33 |
34 | internal static IPAddress GetAddressFromSocketAddress(IntPtr sa)
35 | {
36 | System.Net.Sockets.AddressFamily af = (System.Net.Sockets.AddressFamily)Marshal.ReadInt16(sa, 0);
37 | IPAddress address = null;
38 | switch (af)
39 | {
40 | case System.Net.Sockets.AddressFamily.InterNetwork:
41 | address = new IPAddress(Marshal.ReadInt64(sa, 4));
42 | break;
43 |
44 | case System.Net.Sockets.AddressFamily.InterNetworkV6:
45 | byte[] addressBytes = new byte[16];
46 | Marshal.Copy(IntPtrInTheHand.Add(sa, 8), addressBytes, 0, 16);
47 | address = new IPAddress(addressBytes);
48 | break;
49 | }
50 |
51 | return address;
52 | }
53 |
54 | internal IPAddress address;
55 | ///
56 | /// Gets the Internet Protocol (IP) address.
57 | ///
58 | public IPAddress Address
59 | {
60 | get
61 | {
62 | return address;
63 | }
64 | }
65 |
66 | internal bool isDnsEligible;
67 | ///
68 | /// Gets a Boolean value that indicates whether the Internet Protocol (IP) address is valid to appear in a Domain Name System (DNS) server database.
69 | ///
70 | public bool IsDnsEligible
71 | {
72 | get
73 | {
74 | return isDnsEligible;
75 | }
76 | }
77 |
78 | internal bool isTransient;
79 | ///
80 | /// Gets a Boolean value that indicates whether the Internet Protocol (IP) address is transient (a cluster address).
81 | ///
82 | public bool IsTransient
83 | {
84 | get
85 | {
86 | return isTransient;
87 | }
88 | }
89 | }
90 |
91 | [StructLayout(LayoutKind.Sequential)]
92 | internal struct IP_ADAPTER_ANYCAST_ADDRESS
93 | {
94 | internal int Length;
95 | internal IP_ADAPTER_ADDRESS Flags;
96 | internal IntPtr Next;
97 | internal SOCKET_ADDRESS Address;
98 | }
99 | }
--------------------------------------------------------------------------------
/InTheHand.Net.NetworkInformation/PingReply.cs:
--------------------------------------------------------------------------------
1 | // In The Hand - .NET Components for Mobility
2 | //
3 | // InTheHand.Net.NetworkInformation.PingReply
4 | //
5 | // Copyright (c) 2003-2014 In The Hand Ltd, All rights reserved.
6 |
7 | using System.Net;
8 | using System.Runtime.InteropServices;
9 |
10 | namespace InTheHand.Net.NetworkInformation
11 | {
12 | ///
13 | /// Provides information about the status and data resulting from a operation.
14 | ///
15 | public class PingReply
16 | {
17 | private IPAddress address;
18 | private byte[] buffer;
19 | private IPStatus ipStatus;
20 | private PingOptions options;
21 | private long rtt;
22 |
23 |
24 | internal PingReply(IcmpEchoReply reply)
25 | {
26 | this.address = new IPAddress((long)reply.address);
27 | this.ipStatus = (IPStatus)reply.status;
28 | if (this.ipStatus == IPStatus.Success)
29 | {
30 | this.rtt = reply.roundTripTime;
31 | this.buffer = new byte[reply.dataSize];
32 | Marshal.Copy(reply.data, this.buffer, 0, reply.dataSize);
33 | this.options = new PingOptions(reply.options);
34 | }
35 | else
36 | {
37 | this.buffer = new byte[0];
38 | }
39 | }
40 |
41 | internal PingReply(IPStatus ipStatus)
42 | {
43 | this.ipStatus = ipStatus;
44 | this.buffer = new byte[0];
45 | }
46 |
47 | ///
48 | /// Gets the address of the host that sends the Internet Control Message Protocol (ICMP) echo reply.
49 | ///
50 | public IPAddress Address
51 | {
52 | get
53 | {
54 | return this.address;
55 | }
56 | }
57 |
58 | ///
59 | /// Gets the buffer of data received in an Internet Control Message Protocol (ICMP) echo reply message.
60 | ///
61 | public byte[] Buffer
62 | {
63 | get
64 | {
65 | return this.buffer;
66 | }
67 | }
68 |
69 | ///
70 | /// Gets the options used to transmit the reply to an Internet Control Message Protocol (ICMP) echo request.
71 | ///
72 | public PingOptions Options
73 | {
74 | get
75 | {
76 | return this.options;
77 | }
78 | }
79 |
80 | ///
81 | /// Gets the number of milliseconds taken to send an Internet Control Message Protocol (ICMP) echo request and receive the corresponding ICMP echo reply message.
82 | ///
83 | public long RoundtripTime
84 | {
85 | get
86 | {
87 | return this.rtt;
88 | }
89 | }
90 |
91 | ///
92 | /// Gets the status of an attempt to send an Internet Control Message Protocol (ICMP) echo request and receive the corresponding ICMP echo reply message.
93 | ///
94 | public IPStatus Status
95 | {
96 | get
97 | {
98 | return this.ipStatus;
99 | }
100 | }
101 | }
102 | }
103 |
--------------------------------------------------------------------------------
/InTheHand/Type.cs:
--------------------------------------------------------------------------------
1 | // In The Hand - .NET Components for Mobility
2 | //
3 | // InTheHand.Type
4 | //
5 | // Copyright (c) 2003-2014 In The Hand Ltd, All rights reserved.
6 |
7 | using System;
8 | using System.Runtime.InteropServices;
9 |
10 | namespace InTheHand
11 | {
12 | ///
13 | /// Helper for .
14 | ///
15 | public static class TypeInTheHand
16 | {
17 | ///
18 | /// Gets the GUID associated with the Type.
19 | ///
20 | /// The .
21 | /// The GUID associated with the .
22 | public static Guid GetGUID(this Type t)
23 | {
24 | object[] attributes = t.GetCustomAttributes(typeof(GuidAttribute),false);
25 | foreach (GuidAttribute ga in attributes)
26 | {
27 | return new Guid(ga.Value);
28 | }
29 |
30 | return Guid.Empty;
31 | }
32 |
33 | ///
34 | /// Searches for the interface with the specified name.
35 | ///
36 | /// The .
37 | /// The String containing the name of the interface to get.
38 | /// For generic interfaces, this is the mangled name.
39 | /// A object representing the interface with the specified name, implemented or inherited by the current , if found; otherwise, a null reference (Nothing in Visual Basic).
40 | /// The search for name is case-sensitive.
41 | public static Type GetInterface(this Type instance, string interfaceName)
42 | {
43 | return GetInterface(instance, interfaceName, false);
44 | }
45 |
46 | ///
47 | /// Searches for the specified interface, specifying whether to do a case-insensitive search for the interface name.
48 | ///
49 | /// The .
50 | /// The containing the name of the interface to get.
51 | /// For generic interfaces, this is the mangled name.
52 | /// true to ignore the case of that part of name that specifies the simple interface name (the part that specifies the namespace must be correctly cased).
53 | /// -or-
54 | /// false to perform a case-sensitive search for all parts of name.
55 | /// A object representing the interface with the specified name, implemented or inherited by the current , if found; otherwise, a null reference (Nothing in Visual Basic).
56 | public static Type GetInterface(this Type instance, string interfaceName, bool ignoreCase)
57 | {
58 | if (interfaceName == null)
59 | {
60 | throw new ArgumentNullException();
61 | }
62 |
63 | foreach (Type type in instance.GetInterfaces())
64 | {
65 | if (string.Compare(type.Name, interfaceName, ignoreCase ? StringComparison.InvariantCultureIgnoreCase : StringComparison.InvariantCulture) == 0)
66 | {
67 | return type;
68 | }
69 | }
70 |
71 | return null;
72 | }
73 | }
74 | }
--------------------------------------------------------------------------------
/InTheHand.Phone/Tasks/PhoneNumberChooserTask.cs:
--------------------------------------------------------------------------------
1 | // In The Hand - .NET Components for Mobility
2 | //
3 | // InTheHand.Phone.Tasks.PhoneNumberChooserTask
4 | //
5 | // Copyright (c) 2010-2012 In The Hand Ltd, All rights reserved.
6 |
7 | using System;
8 | using System.Runtime.InteropServices;
9 |
10 | namespace InTheHand.Phone.Tasks
11 | {
12 | ///
13 | /// Allows an application to launch the Contacts application.
14 | /// Use this to obtain the phone number of a contact selected by the user.
15 | ///
16 | /// Launch the Contacts application by calling the method of the object.
17 | /// Obtain the result of the chooser operation by handling the event.
18 | ///
19 | /// Platforms Supported
20 | /// - Windows MobileWindows Mobile Version 5.0 and later
21 | /// - Windows Embedded CompactWindows Embedded Compact 7
22 | ///
23 | ///
24 | public sealed class PhoneNumberChooserTask : ChooserBase
25 | {
26 | private const int ALL_PHONE = 0x1800001f;
27 |
28 | ///
29 | /// Shows the Contacts application.
30 | ///
31 | /// Obtain the result of the chooser operation by handling the event.
32 | public new void Show()
33 | {
34 | System.Threading.ThreadPool.QueueUserWorkItem(new System.Threading.WaitCallback(Worker), null);
35 | base.Show();
36 | }
37 |
38 | private void Worker(object state)
39 | {
40 | PhoneNumberResult pr = new PhoneNumberResult();
41 | NativeMethods.CHOOSECONTACT cc = new NativeMethods.CHOOSECONTACT();
42 |
43 | try
44 | {
45 | cc.cbSize = Marshal.SizeOf(cc);
46 | cc.dwFlags = NativeMethods.CCF.RETURNPROPERTYVALUE | NativeMethods.CCF.HIDENEW;
47 | cc.cRequiredProperties = 1;
48 | cc.rgpropidRequiredProperties = Marshal.AllocHGlobal(4);
49 | Marshal.WriteInt32(cc.rgpropidRequiredProperties, ALL_PHONE);
50 |
51 | int hresult = NativeMethods.ChooseContact(ref cc);
52 |
53 | switch (hresult)
54 | {
55 | case 0:
56 | pr.PhoneNumber = Marshal.PtrToStringUni(cc.bstrPropertyValueSelected);
57 | pr.TaskResult = TaskResult.OK;
58 | break;
59 |
60 | case unchecked((int)0x80004004):
61 | pr.TaskResult = TaskResult.Cancel;
62 | break;
63 | }
64 |
65 | }
66 | catch (Exception ex)
67 | {
68 | pr.TaskResult = TaskResult.None;
69 | pr.Error = ex;
70 | }
71 | finally
72 | {
73 | if (cc.rgpropidRequiredProperties != IntPtr.Zero)
74 | {
75 | Marshal.FreeHGlobal(cc.rgpropidRequiredProperties);
76 | cc.rgpropidRequiredProperties = IntPtr.Zero;
77 | }
78 | }
79 |
80 | base.FireCompleted(this, pr, null);
81 | }
82 | }
83 | }
--------------------------------------------------------------------------------
/InTheHand.Windows.Forms/ProgressBar.cs:
--------------------------------------------------------------------------------
1 | // In The Hand - .NET Components for Mobility
2 | //
3 | // InTheHand.Windows.Forms.ProgressBar
4 | //
5 | // Copyright (c) 2011-12 In The Hand Ltd, All rights reserved.
6 |
7 | using System;
8 | using System.Drawing;
9 | using InTheHand.Runtime.InteropServices;
10 | using InTheHand.Drawing;
11 | using System.Windows.Forms;
12 |
13 | namespace InTheHand.Windows.Forms
14 | {
15 | ///
16 | /// Provides supporting methods for .
17 | ///
18 | public static class ProgressBarInTheHand
19 | {
20 | private const int PBM_SETSTEP = 0x404;
21 | private const int PBM_STEPIT = 0x405;
22 | private const int PBM_SETMARQUEE = 0x40A;
23 |
24 | ///
25 | /// Advances the current position of the progress bar by the amount of the Step property.
26 | ///
27 | /// The progress bar.
28 | ///
29 | /// Platforms Supported
30 | /// - Windows MobilePocket PC 2003 and later, Windows Mobile Version 5.0 and later
31 | /// - Windows Embedded CompactWindows CE 4.1 and later
32 | ///
33 | ///
34 | public static void PerformStep(this ProgressBar progressBar)
35 | {
36 | NativeMethods.SendMessage(progressBar.Handle, PBM_STEPIT, 0, 0);
37 | }
38 |
39 | ///
40 | /// Sets the amount by which a call to the method increases the current position of the progress bar.
41 | ///
42 | /// The progress bar.
43 | /// The amount by which to increment the progress bar with each call to the method.
44 | /// The default is 10.
45 | ///
46 | /// Platforms Supported
47 | /// - Windows MobilePocket PC 2003 and later, Windows Mobile Version 5.0 and later
48 | /// - Windows Embedded CompactWindows CE 4.1 and later
49 | ///
50 | ///
51 | public static void SetStep(this ProgressBar progressBar, int value)
52 | {
53 | NativeMethods.SendMessage(progressBar.Handle, PBM_SETSTEP, value, 0);
54 | }
55 |
56 | ///
57 | ///
58 | ///
59 | ///
60 | ///
61 | ///
62 | /// Platforms Supported
63 | /// - Windows Embedded CompactWindows CE 6.0 and later
64 | ///
65 | ///
66 | public static void SetMarqueeStyle(this ProgressBar progressBar, bool value)
67 | {
68 | ControlInTheHand.ModifyStyles(progressBar.Handle, value ? PBS_MARQUEE : ~PBS_MARQUEE, value ? ~PBS_MARQUEE : PBS_MARQUEE);
69 | NativeMethods.SendMessage(progressBar.Handle, PBM_SETMARQUEE, value ? 1 : 0, 100);
70 | }
71 |
72 | private const int PBS_MARQUEE = 0x8;
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/InTheHand.Diagnostics/ProcessModule.cs:
--------------------------------------------------------------------------------
1 | // --------------------------------------------------------------------------------------------------------------------
2 | //
3 | // Copyright (c) 2003-14 In The Hand Ltd. All Rights Reserved.
4 | //
5 | // Peter Foot
6 | // --------------------------------------------------------------------------------------------------------------------
7 |
8 | namespace InTheHand.Diagnostics
9 | {
10 | using System;
11 | using System.ComponentModel;
12 |
13 | ///
14 | /// Represents a.dll or .exe file that is loaded into a particular process.
15 | ///
16 | ///
17 | /// A module is an executable file or a dynamic link library (DLL).
18 | /// Each process consists of one or more modules.
19 | /// You can use this class to get information about the module.
20 | public sealed class ProcessModule : Component
21 | {
22 | private NativeMethods.MODULEENTRY32 me;
23 |
24 | internal ProcessModule(NativeMethods.MODULEENTRY32 me)
25 | {
26 | this.me = me;
27 | }
28 |
29 | ///
30 | /// Gets the memory address where the module was loaded.
31 | ///
32 | /// The load address of the module.
33 | public IntPtr BaseAddress
34 | {
35 | get
36 | {
37 | return me.modBaseAddr;
38 | }
39 | }
40 |
41 | ///
42 | /// Gets the full path to the module.
43 | ///
44 | /// The fully qualified path that defines the location of the module.
45 | public string FileName
46 | {
47 | get
48 | {
49 | return me.szExePath;
50 | }
51 | }
52 |
53 | private FileVersionInfo fvi;
54 | ///
55 | /// Gets version information about the module.
56 | ///
57 | /// A that contains the module's version information.
58 | public FileVersionInfo FileVersionInfo
59 | {
60 | get
61 | {
62 | if (fvi == null)
63 | {
64 | if(!string.IsNullOrEmpty(FileName))
65 | {
66 | fvi = FileVersionInfo.GetVersionInfo(FileName);
67 | }
68 | }
69 |
70 | return fvi;
71 | }
72 | }
73 |
74 | ///
75 | /// Gets the amount of memory that is required to load the module.
76 | ///
77 | /// The size, in bytes, of the memory that the module occupies.
78 | /// ModuleMemorySize does not include any additional memory allocations that the module makes once it is running; it includes only the size of the static code and data in the module file.
79 | public int ModuleMemorySize
80 | {
81 | get
82 | {
83 | return me.modBaseSize;
84 | }
85 | }
86 |
87 | ///
88 | /// Gets the name of the process module.
89 | ///
90 | /// The name of the module.
91 | public string ModuleName
92 | {
93 | get
94 | {
95 | return me.szModule;
96 | }
97 | }
98 | }
99 | }
100 |
--------------------------------------------------------------------------------
/InTheHand.Device.Location/ICivicAddressResolver.cs:
--------------------------------------------------------------------------------
1 | // --------------------------------------------------------------------------------------------------------------------
2 | //
3 | // Copyright (c) 2010-14 In The Hand Ltd. All Rights Reserved.
4 | //
5 | // Peter Foot
6 | // --------------------------------------------------------------------------------------------------------------------
7 |
8 | using System;
9 | using System.ComponentModel;
10 | using System.Globalization;
11 | using System.Runtime.InteropServices;
12 |
13 | namespace InTheHand.Device.Location
14 | {
15 | ///
16 | /// Provides a method that when implemented, resolves a latitude/longitude location to a civic address.
17 | ///
18 | /// Equivalent to System.Device.Location.ICivicAddressResolver in the .NET Framework 4
19 | /// To resolve a to a asynchronously, implement , and provide the civic address data to the event.
20 | public interface ICivicAddressResolver
21 | {
22 | ///
23 | /// Resolves a to a civic address synchronously.
24 | ///
25 | /// The latitude/longitude location to resolve to an address.
26 | ///
27 | CivicAddress ResolveAddress(GeoCoordinate coordinate);
28 |
29 | ///
30 | /// Initiates a request to resolve a latitude/longitude location to an address.
31 | ///
32 | /// The latitude/longitude location to resolve to an address.
33 | void ResolveAddressAsync(GeoCoordinate coordinate);
34 |
35 | ///
36 | /// Occurs when an asynchronous request using to resolve a latitude/longitude to a civic address is complete.
37 | ///
38 | event EventHandler ResolveAddressCompleted;
39 | }
40 |
41 | ///
42 | /// Provides data for the event.
43 | ///
44 | public class ResolveAddressCompletedEventArgs : AsyncCompletedEventArgs
45 | {
46 | ///
47 | ///
48 | ///
49 | /// The containing the address resolved from the latitude/longitude location, if successful.
50 | /// The exception object for any exception that may have occurred during the attempt to resolve the address.
51 | /// true if the operation was cancelled; otherwise, false.
52 | /// A token for tracking the request to resolve the address.
53 | /// May be null if not used.
54 | /// This constructor is public so that classes implementing the interface can create this object to fire events.
55 | public ResolveAddressCompletedEventArgs(CivicAddress address, Exception error, bool cancelled, Object userState) : base(error, cancelled, userState)
56 | {
57 | this.Address = address;
58 | }
59 |
60 | ///
61 | /// Gets the associated with the event.
62 | ///
63 | public CivicAddress Address { get; private set; }
64 | }
65 | }
--------------------------------------------------------------------------------
/InTheHand.Device.Location/IGeoCoordinateResolver.cs:
--------------------------------------------------------------------------------
1 | // --------------------------------------------------------------------------------------------------------------------
2 | //
3 | // Copyright (c) 2010-14 In The Hand Ltd. All Rights Reserved.
4 | //
5 | // Peter Foot
6 | // --------------------------------------------------------------------------------------------------------------------
7 |
8 | using System;
9 | using System.ComponentModel;
10 | using System.Globalization;
11 | using System.Runtime.InteropServices;
12 | using InTheHand.ComponentModel;
13 |
14 | namespace InTheHand.Device.Location
15 | {
16 | ///
17 | /// Provides a method that when implemented, resolves a civic address to a latitude/longitude location.
18 | ///
19 | ///
20 | /// To resolve a to a asynchronously, implement , and provide the co-ordinate data to the event.
21 | public interface IGeoCoordinateResolver
22 | {
23 | ///
24 | /// Resolves a to a co-ordinate location synchronously.
25 | ///
26 | /// The address (or partial address) to resolve to a latitude/longitude location.
27 | /// The which matches the supplied address.
28 | GeoCoordinate ResolveCoordinate(CivicAddress address);
29 |
30 | ///
31 | /// Initiates a request to resolve an address to a latitude/longitude location .
32 | ///
33 | /// The address (or partial address) to resolve to a latitude/longitude location.
34 | void ResolveCoordinateAsync(CivicAddress address);
35 |
36 | ///
37 | /// Occurs when an asynchronous request using to resolve a civic address to a latitude/longitude is complete.
38 | ///
39 | event EventHandler ResolveCoordinateCompleted;
40 | }
41 |
42 | ///
43 | /// Provides data for the event.
44 | ///
45 | public class ResolveCoordinateCompletedEventArgs : AsyncCompletedEventArgs
46 | {
47 | ///
48 | ///
49 | ///
50 | /// The containing the latitude/longitude resolved from the address, if successful.
51 | /// The exception object for any exception that may have occurred during the attempt to resolve the location.
52 | /// true if the operation was cancelled; otherwise, false.
53 | /// A token for tracking the request to resolve the address.
54 | /// May be null if not used.
55 | /// This constructor is public so that classes implementing the interface can create this object to fire events.
56 | public ResolveCoordinateCompletedEventArgs(GeoCoordinate coordinates, Exception error, bool cancelled, Object userState)
57 | : base(error, cancelled, userState)
58 | {
59 | this.Coordinates = coordinates;
60 | }
61 |
62 | ///
63 | /// Gets the associated with the event.
64 | ///
65 | public GeoCoordinate Coordinates { get; private set; }
66 | }
67 | }
--------------------------------------------------------------------------------
/InTheHand.Net.NetworkInformation/UnicastIPAddressInformation.cs:
--------------------------------------------------------------------------------
1 | // In The Hand - .NET Components for Mobility
2 | //
3 | // InTheHand.Net.NetworkInformation.UnicastIPAddressInformation
4 | //
5 | // Copyright (c) 2010 In The Hand Ltd, All rights reserved.
6 |
7 | using System;
8 | using System.Runtime.InteropServices;
9 |
10 | namespace InTheHand.Net.NetworkInformation
11 | {
12 | ///
13 | /// Provides information about a network interface's unicast address.
14 | ///
15 | public sealed class UnicastIPAddressInformation : IPAddressInformation
16 | {
17 | private IP_ADAPTER_UNICAST_ADDRESS iaua;
18 |
19 | internal UnicastIPAddressInformation(IP_ADAPTER_UNICAST_ADDRESS unicastAddress)
20 | {
21 | this.iaua = unicastAddress;
22 | address = GetAddressFromSocketAddress(iaua.Address.lpSockaddr);
23 | isDnsEligible = iaua.Flags.HasFlag(IP_ADAPTER_ADDRESS.DNS_ELIGIBLE);
24 | isTransient = iaua.Flags.HasFlag(IP_ADAPTER_ADDRESS.TRANSIENT);
25 | }
26 |
27 | ///
28 | /// Gets the number of seconds remaining during which this address is the preferred address.
29 | ///
30 | public long AddressPreferredLifetime
31 | {
32 | get
33 | {
34 |
35 | return (long)iaua.PreferredLifetime;
36 | }
37 | }
38 |
39 | ///
40 | /// Gets the number of seconds remaining during which this address is valid.
41 | ///
42 | public long AddressValidLifetime
43 | {
44 | get
45 | {
46 | return (long)iaua.ValidLifetime;
47 | }
48 | }
49 |
50 | ///
51 | /// Specifies the amount of time remaining on the Dynamic Host Configuration Protocol (DHCP) lease for this IP address.
52 | ///
53 | public long DhcpLeaseLifetime
54 | {
55 | get
56 | {
57 | return (long)iaua.LeaseLifetime;
58 | }
59 | }
60 |
61 | ///
62 | /// Gets a value that indicates the state of the duplicate address detection algorithm.
63 | ///
64 | public DuplicateAddressDetectionState DuplicateAddressDetectionState
65 | {
66 | get
67 | {
68 | return iaua.DadState;
69 | }
70 | }
71 |
72 | ///
73 | /// Gets a value that identifies the source of a unicast Internet Protocol (IP) address prefix.
74 | ///
75 | public PrefixOrigin PrefixOrigin
76 | {
77 | get
78 | {
79 | return iaua.PrefixOrigin;
80 | }
81 | }
82 |
83 | ///
84 | /// Gets a value that identifies the source of a unicast Internet Protocol (IP) address suffix.
85 | ///
86 | public SuffixOrigin SuffixOrigin
87 | {
88 | get
89 | {
90 | return iaua.SuffixOrigin;
91 | }
92 | }
93 | }
94 |
95 | [StructLayout(LayoutKind.Sequential)]
96 | internal struct IP_ADAPTER_UNICAST_ADDRESS
97 | {
98 | internal int Length;
99 | internal IP_ADAPTER_ADDRESS Flags;
100 | internal IntPtr Next;
101 | internal SOCKET_ADDRESS Address;
102 | internal PrefixOrigin PrefixOrigin;
103 | internal SuffixOrigin SuffixOrigin;
104 | internal DuplicateAddressDetectionState DadState;
105 | internal uint ValidLifetime;
106 | internal uint PreferredLifetime;
107 | internal uint LeaseLifetime;
108 | }
109 | }
--------------------------------------------------------------------------------
/InTheHand.WindowsMobile.Net/InTheHand.WindowsMobile.Net.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | Debug
4 | AnyCPU
5 | 9.0.30729
6 | 2.0
7 | {9A5522FC-1C5C-4B5C-A13D-264B63409E7B}
8 | Library
9 | Properties
10 | InTheHand.WindowsMobile.Net
11 | InTheHand.WindowsMobile.Net
12 | {4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
13 | WindowsCE
14 | E2BECB1F-8C8C-41ba-B736-9BE7D946A398
15 | 5.0
16 | InTheHand.WindowsMobile.Net
17 | v3.5
18 | Windows CE
19 |
20 |
21 |
22 |
23 | true
24 | full
25 | false
26 | bin\Debug\
27 | DEBUG;TRACE;$(PlatformFamilyName)
28 | true
29 | true
30 | prompt
31 | 512
32 | 4
33 | Off
34 |
35 |
36 | pdbonly
37 | true
38 | ..\Output\Release\
39 | TRACE;$(PlatformFamilyName)
40 | true
41 | true
42 | prompt
43 | 512
44 | 4
45 | Off
46 | ..\Output\Release\InTheHand.WindowsMobile.Net.XML
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 | Properties\SharedAssemblyInfo.cs
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 | {A15D1A76-E6C9-45B7-859F-48EC8A1130CE}
64 | InTheHand
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
82 |
--------------------------------------------------------------------------------
/InTheHand/IO/Stream.cs:
--------------------------------------------------------------------------------
1 | // In The Hand - .NET Components for Mobility
2 | //
3 | // InTheHand.IO.Stream
4 | //
5 | // Copyright (c) 2010-2014 In The Hand Ltd, All rights reserved.
6 |
7 | using System;
8 |
9 | namespace InTheHand.IO
10 | {
11 | ///
12 | /// Provides helper methods for the class.
13 | ///
14 | ///
15 | /// Platforms Supported
16 | /// - Windows MobilePocket PC 2003, Windows Mobile Version 5.0 and later
17 | /// - Windows EmbeddedWindows CE .NET 4.1 and later
18 | /// - Windows PhoneWindows Phone 7
19 | ///
20 | ///
21 | public static class StreamInTheHand
22 | {
23 | #region Copy To
24 | ///
25 | /// Reads all the bytes from the current stream and writes them to a destination stream.
26 | ///
27 | ///
28 | /// The stream that will contain the contents of the current stream.
29 | /// Copying begins at the current position in the current stream.
30 | /// destination is a null reference (Nothing in Visual Basic).
31 | /// The current stream does not support reading.
32 | /// -or-
33 | /// destination does not support writing.
34 | public static void CopyTo(this System.IO.Stream s, System.IO.Stream destination)
35 | {
36 | CopyTo(s, destination, 4096);
37 | }
38 |
39 | ///
40 | /// Reads all the bytes from the current stream and writes them to a destination stream, using a specified buffer size.
41 | ///
42 | ///
43 | /// The stream that will contain the contents of the current stream.
44 | /// The size of the buffer.
45 | /// This value must be greater than zero.
46 | /// The default size is 4096.
47 | /// Copying begins at the current position in the current stream.
48 | /// destination is a null reference (Nothing in Visual Basic).
49 | /// bufferSize is negative or zero.
50 | /// The current stream does not support reading.
51 | /// -or-
52 | /// destination does not support writing.
53 | public static void CopyTo(this System.IO.Stream s, System.IO.Stream destination, int bufferSize)
54 | {
55 | if (destination == null)
56 | {
57 | throw new ArgumentNullException("destination");
58 | }
59 |
60 | if (bufferSize < 1)
61 | {
62 | throw new ArgumentOutOfRangeException("bufferSize");
63 | }
64 |
65 | if (!s.CanRead || !destination.CanWrite)
66 | {
67 | throw new NotSupportedException();
68 | }
69 |
70 | byte[] buffer = new byte[bufferSize];
71 | int bytesRead = int.MaxValue;
72 | while (bytesRead > 0)
73 | {
74 | bytesRead = s.Read(buffer, 0, bufferSize);
75 | if (bytesRead > 0)
76 | {
77 | destination.Write(buffer, 0, bytesRead);
78 | }
79 | }
80 | }
81 | #endregion
82 | }
83 | }
--------------------------------------------------------------------------------
/InTheHand.WindowsMobile.Configuration/InTheHand.WindowsMobile.Configuration.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | Debug
4 | AnyCPU
5 | 9.0.30729
6 | 2.0
7 | {48203307-F58C-45D3-8D53-901D9DCBB919}
8 | Library
9 | Properties
10 | InTheHand.WindowsMobile.Configuration
11 | InTheHand.WindowsMobile.Configuration
12 | {4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
13 | WindowsCE
14 | E2BECB1F-8C8C-41ba-B736-9BE7D946A398
15 | 5.0
16 | InTheHand.WindowsMobile.Configuration
17 | v3.5
18 | Windows CE
19 | SAK
20 | SAK
21 | SAK
22 | SAK
23 |
24 |
25 |
26 |
27 | true
28 | full
29 | false
30 | bin\Debug\
31 | DEBUG;TRACE;$(PlatformFamilyName)
32 | true
33 | true
34 | prompt
35 | 512
36 | 4
37 | Off
38 |
39 |
40 | pdbonly
41 | true
42 | ..\Output\Release\
43 | TRACE;$(PlatformFamilyName)
44 | true
45 | true
46 | prompt
47 | 512
48 | 4
49 | Off
50 | ..\Output\Release\InTheHand.WindowsMobile.Configuration.XML
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 | Properties\SharedAssemblyInfo.cs
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
82 |
--------------------------------------------------------------------------------
/InTheHand.IO/FileSystemEventArgs.cs:
--------------------------------------------------------------------------------
1 | // --------------------------------------------------------------------------------------------------------------------
2 | //
3 | // Copyright (c) 2003-14 In The Hand Ltd. All Rights Reserved.
4 | //
5 | // Peter Foot
6 | // --------------------------------------------------------------------------------------------------------------------
7 |
8 | namespace InTheHand.IO
9 | {
10 | ///
11 | /// Provides data for the directory events: , , .
12 | ///
13 | /// The FileSystemEventArgs class is passed as a parameter to event handlers for these events:
14 | /// The event occurs when changes are made to the size, system attributes, last write time, last access time, or security permissions in a file or directory in the specified of a .
15 | /// The event occurs when a file or directory in the specified of a is created.
16 | /// The event occurs when a file or directory in the specified of a is deleted. For more information, see .
17 | public class FileSystemEventArgs
18 | {
19 | private string fullPath = string.Empty;
20 | private string name = string.Empty;
21 | internal WatcherChangeTypes changeType = WatcherChangeTypes.All;
22 |
23 | ///
24 | /// Initializes a new instance of the class.
25 | ///
26 | /// One of the values, which represents the kind of change detected in the file system.
27 | /// The root directory of the affected file or directory.
28 | /// The name of the affected file or directory.
29 | public FileSystemEventArgs(WatcherChangeTypes changeType, string directory, string name)
30 | : base()
31 | {
32 | this.changeType = changeType;
33 | this.name = name;
34 | if (!(directory.EndsWith("\\")))
35 | directory = directory + "\\";
36 | this.fullPath = directory + name;
37 | }
38 |
39 | ///
40 | /// Gets the type of directory event that occurred.
41 | ///
42 | /// One of the values that represents the kind of change detected in the file system.
43 | ///
44 | ///
45 | public WatcherChangeTypes ChangeType
46 | {
47 | get
48 | {
49 | return changeType;
50 | }
51 | }
52 | ///
53 | /// Gets the fully qualifed path of the affected file or directory.
54 | ///
55 | /// The path of the affected file or directory.
56 | public string FullPath
57 | {
58 | get
59 | {
60 | return fullPath;
61 | }
62 | }
63 | ///
64 | /// Gets the name of the affected file or directory.
65 | ///
66 | /// The name of the affected file or directory.
67 | public string Name
68 | {
69 | get
70 | {
71 | return name;
72 | }
73 | }
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/InTheHand.Phone/Tasks/CameraCaptureTask.cs:
--------------------------------------------------------------------------------
1 | // In The Hand - .NET Components for Mobility
2 | //
3 | // InTheHand.Phone.Tasks.CameraCaptureTask
4 | //
5 | // Copyright (c) 2010-2011 In The Hand Ltd, All rights reserved.
6 |
7 | using System;
8 |
9 | using System.Collections.Generic;
10 | using System.Runtime.InteropServices;
11 |
12 | namespace InTheHand.Phone.Tasks
13 | {
14 | ///
15 | /// Allows an application to launch the Camera application.
16 | /// Use this to allow users to take a photo from your application.
17 | ///
18 | /// Launch the Photo Chooser application by calling the method of the object.
19 | /// Obtain the result of the chooser operation by handling the event.
20 | ///
21 | /// Platforms Supported
22 | /// - Windows MobileWindows Mobile Version 5.0 and later
23 | /// - Windows EmbeddedWindows Embedded CE 6.0
24 | ///
25 | ///
26 | public sealed class CameraCaptureTask : ChooserBase
27 | {
28 | ///
29 | /// Shows the camera application.
30 | ///
31 | /// Obtain the result of the chooser operation by handling the event.
32 | public override void Show()
33 | {
34 | IntPtr parentHwnd = IntPtr.Zero;
35 | System.Threading.ThreadPool.QueueUserWorkItem(new System.Threading.WaitCallback(BackgroundShow), parentHwnd);
36 | }
37 |
38 | private void BackgroundShow(object state)
39 | {
40 | NativeMethods.SHCAMERACAPTURE shcc = new NativeMethods.SHCAMERACAPTURE();
41 | shcc.cbSize = Marshal.SizeOf(shcc);
42 | shcc.hwndOwner = (IntPtr)state;
43 |
44 | PhotoResult photoResult = null;
45 |
46 | try
47 | {
48 | TaskResult result = NativeMethods.CameraCapture(ref shcc) == 0 ? TaskResult.OK : TaskResult.Cancel;
49 |
50 | photoResult = new PhotoResult(result);
51 | if (result == TaskResult.OK)
52 | {
53 | photoResult.OriginalFileName = shcc.szFile;
54 | }
55 | }
56 | catch (Exception ex)
57 | {
58 | photoResult = new PhotoResult(TaskResult.Cancel);
59 | photoResult.Error = ex;
60 | }
61 |
62 | FireCompleted(this, photoResult, null);
63 | }
64 |
65 | private static class NativeMethods
66 | {
67 | [DllImport("aygshell", EntryPoint = "SHCameraCapture", SetLastError = false)]
68 | internal static extern int CameraCapture(ref SHCAMERACAPTURE pshcc);
69 |
70 | [StructLayout(LayoutKind.Sequential)]
71 | internal struct SHCAMERACAPTURE
72 | {
73 | internal int cbSize;
74 | internal IntPtr hwndOwner;
75 | [MarshalAs(UnmanagedType.ByValTStr, SizeConst = InTheHand.EnvironmentInTheHand.MaxPath)]
76 | internal string szFile;
77 | [MarshalAs(UnmanagedType.LPWStr)]
78 | internal string pszInitialDir;
79 | [MarshalAs(UnmanagedType.LPWStr)]
80 | internal string pszDefaultFileName;
81 | [MarshalAs(UnmanagedType.LPWStr)]
82 | internal string pszTitle;
83 | internal int StillQuality;
84 | internal int VideoTypes;
85 | internal int nResolutionWidth;
86 | internal int nResolutionHeight;
87 | internal int nVideoTimeLimit;
88 | internal int Mode;
89 | }
90 | }
91 | }
92 | }
93 |
--------------------------------------------------------------------------------
/InTheHand.Windows/InTheHand.Windows.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | Debug
4 | AnyCPU
5 | 9.0.30729
6 | 2.0
7 | {3E695531-2B7E-4F79-B0E9-C31297F08BCD}
8 | Library
9 | Properties
10 | InTheHand.Windows
11 | InTheHand.Windows
12 | {4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
13 | WindowsCE
14 | E2BECB1F-8C8C-41ba-B736-9BE7D946A398
15 | 5.0
16 | InTheHand.Windows
17 | v3.5
18 | Windows CE
19 |
20 |
21 | SAK
22 | SAK
23 | SAK
24 | SAK
25 |
26 |
27 | true
28 | full
29 | false
30 | bin\Debug\
31 | DEBUG;TRACE;$(PlatformFamilyName)
32 | true
33 | true
34 | prompt
35 | 512
36 | 4
37 | Off
38 |
39 |
40 | pdbonly
41 | true
42 | ..\Output\Release\
43 | TRACE;$(PlatformFamilyName)
44 | true
45 | true
46 | prompt
47 | 512
48 | 4
49 | Off
50 | ..\Output\Release\InTheHand.Windows.XML
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 | Properties\SharedAssemblyInfo.cs
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 | {A15D1A76-E6C9-45B7-859F-48EC8A1130CE}
73 | InTheHand
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
91 |
--------------------------------------------------------------------------------
/InTheHand.Security.Cryptography/InTheHand.Security.Cryptography.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | Debug
4 | AnyCPU
5 | 9.0.30729
6 | 2.0
7 | {5513B733-8432-4ADD-BD7D-E59976E20F40}
8 | Library
9 | Properties
10 | InTheHand.Security.Cryptography
11 | InTheHand.Security.Cryptography
12 | {4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
13 | WindowsCE
14 | E2BECB1F-8C8C-41ba-B736-9BE7D946A398
15 | 5.0
16 | InTheHand.Security.Cryptography
17 | v3.5
18 | Windows CE
19 | SAK
20 | SAK
21 | SAK
22 | SAK
23 |
24 |
25 |
26 |
27 | true
28 | full
29 | false
30 | bin\Debug\
31 | DEBUG;TRACE;$(PlatformFamilyName)
32 | true
33 | true
34 | prompt
35 | 512
36 | 4
37 | Off
38 |
39 |
40 | pdbonly
41 | true
42 | ..\Output\Release\
43 | TRACE;$(PlatformFamilyName)
44 | true
45 | true
46 | prompt
47 | 512
48 | 4
49 | Off
50 | ..\Output\Release\InTheHand.Security.Cryptography.XML
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 | Properties\SharedAssemblyInfo.cs
59 |
60 |
61 |
62 |
63 |
64 | True
65 | True
66 | Resources.resx
67 |
68 |
69 |
70 |
71 | ResXFileCodeGenerator
72 | Resources.Designer.cs
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
90 |
--------------------------------------------------------------------------------
/InTheHand.Diagnostics/InTheHand.Diagnostics.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | Debug
4 | AnyCPU
5 | 9.0.30729
6 | 2.0
7 | {FE2DEE97-895E-4C4F-8710-2B2212B9BE6F}
8 | Library
9 | Properties
10 | InTheHand.Diagnostics
11 | InTheHand.Diagnostics
12 | {4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
13 | WindowsCE
14 | E2BECB1F-8C8C-41ba-B736-9BE7D946A398
15 | 5.0
16 | InTheHand.Diagnostics
17 | v3.5
18 | Windows CE
19 | SAK
20 | SAK
21 | SAK
22 | SAK
23 |
24 |
25 |
26 |
27 | true
28 | full
29 | false
30 | bin\Debug\
31 | DEBUG;TRACE;$(PlatformFamilyName)
32 | true
33 | true
34 | prompt
35 | 512
36 | 4
37 | Off
38 |
39 |
40 | pdbonly
41 | true
42 | ..\Output\Release\
43 | TRACE;$(PlatformFamilyName)
44 | true
45 | true
46 | prompt
47 | 512
48 | 4
49 | Off
50 | ..\Output\Release\InTheHand.Diagnostics.XML
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 | Properties\SharedAssemblyInfo.cs
60 |
61 |
62 |
63 |
64 |
65 | Component
66 |
67 |
68 | Component
69 |
70 |
71 |
72 |
73 |
74 | {A15D1A76-E6C9-45B7-859F-48EC8A1130CE}
75 | InTheHand
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
93 |
--------------------------------------------------------------------------------
/InTheHand.Net/Mime/MediaTypeNames.cs:
--------------------------------------------------------------------------------
1 | // --------------------------------------------------------------------------------------------------------------------
2 | //
3 | // Copyright (c) 2003-14 In The Hand Ltd. All Rights Reserved.
4 | //
5 | // Peter Foot
6 | // --------------------------------------------------------------------------------------------------------------------
7 |
8 | using System;
9 |
10 | namespace InTheHand.Net.Mime
11 | {
12 | ///
13 | /// Specifies the media type information for an object.
14 | ///
15 | public static class MediaTypeNames
16 | {
17 | ///
18 | /// Specifies the type of text data in an object.
19 | ///
20 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
21 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1724:TypeNamesShouldNotMatchNamespaces")]
22 | public static class Application
23 | {
24 | ///
25 | /// Specifies that the application data is not interpreted.
26 | ///
27 | /// The Octet member designates that the attachment contains generic binary data.
28 | public const string Octet = "application/octet-stream";
29 |
30 | ///
31 | /// Specifies that the application data is in Portable Document Format (PDF).
32 | ///
33 | public const string Pdf = "application/pdf";
34 |
35 | ///
36 | /// Specifies that the application data is in Rich Text Format (RTF).
37 | ///
38 | public const string Rtf = "text/rtf";
39 |
40 | ///
41 | /// Specifies that the application data is a SOAP document.
42 | ///
43 | public const string Soap = "application/soap";
44 |
45 | ///
46 | /// Specifies that the application data is compressed.
47 | ///
48 | public const string Zip = "application/zip";
49 | }
50 |
51 | ///
52 | /// Specifies the type of image data in an object.
53 | ///
54 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
55 | public static class Image
56 | {
57 | ///
58 | /// Specifies that the image data is in Graphics Interchange Format (GIF).
59 | ///
60 | public const string Gif = "image/gif";
61 |
62 | ///
63 | /// Specifies that the image data is in Joint Photographic Experts Group (JPEG) format.
64 | ///
65 | public const string Jpg = "image/jpg";
66 |
67 | ///
68 | /// Specifies that the image data is in Tagged Image File Format (TIFF).
69 | ///
70 | public const string Tiff = "image/tiff";
71 | }
72 |
73 | ///
74 | /// Specifies the type of text data in an object.
75 | ///
76 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
77 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1724:TypeNamesShouldNotMatchNamespaces")]
78 | public static class Text
79 | {
80 | ///
81 | /// Specifies that the data is in HTML format.
82 | ///
83 | public const string Html = "text/html";
84 |
85 | ///
86 | /// Specifies that the data is in plain text format.
87 | ///
88 | public const string Plain = "text/plain";
89 |
90 | ///
91 | /// Specifies that the data is in Rich Text Format (RTF).
92 | ///
93 | public const string RichText = "text/rtf";
94 |
95 | ///
96 | /// Specifies that the data is in XML format.
97 | ///
98 | public const string Xml = "text/xml";
99 | }
100 | }
101 | }
102 |
--------------------------------------------------------------------------------
/InTheHand.Net.NetworkInformation/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:2.0.50727.8009
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace InTheHand.Net.NetworkInformation.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
23 | internal class Resources {
24 |
25 | private static global::System.Resources.ResourceManager resourceMan;
26 |
27 | private static global::System.Globalization.CultureInfo resourceCulture;
28 |
29 | internal Resources() {
30 | }
31 |
32 | ///
33 | /// Returns the cached ResourceManager instance used by this class.
34 | ///
35 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
36 | internal static global::System.Resources.ResourceManager ResourceManager {
37 | get {
38 | if (object.ReferenceEquals(resourceMan, null)) {
39 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("InTheHand.Net.NetworkInformation.Properties.Resources", typeof(Resources).Assembly);
40 | resourceMan = temp;
41 | }
42 | return resourceMan;
43 | }
44 | }
45 |
46 | ///
47 | /// Overrides the current thread's CurrentUICulture property for all
48 | /// resource lookups using this strongly typed resource class.
49 | ///
50 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
51 | internal static global::System.Globalization.CultureInfo Culture {
52 | get {
53 | return resourceCulture;
54 | }
55 | set {
56 | resourceCulture = value;
57 | }
58 | }
59 |
60 | ///
61 | /// Looks up a localized string similar to An invalid physical address was specified..
62 | ///
63 | internal static string net_bad_mac_address {
64 | get {
65 | return ResourceManager.GetString("net_bad_mac_address", resourceCulture);
66 | }
67 | }
68 |
69 | ///
70 | /// Looks up a localized string similar to The collection is read-only..
71 | ///
72 | internal static string net_collection_readonly {
73 | get {
74 | return ResourceManager.GetString("net_collection_readonly", resourceCulture);
75 | }
76 | }
77 |
78 | ///
79 | /// Looks up a localized string similar to IPv4 address 0.0.0.0 and IPv6 address ::0 are unspecified addresses that cannot be used as a target address..
80 | ///
81 | internal static string net_invalid_ip_addr {
82 | get {
83 | return ResourceManager.GetString("net_invalid_ip_addr", resourceCulture);
84 | }
85 | }
86 |
87 | ///
88 | /// Looks up a localized string similar to The buffer length must not exceed 65500 bytes..
89 | ///
90 | internal static string net_invalidPingBufferSize {
91 | get {
92 | return ResourceManager.GetString("net_invalidPingBufferSize", resourceCulture);
93 | }
94 | }
95 | }
96 | }
97 |
--------------------------------------------------------------------------------
/InTheHand/Collections/ArrayListHelper.cs:
--------------------------------------------------------------------------------
1 | // In The Hand - .NET Components for Mobility
2 | //
3 | // InTheHand.Collections.ArrayList
4 | //
5 | // Copyright (c) 2010-2014 In The Hand Ltd, All rights reserved.
6 |
7 | using System;
8 | using System.Collections;
9 |
10 | namespace InTheHand.Collections
11 | {
12 | ///
13 | /// Helper for class.
14 | ///
15 | public static class ArrayListInTheHand
16 | {
17 | ///
18 | /// Returns a read-only wrapper.
19 | ///
20 | /// The to wrap
21 | /// A read-only wrapper around list.
22 | public static IList ReadOnly(IList list)
23 | {
24 | if (list == null)
25 | {
26 | throw new ArgumentNullException("list");
27 | }
28 | return new ReadOnlyList(list);
29 | }
30 |
31 | ///
32 | [Serializable]
33 | private sealed class ReadOnlyList : IList, ICollection, IEnumerable
34 | {
35 | private IList _list;
36 |
37 | internal ReadOnlyList(IList l)
38 | {
39 | this._list = l;
40 | }
41 |
42 | public int Add(object obj)
43 | {
44 | throw new NotSupportedException(Properties.Resources.NotSupported_ReadOnlyCollection);
45 | }
46 |
47 | public void Clear()
48 | {
49 | throw new NotSupportedException(Properties.Resources.NotSupported_ReadOnlyCollection);
50 | }
51 |
52 | public bool Contains(object obj)
53 | {
54 | return this._list.Contains(obj);
55 | }
56 |
57 | public void CopyTo(Array array, int index)
58 | {
59 | this._list.CopyTo(array, index);
60 | }
61 |
62 | public IEnumerator GetEnumerator()
63 | {
64 | return this._list.GetEnumerator();
65 | }
66 |
67 | public int IndexOf(object value)
68 | {
69 | return this._list.IndexOf(value);
70 | }
71 |
72 | public void Insert(int index, object obj)
73 | {
74 | throw new NotSupportedException(Properties.Resources.NotSupported_ReadOnlyCollection);
75 | }
76 |
77 | public void Remove(object value)
78 | {
79 | throw new NotSupportedException(Properties.Resources.NotSupported_ReadOnlyCollection);
80 | }
81 |
82 | public void RemoveAt(int index)
83 | {
84 | throw new NotSupportedException(Properties.Resources.NotSupported_ReadOnlyCollection);
85 | }
86 |
87 | public int Count
88 | {
89 | get
90 | {
91 | return this._list.Count;
92 | }
93 | }
94 |
95 | public bool IsFixedSize
96 | {
97 | get
98 | {
99 | return true;
100 | }
101 | }
102 |
103 | public bool IsReadOnly
104 | {
105 | get
106 | {
107 | return true;
108 | }
109 | }
110 |
111 | public bool IsSynchronized
112 | {
113 | get
114 | {
115 | return this._list.IsSynchronized;
116 | }
117 | }
118 |
119 | public object this[int index]
120 | {
121 | get
122 | {
123 | return this._list[index];
124 | }
125 |
126 | set
127 | {
128 | throw new NotSupportedException(Properties.Resources.NotSupported_ReadOnlyCollection);
129 | }
130 | }
131 |
132 | public object SyncRoot
133 | {
134 | get
135 | {
136 | return this._list.SyncRoot;
137 | }
138 | }
139 | }
140 | }
141 | }
--------------------------------------------------------------------------------