diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000..7f4ad8b
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,16 @@
+# EditorConfig is awesome: http://EditorConfig.org
+
+# top-most EditorConfig file
+root = true
+
+[*]
+indent_style = space
+tab_width = 4
+end_of_line = crlf
+charset = utf-8
+trim_trailing_whitespace = true
+insert_final_newline = false
+
+[*.{xml,html,config}]
+indent_style = space
+indent_size = 2
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..d88e4ff
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,13 @@
+bin
+obj
+StyleCop.Cache
+_ReSharper*
+_TeamCity.*
+*.user
+*.suo
+*.~*
+.*
+
+!.gitignore
+
+src/packages
diff --git a/src/External/..svnbridge/NLog.dll b/src/External/..svnbridge/NLog.dll
deleted file mode 100644
index 51d3842..0000000
--- a/src/External/..svnbridge/NLog.dll
+++ /dev/null
@@ -1,8 +0,0 @@
-svn:ignore[Bb]in
-obj
-[Dd]ebug
-[Rr]elease
-*.user
-*.aps
-*.eto
-svn:mime-typeapplication/octet-stream
\ No newline at end of file
diff --git a/src/External/NLog.dll b/src/External/NLog.dll
deleted file mode 100644
index 8a74ad4..0000000
Binary files a/src/External/NLog.dll and /dev/null differ
diff --git a/src/External/WindowsAPICodePack/Core/AppRestartRecovery/ApplicationRestartRecoveryManager.cs b/src/External/WindowsAPICodePack/Core/AppRestartRecovery/ApplicationRestartRecoveryManager.cs
deleted file mode 100644
index fd6277a..0000000
--- a/src/External/WindowsAPICodePack/Core/AppRestartRecovery/ApplicationRestartRecoveryManager.cs
+++ /dev/null
@@ -1,158 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.ComponentModel;
-using System.Runtime.InteropServices;
-using System.Diagnostics;
-using MS.WindowsAPICodePack.Internal;
-
-namespace Microsoft.WindowsAPICodePack.ApplicationServices
-{
- ///
- /// Provides access to the Application Restart and Recovery
- /// features available in Windows Vista or higher. Application Restart and Recovery lets an
- /// application do some recovery work to save data before the process exits.
- ///
- public static class ApplicationRestartRecoveryManager
- {
- ///
- /// Registers an application for recovery by Application Restart and Recovery.
- ///
- /// An object that specifies
- /// the callback method, an optional parameter to pass to the callback
- /// method and a time interval.
- ///
- /// The registration failed due to an invalid parameter.
- ///
- ///
- /// The registration failed.
- /// The time interval is the period of time within
- /// which the recovery callback method
- /// calls the method to indicate
- /// that it is still performing recovery work.
- public static void RegisterForApplicationRecovery(RecoverySettings settings)
- {
- // Throw PlatformNotSupportedException if the user is not running Vista or beyond
- CoreHelpers.ThrowIfNotVista();
-
- if (settings == null)
- throw new ArgumentNullException("settings");
-
- GCHandle handle = GCHandle.Alloc(settings.RecoveryData);
-
- HRESULT hr = AppRestartRecoveryNativeMethods.RegisterApplicationRecoveryCallback(AppRestartRecoveryNativeMethods.internalCallback, (IntPtr)handle, settings.PingInterval, (uint)0);
-
- if (!CoreErrorHelper.Succeeded((int)hr))
- {
- if (hr == HRESULT.E_INVALIDARG)
- throw new ArgumentException("Application was not registered for recovery due to bad parameters.");
- else
- throw new ExternalException("Application failed to register for recovery.");
- }
- }
-
- ///
- /// Removes an application's recovery registration.
- ///
- ///
- /// The attempt to unregister for recovery failed.
- public static void UnregisterApplicationRecovery()
- {
- // Throw PlatformNotSupportedException if the user is not running Vista or beyond
- CoreHelpers.ThrowIfNotVista();
-
- HRESULT hr = AppRestartRecoveryNativeMethods.UnregisterApplicationRecoveryCallback();
-
- if (hr == HRESULT.E_FAIL)
- throw new ExternalException("Unregister for recovery failed.");
- }
-
- ///
- /// Removes an application's restart registration.
- ///
- ///
- /// The attempt to unregister for restart failed.
- public static void UnregisterApplicationRestart()
- {
- // Throw PlatformNotSupportedException if the user is not running Vista or beyond
- CoreHelpers.ThrowIfNotVista();
-
- HRESULT hr = AppRestartRecoveryNativeMethods.UnregisterApplicationRestart();
-
- if (hr == HRESULT.E_FAIL)
- throw new ExternalException("Unregister for restart failed.");
- }
-
- ///
- /// Called by an application's method
- /// to indicate that it is still performing recovery work.
- ///
- /// A value indicating whether the user
- /// canceled the recovery.
- ///
- /// This method must be called from a registered callback method.
- public static bool ApplicationRecoveryInProgress()
- {
- // Throw PlatformNotSupportedException if the user is not running Vista or beyond
- CoreHelpers.ThrowIfNotVista();
-
- bool canceled = false;
-
- HRESULT hr = AppRestartRecoveryNativeMethods.ApplicationRecoveryInProgress(out canceled);
-
- if (hr == HRESULT.E_FAIL)
- throw new InvalidOperationException("This method must be called from the registered callback method.");
-
- return canceled;
- }
-
- ///
- /// Called by an application's method to
- /// indicate that the recovery work is complete.
- ///
- ///
- /// This should
- /// be the last call made by the method because
- /// Windows Error Reporting will terminate the application
- /// after this method is invoked.
- ///
- /// true to indicate the the program was able to complete its recovery
- /// work before terminating; otherwise false.
- public static void ApplicationRecoveryFinished(bool success)
- {
- // Throw PlatformNotSupportedException if the user is not running Vista or beyond
- CoreHelpers.ThrowIfNotVista();
-
- AppRestartRecoveryNativeMethods.ApplicationRecoveryFinished(success);
- }
-
- ///
- /// Registers an application for automatic restart if
- /// the application
- /// is terminated by Windows Error Reporting.
- ///
- /// An object that specifies
- /// the command line arguments used to restart the
- /// application, and
- /// the conditions under which the application should not be
- /// restarted.
- /// Registration failed due to an invalid parameter.
- /// The attempt to register failed.
- /// A registered application will not be restarted if it executed for less than 60 seconds before terminating.
- public static void RegisterForApplicationRestart(RestartSettings settings)
- {
- // Throw PlatformNotSupportedException if the user is not running Vista or beyond
- CoreHelpers.ThrowIfNotVista();
-
- HRESULT hr = AppRestartRecoveryNativeMethods.RegisterApplicationRestart(settings.Command, settings.Restrictions);
-
- if (hr == HRESULT.E_FAIL)
- throw new InvalidOperationException("Application failed to registered for restart.");
-
- if (hr == HRESULT.E_INVALIDARG)
- throw new ArgumentException("Failed to register application for restart due to bad parameters.");
- }
-
- }
-}
-
diff --git a/src/External/WindowsAPICodePack/Core/AppRestartRecovery/RecoveryData.cs b/src/External/WindowsAPICodePack/Core/AppRestartRecovery/RecoveryData.cs
deleted file mode 100644
index d1a9756..0000000
--- a/src/External/WindowsAPICodePack/Core/AppRestartRecovery/RecoveryData.cs
+++ /dev/null
@@ -1,58 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Runtime.InteropServices;
-
-namespace Microsoft.WindowsAPICodePack.ApplicationServices
-{
- ///
- /// The that represents the callback method invoked
- /// by the system when an application has registered for
- /// application recovery.
- ///
- /// An application-defined state object that is passed to the callback method.
- /// The callback method will be invoked
- /// prior to the application being terminated by Windows Error Reporting (WER). To keep WER from terminating the application before
- /// the callback method completes, the callback method must
- /// periodically call the method.
- ///
- public delegate int RecoveryCallback(object state);
-
- ///
- /// Defines a class that contains a callback delegate and properties of the application
- /// as defined by the user.
- ///
- public class RecoveryData
- {
- ///
- /// Initializes a recovery data wrapper with a callback method and the current
- /// state of the application.
- ///
- /// The callback delegate.
- /// The current state of the application.
- public RecoveryData(RecoveryCallback callback, object state)
- {
- Callback = callback;
- State = state;
- }
-
- ///
- /// Gets or sets a value that determines the recovery callback function.
- ///
- public RecoveryCallback Callback { get; set; }
-
- ///
- /// Gets or sets a value that determines the application state.
- ///
- public object State { get; set; }
-
- ///
- /// Invokes the recovery callback function.
- ///
- public void Invoke()
- {
- if(Callback != null)
- Callback(State);
- }
- }
-}
diff --git a/src/External/WindowsAPICodePack/Core/AppRestartRecovery/RecoverySettings.cs b/src/External/WindowsAPICodePack/Core/AppRestartRecovery/RecoverySettings.cs
deleted file mode 100644
index 579b576..0000000
--- a/src/External/WindowsAPICodePack/Core/AppRestartRecovery/RecoverySettings.cs
+++ /dev/null
@@ -1,77 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-
-namespace Microsoft.WindowsAPICodePack.ApplicationServices
-{
- ///
- /// Defines methods and properties for recovery settings, and specifies options for an application that attempts
- /// to perform final actions after a fatal event, such as an
- /// unhandled exception.
- ///
- /// This class is used to register for application recovery.
- /// See the class.
- ///
- public class RecoverySettings
- {
- private RecoveryData recoveryData;
- private uint pingInterval;
-
- ///
- /// Initializes a new instance of the RecoverySettings class.
- ///
- /// A recovery data object that contains the callback method (invoked by the system
- /// before Windows Error Reporting terminates the application) and an optional state object.
- /// The time interval within which the
- /// callback method must invoke to
- /// prevent WER from terminating the application.
- ///
- public RecoverySettings(RecoveryData data, uint interval)
- {
- this.recoveryData = data;
- this.pingInterval = interval;
- }
-
- ///
- /// Gets the recovery data object that contains the callback method and an optional
- /// parameter (usually the state of the application) to be passed to the
- /// callback method.
- ///
- /// A object.
- public RecoveryData RecoveryData
- {
- get { return recoveryData; }
- }
-
- ///
- /// Gets the time interval for notifying Windows Error Reporting.
- /// The method must invoke
- /// within this interval to prevent WER from terminating the application.
- ///
- ///
- /// The recovery ping interval is specified in milliseconds.
- /// By default, the interval is 5 seconds.
- /// If you specify zero, the default interval is used.
- ///
- public uint PingInterval
- {
- get { return pingInterval; }
- }
-
- ///
- /// Returns a string representation of the current state
- /// of this object.
- ///
- /// A object.
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.String.Format(System.String,System.Object,System.Object,System.Object)",
- Justification = "We are not currently handling globalization or localization")]
- public override string ToString()
- {
- return String.Format("delegate: {0}, state: {1}, ping: {2}",
- this.recoveryData.Callback.Method.ToString(),
- this.recoveryData.State.ToString(),
- this.PingInterval);
- }
- }
-}
-
diff --git a/src/External/WindowsAPICodePack/Core/AppRestartRecovery/RestartRestrictions.cs b/src/External/WindowsAPICodePack/Core/AppRestartRecovery/RestartRestrictions.cs
deleted file mode 100644
index 7ea35b1..0000000
--- a/src/External/WindowsAPICodePack/Core/AppRestartRecovery/RestartRestrictions.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-
-namespace Microsoft.WindowsAPICodePack.ApplicationServices
-{
- ///
- /// Specifies the conditions when Windows Error Reporting
- /// should not restart an application that has registered
- /// for automatic restart.
- ///
- [Flags]
- public enum RestartRestrictions
- {
- ///
- /// Always restart the application.
- ///
- None = 0,
- ///
- /// Do not restart when the application has crashed.
- ///
- NotOnCrash = 1,
- ///
- /// Do not restart when the application is hung.
- ///
- NotOnHang = 2,
- ///
- /// Do not restart when the application is terminated
- /// due to a system update.
- ///
- NotOnPatch = 4,
- ///
- /// Do not restart when the application is terminated
- /// because of a system reboot.
- ///
- NotOnReboot = 8
- }
-}
diff --git a/src/External/WindowsAPICodePack/Core/AppRestartRecovery/RestartSettings.cs b/src/External/WindowsAPICodePack/Core/AppRestartRecovery/RestartSettings.cs
deleted file mode 100644
index f3ce68a..0000000
--- a/src/External/WindowsAPICodePack/Core/AppRestartRecovery/RestartSettings.cs
+++ /dev/null
@@ -1,69 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-
-namespace Microsoft.WindowsAPICodePack.ApplicationServices
-{
- ///
- /// Specifies the options for an application to be automatically
- /// restarted by Windows Error Reporting.
- ///
- /// Regardless of these
- /// settings, the application
- /// will not be restarted if it executed for less than 60 seconds before
- /// terminating.
- public class RestartSettings
- {
- private string command;
- private RestartRestrictions restrictions;
-
- ///
- /// Creates a new instance of the RestartSettings class.
- ///
- /// The command line arguments
- /// used to restart the application.
- /// A bitwise combination of the RestartRestrictions
- /// values that specify
- /// when the application should not be restarted.
- ///
- public RestartSettings(string commandLine, RestartRestrictions restrict)
- {
- command = commandLine;
- restrictions = restrict;
- }
-
- ///
- /// Gets the command line arguments used to restart the application.
- ///
- /// A object.
- public string Command
- {
- get { return command; }
- }
-
- ///
- /// Gets the set of conditions when the application
- /// should not be restarted.
- ///
- /// A set of values.
- public RestartRestrictions Restrictions
- {
- get { return restrictions; }
- }
-
- ///
- /// Returns a string representation of the current state
- /// of this object.
- ///
- /// A that displays
- /// the command line arguments
- /// and restrictions for restarting the application.
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.String.Format(System.String,System.Object,System.Object)",
- Justification = "We are not currently handling globalization or localization")]
- public override string ToString()
- {
- return String.Format("command: {0} restrictions: {1}", command, restrictions.ToString());
- }
- }
-}
-
diff --git a/src/External/WindowsAPICodePack/Core/Core.csproj b/src/External/WindowsAPICodePack/Core/Core.csproj
deleted file mode 100644
index bc82f06..0000000
--- a/src/External/WindowsAPICodePack/Core/Core.csproj
+++ /dev/null
@@ -1,164 +0,0 @@
-
-
-
- Debug
- AnyCPU
- 9.0.21022
- 2.0
- {2E1FB0DF-F9BB-4909-9F32-2D9D022A8E57}
- Library
- Properties
- Microsoft.WindowsAPICodePack
- Microsoft.WindowsAPICodePack
- v4.0
- 512
- SAK
- SAK
- SAK
- SAK
-
-
- 3.5
-
- publish\
- true
- Disk
- false
- Foreground
- 7
- Days
- false
- false
- true
- 0
- 1.0.0.%2a
- false
- false
- true
-
-
-
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
- bin\Debug\Microsoft.WindowsAPICodePack.XML
-
-
- Migrated rules for Core.ruleset
-
-
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
- AllRules.ruleset
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- False
- .NET Framework 3.5 SP1 Client Profile
- false
-
-
- False
- .NET Framework 3.5 SP1
- true
-
-
- False
- Windows Installer 3.1
- true
-
-
-
-
-
\ No newline at end of file
diff --git a/src/External/WindowsAPICodePack/Core/Core.csproj.vspscc b/src/External/WindowsAPICodePack/Core/Core.csproj.vspscc
deleted file mode 100644
index feffdec..0000000
--- a/src/External/WindowsAPICodePack/Core/Core.csproj.vspscc
+++ /dev/null
@@ -1,10 +0,0 @@
-""
-{
-"FILE_VERSION" = "9237"
-"ENLISTMENT_CHOICE" = "NEVER"
-"PROJECT_FILE_RELATIVE_PATH" = ""
-"NUMBER_OF_EXCLUDED_FILES" = "0"
-"ORIGINAL_PROJECT_FILE_PATH" = ""
-"NUMBER_OF_NESTED_PROJECTS" = "0"
-"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
-}
diff --git a/src/External/WindowsAPICodePack/Core/Dialogs/Common/DialogControl.cs b/src/External/WindowsAPICodePack/Core/Dialogs/Common/DialogControl.cs
deleted file mode 100644
index bc283fc..0000000
--- a/src/External/WindowsAPICodePack/Core/Dialogs/Common/DialogControl.cs
+++ /dev/null
@@ -1,152 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Diagnostics;
-
-namespace Microsoft.WindowsAPICodePack.Dialogs
-{
- ///
- /// Abstract base class for all dialog controls
- ///
- public abstract class DialogControl
- {
- private static int nextId = DialogsDefaults.MinimumDialogControlId;
-
- ///
- /// Creates a new instance of a dialog control
- ///
- protected DialogControl()
- {
- this.id = nextId;
-
- // Support wrapping of control IDs in case you create a lot of custom controls
- if (nextId == Int32.MaxValue)
- nextId = DialogsDefaults.MinimumDialogControlId;
- else
- nextId++;
- }
-
- ///
- /// Creates a new instance of a dialog control with the specified name.
- ///
- /// The name for this dialog.
- protected DialogControl(string name) : this()
- {
- this.Name = name;
- }
-
- private IDialogControlHost hostingDialog;
- ///
- /// The native dialog that is hosting this control. This property is null is
- /// there is not associated dialog
- ///
- public IDialogControlHost HostingDialog
- {
- get { return hostingDialog; }
- set { hostingDialog = value; }
- }
-
- private string name;
- ///
- /// Gets or sets the name for this control.
- ///
- /// A value.
- ///
- /// The name of the control should not be modified once set
- ///
- /// The name cannot be null or a zero-length string.
- /// The name has already been set.
- public string Name
- {
- get { return name; }
- set
- {
- // Names for controls need to be quite stable,
- // as we are going to maintain a mapping between
- // the names and the underlying Win32/COM control IDs.
- if (String.IsNullOrEmpty(value))
- throw new ArgumentException(
- "Dialog control name cannot be empty or null.");
-
- if (!String.IsNullOrEmpty(name))
- throw new InvalidOperationException(
- "Dialog controls cannot be renamed.");
-
- // Note that we don't notify the hosting dialog of
- // the change, as the initial set of name is (must be)
- // always legal, and renames are always illegal.
- name = value;
- }
- }
-
- private int id;
- ///
- /// Gets the identifier for this control.
- ///
- /// An value.
- public int Id
- {
- get { return id; }
- }
-
- ///
- /// Calls the hosting dialog, if it exists, to check whether the
- /// property can be set in the dialog's current state.
- /// The host should throw an exception if the change is not supported.
- /// Note that if the dialog isn't set yet,
- /// there are no restrictions on setting the property.
- ///
- /// The name of the property that is changing
- protected void CheckPropertyChangeAllowed(string propName)
- {
- Debug.Assert(!String.IsNullOrEmpty(propName), "Property to change was not specified");
-
- if (hostingDialog != null)
- hostingDialog.IsControlPropertyChangeAllowed(propName, this);
- }
-
- ///
- /// Calls the hosting dialog, if it exists, to
- /// to indicate that a property has changed, and that
- /// the dialog should do whatever is necessary
- /// to propagate the change to the native control.
- /// Note that if the dialog isn't set yet,
- /// there are no restrictions on setting the property.
- ///
- /// The name of the property that is changing.
- protected void ApplyPropertyChange(string propName)
- {
- Debug.Assert(!String.IsNullOrEmpty(propName), "Property changed was not specified");
-
- if (hostingDialog != null)
- hostingDialog.ApplyControlPropertyChange(propName, this);
- }
-
- ///
- /// Compares two objects to determine whether they are equal
- ///
- /// The object to compare against.
- /// A value.
- public override bool Equals(object obj)
- {
- DialogControl control = obj as DialogControl;
-
- if (control != null)
- return (this.Id == control.Id);
-
- return false;
- }
-
- ///
- /// Serves as a hash function for a particular type.
- ///
- /// An hash code for this control.
- public override int GetHashCode()
- {
- if (name == null)
- return this.ToString().GetHashCode();
-
- return name.GetHashCode();
- }
- }
-}
\ No newline at end of file
diff --git a/src/External/WindowsAPICodePack/Core/Dialogs/Common/DialogControlCollection.cs b/src/External/WindowsAPICodePack/Core/Dialogs/Common/DialogControlCollection.cs
deleted file mode 100644
index 413a9bb..0000000
--- a/src/External/WindowsAPICodePack/Core/Dialogs/Common/DialogControlCollection.cs
+++ /dev/null
@@ -1,164 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-
-namespace Microsoft.WindowsAPICodePack.Dialogs
-{
- ///
- /// Strongly typed collection for dialog controls.
- ///
- /// DialogControl
- public sealed class DialogControlCollection : Collection where T : DialogControl
- {
- private IDialogControlHost hostingDialog;
-
- internal DialogControlCollection(IDialogControlHost host)
- {
- hostingDialog = host;
- }
-
- ///
- /// Inserts an dialog control at the specified index.
- ///
- /// The location to insert the control.
- /// The item to insert.
- /// A control with
- /// the same name already exists in this collection -or-
- /// the control is being hosted by another dialog -or- the associated dialog is
- /// showing and cannot be modified.
- protected override void InsertItem(int index, T control)
- {
- // Check for duplicates, lack of host,
- // and during-show adds.
- if (Items.Contains(control))
- throw new InvalidOperationException(
- "Dialog cannot have more than one control with the same name.");
- if (control.HostingDialog != null)
- throw new InvalidOperationException(
- "Dialog control must be removed from current collections first.");
- if (!hostingDialog.IsCollectionChangeAllowed())
- throw new InvalidOperationException(
- "Modifying controls collection while dialog is showing is not supported.");
-
- // Reparent, add control.
- control.HostingDialog = hostingDialog;
- base.InsertItem(index, control);
-
- // Notify that we've added a control.
- hostingDialog.ApplyCollectionChanged();
- }
-
- ///
- /// Removes the control at the specified index.
- ///
- /// The location of the control to remove.
- ///
- /// The associated dialog is
- /// showing and cannot be modified.
- protected override void RemoveItem(int index)
- {
- // Notify that we're about to remove a control.
- // Throw if dialog showing.
- if (!hostingDialog.IsCollectionChangeAllowed())
- throw new InvalidOperationException(
- "Modifying controls collection while dialog is showing is not supported.");
-
- DialogControl control = (DialogControl)Items[index];
-
- // Unparent and remove.
- control.HostingDialog = null;
- base.RemoveItem(index);
-
- hostingDialog.ApplyCollectionChanged();
- }
-
- ///
- /// Defines the indexer that supports accessing controls by name.
- ///
- ///
- /// Control names are case sensitive.
- /// This indexer is useful when the dialog is created in XAML
- /// rather than constructed in code.
- ///
- /// The name cannot be null or a zero-length string.
- /// If there is more than one control with the same name, only the first control will be returned.
- public T this[string name]
- {
- get
- {
- if (String.IsNullOrEmpty(name))
- throw new ArgumentException(
- "Control name must not be null or zero length.");
-
- foreach (T control in base.Items)
- {
- // NOTE: we don't ToLower() the strings - casing effects
- // hash codes, so we are case-sensitive.
- if (control.Name == name)
- return control;
- }
- return null;
- }
- }
-
- ///
- /// Recursively searches for the control who's id matches the value
- /// passed in the parameter.
- ///
- ///
- /// An integer containing the identifier of the
- /// control being searched for.
- ///
- /// A DialogControl who's id matches the value of the
- /// parameter.
- ///
- internal DialogControl GetControlbyId(int id)
- {
- //return ( Items.Count == 0 ? null :
- // GetSubControlbyId(Items as IEnumerable,
- // id)
- //);
- return GetSubControlbyId(
- Items as IEnumerable,
- id);
- }
-
-
- ///
- /// Recursively searches for a given control id in the
- /// collection passed via the parameter.
- ///
- ///
- /// A Collection<CommonFileDialogControl>
- /// An int containing the identifier of the control
- /// being searched for.
- ///
- /// A DialogControl who's Id matches the value of the
- /// parameter.
- ///
- internal DialogControl GetSubControlbyId( IEnumerable ctrlColl,
- int id )
- {
- // if ctrlColl is null, it will throw in the foreach.
- if (ctrlColl == null)
- return null;
-
- foreach (DialogControl control in ctrlColl)
- {
- // Match?
- if (control.Id == id)
- {
- return control;
- }
- }
-
- // Control id not found - likely an error, but the calling
- // function should ultimately decide.
- return null;
-
- }
-
- }
-}
diff --git a/src/External/WindowsAPICodePack/Core/Dialogs/Common/DialogsDefaults.cs b/src/External/WindowsAPICodePack/Core/Dialogs/Common/DialogsDefaults.cs
deleted file mode 100644
index 67a72c5..0000000
--- a/src/External/WindowsAPICodePack/Core/Dialogs/Common/DialogsDefaults.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-namespace Microsoft.WindowsAPICodePack.Dialogs
-{
- internal static class DialogsDefaults
- {
- internal const string Caption = "Application";
- internal const string MainInstruction = "";
- internal const string Content = "";
-
- internal const int ProgressBarStartingValue = 0;
- internal const int ProgressBarMinimumValue = 0;
- internal const int ProgressBarMaximumValue = 100;
-
- internal const int IdealWidth = 0;
-
- // For generating control ID numbers that won't
- // collide with the standard button return IDs.
- internal const int MinimumDialogControlId =
- (int)TaskDialogNativeMethods.TASKDIALOG_COMMON_BUTTON_RETURN_ID.IDCLOSE + 1;
- }
-}
diff --git a/src/External/WindowsAPICodePack/Core/Dialogs/Common/IDialogControlHost.cs b/src/External/WindowsAPICodePack/Core/Dialogs/Common/IDialogControlHost.cs
deleted file mode 100644
index 5433343..0000000
--- a/src/External/WindowsAPICodePack/Core/Dialogs/Common/IDialogControlHost.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-namespace Microsoft.WindowsAPICodePack.Dialogs
-{
- ///
- /// Indicates that the implementing class is a dialog that can host
- /// customizable dialog controls (subclasses of DialogControl).
- ///
- public interface IDialogControlHost
- {
- ///
- /// Handle notifications of pseudo-controls being added
- /// or removed from the collection.
- /// PreFilter should throw if a control cannot
- /// be added/removed in the dialog's current state.
- /// PostProcess should pass on changes to native control,
- /// if appropriate.
- ///
- /// true if collection change is allowed.
- bool IsCollectionChangeAllowed();
-
- ///
- /// Applies changes to the collection.
- ///
- void ApplyCollectionChanged();
-
- ///
- /// Handle notifications of individual child
- /// pseudo-controls' properties changing..
- /// Prefilter should throw if the property
- /// cannot be set in the dialog's current state.
- /// PostProcess should pass on changes to native control,
- /// if appropriate.
- ///
- /// The name of the property.
- /// The control propertyName applies to.
- /// true if the property change is allowed.
- bool IsControlPropertyChangeAllowed(string propertyName, DialogControl control);
-
- ///
- /// Called when a control currently in the collection
- /// has a property changed.
- ///
- /// The name of the property changed.
- /// The control whose property has changed.
- void ApplyControlPropertyChange(string propertyName, DialogControl control);
- }
-}
diff --git a/src/External/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialog.cs b/src/External/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialog.cs
deleted file mode 100644
index 73596de..0000000
--- a/src/External/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialog.cs
+++ /dev/null
@@ -1,1262 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Security.Permissions;
-using MS.WindowsAPICodePack.Internal;
-
-namespace Microsoft.WindowsAPICodePack.Dialogs
-{
- ///
- /// Encapsulates a new-to-Vista Win32 TaskDialog window
- /// - a powerful successor to the MessageBox available
- /// in previous versions of Windows.
- ///
- [SecurityPermissionAttribute(SecurityAction.InheritanceDemand, Flags = SecurityPermissionFlag.UnmanagedCode)]
- public class TaskDialog : IDialogControlHost, IDisposable
- {
- // Global instance of TaskDialog, to be used by static Show() method.
- // As most parameters of a dialog created via static Show() will have
- // identical parameters, we'll create one TaskDialog and treat it
- // as a NativeTaskDialog generator for all static Show() calls.
- private static TaskDialog staticDialog;
-
- // Main current native dialog.
- private NativeTaskDialog nativeDialog;
-
- private List buttons;
- private List radioButtons;
- private List commandLinks;
- private IntPtr ownerWindow;
-
- #region Public Properties
- ///
- /// Occurs when a progress bar changes.
- ///
- public event EventHandler Tick;
-
- ///
- /// Occurs when a user clicks a hyperlink.
- ///
- public event EventHandler HyperlinkClick;
-
- ///
- /// Occurs when the TaskDialog is closing.
- ///
- public event EventHandler Closing;
-
- ///
- /// Occurs when a user clicks on Help.
- ///
- public event EventHandler HelpInvoked;
-
- ///
- /// Occurs when the TaskDialog is opened.
- ///
- public event EventHandler Opened;
-
- ///
- /// Gets or sets a value that contains the owner window's handle.
- ///
- public IntPtr OwnerWindowHandle
- {
- get { return ownerWindow; }
- set
- {
- ThrowIfDialogShowing("Dialog owner cannot be modified while dialog is showing.");
- ownerWindow = value;
- }
- }
-
- // Main content (maps to MessageBox's "message").
- private string text;
- ///
- /// Gets or sets a value that contains the message text.
- ///
- public string Text
- {
- get { return text; }
- set
- {
- // Set local value, then update native dialog if showing.
- text = value;
- if (NativeDialogShowing)
- nativeDialog.UpdateText(text);
- }
- }
-
- private string instructionText;
- ///
- /// Gets or sets a value that contains the instruction text.
- ///
- public string InstructionText
- {
- get { return instructionText; }
- set
- {
- // Set local value, then update native dialog if showing.
- instructionText = value;
- if (NativeDialogShowing)
- nativeDialog.UpdateInstruction(instructionText);
- }
- }
-
- private string caption;
- ///
- /// Gets or sets a value that contains the caption text.
- ///
- public string Caption
- {
- get { return caption; }
- set
- {
- ThrowIfDialogShowing("Dialog caption can't be set while dialog is showing.");
- caption = value;
- }
- }
-
- private string footerText;
- ///
- /// Gets or sets a value that contains the footer text.
- ///
- public string FooterText
- {
- get { return footerText; }
- set
- {
- // Set local value, then update native dialog if showing.
- footerText = value;
- if (NativeDialogShowing)
- nativeDialog.UpdateFooterText(footerText);
- }
- }
-
- private string checkBoxText;
- ///
- /// Gets or sets a value that contains the footer check box text.
- ///
- public string FooterCheckBoxText
- {
- get { return checkBoxText; }
- set
- {
- ThrowIfDialogShowing("Checkbox text can't be set while dialog is showing.");
- checkBoxText = value;
- }
- }
-
- private string detailsExpandedText;
- ///
- /// Gets or sets a value that contains the expanded text in the details section.
- ///
- public string DetailsExpandedText
- {
- get { return detailsExpandedText; }
- set
- {
- // Set local value, then update native dialog if showing.
- detailsExpandedText = value;
- if (NativeDialogShowing)
- nativeDialog.UpdateExpandedText(detailsExpandedText);
- }
- }
-
- private bool detailsExpanded;
- ///
- /// Gets or sets a value that determines if the details section is expanded.
- ///
- public bool DetailsExpanded
- {
- get { return detailsExpanded; }
- set
- {
- ThrowIfDialogShowing("Expanded state of the dialog can't be modified while dialog is showing.");
- detailsExpanded = value;
- }
- }
-
- private string detailsExpandedLabel;
- ///
- /// Gets or sets a value that contains the expanded control text.
- ///
- public string DetailsExpandedLabel
- {
- get { return detailsExpandedLabel; }
- set
- {
- ThrowIfDialogShowing("Expanded control label can't be set while dialog is showing.");
- detailsExpandedLabel = value;
- }
- }
-
- private string detailsCollapsedLabel;
- ///
- /// Gets or sets a value that contains the collapsed control text.
- ///
- public string DetailsCollapsedLabel
- {
- get { return detailsCollapsedLabel; }
- set
- {
- ThrowIfDialogShowing("Collapsed control text can't be set while dialog is showing.");
- detailsCollapsedLabel = value;
- }
- }
-
- private bool cancelable;
- ///
- /// Gets or sets a value that determines if Cancelable is set.
- ///
- public bool Cancelable
- {
- get { return cancelable; }
- set
- {
- ThrowIfDialogShowing("Cancelable can't be set while dialog is showing.");
- cancelable = value;
- }
- }
-
- private TaskDialogStandardIcon icon;
- ///
- /// Gets or sets a value that contains the TaskDialog main icon.
- ///
- public TaskDialogStandardIcon Icon
- {
- get { return icon; }
- set
- {
- // Set local value, then update native dialog if showing.
- icon = value;
- if (NativeDialogShowing)
- nativeDialog.UpdateMainIcon(icon);
- }
- }
-
- private TaskDialogStandardIcon footerIcon;
- ///
- /// Gets or sets a value that contains the footer icon.
- ///
- public TaskDialogStandardIcon FooterIcon
- {
- get { return footerIcon; }
- set
- {
- // Set local value, then update native dialog if showing.
- footerIcon = value;
- if (NativeDialogShowing)
- nativeDialog.UpdateFooterIcon(footerIcon);
- }
- }
-
- private TaskDialogStandardButtons standardButtons = TaskDialogStandardButtons.None;
- ///
- /// Gets or sets a value that contains the standard buttons.
- ///
- public TaskDialogStandardButtons StandardButtons
- {
- get { return standardButtons; }
- set
- {
- ThrowIfDialogShowing("Standard buttons can't be set while dialog is showing.");
- standardButtons = value;
- }
- }
-
- private DialogControlCollection controls;
- ///
- /// Gets a value that contains the TaskDialog controls.
- ///
- public DialogControlCollection Controls
- {
- // "Show protection" provided by collection itself,
- // as well as individual controls.
- get { return controls; }
- }
-
- private bool hyperlinksEnabled;
- ///
- /// Gets or sets a value that determines if hyperlinks are enabled.
- ///
- public bool HyperlinksEnabled
- {
- get { return hyperlinksEnabled; }
- set
- {
- ThrowIfDialogShowing("Hyperlinks can't be enabled/disabled while dialog is showing.");
- hyperlinksEnabled = value;
- }
- }
-
- private bool? footerCheckBoxChecked = null;
- ///
- /// Gets or sets a value that indicates if the footer checkbox is checked.
- ///
- public bool? FooterCheckBoxChecked
- {
- get
- {
- if (!footerCheckBoxChecked.HasValue)
- return false;
- else
- return footerCheckBoxChecked;
- }
- set
- {
- // Set local value, then update native dialog if showing.
- footerCheckBoxChecked = value;
- if (NativeDialogShowing)
- nativeDialog.UpdateCheckBoxChecked(footerCheckBoxChecked.Value);
- }
- }
-
- private TaskDialogExpandedDetailsLocation expansionMode;
- ///
- /// Gets or sets a value that contains the expansion mode for this dialog.
- ///
- public TaskDialogExpandedDetailsLocation ExpansionMode
- {
- get { return expansionMode; }
- set
- {
- ThrowIfDialogShowing("Expanded information mode can't be set while dialog is showing.");
- expansionMode = value;
- }
- }
-
- private TaskDialogStartupLocation startupLocation;
-
- ///
- /// Gets or sets a value that contains the startup location.
- ///
- public TaskDialogStartupLocation StartupLocation
- {
- get { return startupLocation; }
- set
- {
- ThrowIfDialogShowing("Startup location can't be changed while dialog is showing.");
- startupLocation = value;
- }
- }
-
- private TaskDialogProgressBar progressBar;
- ///
- /// Gets or sets the progress bar on the taskdialog. ProgressBar a visual representation
- /// of the progress of a long running operation.
- ///
- public TaskDialogProgressBar ProgressBar
- {
- get { return progressBar; }
- set
- {
- ThrowIfDialogShowing("Progress bar can't be changed while dialog is showing");
- if (value != null)
- {
- if (value.HostingDialog != null)
- throw new InvalidOperationException("Progress bar cannot be hosted in multiple dialogs.");
-
- value.HostingDialog = this;
- }
- progressBar = value;
- }
- }
-
- #endregion
-
- #region Constructors
-
- // Constructors.
-
-
- ///
- /// Creates a basic TaskDialog window
- ///
- public TaskDialog()
- {
- // Throw PlatformNotSupportedException if the user is not running Vista or beyond
- CoreHelpers.ThrowIfNotVista();
-
- // Initialize various data structs.
- controls = new DialogControlCollection(this);
- buttons = new List();
- radioButtons = new List();
- commandLinks = new List();
- }
-
-
-
- #endregion
-
- #region Static Show Methods
-
- ///
- /// Creates and shows a task dialog with the specified message text.
- ///
- /// The text to display.
- /// The dialog result.
- public static TaskDialogResult Show(string text)
- {
- return ShowCoreStatic(
- text,
- TaskDialogDefaults.MainInstruction,
- TaskDialogDefaults.Caption);
- }
-
- ///
- /// Creates and shows a task dialog with the specified supporting text and main instruction.
- ///
- /// The supporting text to display.
- /// The main instruction text to display.
- /// The dialog result.
- public static TaskDialogResult Show(string text, string instructionText)
- {
- return ShowCoreStatic(
- text, instructionText,
- TaskDialogDefaults.Caption);
- }
-
- ///
- /// Creates and shows a task dialog with the specified supporting text, main instruction, and dialog caption.
- ///
- /// The supporting text to display.
- /// The main instruction text to display.
- /// The caption for the dialog.
- /// The dialog result.
- public static TaskDialogResult Show(string text, string instructionText, string caption)
- {
- return ShowCoreStatic(text, instructionText, caption);
- }
- #endregion
-
- #region Instance Show Methods
-
- ///
- /// Creates and shows a task dialog.
- ///
- /// The dialog result.
- public TaskDialogResult Show()
- {
- return ShowCore();
- }
- #endregion
-
- #region Core Show Logic
-
- // CORE SHOW METHODS:
- // All static Show() calls forward here -
- // it is responsible for retrieving
- // or creating our cached TaskDialog instance, getting it configured,
- // and in turn calling the appropriate instance Show.
-
- private static TaskDialogResult ShowCoreStatic(
- string text,
- string instructionText,
- string caption)
- {
- // Throw PlatformNotSupportedException if the user is not running Vista or beyond
- CoreHelpers.ThrowIfNotVista();
-
- // If no instance cached yet, create it.
- if (staticDialog == null)
- {
- // New TaskDialog will automatically pick up defaults when
- // a new config structure is created as part of ShowCore().
- staticDialog = new TaskDialog();
- }
-
- // Set the few relevant properties,
- // and go with the defaults for the others.
- staticDialog.text = text;
- staticDialog.instructionText = instructionText;
- staticDialog.caption = caption;
-
- return staticDialog.Show();
- }
-
- private TaskDialogResult ShowCore()
- {
- TaskDialogResult result;
-
- try
- {
- // Populate control lists, based on current
- // contents - note we are somewhat late-bound
- // on our control lists, to support XAML scenarios.
- SortDialogControls();
-
- // First, let's make sure it even makes
- // sense to try a show.
- ValidateCurrentDialogSettings();
-
- // Create settings object for new dialog,
- // based on current state.
- NativeTaskDialogSettings settings =
- new NativeTaskDialogSettings();
- ApplyCoreSettings(settings);
- ApplySupplementalSettings(settings);
-
- // Show the dialog.
- // NOTE: this is a BLOCKING call; the dialog proc callbacks
- // will be executed by the same thread as the
- // Show() call before the thread of execution
- // contines to the end of this method.
- nativeDialog = new NativeTaskDialog(settings, this);
- nativeDialog.NativeShow();
-
- // Build and return dialog result to public API - leaving it
- // null after an exception is thrown is fine in this case
- result = ConstructDialogResult(nativeDialog);
- footerCheckBoxChecked = nativeDialog.CheckBoxChecked;
- }
- finally
- {
- CleanUp();
- nativeDialog = null;
- }
-
- return result;
- }
-
- // Helper that looks at the current state of the TaskDialog and verifies
- // that there aren't any abberant combinations of properties.
- // NOTE that this method is designed to throw
- // rather than return a bool.
- private void ValidateCurrentDialogSettings()
- {
- if (footerCheckBoxChecked.HasValue &&
- footerCheckBoxChecked.Value == true &&
- String.IsNullOrEmpty(checkBoxText))
- throw new InvalidOperationException(
- "Checkbox text must be provided to enable the dialog checkbox.");
-
- // Progress bar validation.
- // Make sure the progress bar values are valid.
- // the Win32 API will valiantly try to rationalize
- // bizarre min/max/value combinations, but we'll save
- // it the trouble by validating.
- if (progressBar != null)
- if (!progressBar.HasValidValues)
- throw new ArgumentException(
- "Progress bar must have a value between the minimum and maxium values.");
-
- // Validate Buttons collection.
- // Make sure we don't have buttons AND
- // command-links - the Win32 API treats them as different
- // flavors of a single button struct.
- if (buttons.Count > 0 && commandLinks.Count > 0)
- throw new NotSupportedException(
- "Dialog cannot display both non-standard buttons and command links.");
- if (buttons.Count > 0 && standardButtons != TaskDialogStandardButtons.None)
- throw new NotSupportedException(
- "Dialog cannot display both non-standard buttons and standard buttons.");
- }
-
- // Analyzes the final state of the NativeTaskDialog instance and creates the
- // final TaskDialogResult that will be returned from the public API
- private TaskDialogResult ConstructDialogResult(NativeTaskDialog native)
- {
- Debug.Assert(native.ShowState == DialogShowState.Closed, "dialog result being constructed for unshown dialog.");
-
- TaskDialogResult result = TaskDialogResult.Cancel;
-
- TaskDialogStandardButtons standardButton = MapButtonIdToStandardButton(native.SelectedButtonID);
-
- // If returned ID isn't a standard button, let's fetch
- if (standardButton == TaskDialogStandardButtons.None)
- result = TaskDialogResult.CustomButtonClicked;
- else
- result = (TaskDialogResult)standardButton;
-
- return result;
- }
-
- ///
- /// Close TaskDialog
- ///
- /// if TaskDialog is not showing.
- public void Close()
- {
- if (!NativeDialogShowing)
- throw new InvalidOperationException(
- "Attempting to close a non-showing dialog.");
-
- nativeDialog.NativeClose(TaskDialogResult.Cancel);
- // TaskDialog's own cleanup code -
- // which runs post show - will handle disposal of native dialog.
- }
-
- ///
- /// Close TaskDialog with a given TaskDialogResult
- ///
- /// TaskDialogResult to return from the TaskDialog.Show() method
- /// if TaskDialog is not showing.
- public void Close(TaskDialogResult closingResult)
- {
- if (!NativeDialogShowing)
- throw new InvalidOperationException(
- "Attempting to close a non-showing dialog.");
-
- nativeDialog.NativeClose(closingResult);
- // TaskDialog's own cleanup code -
- // which runs post show - will handle disposal of native dialog.
- }
-
- #endregion
-
- #region Configuration Construction
-
- private void ApplyCoreSettings(NativeTaskDialogSettings settings)
- {
- ApplyGeneralNativeConfiguration(settings.NativeConfiguration);
- ApplyTextConfiguration(settings.NativeConfiguration);
- ApplyOptionConfiguration(settings.NativeConfiguration);
- ApplyControlConfiguration(settings);
- }
-
- private void ApplyGeneralNativeConfiguration(TaskDialogNativeMethods.TASKDIALOGCONFIG dialogConfig)
- {
- // If an owner wasn't specifically specified,
- // we'll use the app's main window.
- if (ownerWindow != IntPtr.Zero)
- dialogConfig.hwndParent = ownerWindow;
-
- // Other miscellaneous sets.
- dialogConfig.MainIcon =
- new TaskDialogNativeMethods.TASKDIALOGCONFIG_ICON_UNION((int)icon);
- dialogConfig.FooterIcon =
- new TaskDialogNativeMethods.TASKDIALOGCONFIG_ICON_UNION((int)footerIcon);
- dialogConfig.dwCommonButtons =
- (TaskDialogNativeMethods.TASKDIALOG_COMMON_BUTTON_FLAGS)standardButtons;
- }
-
- ///
- /// Sets important text properties.
- ///
- /// An instance of a object.
- private void ApplyTextConfiguration(TaskDialogNativeMethods.TASKDIALOGCONFIG dialogConfig)
- {
- // note that nulls or empty strings are fine here.
- dialogConfig.pszContent = text;
- dialogConfig.pszWindowTitle = caption;
- dialogConfig.pszMainInstruction = instructionText;
- dialogConfig.pszExpandedInformation = detailsExpandedText;
- dialogConfig.pszExpandedControlText = detailsExpandedLabel;
- dialogConfig.pszCollapsedControlText = detailsCollapsedLabel;
- dialogConfig.pszFooter = footerText;
- dialogConfig.pszVerificationText = checkBoxText;
- }
-
- private void ApplyOptionConfiguration(TaskDialogNativeMethods.TASKDIALOGCONFIG dialogConfig)
- {
- // Handle options - start with no options set.
- TaskDialogNativeMethods.TASKDIALOG_FLAGS options = TaskDialogNativeMethods.TASKDIALOG_FLAGS.NONE;
- if (cancelable)
- options |= TaskDialogNativeMethods.TASKDIALOG_FLAGS.TDF_ALLOW_DIALOG_CANCELLATION;
- if (footerCheckBoxChecked.HasValue && footerCheckBoxChecked.Value)
- options |= TaskDialogNativeMethods.TASKDIALOG_FLAGS.TDF_VERIFICATION_FLAG_CHECKED;
- if (hyperlinksEnabled)
- options |= TaskDialogNativeMethods.TASKDIALOG_FLAGS.TDF_ENABLE_HYPERLINKS;
- if (detailsExpanded)
- options |= TaskDialogNativeMethods.TASKDIALOG_FLAGS.TDF_EXPANDED_BY_DEFAULT;
- if (Tick != null)
- options |= TaskDialogNativeMethods.TASKDIALOG_FLAGS.TDF_CALLBACK_TIMER;
- if (startupLocation == TaskDialogStartupLocation.CenterOwner)
- options |= TaskDialogNativeMethods.TASKDIALOG_FLAGS.TDF_POSITION_RELATIVE_TO_WINDOW;
-
- // Note: no validation required, as we allow this to
- // be set even if there is no expanded information
- // text because that could be added later.
- // Default for Win32 API is to expand into (and after)
- // the content area.
- if (expansionMode == TaskDialogExpandedDetailsLocation.ExpandFooter)
- options |= TaskDialogNativeMethods.TASKDIALOG_FLAGS.TDF_EXPAND_FOOTER_AREA;
-
- // Finally, apply options to config.
- dialogConfig.dwFlags = options;
- }
-
- // Builds the actual configuration
- // that the NativeTaskDialog (and underlying Win32 API)
- // expects, by parsing the various control
- // lists, marshalling to the unmanaged heap, etc.
-
- private void ApplyControlConfiguration(NativeTaskDialogSettings settings)
- {
- // Deal with progress bars/marquees.
- if (progressBar != null)
- {
- if (progressBar.State == TaskDialogProgressBarState.Marquee)
- settings.NativeConfiguration.dwFlags |= TaskDialogNativeMethods.TASKDIALOG_FLAGS.TDF_SHOW_MARQUEE_PROGRESS_BAR;
- else
- settings.NativeConfiguration.dwFlags |= TaskDialogNativeMethods.TASKDIALOG_FLAGS.TDF_SHOW_PROGRESS_BAR;
- }
-
- // Build the native struct arrays that NativeTaskDialog
- // needs - though NTD will handle
- // the heavy lifting marshalling to make sure
- // all the cleanup is centralized there.
- if (buttons.Count > 0 || commandLinks.Count > 0)
- {
- // These are the actual arrays/lists of
- // the structs that we'll copy to the
- // unmanaged heap.
- List sourceList = (
- buttons.Count > 0 ? buttons : commandLinks);
- settings.Buttons = BuildButtonStructArray(sourceList);
-
- // Apply option flag that forces all
- // custom buttons to render as command links.
- if (commandLinks.Count > 0)
- settings.NativeConfiguration.dwFlags |=
- TaskDialogNativeMethods.TASKDIALOG_FLAGS.TDF_USE_COMMAND_LINKS;
-
- // Set default button and add elevation icons
- // to appropriate buttons.
- settings.NativeConfiguration.nDefaultButton =
- FindDefaultButtonId(sourceList);
-
- ApplyElevatedIcons(settings, sourceList);
- }
- if (radioButtons.Count > 0)
- {
- settings.RadioButtons = BuildButtonStructArray(radioButtons);
-
- // Set default radio button - radio buttons don't support.
- int defaultRadioButton = FindDefaultButtonId(radioButtons);
- settings.NativeConfiguration.nDefaultRadioButton =
- defaultRadioButton;
-
- if (defaultRadioButton ==
- TaskDialogNativeMethods.NO_DEFAULT_BUTTON_SPECIFIED)
- settings.NativeConfiguration.dwFlags |= TaskDialogNativeMethods.TASKDIALOG_FLAGS.TDF_NO_DEFAULT_RADIO_BUTTON;
- }
- }
-
- private static TaskDialogNativeMethods.TASKDIALOG_BUTTON[] BuildButtonStructArray(List controls)
- {
- TaskDialogNativeMethods.TASKDIALOG_BUTTON[] buttonStructs;
- TaskDialogButtonBase button;
-
- int totalButtons = controls.Count;
- buttonStructs = new TaskDialogNativeMethods.TASKDIALOG_BUTTON[totalButtons];
- for (int i = 0; i < totalButtons; i++)
- {
- button = controls[i];
- buttonStructs[i] = new TaskDialogNativeMethods.TASKDIALOG_BUTTON(button.Id, button.ToString());
- }
- return buttonStructs;
- }
-
- // Searches list of controls and returns the ID of
- // the default control, or null if no default was specified.
- private static int FindDefaultButtonId(List controls)
- {
- int found = TaskDialogNativeMethods.NO_DEFAULT_BUTTON_SPECIFIED;
- foreach (TaskDialogButtonBase control in controls)
- {
- if (control.Default)
- {
- // Check if we've found a default in this list already.
- if (found != TaskDialogNativeMethods.NO_DEFAULT_BUTTON_SPECIFIED)
- throw new InvalidOperationException("Can't have more than one default button of a given type.");
- return control.Id;
- }
- }
- return found;
- }
-
- private static void ApplyElevatedIcons(NativeTaskDialogSettings settings, List controls)
- {
- foreach (TaskDialogButton control in controls)
- {
- if (control.ShowElevationIcon)
- {
- if (settings.ElevatedButtons == null)
- settings.ElevatedButtons = new List();
- settings.ElevatedButtons.Add(control.Id);
- }
- }
- }
-
- private void ApplySupplementalSettings(NativeTaskDialogSettings settings)
- {
- if (progressBar != null)
- {
- if (progressBar.State != TaskDialogProgressBarState.Marquee)
- {
- settings.ProgressBarMinimum = progressBar.Minimum;
- settings.ProgressBarMaximum = progressBar.Maximum;
- settings.ProgressBarValue = progressBar.Value;
- settings.ProgressBarState = progressBar.State;
- }
- }
-
- if (HelpInvoked != null)
- settings.InvokeHelp = true;
- }
-
- // Here we walk our controls collection and
- // sort the various controls by type.
- private void SortDialogControls()
- {
- foreach (TaskDialogControl control in controls)
- {
- if (control is TaskDialogButtonBase && String.IsNullOrEmpty(((TaskDialogButtonBase)control).Text))
- {
- if (control is TaskDialogCommandLink && String.IsNullOrEmpty(((TaskDialogCommandLink)control).Instruction))
- throw new InvalidOperationException(
- "Button text must be non-empty");
- }
-
- // Loop through child controls
- // and sort the controls based on type.
- if (control is TaskDialogCommandLink)
- {
- commandLinks.Add((TaskDialogCommandLink)control);
- }
- else if (control is TaskDialogRadioButton)
- {
- if (radioButtons == null)
- radioButtons = new List();
- radioButtons.Add((TaskDialogRadioButton)control);
- }
- else if (control is TaskDialogButtonBase)
- {
- if (buttons == null)
- buttons = new List();
- buttons.Add((TaskDialogButtonBase)control);
- }
- else if (control is TaskDialogProgressBar)
- {
- progressBar = (TaskDialogProgressBar)control;
- }
- else
- {
- throw new ArgumentException("Unknown dialog control type.");
- }
- }
- }
-
- #endregion
-
- #region Helpers
-
- // Helper to map the standard button IDs returned by
- // TaskDialogIndirect to the standard button ID enum -
- // note that we can't just cast, as the Win32
- // typedefs differ incoming and outgoing.
-
- private static TaskDialogStandardButtons MapButtonIdToStandardButton(int id)
- {
- switch ((TaskDialogNativeMethods.TASKDIALOG_COMMON_BUTTON_RETURN_ID)id)
- {
- case TaskDialogNativeMethods.TASKDIALOG_COMMON_BUTTON_RETURN_ID.IDOK:
- return TaskDialogStandardButtons.Ok;
- case TaskDialogNativeMethods.TASKDIALOG_COMMON_BUTTON_RETURN_ID.IDCANCEL:
- return TaskDialogStandardButtons.Cancel;
- case TaskDialogNativeMethods.TASKDIALOG_COMMON_BUTTON_RETURN_ID.IDABORT:
- // Included for completeness in API -
- // we can't pass in an Abort standard button.
- return TaskDialogStandardButtons.None;
- case TaskDialogNativeMethods.TASKDIALOG_COMMON_BUTTON_RETURN_ID.IDRETRY:
- return TaskDialogStandardButtons.Retry;
- case TaskDialogNativeMethods.TASKDIALOG_COMMON_BUTTON_RETURN_ID.IDIGNORE:
- // Included for completeness in API -
- // we can't pass in an Ignore standard button.
- return TaskDialogStandardButtons.None;
- case TaskDialogNativeMethods.TASKDIALOG_COMMON_BUTTON_RETURN_ID.IDYES:
- return TaskDialogStandardButtons.Yes;
- case TaskDialogNativeMethods.TASKDIALOG_COMMON_BUTTON_RETURN_ID.IDNO:
- return TaskDialogStandardButtons.No;
- case TaskDialogNativeMethods.TASKDIALOG_COMMON_BUTTON_RETURN_ID.IDCLOSE:
- return TaskDialogStandardButtons.Close;
- default:
- return TaskDialogStandardButtons.None;
- }
- }
-
- private void ThrowIfDialogShowing(string message)
- {
- if (NativeDialogShowing)
- throw new NotSupportedException(message);
- }
-
- private bool NativeDialogShowing
- {
- get
- {
- return (nativeDialog != null)
- && (nativeDialog.ShowState == DialogShowState.Showing ||
- nativeDialog.ShowState == DialogShowState.Closing);
- }
- }
-
- // NOTE: we are going to require names be unique
- // across both buttons and radio buttons,
- // even though the Win32 API allows them to be separate.
- private TaskDialogButtonBase GetButtonForId(int id)
- {
- return (TaskDialogButtonBase)controls.GetControlbyId(id);
- }
-
- #endregion
-
- #region IDialogControlHost Members
-
- // We're explicitly implementing this interface
- // as the user will never need to know about it
- // or use it directly - it is only for the internal
- // implementation of "pseudo controls" within
- // the dialogs.
-
- // Called whenever controls are being added
- // to or removed from the dialog control collection.
- bool IDialogControlHost.IsCollectionChangeAllowed()
- {
- // Only allow additions to collection if dialog is NOT showing.
- return !NativeDialogShowing;
- }
-
- // Called whenever controls have been added or removed.
- void IDialogControlHost.ApplyCollectionChanged()
- {
- // If we're showing, we should never get here -
- // the changing notification would have thrown and the
- // property would not have been changed.
- Debug.Assert(!NativeDialogShowing,
- "Collection changed notification received despite show state of dialog");
- }
-
- // Called when a control currently in the collection
- // has a property changing - this is
- // basically to screen out property changes that
- // cannot occur while the dialog is showing
- // because the Win32 API has no way for us to
- // propagate the changes until we re-invoke the Win32 call.
- bool IDialogControlHost.IsControlPropertyChangeAllowed(string propertyName, DialogControl control)
- {
- Debug.Assert(control is TaskDialogControl,
- "Property changing for a control that is not a TaskDialogControl-derived type");
- Debug.Assert(propertyName != "Name",
- "Name changes at any time are not supported - public API should have blocked this");
-
- bool canChange = false;
-
- if (!NativeDialogShowing)
- {
- // Certain properties can't be changed if the dialog is not showing
- // we need a handle created before we can set these...
- switch(propertyName)
- {
- case "Enabled":
- canChange = false;
- break;
- default:
- canChange = true;
- break;
- }
- }
- else
- {
- // If the dialog is showing, we can only
- // allow some properties to change.
- switch (propertyName)
- {
- // Properties that CAN'T be changed while dialog is showing.
- case "Text":
- case "Default":
- canChange = false;
- break;
-
- // Properties that CAN be changed while dialog is showing.
- case "ShowElevationIcon":
- case "Enabled":
- canChange = true;
- break;
- default:
- Debug.Assert(true, "Unknown property name coming through property changing handler");
- break;
- }
- }
- return canChange;
- }
-
- // Called when a control currently in the collection
- // has a property changed - this handles propagating
- // the new property values to the Win32 API.
- // If there isn't a way to change the Win32 value, then we
- // should have already screened out the property set
- // in NotifyControlPropertyChanging.
- void IDialogControlHost.ApplyControlPropertyChange(string propertyName, DialogControl control)
- {
- // We only need to apply changes to the
- // native dialog when it actually exists.
- if (NativeDialogShowing)
- {
- if (control is TaskDialogProgressBar)
- {
- if (!progressBar.HasValidValues)
- throw new ArgumentException(
- "Progress bar must have a value between Minimum and Maximum.");
- switch (propertyName)
- {
- case "State":
- nativeDialog.UpdateProgressBarState(progressBar.State);
- break;
- case "Value":
- nativeDialog.UpdateProgressBarValue(progressBar.Value);
- break;
- case "Minimum":
- case "Maximum":
- nativeDialog.UpdateProgressBarRange();
- break;
- default:
- Debug.Assert(true, "Unknown property being set");
- break;
- }
- }
- else if (control is TaskDialogButton)
- {
- TaskDialogButton button = (TaskDialogButton)control;
- switch (propertyName)
- {
- case "ShowElevationIcon":
- nativeDialog.UpdateElevationIcon(button.Id, button.ShowElevationIcon);
- break;
- case "Enabled":
- nativeDialog.UpdateButtonEnabled(button.Id, button.Enabled);
- break;
- default:
- Debug.Assert(true, "Unknown property being set");
- break;
- }
- }
- else if (control is TaskDialogRadioButton)
- {
- TaskDialogRadioButton button = (TaskDialogRadioButton)control;
- switch (propertyName)
- {
- case "Enabled":
- nativeDialog.UpdateRadioButtonEnabled(button.Id, button.Enabled);
- break;
- default:
- Debug.Assert(true, "Unknown property being set");
- break;
- }
- }
- else
- {
- // Do nothing with property change -
- // note that this shouldn't ever happen, we should have
- // either thrown on the changing event, or we handle above.
- Debug.Assert(true, "Control property changed notification not handled properly - being ignored");
- }
- }
- return;
- }
-
- #endregion
-
- #region Event Percolation Methods
-
- // All Raise*() methods are called by the
- // NativeTaskDialog when various pseudo-controls
- // are triggered.
- internal void RaiseButtonClickEvent(int id)
- {
- // First check to see if the ID matches a custom button.
- TaskDialogButtonBase button = GetButtonForId(id);
-
- // If a custom button was found,
- // raise the event - if not, it's a standard button, and
- // we don't support custom event handling for the standard buttons
- if (button != null)
- button.RaiseClickEvent();
- }
-
- internal void RaiseHyperlinkClickEvent(string link)
- {
- EventHandler handler = HyperlinkClick;
- if (handler != null)
- {
- handler(this, new TaskDialogHyperlinkClickedEventArgs(link));
- }
- }
-
- // Gives event subscriber a chance to prevent
- // the dialog from closing, based on
- // the current state of the app and the button
- // used to commit. Note that we don't
- // have full access at this stage to
- // the full dialog state.
- internal int RaiseClosingEvent(int id)
- {
- EventHandler handler = Closing;
- if (handler != null)
- {
-
- TaskDialogButtonBase customButton = null;
- TaskDialogClosingEventArgs e = new TaskDialogClosingEventArgs();
-
- // Try to identify the button - is it a standard one?
- TaskDialogStandardButtons buttonClicked = MapButtonIdToStandardButton(id);
-
- // If not, it had better be a custom button...
- if (buttonClicked == TaskDialogStandardButtons.None)
- {
- customButton = GetButtonForId(id);
-
- // ... or we have a problem.
- if (customButton == null)
- throw new InvalidOperationException("Bad button ID in closing event.");
-
- e.CustomButton = customButton.Name;
-
- e.TaskDialogResult = TaskDialogResult.CustomButtonClicked;
- }
- else
- e.TaskDialogResult = (TaskDialogResult)buttonClicked;
-
- // Raise the event and determine how to proceed.
- handler(this, e);
- if (e.Cancel)
- return (int)HRESULT.S_FALSE;
- }
-
- // It's okay to let the dialog close.
- return (int)HRESULT.S_OK;
- }
-
- internal void RaiseHelpInvokedEvent()
- {
- EventHandler handler = HelpInvoked;
- if (handler != null)
- handler(this, EventArgs.Empty);
- }
-
- internal void RaiseOpenedEvent()
- {
- EventHandler handler = Opened;
- if (handler != null)
- handler(this, EventArgs.Empty);
- }
-
- internal void RaiseTickEvent(int ticks)
- {
- EventHandler handler = Tick;
- if (handler != null)
- handler(this, new TaskDialogTickEventArgs(ticks));
- }
-
- #endregion
-
- #region Cleanup Code
-
- // Cleans up data and structs from a single
- // native dialog Show() invocation.
- private void CleanUp()
- {
- // Reset values that would be considered
- // 'volatile' in a given instance.
- if (progressBar != null)
- {
- progressBar.Reset();
- }
-
- // Clean out sorted control lists -
- // though we don't of course clear the main controls collection,
- // so the controls are still around; we'll
- // resort on next show, since the collection may have changed.
- if (buttons != null)
- buttons.Clear();
- if (commandLinks != null)
- commandLinks.Clear();
- if (radioButtons != null)
- radioButtons.Clear();
- progressBar = null;
-
- // Have the native dialog clean up the rest.
- if (nativeDialog != null)
- nativeDialog.Dispose();
- }
-
-
- // Dispose pattern - cleans up data and structs for
- // a) any native dialog currently showing, and
- // b) anything else that the outer TaskDialog has.
- private bool disposed;
-
- ///
- /// Dispose TaskDialog Resources
- ///
- public void Dispose()
- {
- Dispose(true);
- GC.SuppressFinalize(this);
- }
-
- ///
- /// TaskDialog Finalizer
- ///
- ~TaskDialog()
- {
- Dispose(false);
- }
-
- ///
- /// Dispose TaskDialog Resources
- ///
- /// If true, indicates that this is being called via Dispose rather than via the finalizer.
- public virtual void Dispose(bool disposing)
- {
- if (!disposed)
- {
- disposed = true;
-
- if (disposing)
- {
- // Clean up managed resources.
- if (nativeDialog != null && nativeDialog.ShowState == DialogShowState.Showing)
- {
- nativeDialog.NativeClose(TaskDialogResult.Cancel);
- }
-
- buttons = null;
- radioButtons = null;
- commandLinks = null;
- }
-
- // Clean up unmanaged resources SECOND, NTD counts on
- // being closed before being disposed.
- if (nativeDialog != null)
- {
- nativeDialog.Dispose();
- nativeDialog = null;
- }
-
- if (staticDialog != null)
- {
- staticDialog.Dispose();
- staticDialog = null;
- }
-
-
- }
- }
-
- #endregion
-
- ///
- /// Indicates whether this feature is supported on the current platform.
- ///
- public static bool IsPlatformSupported
- {
- get
- {
- // We need Windows Vista onwards ...
- return CoreHelpers.RunningOnVista;
- }
- }
- }
-}
diff --git a/src/External/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialogBar.cs b/src/External/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialogBar.cs
deleted file mode 100644
index a0632df..0000000
--- a/src/External/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialogBar.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-
-namespace Microsoft.WindowsAPICodePack.Dialogs
-{
- ///
- /// Defines a common class for all task dialog bar controls, such as the progress and marquee bars.
- ///
- public class TaskDialogBar : TaskDialogControl
- {
- ///
- /// Creates a new instance of this class.
- ///
- public TaskDialogBar() {}
- ///
- /// Creates a new instance of this class with the specified name.
- ///
- /// The name for this control.
- protected TaskDialogBar(string name) : base(name) { }
-
- private TaskDialogProgressBarState state;
- ///
- /// Gets or sets the state of the progress bar.
- ///
- public TaskDialogProgressBarState State
- {
- get { return state; }
- set
- {
- CheckPropertyChangeAllowed("State");
- state = value;
- ApplyPropertyChange("State");
- }
- }
- ///
- /// Resets the state of the control to normal.
- ///
- protected internal virtual void Reset()
- {
- state = TaskDialogProgressBarState.Normal;
- }
- }
-}
diff --git a/src/External/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialogButton.cs b/src/External/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialogButton.cs
deleted file mode 100644
index a612f00..0000000
--- a/src/External/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialogButton.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-
-namespace Microsoft.WindowsAPICodePack.Dialogs
-{
- ///
- /// Implements a button that can be hosted in a task dialog.
- ///
- public class TaskDialogButton : TaskDialogButtonBase
- {
- ///
- /// Creates a new instance of this class.
- ///
- public TaskDialogButton() { }
-
- ///
- /// Creates a new instance of this class with the specified property settings.
- ///
- /// The name of the button.
- /// The button label.
- public TaskDialogButton(string name, string text) : base(name, text) { }
-
- private bool showElevationIcon;
- ///
- /// Gets or sets a value that controls whether the elevation icon is displayed.
- ///
- public bool ShowElevationIcon
- {
- get { return showElevationIcon; }
- set
- {
- CheckPropertyChangeAllowed("ShowElevationIcon");
- showElevationIcon = value;
- ApplyPropertyChange("ShowElevationIcon");
- }
- }
- }
-}
diff --git a/src/External/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialogButtonBase.cs b/src/External/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialogButtonBase.cs
deleted file mode 100644
index 6419dfb..0000000
--- a/src/External/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialogButtonBase.cs
+++ /dev/null
@@ -1,115 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-
-namespace Microsoft.WindowsAPICodePack.Dialogs
-{
- // ContentProperty allows us to specify the text
- // of the button as the child text of
- // a button element in XAML, as well as explicitly
- // set with 'Text=""'
- // Note that this attribute is inherited, so it
- // applies to command-links and radio buttons as well.
- ///
- /// Defines the abstract base class for task dialog buttons.
- /// Classes that inherit from this class will inherit
- /// the Text property defined in this class.
- ///
- public abstract class TaskDialogButtonBase : TaskDialogControl
- {
-
- ///
- /// Creates a new instance on a task dialog button.
- ///
- protected TaskDialogButtonBase() { }
- ///
- /// Creates a new instance on a task dialog button with
- /// the specified name and text.
- ///
- /// The name for this button.
- /// The label for this button.
- protected TaskDialogButtonBase(string name, string text) : base(name)
- {
- this.text = text;
- }
-
- // Note that we don't need to explicitly
- // implement the add/remove delegate for the Click event;
- // the hosting dialog only needs the delegate
- // information when the Click event is
- // raised (indirectly) by NativeTaskDialog,
- // so the latest delegate is always available.
- ///
- /// Raised when the task dialog button is clicked.
- ///
- public event EventHandler Click;
- internal void RaiseClickEvent()
- {
- // Only perform click if the button is enabled.
- if (!enabled)
- return;
-
- EventHandler handler = Click;
- if (handler != null)
- handler(this, EventArgs.Empty);
- }
-
- private string text;
- ///
- /// Gets or sets the button text.
- ///
- public string Text
- {
- get { return text; }
- set
- {
- CheckPropertyChangeAllowed("Text");
- text = value;
- ApplyPropertyChange("Text");
- }
- }
-
- private bool enabled = true;
- ///
- /// Gets or sets a value that determines whether the
- /// button is enabled. The enabled state can cannot be changed
- /// before the dialog is shown.
- ///
- public bool Enabled
- {
- get { return enabled; }
- set
- {
- CheckPropertyChangeAllowed("Enabled");
- enabled = value;
- ApplyPropertyChange("Enabled");
- }
- }
-
- private bool defaultControl;
- ///
- /// Gets or sets a value that indicates whether
- /// this button is the default button.
- ///
- public bool Default
- {
- get { return defaultControl; }
- set
- {
- CheckPropertyChangeAllowed("Default");
- defaultControl = value;
- ApplyPropertyChange("Default");
- }
- }
- ///
- /// Returns the Text property value for this button.
- ///
- /// A .
- public override string ToString()
- {
- if (text == null)
- return "";
- return text;
- }
- }
-}
diff --git a/src/External/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialogClosingEventArgs.cs b/src/External/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialogClosingEventArgs.cs
deleted file mode 100644
index 5c3aa76..0000000
--- a/src/External/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialogClosingEventArgs.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System.ComponentModel;
-
-namespace Microsoft.WindowsAPICodePack.Dialogs
-{
- ///
- /// Data associated with event.
- ///
- public class TaskDialogClosingEventArgs : CancelEventArgs
- {
- private TaskDialogResult taskDialogResult;
- ///
- /// Gets or sets the standard button that was clicked.
- ///
- public TaskDialogResult TaskDialogResult
- {
- get { return taskDialogResult; }
- set { taskDialogResult = value; }
- }
-
- private string customButton;
- ///
- /// Gets or sets the text of the custom button that was clicked.
- ///
- public string CustomButton
- {
- get { return customButton; }
- set { customButton = value; }
- }
-
-
- }
-}
diff --git a/src/External/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialogCommandLink.cs b/src/External/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialogCommandLink.cs
deleted file mode 100644
index 122c160..0000000
--- a/src/External/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialogCommandLink.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-namespace Microsoft.WindowsAPICodePack.Dialogs
-{
- ///
- /// Represents a command-link.
- ///
- public class TaskDialogCommandLink : TaskDialogButton
- {
- ///
- /// Creates a new instance of this class.
- ///
- public TaskDialogCommandLink() { }
- ///
- /// Creates a new instance of this class with the specified name and label.
- ///
- /// The name for this button.
- /// The label for this button.
- public TaskDialogCommandLink(string name, string text) : base(name, text) { }
-
- ///
- /// Creates a new instance of this class with the specified name,label, and instruction.
- ///
- /// The name for this button.
- /// The label for this button.
- /// The instruction for this command link.
- public TaskDialogCommandLink(string name, string text, string instruction)
- : base(name, text)
- {
- this.instruction = instruction;
- }
-
- private string instruction;
- ///
- /// Gets or sets the instruction associated with this command link button.
- ///
- public string Instruction
- {
- get { return instruction; }
- set { instruction = value; }
- }
-
- ///
- /// Returns a string representation of this object.
- ///
- /// A
- public override string ToString()
- {
- string instructionString = (instruction == null ? "" : instruction);
- return Text + "\n" + instructionString;
- }
- }
-}
diff --git a/src/External/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialogControl.cs b/src/External/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialogControl.cs
deleted file mode 100644
index 35b5822..0000000
--- a/src/External/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialogControl.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-namespace Microsoft.WindowsAPICodePack.Dialogs
-{
- ///
- /// Declares the abstract base class for all custom task dialog controls.
- ///
- public abstract class TaskDialogControl : DialogControl
- {
- ///
- /// Creates a new instance of a task dialog control.
- ///
- protected TaskDialogControl() {}
- ///
- /// Creates a new instance of a task dialog control with the specified name.
- ///
- /// The name for this control.
- protected TaskDialogControl(string name) : base(name) {}
- }
-}
\ No newline at end of file
diff --git a/src/External/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialogDefaults.cs b/src/External/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialogDefaults.cs
deleted file mode 100644
index d69a53f..0000000
--- a/src/External/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialogDefaults.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-namespace Microsoft.WindowsAPICodePack.Dialogs
-{
- internal static class TaskDialogDefaults
- {
- internal const string Caption = "Application";
- internal const string MainInstruction = "";
- internal const string Content = "";
-
-
- internal const int ProgressBarMinimumValue = 0;
- internal const int ProgressBarMaximumValue = 100;
-
- internal const int IdealWidth = 0;
-
- // For generating control ID numbers that won't
- // collide with the standard button return IDs.
- internal const int MinimumDialogControlId =
- (int)TaskDialogNativeMethods.TASKDIALOG_COMMON_BUTTON_RETURN_ID.IDCLOSE + 1;
- }
-}
diff --git a/src/External/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialogExpandedInfoMode.cs b/src/External/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialogExpandedInfoMode.cs
deleted file mode 100644
index 67e7f98..0000000
--- a/src/External/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialogExpandedInfoMode.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-namespace Microsoft.WindowsAPICodePack.Dialogs
-{
- ///
- /// Specifies the options for expand/collapse sections in dialogs.
- ///
- public enum TaskDialogExpandedDetailsLocation
- {
- ///
- /// Do not show the content.
- ///
- Hide,
- ///
- /// Show the content.
- ///
- ExpandContent,
- ///
- /// Expand the footer content.
- ///
- ExpandFooter
- }
-}
diff --git a/src/External/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialogHyperlinkClickedEventArgs.cs b/src/External/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialogHyperlinkClickedEventArgs.cs
deleted file mode 100644
index 6da59f3..0000000
--- a/src/External/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialogHyperlinkClickedEventArgs.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-
-namespace Microsoft.WindowsAPICodePack.Dialogs
-{
- ///
- /// Defines event data associated with a HyperlinkClick event.
- ///
- public class TaskDialogHyperlinkClickedEventArgs : EventArgs
- {
- ///
- /// Creates a new instance of this class with the specified link text.
- ///
- /// The text of the hyperlink that was clicked.
- public TaskDialogHyperlinkClickedEventArgs(string link)
- {
- linkText = link;
- }
-
- private string linkText;
- ///
- /// Gets or sets the text of the hyperlink that was clicked.
- ///
- public string LinkText
- {
- get { return linkText; }
- set { linkText = value; }
- }
- }
-}
diff --git a/src/External/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialogProgressBar.cs b/src/External/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialogProgressBar.cs
deleted file mode 100644
index f08fd21..0000000
--- a/src/External/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialogProgressBar.cs
+++ /dev/null
@@ -1,113 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-namespace Microsoft.WindowsAPICodePack.Dialogs
-{
- ///
- /// Provides a visual representation of the progress of a long running operation.
- ///
- public class TaskDialogProgressBar : TaskDialogBar
- {
- ///
- /// Creates a new instance of this class.
- ///
- public TaskDialogProgressBar()
- {
- }
- ///
- /// Creates a new instance of this class with the specified name.
- /// And using the default values: Min = 0, Max = 100, Current = 0
- ///
- /// The name of the control.
- public TaskDialogProgressBar(string name) : base(name) { }
- ///
- /// Creates a new instance of this class with the specified
- /// minimum, maximum and current values.
- ///
- /// The minimum value for this control.
- /// The maximum value for this control.
- /// The current value for this control.
- public TaskDialogProgressBar(int minimum, int maximum, int value)
- {
- Minimum = minimum;
- Maximum = maximum;
- Value = value;
- }
-
- private int minimum = TaskDialogDefaults.ProgressBarMinimumValue;
- private int value = TaskDialogDefaults.ProgressBarMinimumValue;
- private int maximum = TaskDialogDefaults.ProgressBarMaximumValue;
-
- ///
- /// Gets or sets the minimum value for the control.
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1500:VariableNamesShouldNotMatchFieldNames", MessageId = "value",
- Justification="Value is standard for progressbar's current value property")]
- public int Minimum
- {
- get { return minimum; }
- set
- {
- CheckPropertyChangeAllowed("Minimum");
- // Check for positive numbers
- if (value < 0)
- throw new System.ArgumentException("Minimum value provided must be a positive number", "value");
- // Check if min / max differ
- if (value >= Maximum)
- throw new System.ArgumentException("Minimum value provided must less than the maximum value", "value");
- minimum = value;
- ApplyPropertyChange("Minimum");
- }
- }
- ///
- /// Gets or sets the maximum value for the control.
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1500:VariableNamesShouldNotMatchFieldNames", MessageId = "value",
- Justification="Value is standard for progressbar's current value property")]
- public int Maximum
- {
- get { return maximum; }
- set
- {
- CheckPropertyChangeAllowed("Maximum");
- // Check if min / max differ
- if (value < Minimum)
- throw new System.ArgumentException("Maximum value provided must be greater than the minimum value", "value");
- maximum = value;
- ApplyPropertyChange("Maximum");
- }
- }
- ///
- /// Gets or sets the current value for the control.
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1500:VariableNamesShouldNotMatchFieldNames", MessageId = "value",
- Justification="Value is standard for progressbar's current value property")]
- public int Value
- {
- get { return this.value; }
- set
- {
- CheckPropertyChangeAllowed("Value");
- // Check for positive numbers
- if (value < Minimum)
- throw new System.ArgumentException("Value provided must be greater than or equal to minimum value", "value");
- if (value > Maximum)
- throw new System.ArgumentException("Value provided must be less than or equal to the maximum value", "value");
- this.value = value;
- ApplyPropertyChange("Value");
- }
- }
-
- internal bool HasValidValues
- {
- get { return (minimum <= value && value <= maximum); }
- }
- ///
- /// Resets the control to its minimum value.
- ///
- protected internal override void Reset()
- {
- base.Reset();
- value = minimum;
- }
- }
-}
diff --git a/src/External/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialogProgressBarState.cs b/src/External/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialogProgressBarState.cs
deleted file mode 100644
index ccd5f3f..0000000
--- a/src/External/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialogProgressBarState.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-namespace Microsoft.WindowsAPICodePack.Dialogs
-{
- ///
- /// Sets the state of a task dialog progress bar.
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1008:EnumsShouldHaveZeroValue")]
- public enum TaskDialogProgressBarState
- {
- ///
- /// Normal state.
- ///
- Normal = TaskDialogNativeMethods.PBST.PBST_NORMAL,
-
- ///
- /// An error occurred.
- ///
- Error = TaskDialogNativeMethods.PBST.PBST_ERROR,
-
- ///
- /// The progress is paused.
- ///
- Paused = TaskDialogNativeMethods.PBST.PBST_PAUSED,
-
- ///
- /// Displays marquee (indeterminate) style progress
- ///
- Marquee,
- }
-}
diff --git a/src/External/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialogRadioButton.cs b/src/External/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialogRadioButton.cs
deleted file mode 100644
index e805e4f..0000000
--- a/src/External/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialogRadioButton.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-namespace Microsoft.WindowsAPICodePack.Dialogs
-{
- ///
- /// Defines a radio button that can be hosted in by a
- /// object.
- ///
- public class TaskDialogRadioButton : TaskDialogButtonBase
- {
- ///
- /// Creates a new instance of this class.
- ///
- public TaskDialogRadioButton() { }
- ///
- /// Creates a new instance of this class with
- /// the specified name and text.
- ///
- /// The name for this control.
- /// The value for this controls
- /// property.
- public TaskDialogRadioButton(string name, string text) : base(name, text) { }
- }
-}
diff --git a/src/External/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialogResult.cs b/src/External/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialogResult.cs
deleted file mode 100644
index 48f497e..0000000
--- a/src/External/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialogResult.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-namespace Microsoft.WindowsAPICodePack.Dialogs
-{
- ///
- /// Indicates the various buttons and options clicked by the user on the task dialog.
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1027:MarkEnumsWithFlags"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1008:EnumsShouldHaveZeroValue")]
- public enum TaskDialogResult
- {
- ///
- /// "OK" button was clicked
- ///
- Ok = 0x0001,
-
- ///
- /// "Yes" button was clicked
- ///
- Yes = 0x0002,
-
- ///
- /// "No" button was clicked
- ///
- No = 0x0004,
-
- ///
- /// "Cancel" button was clicked
- ///
- Cancel = 0x0008,
-
- ///
- /// "Retry" button was clicked
- ///
- Retry = 0x0010,
-
- ///
- /// "Close" button was clicked
- ///
- Close = 0x0020,
-
- ///
- /// A custom button was clicked.
- ///
- CustomButtonClicked = 0x0100,
- }
-}
diff --git a/src/External/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialogStandardButton.cs b/src/External/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialogStandardButton.cs
deleted file mode 100644
index f371db8..0000000
--- a/src/External/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialogStandardButton.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-
-namespace Microsoft.WindowsAPICodePack.Dialogs
-{
- ///
- /// Identifies one of the standard buttons that
- /// can be displayed via TaskDialog.
- ///
- [Flags]
- public enum TaskDialogStandardButtons
- {
- ///
- /// No buttons on the dialog.
- ///
- None = 0x0000,
-
- ///
- /// An "OK" button.
- ///
- Ok = 0x0001,
-
- ///
- /// A "Yes" button.
- ///
- Yes = 0x0002,
-
- ///
- /// A "No" button.
- ///
- No = 0x0004,
-
- ///
- /// A "Cancel" button.
- ///
- Cancel = 0x0008,
-
- ///
- /// A "Retry" button.
- ///
- Retry = 0x0010,
-
- ///
- /// A "Close" button.
- ///
- Close = 0x0020
- }
-}
diff --git a/src/External/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialogStandardIcon.cs b/src/External/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialogStandardIcon.cs
deleted file mode 100644
index 5246225..0000000
--- a/src/External/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialogStandardIcon.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-namespace Microsoft.WindowsAPICodePack.Dialogs
-{
- ///
- /// Specifies the icon displayed in a task dialog.
- ///
- public enum TaskDialogStandardIcon
- {
- ///
- /// Displays no icons (default).
- ///
- None = 0,
- ///
- /// Displays the warning icon.
- ///
- Warning = 65535,
- ///
- /// Displays the error icon.
- ///
- Error = 65534,
- ///
- /// Displays the Information icon.
- ///
- Information = 65533,
- ///
- /// Displays the User Account Control shield.
- ///
- Shield = 65532
- }
-}
diff --git a/src/External/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialogStartupLocation.cs b/src/External/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialogStartupLocation.cs
deleted file mode 100644
index 5fc144d..0000000
--- a/src/External/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialogStartupLocation.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-namespace Microsoft.WindowsAPICodePack.Dialogs
-{
- ///
- /// Specifies the initial display location for a task dialog.
- ///
- public enum TaskDialogStartupLocation
- {
- ///
- /// The window placed in the center of the screen.
- ///
- CenterScreen,
- ///
- /// The window centered relative to the window that launched the dialog.
- ///
- CenterOwner
- }
-}
diff --git a/src/External/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialogTickEventArgs.cs b/src/External/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialogTickEventArgs.cs
deleted file mode 100644
index 93b15f7..0000000
--- a/src/External/WindowsAPICodePack/Core/Dialogs/TaskDialogs/TaskDialogTickEventArgs.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-
-namespace Microsoft.WindowsAPICodePack.Dialogs
-{
- ///
- /// The event data for a TaskDialogTick event.
- ///
- public class TaskDialogTickEventArgs : EventArgs
- {
- private int ticks;
- ///
- /// Initializes the data associated with the TaskDialog tick event.
- ///
- /// The total number of ticks since the control was activated.
- public TaskDialogTickEventArgs(int totalTicks)
- {
- ticks = totalTicks;
- }
- ///
- /// Gets a value that determines the current number of ticks.
- ///
- public int Ticks
- {
- get { return ticks; }
- }
- }
-}
diff --git a/src/External/WindowsAPICodePack/Core/Interop/AppRestartRecovery/AppRestartRecoveryNativeMethods.cs b/src/External/WindowsAPICodePack/Core/Interop/AppRestartRecovery/AppRestartRecoveryNativeMethods.cs
deleted file mode 100644
index e64d375..0000000
--- a/src/External/WindowsAPICodePack/Core/Interop/AppRestartRecovery/AppRestartRecoveryNativeMethods.cs
+++ /dev/null
@@ -1,87 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Runtime.InteropServices;
-using MS.WindowsAPICodePack.Internal;
-
-namespace Microsoft.WindowsAPICodePack.ApplicationServices
-{
- internal static class AppRestartRecoveryNativeMethods
- {
- #region Application Restart and Recovery Definitions
-
- internal delegate UInt32 InternalRecoveryCallback(IntPtr state);
-
- internal static InternalRecoveryCallback internalCallback;
-
- static AppRestartRecoveryNativeMethods()
- {
- internalCallback = new InternalRecoveryCallback(InternalRecoveryHandler);
- }
-
- private static UInt32 InternalRecoveryHandler(IntPtr parameter)
- {
- bool cancelled = false;
- ApplicationRecoveryInProgress(out cancelled);
-
- GCHandle handle = GCHandle.FromIntPtr(parameter);
- RecoveryData data = handle.Target as RecoveryData;
- data.Invoke();
- handle.Free();
-
- return (0);
- }
-
-
-
- [DllImport("kernel32.dll")]
- internal static extern void ApplicationRecoveryFinished(
- [MarshalAs(UnmanagedType.Bool)] bool success);
-
- [DllImport("kernel32.dll")]
- [PreserveSig]
- internal static extern HRESULT ApplicationRecoveryInProgress(
- [Out, MarshalAs(UnmanagedType.Bool)] out bool canceled);
-
- [DllImport("kernel32.dll")]
- [PreserveSig]
- internal static extern HRESULT GetApplicationRecoveryCallback(
- IntPtr processHandle,
- out RecoveryCallback recoveryCallback,
- out object state,
- out uint pingInterval,
- out uint flags);
-
- [DllImport("kernel32.dll", CharSet = CharSet.Unicode)]
- [PreserveSig]
- internal static extern HRESULT RegisterApplicationRecoveryCallback(
- InternalRecoveryCallback callback, IntPtr param,
- uint pingInterval,
- uint flags); // Unused.
-
-
- [DllImport("kernel32.dll")]
- [PreserveSig]
- internal static extern HRESULT RegisterApplicationRestart(
- [MarshalAs(UnmanagedType.BStr)] string commandLineArgs,
- RestartRestrictions flags);
-
- [DllImport("KERNEL32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
- [PreserveSig]
- internal static extern HRESULT GetApplicationRestartSettings(
- IntPtr process,
- IntPtr commandLine,
- ref uint size,
- out RestartRestrictions flags);
-
- [DllImport("kernel32.dll")]
- [PreserveSig]
- internal static extern HRESULT UnregisterApplicationRecoveryCallback();
-
- [DllImport("kernel32.dll")]
- [PreserveSig]
- internal static extern HRESULT UnregisterApplicationRestart();
-
- #endregion
- }
-}
diff --git a/src/External/WindowsAPICodePack/Core/Interop/CommonDllNames.cs b/src/External/WindowsAPICodePack/Core/Interop/CommonDllNames.cs
deleted file mode 100644
index e040c1d..0000000
--- a/src/External/WindowsAPICodePack/Core/Interop/CommonDllNames.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-namespace MS.WindowsAPICodePack.Internal
-{
- ///
- /// Class to hold string references to common interop DLLs.
- ///
- public sealed class CommonDllNames
- {
- private CommonDllNames()
- {
- // Remove the public constructor
- }
-
- ///
- /// Comctl32.DLL
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Ctl")]
- public const string ComCtl32 = "comctl32.dll";
- ///
- /// Kernel32.dll
- ///
- public const string Kernel32 = "kernel32.dll";
- ///
- /// Comdlg32.dll
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Dlg")]
- public const string ComDlg32 = "comdlg32.dll";
- ///
- /// User32.dll
- ///
- public const string User32 = "user32.dll";
- ///
- /// Shell32.dll
- ///
- public const string Shell32 = "shell32.dll";
- }
-}
diff --git a/src/External/WindowsAPICodePack/Core/Interop/CoreErrorHelper.cs b/src/External/WindowsAPICodePack/Core/Interop/CoreErrorHelper.cs
deleted file mode 100644
index db023ea..0000000
--- a/src/External/WindowsAPICodePack/Core/Interop/CoreErrorHelper.cs
+++ /dev/null
@@ -1,168 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-namespace MS.WindowsAPICodePack.Internal
-{
- ///
- /// HRESULT Wrapper
- /// This is intended for Library Internal use only.
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "HRESULT"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32",
- Justification="The base type for all of these value is uint")]
- public enum HRESULT : uint
- {
- ///
- /// S_FALSE
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores")]
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "FALSE")]
- S_FALSE = 0x0001,
-
- ///
- /// S_OK
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores")]
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "OK")]
- S_OK = 0x0000,
-
- ///
- /// E_INVALIDARG
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores")]
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "INVALIDARG")]
- E_INVALIDARG = 0x80070057,
-
- ///
- /// E_OUTOFMEMORY
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores")]
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "OUTOFMEMORY")]
- E_OUTOFMEMORY = 0x8007000E,
-
- ///
- /// E_NOINTERFACE
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores")]
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "NOINTERFACE")]
- E_NOINTERFACE = 0x80004002,
-
- ///
- /// E_FAIL
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores")]
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "FAIL")]
- E_FAIL = 0x80004005,
-
- ///
- /// E_ELEMENTNOTFOUND
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores")]
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "ELEMENTNOTFOUND")]
- E_ELEMENTNOTFOUND = 0x80070490,
-
- ///
- /// TYPE_E_ELEMENTNOTFOUND
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores")]
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "TYPE")]
- TYPE_E_ELEMENTNOTFOUND = 0x8002802B,
-
-
- ///
- /// NO_OBJECT
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores")]
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "NO_OBJECT")]
- NO_OBJECT = 0x800401E5,
-
- ///
- /// Win32 Error code: ERROR_CANCELLED
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores")]
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "ERROR")]
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "CANCELLED")]
- ERROR_CANCELLED = 1223,
-
- ///
- /// ERROR_CANCELLED
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores" )]
- [System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "ERROR" )]
- [System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "CANCELLED" )]
- E_ERROR_CANCELLED = 0x800704C7,
-
- ///
- /// The requested resource is in use
- ///
- RESOURCE_IN_USE = 0x800700AA,
- }
-
- ///
- /// Provide Error Message Helper Methods.
- /// This is intended for Library Internal use only.
- ///
- public static class CoreErrorHelper
- {
- ///
- /// This is intended for Library Internal use only.
- ///
- private const int FACILITY_WIN32 = 7;
-
- ///
- /// This is intended for Library Internal use only.
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "IGNORED")]
- public const int IGNORED = (int)HRESULT.S_OK;
-
- ///
- /// This is intended for Library Internal use only.
- ///
- /// The Windows API error code.
- /// The equivalent HRESULT.
- public static int HResultFromWin32(int win32ErrorCode)
- {
- if (win32ErrorCode > 0)
- {
- win32ErrorCode =
- (int)(((uint)win32ErrorCode & 0x0000FFFF) | (FACILITY_WIN32 << 16) | 0x80000000);
- }
- return win32ErrorCode;
-
- }
-
- ///
- /// This is intended for Library Internal use only.
- ///
- /// The error code.
- /// True if the error code indicates success.
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "hresult")]
- public static bool Succeeded(int hresult)
- {
- return (hresult >= 0);
- }
-
- ///
- /// This is intended for Library Internal use only.
- ///
- /// The error code.
- /// True if the error code indicates failure.
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "h")]
- public static bool Failed(HRESULT hResult)
- {
- return ((int)hResult < 0);
- }
-
- ///
- /// This is intended for Library Internal use only.
- ///
- /// The COM error code.
- /// The Win32 error code.
- /// Inticates that the Win32 error code corresponds to the COM error code.
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "hresult")]
- public static bool Matches(int hresult, int win32ErrorCode)
- {
- return (hresult == HResultFromWin32(win32ErrorCode));
- }
-
-
- }
-}
diff --git a/src/External/WindowsAPICodePack/Core/Interop/CoreHelpers.cs b/src/External/WindowsAPICodePack/Core/Interop/CoreHelpers.cs
deleted file mode 100644
index 2d9a4cb..0000000
--- a/src/External/WindowsAPICodePack/Core/Interop/CoreHelpers.cs
+++ /dev/null
@@ -1,120 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Text;
-
-namespace MS.WindowsAPICodePack.Internal
-{
- ///
- /// Common Helper methods
- ///
- static public class CoreHelpers
- {
- ///
- /// Determines if the application is running on XP
- ///
- public static bool RunningOnXP
- {
- get
- {
- return Environment.OSVersion.Version.Major >= 5;
- }
- }
-
- ///
- /// Throws PlatformNotSupportedException if the application is not running on Windows XP
- ///
- public static void ThrowIfNotXP()
- {
- if (!CoreHelpers.RunningOnXP)
- {
- throw new PlatformNotSupportedException("Only supported on Windows XP or newer.");
- }
- }
-
- ///
- /// Determines if the application is running on Vista
- ///
- public static bool RunningOnVista
- {
- get
- {
- return Environment.OSVersion.Version.Major >= 6;
- }
- }
-
- ///
- /// Throws PlatformNotSupportedException if the application is not running on Windows Vista
- ///
- public static void ThrowIfNotVista()
- {
- if (!CoreHelpers.RunningOnVista)
- {
- throw new PlatformNotSupportedException("Only supported on Windows Vista or newer.");
- }
- }
-
- ///
- /// Determines if the application is running on Windows 7
- ///
- public static bool RunningOnWin7
- {
- get
- {
- return (Environment.OSVersion.Version.Major > 6) ||
- (Environment.OSVersion.Version.Major == 6 && Environment.OSVersion.Version.Minor >= 1);
- }
- }
-
- ///
- /// Throws PlatformNotSupportedException if the application is not running on Windows 7
- ///
- public static void ThrowIfNotWin7()
- {
- if (!CoreHelpers.RunningOnWin7)
- {
- throw new PlatformNotSupportedException("Only supported on Windows 7 or newer.");
- }
- }
-
- ///
- /// Get a string resource given a resource Id
- ///
- /// The resource Id
- /// The string resource corresponding to the given resource Id. Returns null if the resource id
- /// is invalid or the string cannot be retrieved for any other reason.
- public static string GetStringResource(string resourceId)
- {
- string[] parts;
- string library;
- int index;
-
- if (String.IsNullOrEmpty(resourceId))
- {
- return String.Empty;
- }
- // Known folder "Recent" has a malformed resource id
- // for its tooltip. This causes the resource id to
- // parse into 3 parts instead of 2 parts if we don't fix.
- resourceId = resourceId.Replace("shell32,dll", "shell32.dll");
- parts = resourceId.Split(new char[] { ',' });
-
- library = parts[0];
- library = library.Replace(@"@", String.Empty);
-
- parts[1] = parts[1].Replace("-", String.Empty);
- index = Int32.Parse(parts[1]);
-
- library = Environment.ExpandEnvironmentVariables(library);
- IntPtr handle = CoreNativeMethods.LoadLibrary(library);
- StringBuilder stringValue = new StringBuilder(255);
- int retval = CoreNativeMethods.LoadString(
- handle, index, stringValue, 255);
-
- if (retval == 0)
- return null;
- else
- return stringValue.ToString();
- }
- }
-}
diff --git a/src/External/WindowsAPICodePack/Core/Interop/CoreNativeMethods.cs b/src/External/WindowsAPICodePack/Core/Interop/CoreNativeMethods.cs
deleted file mode 100644
index 9d802f6..0000000
--- a/src/External/WindowsAPICodePack/Core/Interop/CoreNativeMethods.cs
+++ /dev/null
@@ -1,425 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Runtime.InteropServices;
-using System.Text;
-
-namespace MS.WindowsAPICodePack.Internal
-{
- ///
- /// Wrappers for Native Methods and Structs.
- /// This type is intended for internal use only
- ///
- public sealed class CoreNativeMethods
- {
- private CoreNativeMethods()
- {
-
- }
-
- #region Common Defintions
-
- #endregion
-
- #region General Definitions
-
- ///
- /// Sends the specified message to a window or windows. The SendMessage function calls
- /// the window procedure for the specified window and does not return until the window
- /// procedure has processed the message.
- ///
- /// Handle to the window whose window procedure will receive the message.
- /// If this parameter is HWND_BROADCAST, the message is sent to all top-level windows in the system,
- /// including disabled or invisible unowned windows, overlapped windows, and pop-up windows;
- /// but the message is not sent to child windows.
- ///
- /// Specifies the message to be sent.
- /// Specifies additional message-specific information.
- /// Specifies additional message-specific information.
- /// A return code specific to the message being sent.
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "w"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "l"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "h"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Wnd"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Param"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Interoperability", "CA1401:PInvokesShouldNotBeVisible",
- Justification="This is used from another assembly, also it's in an internal namespace"), DllImport(CommonDllNames.User32,
- CharSet = CharSet.Auto,
- SetLastError = true)]
- public static extern IntPtr SendMessage(
- IntPtr hWnd,
- uint msg,
- IntPtr wParam,
- IntPtr lParam
- );
-
- ///
- /// Sends the specified message to a window or windows. The SendMessage function calls
- /// the window procedure for the specified window and does not return until the window
- /// procedure has processed the message.
- ///
- /// Handle to the window whose window procedure will receive the message.
- /// If this parameter is HWND_BROADCAST, the message is sent to all top-level windows in the system,
- /// including disabled or invisible unowned windows, overlapped windows, and pop-up windows;
- /// but the message is not sent to child windows.
- ///
- /// Specifies the message to be sent.
- /// Specifies additional message-specific information.
- /// Specifies additional message-specific information.
- /// A return code specific to the message being sent.
- [System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "w" ), System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "l" ), System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "h" ), System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Wnd" ), System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Param" ), System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Interoperability", "CA1401:PInvokesShouldNotBeVisible" ), DllImport( CommonDllNames.User32,
- CharSet = CharSet.Auto,
- SetLastError = true)]
- public static extern IntPtr SendMessage(
- IntPtr hWnd,
- uint msg,
- int wParam,
- [MarshalAs(UnmanagedType.LPWStr)] string lParam);
-
- ///
- /// Sends the specified message to a window or windows. The SendMessage function calls
- /// the window procedure for the specified window and does not return until the window
- /// procedure has processed the message.
- ///
- /// Handle to the window whose window procedure will receive the message.
- /// If this parameter is HWND_BROADCAST, the message is sent to all top-level windows in the system,
- /// including disabled or invisible unowned windows, overlapped windows, and pop-up windows;
- /// but the message is not sent to child windows.
- ///
- /// Specifies the message to be sent.
- /// Specifies additional message-specific information.
- /// Specifies additional message-specific information.
- /// A return code specific to the message being sent.
- [System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Param" ), System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Wnd" ), System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "h" ), System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "l" ), System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "w" ), System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Interoperability", "CA1401:PInvokesShouldNotBeVisible" ), System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Design", "CA1045:DoNotPassTypesByReference", MessageId = "2#",
- Justification="This is an in/out parameter"),
- DllImport(CommonDllNames.User32, CharSet = CharSet.Auto, SetLastError = true)]
- public static extern IntPtr SendMessage(
- IntPtr hWnd,
- uint msg,
- ref int wParam,
- [MarshalAs(UnmanagedType.LPWStr)] StringBuilder lParam);
-
- // Various helpers for forcing binding to proper
- // version of Comctl32 (v6).
- [DllImport(CommonDllNames.Kernel32, SetLastError = true,
- ThrowOnUnmappableChar = true, BestFitMapping = false)]
- internal static extern IntPtr LoadLibrary(
- [MarshalAs(UnmanagedType.LPStr)] string lpFileName);
-
- [DllImport(CommonDllNames.User32)]
- [return: MarshalAs(UnmanagedType.Bool)]
- internal static extern bool DeleteObject(IntPtr graphicsObjectHandle);
-
- [DllImport(CommonDllNames.User32, SetLastError = true, CharSet = CharSet.Unicode)]
- internal static extern int LoadString(IntPtr hInstance,
- int uID,
- StringBuilder buffer,
- int nBufferMax);
-
- ///
- /// Destroys an icon and frees any memory the icon occupied.
- ///
- /// Handle to the icon to be destroyed. The icon must not be in use.
- /// If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError.
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "h"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Interoperability", "CA1401:PInvokesShouldNotBeVisible", Justification = "This is used from other assemblies, also it's in an internal namespace"),
- DllImport(CommonDllNames.User32, SetLastError = true)]
- [return: MarshalAs(UnmanagedType.Bool)]
- public static extern bool DestroyIcon(IntPtr hIcon);
-
- #endregion
-
- #region Window Handling
-
- [DllImport(CommonDllNames.User32, SetLastError = true, EntryPoint = "DestroyWindow",
- CallingConvention = CallingConvention.StdCall)]
- internal static extern int DestroyWindow(IntPtr handle);
-
- #endregion
-
- #region General Declarations
-
- // Various important window messages
- internal const int WM_USER = 0x0400;
- internal const int WM_ENTERIDLE = 0x0121;
-
- // FormatMessage constants and structs.
- internal const int FORMAT_MESSAGE_FROM_SYSTEM = 0x00001000;
-
- // App recovery and restart return codes
- internal const uint ResultFailed = 0x80004005;
- internal const uint ResultInvalidArgument = 0x80070057;
- internal const uint ResultFalse = 1;
- internal const uint ResultNotFound = 0x80070490;
-
- ///
- /// Gets the HiWord
- ///
- /// The value to get the hi word from.
- /// Size
- /// The upper half of the dword.
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "dword"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "HIWORD")]
- public static int HIWORD(long dword, int size)
- {
- return (short)(dword >> size);
- }
-
- ///
- /// Gets the LoWord
- ///
- /// The value to get the low word from.
- /// The lower half of the dword.
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "LOWORD"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "dword")]
- public static int LOWORD(long dword)
- {
- return (short)(dword & 0xFFFF);
- }
-
- #endregion
-
- #region GDI and DWM Declarations
-
- ///
- /// A Wrapper for a SIZE struct
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "SIZE"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
- [StructLayout(LayoutKind.Sequential)]
- public struct SIZE
- {
- ///
- /// Width
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "cx")]
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields")]
- public int cx;
- ///
- /// Height
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields")]
- public int cy;
- };
-
- ///
- /// A Wrapper for a RECT struct
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "RECT"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
- [StructLayout(LayoutKind.Sequential)]
- public struct RECT
- {
- ///
- /// Position of left edge
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields")]
- public int left;
- ///
- /// Position of top edge
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields")]
- public int top;
- ///
- /// Position of right edge
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields")]
- public int right;
- ///
- /// Position of bottom edge
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields")]
- public int bottom;
- };
-
- [StructLayout(LayoutKind.Sequential)]
- internal struct DWM_THUMBNAIL_PROPERTIES
- {
- internal DwmThumbnailFlags dwFlags;
- internal CoreNativeMethods.RECT rcDestination;
- internal CoreNativeMethods.RECT rcSource;
- internal byte opacity;
- internal bool fVisible;
- internal bool fSourceClientAreaOnly;
- };
-
- // Enable/disable non-client rendering based on window style.
- internal const int DWMNCRP_USEWINDOWSTYLE = 0;
- // Disabled non-client rendering; window style is ignored.
- internal const int DWMNCRP_DISABLED = 1;
- // Enabled non-client rendering; window style is ignored.
- internal const int DWMNCRP_ENABLED = 2;
- // Enable/disable non-client rendering Use DWMNCRP_* values.
- internal const int DWMWA_NCRENDERING_ENABLED = 1;
- // Non-client rendering policy.
- internal const int DWMWA_NCRENDERING_POLICY = 2;
- // Potentially enable/forcibly disable transitions 0 or 1.
- internal const int DWMWA_TRANSITIONS_FORCEDISABLED = 3;
-
- [StructLayout(LayoutKind.Sequential)]
- internal struct UNSIGNED_RATIO
- {
- internal UInt32 uiNumerator;
- internal UInt32 uiDenominator;
- };
-
- [StructLayout(LayoutKind.Sequential)]
- internal struct DWM_PRESENT_PARAMETERS
- {
- internal int cbSize;
- internal bool fQueue;
- internal UInt64 cRefreshStart;
- internal uint cBuffer;
- internal bool fUseSourceRate;
- internal UNSIGNED_RATIO uiNumerator;
- };
-
- internal const int DWM_BB_ENABLE = 0x00000001; // fEnable has been specified
- internal const int DWM_BB_BLURREGION = 0x00000002; // hRgnBlur has been specified
- internal const int DWM_BB_TRANSITIONONMAXIMIZED = 0x00000004; // fTransitionOnMaximized has been specified
-
- internal enum DwmBlurBehindDwFlags : uint
- {
- DWM_BB_ENABLE = 0x00000001,
- DWM_BB_BLURREGION = 0x00000002,
- DWM_BB_TRANSITIONONMAXIMIZED = 0x00000004
- }
-
- internal enum DwmThumbnailFlags : uint
- {
- DWM_TNP_RECTDESTINATION = 0x00000001, //Indicates a value for rcDestination has been specified.
- DWM_TNP_RECTSOURCE = 0x00000002, //Indicates a value for rcSource has been specified.
- DWM_TNP_OPACITY = 0x00000004, //Indicates a value for opacity has been specified.
- DWM_TNP_VISIBLE = 0x00000008, // Indicates a value for fVisible has been specified.
- DWM_TNP_SOURCECLIENTAREAONLY = 0x00000010 //Indicates a value for fSourceClientAreaOnly has been specified.
- }
-
- [StructLayout(LayoutKind.Sequential)]
- internal struct DWM_BLURBEHIND
- {
- public DwmBlurBehindDwFlags dwFlags;
- public bool fEnable;
- public IntPtr hRgnBlur;
- public bool fTransitionOnMaximized;
- };
-
- [StructLayout(LayoutKind.Sequential)]
- internal struct MARGINS
- {
- public int cxLeftWidth; // width of left border that retains its size
- public int cxRightWidth; // width of right border that retains its size
- public int cyTopHeight; // height of top border that retains its size
- public int cyBottomHeight; // height of bottom border that retains its size
- };
-
-
- #endregion
-
- #region Elevation COM Object
-
- [Flags]
- internal enum CLSCTX
- {
- CLSCTX_INPROC_SERVER = 0x1,
- CLSCTX_INPROC_HANDLER = 0x2,
- CLSCTX_LOCAL_SERVER = 0x4,
- CLSCTX_REMOTE_SERVER = 0x10,
- CLSCTX_NO_CODE_DOWNLOAD = 0x400,
- CLSCTX_NO_CUSTOM_MARSHAL = 0x1000,
- CLSCTX_ENABLE_CODE_DOWNLOAD = 0x2000,
- CLSCTX_NO_FAILURE_LOG = 0x4000,
- CLSCTX_DISABLE_AAA = 0x8000,
- CLSCTX_ENABLE_AAA = 0x10000,
- CLSCTX_FROM_DEFAULT_CONTEXT = 0x20000,
- CLSCTX_INPROC = CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER,
- CLSCTX_SERVER = CLSCTX_INPROC_SERVER | CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER,
- CLSCTX_ALL = CLSCTX_SERVER | CLSCTX_INPROC_HANDLER
- }
-
- [StructLayout(LayoutKind.Sequential)]
- internal struct BIND_OPTS3
- {
- internal uint cbStruct;
- internal uint grfFlags;
- internal uint grfMode;
- internal uint dwTickCountDeadline;
- internal uint dwTrackFlags;
- internal uint dwClassContext;
- internal uint locale;
- // This will be passed as null, so the type doesn't matter.
- object pServerInfo;
- internal IntPtr hwnd;
- }
-
- #endregion
-
- #region Windows OS structs and consts
-
- // Code for CreateWindowEx, for a windowless message pump.
- internal const int HWND_MESSAGE = -3;
-
- internal const uint STATUS_ACCESS_DENIED = 0xC0000022;
- [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
- internal struct WNDCLASSEX
- {
- internal uint cbSize;
- internal uint style;
- [MarshalAs(UnmanagedType.FunctionPtr)]
- internal WNDPROC lpfnWndProc;
- internal int cbClsExtra;
- internal int cbWndExtra;
- internal IntPtr hInstance;
- internal IntPtr hIcon;
- internal IntPtr hCursor;
- internal IntPtr hbrBackground;
- [MarshalAs(UnmanagedType.LPTStr)]
- internal string lpszMenuName;
- [MarshalAs(UnmanagedType.LPTStr)]
- internal string lpszClassName;
- internal IntPtr hIconSm;
- }
-
- ///
- /// A Wrapper for a POINT struct
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "POINT"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
- [StructLayout(LayoutKind.Sequential)]
- public struct POINT
- {
- ///
- /// The X coordinate of the point
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "X")]
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields")]
- public int X;
-
- ///
- /// The Y coordinate of the point
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Y")]
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields")]
- public int Y;
-
- ///
- /// Initialize the point
- ///
- /// The x coordinate of the point.
- /// The y coordinate of the point.
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "y"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "x")]
- public POINT(int x, int y)
- {
- this.X = x;
- this.Y = y;
- }
- }
-
-
- [StructLayout(LayoutKind.Sequential)]
- internal struct MSG
- {
- internal IntPtr hwnd;
- internal uint message;
- internal IntPtr wParam;
- internal IntPtr lParam;
- internal uint time;
- internal POINT pt;
- }
-
- internal delegate int WNDPROC(IntPtr hWnd,
- uint uMessage,
- IntPtr wParam,
- IntPtr lParam);
-
- #endregion
- }
-}
diff --git a/src/External/WindowsAPICodePack/Core/Interop/Dialogs/DialogShowState.cs b/src/External/WindowsAPICodePack/Core/Interop/Dialogs/DialogShowState.cs
deleted file mode 100644
index 5de1fad..0000000
--- a/src/External/WindowsAPICodePack/Core/Interop/Dialogs/DialogShowState.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-namespace Microsoft.WindowsAPICodePack.Dialogs
-{
- ///
- /// Dialog Show State
- ///
- public enum DialogShowState
- {
- ///
- /// Pre Show
- ///
- PreShow,
-
- ///
- /// Currently Showing
- ///
- Showing,
-
- ///
- /// Currently Closing
- ///
- Closing,
-
- ///
- /// Closed
- ///
- Closed
- }
-}
diff --git a/src/External/WindowsAPICodePack/Core/Interop/NetworkList/INetwork.cs b/src/External/WindowsAPICodePack/Core/Interop/NetworkList/INetwork.cs
deleted file mode 100644
index c646de1..0000000
--- a/src/External/WindowsAPICodePack/Core/Interop/NetworkList/INetwork.cs
+++ /dev/null
@@ -1,67 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Collections;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-namespace Microsoft.WindowsAPICodePack.Net
-{
- [ComImport]
- [TypeLibType((short)0x1040)]
- [Guid("DCB00002-570F-4A9B-8D69-199FDBA5723B")]
- internal interface INetwork
- {
- [return: MarshalAs(UnmanagedType.BStr)]
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- string GetName();
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void SetName([In, MarshalAs(UnmanagedType.BStr)] string szNetworkNewName);
-
- [return: MarshalAs(UnmanagedType.BStr)]
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- string GetDescription();
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void SetDescription([In, MarshalAs(UnmanagedType.BStr)] string szDescription);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- Guid GetNetworkId();
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- DomainType GetDomainType();
-
- [return: MarshalAs(UnmanagedType.Interface)]
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- IEnumerable GetNetworkConnections();
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetTimeCreatedAndConnected(
- out uint pdwLowDateTimeCreated,
- out uint pdwHighDateTimeCreated,
- out uint pdwLowDateTimeConnected,
- out uint pdwHighDateTimeConnected);
-
- bool IsConnectedToInternet
- {
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- get;
- }
-
- bool IsConnected
- {
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- get;
- }
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- Connectivity GetConnectivity();
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- NetworkCategory GetCategory();
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void SetCategory([In] NetworkCategory NewCategory);
- }
-}
\ No newline at end of file
diff --git a/src/External/WindowsAPICodePack/Core/Interop/NetworkList/INetworkConnection.cs b/src/External/WindowsAPICodePack/Core/Interop/NetworkList/INetworkConnection.cs
deleted file mode 100644
index a52f156..0000000
--- a/src/External/WindowsAPICodePack/Core/Interop/NetworkList/INetworkConnection.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Collections;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-namespace Microsoft.WindowsAPICodePack.Net
-{
- [ComImport]
- [TypeLibType((short)0x1040)]
- [Guid("DCB00005-570F-4A9B-8D69-199FDBA5723B")]
- internal interface INetworkConnection
- {
- [return: MarshalAs(UnmanagedType.Interface)]
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- INetwork GetNetwork();
-
- bool IsConnectedToInternet
- {
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- get;
- }
-
- bool IsConnected
- {
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- get;
- }
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- Connectivity GetConnectivity();
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- Guid GetConnectionId();
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- Guid GetAdapterId();
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- DomainType GetDomainType();
- }
-}
\ No newline at end of file
diff --git a/src/External/WindowsAPICodePack/Core/Interop/NetworkList/INetworkListManager.cs b/src/External/WindowsAPICodePack/Core/Interop/NetworkList/INetworkListManager.cs
deleted file mode 100644
index 2723c1f..0000000
--- a/src/External/WindowsAPICodePack/Core/Interop/NetworkList/INetworkListManager.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Collections;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-namespace Microsoft.WindowsAPICodePack.Net
-{
- [ComImport]
- [Guid("DCB00000-570F-4A9B-8D69-199FDBA5723B")]
- [TypeLibType((short)0x1040)]
- internal interface INetworkListManager
- {
- [return: MarshalAs(UnmanagedType.Interface)]
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- IEnumerable GetNetworks([In] NetworkConnectivityLevels Flags);
-
- [return: MarshalAs(UnmanagedType.Interface)]
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- INetwork GetNetwork([In] Guid gdNetworkId);
-
- [return: MarshalAs(UnmanagedType.Interface)]
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- IEnumerable GetNetworkConnections();
-
- [return: MarshalAs(UnmanagedType.Interface)]
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- INetworkConnection GetNetworkConnection([In] Guid gdNetworkConnectionId);
-
- bool IsConnectedToInternet
- {
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- get;
- }
-
- bool IsConnected
- {
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- get;
- }
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- Connectivity GetConnectivity();
- }
-}
\ No newline at end of file
diff --git a/src/External/WindowsAPICodePack/Core/Interop/NetworkList/NetworkListManagerClass.cs b/src/External/WindowsAPICodePack/Core/Interop/NetworkList/NetworkListManagerClass.cs
deleted file mode 100644
index 4cd91bd..0000000
--- a/src/External/WindowsAPICodePack/Core/Interop/NetworkList/NetworkListManagerClass.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Collections;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-namespace Microsoft.WindowsAPICodePack.Net
-{
- [ComImport, ClassInterface((short)0), Guid("DCB00C01-570F-4A9B-8D69-199FDBA5723B")]
- [ComSourceInterfaces("Microsoft.Windows.NetworkList.Internal.INetworkEvents\0Microsoft.Windows.NetworkList.Internal.INetworkConnectionEvents\0Microsoft.Windows.NetworkList.Internal.INetworkListManagerEvents\0"), TypeLibType((short)2)]
-
- internal class NetworkListManagerClass : INetworkListManager
- {
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(7)]
- public virtual extern Connectivity GetConnectivity();
-
- [return: MarshalAs(UnmanagedType.Interface)]
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(2)]
- public virtual extern INetwork GetNetwork([In] Guid gdNetworkId);
-
- [return: MarshalAs(UnmanagedType.Interface)]
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(4)]
- public virtual extern INetworkConnection GetNetworkConnection([In] Guid gdNetworkConnectionId);
-
- [return: MarshalAs(UnmanagedType.Interface)]
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(3)]
- public virtual extern IEnumerable GetNetworkConnections();
-
- [return: MarshalAs(UnmanagedType.Interface)]
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(1)]
- public virtual extern IEnumerable GetNetworks([In] NetworkConnectivityLevels Flags);
-
- [DispId(6)]
- public virtual extern bool IsConnected
- {
- [MethodImpl(MethodImplOptions.InternalCall,
- MethodCodeType = MethodCodeType.Runtime), DispId(6)]
- get;
- }
-
- [DispId(5)]
- public virtual extern bool IsConnectedToInternet
- {
- [MethodImpl(MethodImplOptions.InternalCall,
- MethodCodeType = MethodCodeType.Runtime), DispId(5)]
- get;
- }
- }
-}
\ No newline at end of file
diff --git a/src/External/WindowsAPICodePack/Core/Interop/PowerManagement/PowerManagementNativeMethods.cs b/src/External/WindowsAPICodePack/Core/Interop/PowerManagement/PowerManagementNativeMethods.cs
deleted file mode 100644
index e4dfb27..0000000
--- a/src/External/WindowsAPICodePack/Core/Interop/PowerManagement/PowerManagementNativeMethods.cs
+++ /dev/null
@@ -1,137 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Runtime.InteropServices;
-
-namespace Microsoft.WindowsAPICodePack.ApplicationServices
-{
- internal class PowerManagementNativeMethods
- {
- private PowerManagementNativeMethods()
- {
-
- }
-
- #region Power Management
-
- internal const uint WM_POWERBROADCAST = 536;
- internal const uint PBT_POWERSETTINGCHANGE = 32787;
- internal const uint SPI_SETSCREENSAVEACTIVE = 0x0011;
- internal const uint SPIF_UPDATEINIFILE = 0x0001;
- internal const uint SPIF_SENDCHANGE = 0x0002;
-
- // This structure is sent when the PBT_POWERSETTINGSCHANGE message is sent.
- // It describes the power setting that has changed and
- // contains data about the change.
- [StructLayout(LayoutKind.Sequential, Pack = 4)]
- internal struct PowerBroadcastSetting
- {
- internal Guid PowerSetting;
- internal Int32 DataLength;
- }
-
- // This structure is used when calling CallNtPowerInformation
- // to retrieve SystemPowerCapabilities
- [StructLayout(LayoutKind.Sequential)]
- internal struct SystemPowerCapabilities
- {
- [MarshalAs(UnmanagedType.I1)]
- internal bool PowerButtonPresent;
- [MarshalAs(UnmanagedType.I1)]
- internal bool SleepButtonPresent;
- [MarshalAs(UnmanagedType.I1)]
- internal bool LidPresent;
- [MarshalAs(UnmanagedType.I1)]
- internal bool SystemS1;
- [MarshalAs(UnmanagedType.I1)]
- internal bool SystemS2;
- [MarshalAs(UnmanagedType.I1)]
- internal bool SystemS3;
- [MarshalAs(UnmanagedType.I1)]
- internal bool SystemS4;
- [MarshalAs(UnmanagedType.I1)]
- internal bool SystemS5;
- [MarshalAs(UnmanagedType.I1)]
- internal bool HiberFilePresent;
- [MarshalAs(UnmanagedType.I1)]
- internal bool FullWake;
- [MarshalAs(UnmanagedType.I1)]
- internal bool VideoDimPresent;
- [MarshalAs(UnmanagedType.I1)]
- internal bool ApmPresent;
- [MarshalAs(UnmanagedType.I1)]
- internal bool UpsPresent;
- [MarshalAs(UnmanagedType.I1)]
- internal bool ThermalControl;
- [MarshalAs(UnmanagedType.I1)]
- internal bool ProcessorThrottle;
- internal byte ProcessorMinThrottle;
- internal byte ProcessorMaxThrottle;
- [MarshalAs(UnmanagedType.I1)]
- internal bool FastSystemS4;
- internal byte spare2_1;
- internal byte spare2_2;
- internal byte spare2_3;
- [MarshalAs(UnmanagedType.I1)]
- internal bool DiskSpinDown;
- internal byte spare3_1;
- internal byte spare3_2;
- internal byte spare3_3;
- internal byte spare3_4;
- internal byte spare3_5;
- internal byte spare3_6;
- internal byte spare3_7;
- internal byte spare3_8;
- [MarshalAs(UnmanagedType.I1)]
- internal bool SystemBatteriesPresent;
- [MarshalAs(UnmanagedType.I1)]
- internal bool BatteriesAreShortTerm;
- internal int granularity;
- internal int capacity;
- }
-
- [StructLayout(LayoutKind.Sequential)]
- internal struct SystemBatteryState
- {
- [MarshalAs(UnmanagedType.I1)]
- internal bool AcOnLine;
- [MarshalAs(UnmanagedType.I1)]
- internal bool BatteryPresent;
- [MarshalAs(UnmanagedType.I1)]
- internal bool Charging;
- [MarshalAs(UnmanagedType.I1)]
- internal bool Discharging;
- internal byte spare1;
- internal byte spare2;
- internal byte spare3;
- internal byte spare4;
- internal uint MaxCapacity;
- internal uint RemainingCapacity;
- internal uint Rate;
- internal uint EstimatedTime;
- internal uint DefaultAlert1;
- internal uint DefaultAlert2;
- }
- [DllImport("powrprof.dll", SetLastError = true)]
- internal static extern UInt32 CallNtPowerInformation(
- Int32 InformationLevel,
- IntPtr lpInputBuffer,
- UInt32 nInputBufferSize,
- IntPtr lpOutputBuffer,
- UInt32 nOutputBufferSize
- );
-
- [DllImport("User32", SetLastError = true,
- EntryPoint = "RegisterPowerSettingNotification",
- CallingConvention = CallingConvention.StdCall)]
- internal static extern int RegisterPowerSettingNotification(
- IntPtr hRecipient,
- ref Guid PowerSettingGuid,
- Int32 Flags);
-
- [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
- internal static extern ExecutionState SetThreadExecutionState(ExecutionState esFlags);
-
- #endregion
- }
-}
diff --git a/src/External/WindowsAPICodePack/Core/Interop/TaskDialogs/NativeTaskDialog.cs b/src/External/WindowsAPICodePack/Core/Interop/TaskDialogs/NativeTaskDialog.cs
deleted file mode 100644
index ac1d700..0000000
--- a/src/External/WindowsAPICodePack/Core/Interop/TaskDialogs/NativeTaskDialog.cs
+++ /dev/null
@@ -1,606 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.ComponentModel;
-using System.Diagnostics;
-using System.Runtime.InteropServices;
-using MS.WindowsAPICodePack.Internal;
-
-namespace Microsoft.WindowsAPICodePack.Dialogs
-{
- ///
- /// Encapsulates the native logic required to create,
- /// configure, and show a TaskDialog,
- /// via the TaskDialogIndirect() Win32 function.
- ///
- /// A new instance of this class should
- /// be created for each messagebox show, as
- /// the HWNDs for TaskDialogs do not remain constant
- /// across calls to TaskDialogIndirect.
- ///
- internal class NativeTaskDialog : IDisposable
- {
- private TaskDialogNativeMethods.TASKDIALOGCONFIG nativeDialogConfig;
- private NativeTaskDialogSettings settings;
- private IntPtr hWndDialog;
- private TaskDialog outerDialog;
-
- private IntPtr[] updatedStrings = new IntPtr[Enum.GetNames(typeof(TaskDialogNativeMethods.TASKDIALOG_ELEMENTS)).Length];
- private IntPtr buttonArray, radioButtonArray;
-
- // Flag tracks whether our first radio
- // button click event has come through.
- private bool firstRadioButtonClicked = true;
-
- #region Constructors
-
- // Configuration is applied at dialog creation time.
- internal NativeTaskDialog(
- NativeTaskDialogSettings settings,
- TaskDialog outerDialog)
- {
- nativeDialogConfig = settings.NativeConfiguration;
- this.settings = settings;
-
- // Wireup dialog proc message loop for this instance.
- nativeDialogConfig.pfCallback =
- new TaskDialogNativeMethods.PFTASKDIALOGCALLBACK(DialogProc);
-
- // Keep a reference to the outer shell, so we can notify.
- this.outerDialog = outerDialog;
- }
-
- #endregion
-
- #region Public Properties
-
- private DialogShowState showState =
- DialogShowState.PreShow;
-
- public DialogShowState ShowState
- {
- get { return showState; }
- }
-
- private int selectedButtonID;
- internal int SelectedButtonID
- {
- get { return selectedButtonID; }
- }
-
- private int selectedRadioButtonID;
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- internal int SelectedRadioButtonID
- {
- get { return selectedRadioButtonID; }
- }
-
- private bool checkBoxChecked;
- internal bool CheckBoxChecked
- {
- get { return checkBoxChecked; }
- }
-
- #endregion
-
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.String.Format(System.String,System.Object)",
- Justification = "We are not currently handling globalization or localization")]
- internal void NativeShow()
- {
- // Applies config struct and other settings, then
- // calls main Win32 function.
- if (settings == null)
- throw new InvalidOperationException(
- "An error has occurred in dialog configuration.");
-
- // Do a last-minute parse of the various dialog control lists,
- // and only allocate the memory at the last minute.
-
- MarshalDialogControlStructs();
- // Make the call and show the dialog.
- // NOTE: this call is BLOCKING, though the thread
- // WILL re-enter via the DialogProc.
- try
- {
- showState = DialogShowState.Showing;
-
- // Here is the way we use "vanilla" P/Invoke to call
- // TaskDialogIndirect().
- HRESULT hresult = TaskDialogNativeMethods.TaskDialogIndirect(
- nativeDialogConfig,
- out selectedButtonID,
- out selectedRadioButtonID,
- out checkBoxChecked);
-
- if (CoreErrorHelper.Failed(hresult))
- {
- string msg;
- switch (hresult)
- {
- case HRESULT.E_INVALIDARG:
- msg = "Invalid arguments to Win32 call.";
- break;
- case HRESULT.E_OUTOFMEMORY:
- msg = "Dialog contents too complex.";
- break;
- default:
- msg = String.Format(
-
- "An unexpected internal error occurred in the Win32 call:{0:x}",
- hresult);
- break;
- }
- Exception e = Marshal.GetExceptionForHR((int)hresult);
- throw new Win32Exception(msg, e);
- }
- }
- catch (EntryPointNotFoundException)
- {
- throw new NotSupportedException("TaskDialog feature needs to load version 6 of comctl32.dll but a different version is current loaded in memory.");
- }
- finally
- {
- showState = DialogShowState.Closed;
- }
- }
-
- // The new task dialog does not support the existing
- // Win32 functions for closing (e.g. EndDialog()); instead,
- // a "click button" message is sent. In this case, we're
- // abstracting out to say that the TaskDialog consumer can
- // simply call "Close" and we'll "click" the cancel button.
- // Note that the cancel button doesn't actually
- // have to exist for this to work.
- internal void NativeClose(TaskDialogResult result)
- {
- showState = DialogShowState.Closing;
-
- int id = (int)TaskDialogNativeMethods.TASKDIALOG_COMMON_BUTTON_RETURN_ID.IDCANCEL;
-
- if(result == TaskDialogResult.Close)
- id = (int)TaskDialogNativeMethods.TASKDIALOG_COMMON_BUTTON_RETURN_ID.IDCLOSE;
- else if(result == TaskDialogResult.CustomButtonClicked)
- id = DialogsDefaults.MinimumDialogControlId; // custom buttons
- else if(result == TaskDialogResult.No)
- id = (int)TaskDialogNativeMethods.TASKDIALOG_COMMON_BUTTON_RETURN_ID.IDNO;
- else if(result == TaskDialogResult.Ok)
- id = (int)TaskDialogNativeMethods.TASKDIALOG_COMMON_BUTTON_RETURN_ID.IDOK;
- else if(result == TaskDialogResult.Retry)
- id = (int)TaskDialogNativeMethods.TASKDIALOG_COMMON_BUTTON_RETURN_ID.IDRETRY;
- else if(result == TaskDialogResult.Yes)
- id = (int)TaskDialogNativeMethods.TASKDIALOG_COMMON_BUTTON_RETURN_ID.IDYES;
-
- SendMessageHelper(TaskDialogNativeMethods.TASKDIALOG_MESSAGES.TDM_CLICK_BUTTON, id, 0);
- }
-
- #region Main Dialog Proc
-
- private int DialogProc(
- IntPtr hwnd,
- uint msg,
- IntPtr wParam,
- IntPtr lParam,
- IntPtr lpRefData)
- {
- // Fetch the HWND - it may be the first time we're getting it.
- hWndDialog = hwnd;
-
- // Big switch on the various notifications the
- // dialog proc can get.
- switch ((TaskDialogNativeMethods.TASKDIALOG_NOTIFICATIONS)msg)
- {
- case TaskDialogNativeMethods.TASKDIALOG_NOTIFICATIONS.TDN_CREATED:
- int result = PerformDialogInitialization();
- outerDialog.RaiseOpenedEvent();
- return result;
- case TaskDialogNativeMethods.TASKDIALOG_NOTIFICATIONS.TDN_BUTTON_CLICKED:
- return HandleButtonClick((int)wParam);
- case TaskDialogNativeMethods.TASKDIALOG_NOTIFICATIONS.TDN_RADIO_BUTTON_CLICKED:
- return HandleRadioButtonClick((int)wParam);
- case TaskDialogNativeMethods.TASKDIALOG_NOTIFICATIONS.TDN_HYPERLINK_CLICKED:
- return HandleHyperlinkClick(lParam);
- case TaskDialogNativeMethods.TASKDIALOG_NOTIFICATIONS.TDN_HELP:
- return HandleHelpInvocation();
- case TaskDialogNativeMethods.TASKDIALOG_NOTIFICATIONS.TDN_TIMER:
- return HandleTick((int)wParam);
- case TaskDialogNativeMethods.TASKDIALOG_NOTIFICATIONS.TDN_DESTROYED:
- return PerformDialogCleanup();
- default:
- break;
- }
- return (int)HRESULT.S_OK;
- }
-
-
- // Once the task dialog HWND is open, we need to send
- // additional messages to configure it.
- private int PerformDialogInitialization()
- {
- // Initialize Progress or Marquee Bar.
- if (IsOptionSet(TaskDialogNativeMethods.TASKDIALOG_FLAGS.TDF_SHOW_PROGRESS_BAR))
- {
- UpdateProgressBarRange();
-
- // The order of the following is important -
- // state is more important than value,
- // and non-normal states turn off the bar value change
- // animation, which is likely the intended
- // and preferable behavior.
- UpdateProgressBarState(settings.ProgressBarState);
- UpdateProgressBarValue(settings.ProgressBarValue);
-
- // Due to a bug that wasn't fixed in time for RTM of Vista,
- // second SendMessage is required if the state is non-Normal.
- UpdateProgressBarValue(settings.ProgressBarValue);
- }
- else if (IsOptionSet(TaskDialogNativeMethods.TASKDIALOG_FLAGS.TDF_SHOW_MARQUEE_PROGRESS_BAR))
- {
- // TDM_SET_PROGRESS_BAR_MARQUEE is necessary
- // to cause the marquee to start animating.
- // Note that this internal task dialog setting is
- // round-tripped when the marquee is
- // is set to different states, so it never has to
- // be touched/sent again.
- SendMessageHelper(TaskDialogNativeMethods.TASKDIALOG_MESSAGES.TDM_SET_PROGRESS_BAR_MARQUEE, 1, 0);
- UpdateProgressBarState(settings.ProgressBarState);
- }
-
- if (settings.ElevatedButtons != null && settings.ElevatedButtons.Count > 0)
- {
- foreach (int id in settings.ElevatedButtons)
- {
- UpdateElevationIcon(id, true);
- }
- }
-
- return CoreErrorHelper.IGNORED;
- }
-
- private int HandleButtonClick(int id)
- {
- // First we raise a Click event, if there is a custom button
- // However, we implement Close() by sending a cancel button, so
- // we don't want to raise a click event in response to that.
- if (showState != DialogShowState.Closing)
- outerDialog.RaiseButtonClickEvent(id);
-
- // Once that returns, we raise a Closing event for the dialog
- // The Win32 API handles button clicking-and-closing
- // as an atomic action,
- // but it is more .NET friendly to split them up.
- // Unfortunately, we do NOT have the return values at this stage.
- if(id <= 9)
- return outerDialog.RaiseClosingEvent(id);
- else
- return 1;
- }
-
- private int HandleRadioButtonClick(int id)
- {
- // When the dialog sets the radio button to default,
- // it (somewhat confusingly)issues a radio button clicked event
- // - we mask that out - though ONLY if
- // we do have a default radio button
- if (firstRadioButtonClicked && !IsOptionSet(TaskDialogNativeMethods.TASKDIALOG_FLAGS.TDF_NO_DEFAULT_RADIO_BUTTON))
- firstRadioButtonClicked = false;
- else
- {
- outerDialog.RaiseButtonClickEvent(id);
- }
-
- // Note: we don't raise Closing, as radio
- // buttons are non-committing buttons
- return CoreErrorHelper.IGNORED;
- }
-
- private int HandleHyperlinkClick(IntPtr pszHREF)
- {
- string link = Marshal.PtrToStringUni(pszHREF);
- outerDialog.RaiseHyperlinkClickEvent(link);
-
- return CoreErrorHelper.IGNORED;
- }
-
-
- private int HandleTick(int ticks)
- {
- outerDialog.RaiseTickEvent(ticks);
- return CoreErrorHelper.IGNORED;
- }
-
- private int HandleHelpInvocation()
- {
- outerDialog.RaiseHelpInvokedEvent();
- return CoreErrorHelper.IGNORED;
- }
-
- // There should be little we need to do here,
- // as the use of the NativeTaskDialog is
- // that it is instantiated for a single show, then disposed of.
- private int PerformDialogCleanup()
- {
- firstRadioButtonClicked = true;
-
- return CoreErrorHelper.IGNORED;
- }
-
- #endregion
-
- #region Update members
-
- internal void UpdateProgressBarValue(int i)
- {
- AssertCurrentlyShowing();
- SendMessageHelper(TaskDialogNativeMethods.TASKDIALOG_MESSAGES.TDM_SET_PROGRESS_BAR_POS, i, 0);
- }
-
- internal void UpdateProgressBarRange()
- {
- AssertCurrentlyShowing();
-
- // Build range LPARAM - note it is in REVERSE intuitive order.
- long range = NativeTaskDialog.MakeLongLParam(
- settings.ProgressBarMaximum,
- settings.ProgressBarMinimum);
-
- SendMessageHelper(TaskDialogNativeMethods.TASKDIALOG_MESSAGES.TDM_SET_PROGRESS_BAR_RANGE, 0, range);
- }
-
- internal void UpdateProgressBarState(TaskDialogProgressBarState state)
- {
- AssertCurrentlyShowing();
- SendMessageHelper(TaskDialogNativeMethods.TASKDIALOG_MESSAGES.TDM_SET_PROGRESS_BAR_STATE, (int)state, 0);
- }
-
- internal void UpdateText(string text)
- {
- UpdateTextCore(text, TaskDialogNativeMethods.TASKDIALOG_ELEMENTS.TDE_CONTENT);
- }
-
- internal void UpdateInstruction(string instruction)
- {
- UpdateTextCore(instruction, TaskDialogNativeMethods.TASKDIALOG_ELEMENTS.TDE_MAIN_INSTRUCTION);
- }
-
- internal void UpdateFooterText(string footerText)
- {
- UpdateTextCore(footerText, TaskDialogNativeMethods.TASKDIALOG_ELEMENTS.TDE_FOOTER);
- }
-
- internal void UpdateExpandedText(string expandedText)
- {
- UpdateTextCore(expandedText, TaskDialogNativeMethods.TASKDIALOG_ELEMENTS.TDE_EXPANDED_INFORMATION);
- }
-
- private void UpdateTextCore(string s, TaskDialogNativeMethods.TASKDIALOG_ELEMENTS element)
- {
- AssertCurrentlyShowing();
-
- FreeOldString(element);
- SendMessageHelper(
- TaskDialogNativeMethods.TASKDIALOG_MESSAGES.TDM_SET_ELEMENT_TEXT,
- (int)element,
- (long)MakeNewString(s, element));
- }
-
- internal void UpdateMainIcon(TaskDialogStandardIcon mainIcon)
- {
- UpdateIconCore(mainIcon, TaskDialogNativeMethods.TASKDIALOG_ICON_ELEMENT.TDIE_ICON_MAIN);
- }
-
- internal void UpdateFooterIcon(TaskDialogStandardIcon footerIcon)
- {
- UpdateIconCore(footerIcon, TaskDialogNativeMethods.TASKDIALOG_ICON_ELEMENT.TDIE_ICON_FOOTER);
- }
-
- private void UpdateIconCore(TaskDialogStandardIcon icon, TaskDialogNativeMethods.TASKDIALOG_ICON_ELEMENT element)
- {
- AssertCurrentlyShowing();
- SendMessageHelper(
- TaskDialogNativeMethods.TASKDIALOG_MESSAGES.TDM_UPDATE_ICON,
- (int)element,
- (long)icon);
- }
-
- internal void UpdateCheckBoxChecked(bool cbc)
- {
- AssertCurrentlyShowing();
- SendMessageHelper(
- TaskDialogNativeMethods.TASKDIALOG_MESSAGES.TDM_CLICK_VERIFICATION,
- (cbc ? 1 : 0),
- 1);
- }
-
- internal void UpdateElevationIcon(int buttonId, bool showIcon)
- {
- AssertCurrentlyShowing();
- SendMessageHelper(
- TaskDialogNativeMethods.TASKDIALOG_MESSAGES.TDM_SET_BUTTON_ELEVATION_REQUIRED_STATE,
- buttonId,
- Convert.ToInt32(showIcon));
- }
-
- internal void UpdateButtonEnabled(int buttonID, bool enabled)
- {
- AssertCurrentlyShowing();
- SendMessageHelper(
- TaskDialogNativeMethods.TASKDIALOG_MESSAGES.TDM_ENABLE_BUTTON, buttonID, enabled == true ? 1 : 0);
- }
- internal void UpdateRadioButtonEnabled(int buttonID, bool enabled)
- {
- AssertCurrentlyShowing();
- SendMessageHelper(
- TaskDialogNativeMethods.TASKDIALOG_MESSAGES.TDM_ENABLE_RADIO_BUTTON, buttonID, enabled == true? 1 : 0);
- }
-
- internal void AssertCurrentlyShowing()
- {
- Debug.Assert(showState == DialogShowState.Showing, "Update*() methods should only be called while native dialog is showing");
- }
-
- #endregion
-
- #region Helpers
-
- private int SendMessageHelper(TaskDialogNativeMethods.TASKDIALOG_MESSAGES msg, int wParam, long lParam)
- {
- // Be sure to at least assert here -
- // messages to invalid handles often just disappear silently
- Debug.Assert(hWndDialog != null,
- "HWND for dialog is null during SendMessage");
-
- return (int)CoreNativeMethods.SendMessage(
- hWndDialog,
- (uint)msg,
- (IntPtr)wParam,
- new IntPtr(lParam));
- }
-
- private bool IsOptionSet(TaskDialogNativeMethods.TASKDIALOG_FLAGS flag)
- {
- return ((nativeDialogConfig.dwFlags & flag) == flag);
- }
-
- // Allocates a new string on the unmanaged heap,
- // and stores the pointer so we can free it later.
-
- private IntPtr MakeNewString(string s,
- TaskDialogNativeMethods.TASKDIALOG_ELEMENTS element)
- {
- IntPtr newStringPtr = Marshal.StringToHGlobalUni(s);
- updatedStrings[(int)element] = newStringPtr;
- return newStringPtr;
- }
-
- // Checks to see if the given element already has an
- // updated string, and if so,
- // frees it. This is done in preparation for a call to
- // MakeNewString(), to prevent
- // leaks from multiple updates calls on the same element
- // within a single native dialog lifetime.
-
- private void FreeOldString(TaskDialogNativeMethods.TASKDIALOG_ELEMENTS element)
- {
- int elementIndex = (int)element;
- if (updatedStrings[elementIndex] != IntPtr.Zero)
- {
- Marshal.FreeHGlobal(updatedStrings[elementIndex]);
- updatedStrings[elementIndex] = IntPtr.Zero;
- }
- }
-
- // Based on the following defines in WinDef.h and WinUser.h:
- // #define MAKELPARAM(l, h) ((LPARAM)(DWORD)MAKELONG(l, h))
- // #define MAKELONG(a, b) ((LONG)(((WORD)(((DWORD_PTR)(a)) & 0xffff)) | ((DWORD)((WORD)(((DWORD_PTR)(b)) & 0xffff))) << 16))
- private static long MakeLongLParam(int a, int b)
- {
- return (a << 16) + b;
- }
-
- // Builds the actual configuration that the
- // NativeTaskDialog (and underlying Win32 API)
- // expects, by parsing the various control lists,
- // marshaling to the unmanaged heap, etc.
-
- private void MarshalDialogControlStructs()
- {
- if (settings.Buttons != null && settings.Buttons.Length > 0)
- {
- buttonArray = AllocateAndMarshalButtons(settings.Buttons);
- settings.NativeConfiguration.pButtons = buttonArray;
- settings.NativeConfiguration.cButtons = (uint)settings.Buttons.Length;
- }
- if (settings.RadioButtons != null && settings.RadioButtons.Length > 0)
- {
- radioButtonArray = AllocateAndMarshalButtons(settings.RadioButtons);
- settings.NativeConfiguration.pRadioButtons = radioButtonArray;
- settings.NativeConfiguration.cRadioButtons = (uint)settings.RadioButtons.Length;
- }
- }
-
- private static IntPtr AllocateAndMarshalButtons(TaskDialogNativeMethods.TASKDIALOG_BUTTON[] structs)
- {
- IntPtr initialPtr = Marshal.AllocHGlobal(
- Marshal.SizeOf(typeof(TaskDialogNativeMethods.TASKDIALOG_BUTTON)) * structs.Length);
-
- IntPtr currentPtr = initialPtr;
- foreach (TaskDialogNativeMethods.TASKDIALOG_BUTTON button in structs)
- {
- Marshal.StructureToPtr(button, currentPtr, false);
- currentPtr = (IntPtr)((int)currentPtr + Marshal.SizeOf(button));
- }
-
- return initialPtr;
- }
-
- #endregion
-
- #region IDispose Pattern
-
- private bool disposed;
-
- // Finalizer and IDisposable implementation.
- public void Dispose()
- {
- Dispose(true);
- GC.SuppressFinalize(this);
- }
- ~NativeTaskDialog()
- {
- Dispose(false);
- }
-
- // Core disposing logic.
- protected void Dispose(bool disposing)
- {
- if (!disposed)
- {
- disposed = true;
-
- // Single biggest resource - make sure the dialog
- // itself has been instructed to close.
-
- if (showState == DialogShowState.Showing)
- NativeClose(TaskDialogResult.Cancel);
-
- // Clean up custom allocated strings that were updated
- // while the dialog was showing. Note that the strings
- // passed in the initial TaskDialogIndirect call will
- // be cleaned up automagically by the default
- // marshalling logic.
-
- if (updatedStrings != null)
- {
- for (int i = 0; i < updatedStrings.Length; i++)
- {
- if (updatedStrings[i] != IntPtr.Zero)
- {
- Marshal.FreeHGlobal(updatedStrings[i]);
- updatedStrings[i] = IntPtr.Zero;
- }
- }
- }
-
- // Clean up the button and radio button arrays, if any.
- if (buttonArray != IntPtr.Zero)
- {
- Marshal.FreeHGlobal(buttonArray);
- buttonArray = IntPtr.Zero;
- }
- if (radioButtonArray != IntPtr.Zero)
- {
- Marshal.FreeHGlobal(radioButtonArray);
- radioButtonArray = IntPtr.Zero;
- }
-
- if (disposing)
- {
- // Clean up managed resources - currently there are none
- // that are interesting.
- }
- }
- }
-
- #endregion
- }
-}
diff --git a/src/External/WindowsAPICodePack/Core/Interop/TaskDialogs/NativeTaskDialogSettings.cs b/src/External/WindowsAPICodePack/Core/Interop/TaskDialogs/NativeTaskDialogSettings.cs
deleted file mode 100644
index 36134e2..0000000
--- a/src/External/WindowsAPICodePack/Core/Interop/TaskDialogs/NativeTaskDialogSettings.cs
+++ /dev/null
@@ -1,111 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Collections.Generic;
-using System.Runtime.InteropServices;
-
-namespace Microsoft.WindowsAPICodePack.Dialogs
-{
- ///
- /// Encapsulates additional configuration needed by NativeTaskDialog
- /// that it can't get from the TASKDIALOGCONFIG struct.
- ///
- internal class NativeTaskDialogSettings
- {
- internal NativeTaskDialogSettings()
- {
- nativeConfiguration = new TaskDialogNativeMethods.TASKDIALOGCONFIG();
-
- // Apply standard settings.
- nativeConfiguration.cbSize = (uint)Marshal.SizeOf(nativeConfiguration);
- nativeConfiguration.hwndParent = IntPtr.Zero;
- nativeConfiguration.hInstance = IntPtr.Zero;
- nativeConfiguration.dwFlags = TaskDialogNativeMethods.TASKDIALOG_FLAGS.TDF_ALLOW_DIALOG_CANCELLATION;
- nativeConfiguration.dwCommonButtons = TaskDialogNativeMethods.TASKDIALOG_COMMON_BUTTON_FLAGS.TDCBF_OK_BUTTON;
- nativeConfiguration.MainIcon = new TaskDialogNativeMethods.TASKDIALOGCONFIG_ICON_UNION(0);
- nativeConfiguration.FooterIcon = new TaskDialogNativeMethods.TASKDIALOGCONFIG_ICON_UNION(0);
- nativeConfiguration.cxWidth = TaskDialogDefaults.IdealWidth;
-
- // Zero out all the custom button fields.
- nativeConfiguration.cButtons = 0;
- nativeConfiguration.cRadioButtons = 0;
- nativeConfiguration.pButtons = IntPtr.Zero;
- nativeConfiguration.pRadioButtons = IntPtr.Zero;
- nativeConfiguration.nDefaultButton = 0;
- nativeConfiguration.nDefaultRadioButton = 0;
-
- // Various text defaults.
- nativeConfiguration.pszWindowTitle = TaskDialogDefaults.Caption;
- nativeConfiguration.pszMainInstruction = TaskDialogDefaults.MainInstruction;
- nativeConfiguration.pszContent = TaskDialogDefaults.Content;
- nativeConfiguration.pszVerificationText = null;
- nativeConfiguration.pszExpandedInformation = null;
- nativeConfiguration.pszExpandedControlText = null;
- nativeConfiguration.pszCollapsedControlText = null;
- nativeConfiguration.pszFooter = null;
- }
-
- private int progressBarMinimum;
- public int ProgressBarMinimum
- {
- get { return progressBarMinimum; }
- set { progressBarMinimum = value; }
- }
-
- private int progressBarMaximum;
- public int ProgressBarMaximum
- {
- get { return progressBarMaximum; }
- set { progressBarMaximum = value; }
- }
-
- private int progressBarValue;
- public int ProgressBarValue
- {
- get { return progressBarValue; }
- set { this.progressBarValue = value; }
- }
-
- private TaskDialogProgressBarState progressBarState;
- public TaskDialogProgressBarState ProgressBarState
- {
- get { return progressBarState; }
- set { progressBarState = value; }
- }
-
- private bool invokeHelp;
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- public bool InvokeHelp
- {
- get { return invokeHelp; }
- set { invokeHelp = value; }
- }
-
- private TaskDialogNativeMethods.TASKDIALOGCONFIG nativeConfiguration;
- public TaskDialogNativeMethods.TASKDIALOGCONFIG NativeConfiguration
- {
- get { return nativeConfiguration; }
- }
-
- private TaskDialogNativeMethods.TASKDIALOG_BUTTON[] buttons;
- public TaskDialogNativeMethods.TASKDIALOG_BUTTON[] Buttons
- {
- get { return buttons; }
- set { buttons = value; }
- }
-
- private TaskDialogNativeMethods.TASKDIALOG_BUTTON[] radioButtons;
- public TaskDialogNativeMethods.TASKDIALOG_BUTTON[] RadioButtons
- {
- get { return radioButtons; }
- set { radioButtons = value; }
- }
-
- private List elevatedButtons;
- public List ElevatedButtons
- {
- get { return elevatedButtons; }
- set { elevatedButtons = value; }
- }
- }
-}
diff --git a/src/External/WindowsAPICodePack/Core/Interop/TaskDialogs/TaskDialogNativeMethods.cs b/src/External/WindowsAPICodePack/Core/Interop/TaskDialogs/TaskDialogNativeMethods.cs
deleted file mode 100644
index 70d8685..0000000
--- a/src/External/WindowsAPICodePack/Core/Interop/TaskDialogs/TaskDialogNativeMethods.cs
+++ /dev/null
@@ -1,235 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Runtime.InteropServices;
-using MS.WindowsAPICodePack.Internal;
-
-namespace Microsoft.WindowsAPICodePack.Dialogs
-{
-
- ///
- /// Internal class containing most native interop declarations used
- /// throughout the library.
- /// Functions that are not performance intensive belong in this class.
- ///
-
- internal static class TaskDialogNativeMethods
- {
- #region TaskDialog Definitions
-
- [DllImport(CommonDllNames.ComCtl32, CharSet = CharSet.Auto,
- SetLastError = true)]
- internal static extern HRESULT TaskDialogIndirect(
- [In] TaskDialogNativeMethods.TASKDIALOGCONFIG pTaskConfig,
- [Out] out int pnButton,
- [Out] out int pnRadioButton,
- [MarshalAs(UnmanagedType.Bool)][Out] out bool pVerificationFlagChecked);
-
- internal delegate HRESULT TDIDelegate(
- [In] TaskDialogNativeMethods.TASKDIALOGCONFIG pTaskConfig,
- [Out] out int pnButton,
- [Out] out int pnRadioButton,
- [Out] out bool pVerificationFlagChecked);
-
- // Main task dialog configuration struct.
- // NOTE: Packing must be set to 4 to make this work on 64-bit platforms.
- [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto, Pack = 4)]
- internal class TASKDIALOGCONFIG
- {
- internal uint cbSize;
- internal IntPtr hwndParent;
- internal IntPtr hInstance;
- internal TASKDIALOG_FLAGS dwFlags;
- internal TASKDIALOG_COMMON_BUTTON_FLAGS dwCommonButtons;
- [MarshalAs(UnmanagedType.LPWStr)]
- internal string pszWindowTitle;
- internal TASKDIALOGCONFIG_ICON_UNION MainIcon; // NOTE: 32-bit union field, holds pszMainIcon as well
- [MarshalAs(UnmanagedType.LPWStr)]
- internal string pszMainInstruction;
- [MarshalAs(UnmanagedType.LPWStr)]
- internal string pszContent;
- internal uint cButtons;
- internal IntPtr pButtons; // Ptr to TASKDIALOG_BUTTON structs
- internal int nDefaultButton;
- internal uint cRadioButtons;
- internal IntPtr pRadioButtons; // Ptr to TASKDIALOG_BUTTON structs
- internal int nDefaultRadioButton;
- [MarshalAs(UnmanagedType.LPWStr)]
- internal string pszVerificationText;
- [MarshalAs(UnmanagedType.LPWStr)]
- internal string pszExpandedInformation;
- [MarshalAs(UnmanagedType.LPWStr)]
- internal string pszExpandedControlText;
- [MarshalAs(UnmanagedType.LPWStr)]
- internal string pszCollapsedControlText;
- internal TASKDIALOGCONFIG_ICON_UNION FooterIcon; // NOTE: 32-bit union field, holds pszFooterIcon as well
- [MarshalAs(UnmanagedType.LPWStr)]
- internal string pszFooter;
- internal PFTASKDIALOGCALLBACK pfCallback;
- internal IntPtr lpCallbackData;
- internal uint cxWidth;
- }
-
- internal const int TASKDIALOG_IDEALWIDTH = 0; // Value for TASKDIALOGCONFIG.cxWidth
- internal const int TASKDIALOG_BUTTON_SHIELD_ICON = 1;
-
- // NOTE: We include a "spacer" so that the struct size varies on
- // 64-bit architectures.
- [StructLayout(LayoutKind.Explicit, CharSet = CharSet.Auto)]
- internal struct TASKDIALOGCONFIG_ICON_UNION
- {
- internal TASKDIALOGCONFIG_ICON_UNION(int i)
- {
- spacer = IntPtr.Zero;
- pszIcon = 0;
- hMainIcon = i;
- }
-
- [FieldOffset(0)]
- internal int hMainIcon;
- [FieldOffset(0)]
- internal int pszIcon;
- [FieldOffset(0)]
- internal IntPtr spacer;
- }
-
- // NOTE: Packing must be set to 4 to make this work on 64-bit platforms.
- [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto, Pack = 4)]
- internal struct TASKDIALOG_BUTTON
- {
- public TASKDIALOG_BUTTON(int n, string txt)
- {
- nButtonID = n;
- pszButtonText = txt;
- }
-
- internal int nButtonID;
- [MarshalAs(UnmanagedType.LPWStr)]
- internal string pszButtonText;
- }
-
- // Task Dialog - identifies common buttons.
- [Flags]
- internal enum TASKDIALOG_COMMON_BUTTON_FLAGS
- {
- TDCBF_OK_BUTTON = 0x0001, // selected control return value IDOK
- TDCBF_YES_BUTTON = 0x0002, // selected control return value IDYES
- TDCBF_NO_BUTTON = 0x0004, // selected control return value IDNO
- TDCBF_CANCEL_BUTTON = 0x0008, // selected control return value IDCANCEL
- TDCBF_RETRY_BUTTON = 0x0010, // selected control return value IDRETRY
- TDCBF_CLOSE_BUTTON = 0x0020 // selected control return value IDCLOSE
- }
-
- // Identify button *return values* - note that, unfortunately, these are different
- // from the inbound button values.
- internal enum TASKDIALOG_COMMON_BUTTON_RETURN_ID
- {
- IDOK = 1,
- IDCANCEL = 2,
- IDABORT = 3,
- IDRETRY = 4,
- IDIGNORE = 5,
- IDYES = 6,
- IDNO = 7,
- IDCLOSE = 8
- }
-
- internal enum TASKDIALOG_ELEMENTS
- {
- TDE_CONTENT,
- TDE_EXPANDED_INFORMATION,
- TDE_FOOTER,
- TDE_MAIN_INSTRUCTION
- }
-
- internal enum TASKDIALOG_ICON_ELEMENT
- {
- TDIE_ICON_MAIN,
- TDIE_ICON_FOOTER
- }
-
- // Task Dialog - flags
- [Flags]
- internal enum TASKDIALOG_FLAGS
- {
- NONE = 0,
- TDF_ENABLE_HYPERLINKS = 0x0001,
- TDF_USE_HICON_MAIN = 0x0002,
- TDF_USE_HICON_FOOTER = 0x0004,
- TDF_ALLOW_DIALOG_CANCELLATION = 0x0008,
- TDF_USE_COMMAND_LINKS = 0x0010,
- TDF_USE_COMMAND_LINKS_NO_ICON = 0x0020,
- TDF_EXPAND_FOOTER_AREA = 0x0040,
- TDF_EXPANDED_BY_DEFAULT = 0x0080,
- TDF_VERIFICATION_FLAG_CHECKED = 0x0100,
- TDF_SHOW_PROGRESS_BAR = 0x0200,
- TDF_SHOW_MARQUEE_PROGRESS_BAR = 0x0400,
- TDF_CALLBACK_TIMER = 0x0800,
- TDF_POSITION_RELATIVE_TO_WINDOW = 0x1000,
- TDF_RTL_LAYOUT = 0x2000,
- TDF_NO_DEFAULT_RADIO_BUTTON = 0x4000
- }
-
- internal enum TASKDIALOG_MESSAGES
- {
- TDM_NAVIGATE_PAGE = CoreNativeMethods.WM_USER + 101,
- TDM_CLICK_BUTTON = CoreNativeMethods.WM_USER + 102, // wParam = Button ID
- TDM_SET_MARQUEE_PROGRESS_BAR = CoreNativeMethods.WM_USER + 103, // wParam = 0 (nonMarque) wParam != 0 (Marquee)
- TDM_SET_PROGRESS_BAR_STATE = CoreNativeMethods.WM_USER + 104, // wParam = new progress state
- TDM_SET_PROGRESS_BAR_RANGE = CoreNativeMethods.WM_USER + 105, // lParam = MAKELPARAM(nMinRange, nMaxRange)
- TDM_SET_PROGRESS_BAR_POS = CoreNativeMethods.WM_USER + 106, // wParam = new position
- TDM_SET_PROGRESS_BAR_MARQUEE = CoreNativeMethods.WM_USER + 107, // wParam = 0 (stop marquee), wParam != 0 (start marquee), lparam = speed (milliseconds between repaints)
- TDM_SET_ELEMENT_TEXT = CoreNativeMethods.WM_USER + 108, // wParam = element (TASKDIALOG_ELEMENTS), lParam = new element text (LPCWSTR)
- TDM_CLICK_RADIO_BUTTON = CoreNativeMethods.WM_USER + 110, // wParam = Radio Button ID
- TDM_ENABLE_BUTTON = CoreNativeMethods.WM_USER + 111, // lParam = 0 (disable), lParam != 0 (enable), wParam = Button ID
- TDM_ENABLE_RADIO_BUTTON = CoreNativeMethods.WM_USER + 112, // lParam = 0 (disable), lParam != 0 (enable), wParam = Radio Button ID
- TDM_CLICK_VERIFICATION = CoreNativeMethods.WM_USER + 113, // wParam = 0 (unchecked), 1 (checked), lParam = 1 (set key focus)
- TDM_UPDATE_ELEMENT_TEXT = CoreNativeMethods.WM_USER + 114, // wParam = element (TASKDIALOG_ELEMENTS), lParam = new element text (LPCWSTR)
- TDM_SET_BUTTON_ELEVATION_REQUIRED_STATE = CoreNativeMethods.WM_USER + 115, // wParam = Button ID, lParam = 0 (elevation not required), lParam != 0 (elevation required)
- TDM_UPDATE_ICON = CoreNativeMethods.WM_USER + 116 // wParam = icon element (TASKDIALOG_ICON_ELEMENTS), lParam = new icon (hIcon if TDF_USE_HICON_* was set, PCWSTR otherwise)
- }
-
- internal enum TASKDIALOG_NOTIFICATIONS
- {
- TDN_CREATED = 0,
- TDN_NAVIGATED = 1,
- TDN_BUTTON_CLICKED = 2, // wParam = Button ID
- TDN_HYPERLINK_CLICKED = 3, // lParam = (LPCWSTR)pszHREF
- TDN_TIMER = 4, // wParam = Milliseconds since dialog created or timer reset
- TDN_DESTROYED = 5,
- TDN_RADIO_BUTTON_CLICKED = 6, // wParam = Radio Button ID
- TDN_DIALOG_CONSTRUCTED = 7,
- TDN_VERIFICATION_CLICKED = 8, // wParam = 1 if checkbox checked, 0 if not, lParam is unused and always 0
- TDN_HELP = 9,
- TDN_EXPANDO_BUTTON_CLICKED = 10 // wParam = 0 (dialog is now collapsed), wParam != 0 (dialog is now expanded)
- }
-
- // Used in the various SET_DEFAULT* TaskDialog messages
- internal const int NO_DEFAULT_BUTTON_SPECIFIED = 0;
-
- // Task Dialog config and related structs (for TaskDialogIndirect())
- internal delegate int PFTASKDIALOGCALLBACK(
- IntPtr hwnd,
- uint msg,
- IntPtr wParam,
- IntPtr lParam,
- IntPtr lpRefData);
-
- internal enum PBST
- {
- PBST_NORMAL = 0x0001,
- PBST_ERROR = 0x0002,
- PBST_PAUSED = 0x0003
- }
-
- internal enum TD_ICON
- {
- TD_WARNING_ICON = 65535,
- TD_ERROR_ICON = 65534,
- TD_INFORMATION_ICON = 65533,
- TD_SHIELD_ICON = 65532
- }
-
- #endregion
- }
-}
diff --git a/src/External/WindowsAPICodePack/Core/Migrated rules for Core.ruleset b/src/External/WindowsAPICodePack/Core/Migrated rules for Core.ruleset
deleted file mode 100644
index 8f335b7..0000000
--- a/src/External/WindowsAPICodePack/Core/Migrated rules for Core.ruleset
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/External/WindowsAPICodePack/Core/NetworkList/Network.cs b/src/External/WindowsAPICodePack/Core/NetworkList/Network.cs
deleted file mode 100644
index 79bf369..0000000
--- a/src/External/WindowsAPICodePack/Core/NetworkList/Network.cs
+++ /dev/null
@@ -1,201 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-
-namespace Microsoft.WindowsAPICodePack.Net
-{
- ///
- /// Represents a network on the local machine.
- /// It can also represent a collection of network
- /// connections with a similar network signature.
- ///
- ///
- /// Instances of this class are obtained by calling
- /// methods on the class.
- ///
- public class Network
- {
- #region Private Fields
-
- INetwork network;
-
- #endregion // Private Fields
-
- internal Network(INetwork network)
- {
- this.network = network;
- }
-
- ///
- /// Gets or sets the category of a network. The
- /// categories are trusted, untrusted, or
- /// authenticated.
- ///
- /// A value.
- public NetworkCategory Category
- {
- get
- {
- return network.GetCategory();
- }
-
- set
- {
- network.SetCategory(value);
- }
- }
-
- ///
- /// Gets the local date and time when the network
- /// was connected.
- ///
- /// A object.
- public DateTime ConnectedTime
- {
- get
- {
- uint low, high, dummy1, dummy2;
- network.GetTimeCreatedAndConnected(out dummy1, out dummy2, out low, out high);
- long time = high;
- // Shift the day info into the high order bits.
- time <<= 32;
- time |= low;
- return DateTime.FromFileTimeUtc(time);
- }
- }
-
- ///
- /// Gets the network connections for the network.
- ///
- /// A object.
- public NetworkConnectionCollection Connections
- {
- get
- {
- return new NetworkConnectionCollection(network.GetNetworkConnections());
- }
- }
-
- ///
- /// Gets the connectivity state of the network.
- ///
- /// A value.
- /// Connectivity provides information on whether
- /// the network is connected, and the protocols
- /// in use for network traffic.
- public Connectivity Connectivity
- {
- get
- {
- return network.GetConnectivity();
- }
- }
-
- ///
- /// Gets the local date and time when the
- /// network was created.
- ///
- /// A object.
- public DateTime CreatedTime
- {
- get
- {
- uint low, high, dummy1, dummy2;
- network.GetTimeCreatedAndConnected(out low, out high, out dummy1, out dummy2);
- long time = high;
- //Shift the value into the high order bits.
- time <<= 32;
- time |= low;
- return DateTime.FromFileTimeUtc(time);
- }
- }
-
- ///
- /// Gets or sets a description for the network.
- ///
- /// A value.
- public string Description
- {
- get
- {
- return network.GetDescription();
- }
-
- set
- {
- network.SetDescription(value);
- }
- }
-
- ///
- /// Gets the domain type of the network.
- ///
- /// A value.
- /// The domain
- /// indictates whether the network is an Active
- /// Directory Network, and whether the machine
- /// has been authenticated by Active Directory.
- public DomainType DomainType
- {
- get
- {
- return network.GetDomainType();
- }
- }
-
- ///
- /// Gets a value that indicates whether there is
- /// network connectivity.
- ///
- /// A value.
- public bool IsConnected
- {
- get
- {
- return network.IsConnected;
- }
- }
-
- ///
- /// Gets a value that indicates whether there is
- /// Internet connectivity.
- ///
- /// A value.
- public bool IsConnectedToInternet
- {
- get
- {
- return network.IsConnectedToInternet;
- }
- }
-
- ///
- /// Gets or sets the name of the network.
- ///
- /// A value.
- public string Name
- {
- get
- {
- return network.GetName();
- }
-
- set
- {
- network.SetName(value);
- }
- }
-
- ///
- /// Gets a unique identifier for the network.
- ///
- /// A value.
- public Guid NetworkId
- {
- get
- {
- return network.GetNetworkId();
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/External/WindowsAPICodePack/Core/NetworkList/NetworkCollection.cs b/src/External/WindowsAPICodePack/Core/NetworkList/NetworkCollection.cs
deleted file mode 100644
index dc079a0..0000000
--- a/src/External/WindowsAPICodePack/Core/NetworkList/NetworkCollection.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-namespace Microsoft.WindowsAPICodePack.Net
-{
- ///
- /// An enumerable collection of objects.
- ///
- public class NetworkCollection : IEnumerable
- {
- #region Private Fields
-
- IEnumerable networkEnumerable;
-
- #endregion // Private Fields
-
- internal NetworkCollection(IEnumerable networkEnumerable)
- {
- this.networkEnumerable = networkEnumerable;
- }
-
- #region IEnumerable Members
-
- ///
- /// Returns the strongly typed enumerator for this collection.
- ///
- /// An object.
- public IEnumerator GetEnumerator()
- {
- foreach (INetwork network in networkEnumerable)
- {
- yield return new Network(network);
- }
- }
-
- #endregion
-
- #region IEnumerable Members
-
- ///
- /// Returns the enumerator for this collection.
- ///
- ///An object.
- IEnumerator IEnumerable.GetEnumerator()
- {
- foreach (INetwork network in networkEnumerable)
- {
- yield return new Network(network);
- }
- }
-
- #endregion
- }
-}
\ No newline at end of file
diff --git a/src/External/WindowsAPICodePack/Core/NetworkList/NetworkConnection.cs b/src/External/WindowsAPICodePack/Core/NetworkList/NetworkConnection.cs
deleted file mode 100644
index f21027b..0000000
--- a/src/External/WindowsAPICodePack/Core/NetworkList/NetworkConnection.cs
+++ /dev/null
@@ -1,115 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Collections;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-namespace Microsoft.WindowsAPICodePack.Net
-{
- ///
- /// Represents a connection to a network.
- ///
- /// A collection containing instances of this class is obtained by calling
- /// the property.
- public class NetworkConnection
- {
- #region Private Fields
-
- INetworkConnection networkConnection;
-
- #endregion // Private Fields
-
- internal NetworkConnection(INetworkConnection networkConnection)
- {
- this.networkConnection = networkConnection;
- }
-
- ///
- /// Retrieves an object that represents the network
- /// associated with this connection.
- ///
- /// A object.
- public Network Network
- {
- get
- {
- return new Network(networkConnection.GetNetwork());
- }
- }
-
- ///
- /// Gets the adapter identifier for this connection.
- ///
- /// A object.
- public Guid AdapterId
- {
- get
- {
- return networkConnection.GetAdapterId();
- }
- }
- ///
- /// Gets the unique identifier for this connection.
- ///
- /// A object.
- public Guid ConnectionId
- {
- get
- {
- return networkConnection.GetConnectionId();
- }
- }
- ///
- /// Gets a value that indicates the connectivity of this connection.
- ///
- /// A value.
- public Connectivity Connectivity
- {
- get
- {
- return networkConnection.GetConnectivity();
- }
- }
-
- ///
- /// Gets a value that indicates whether the network associated
- /// with this connection is
- /// an Active Directory network and whether the machine
- /// has been authenticated by Active Directory.
- ///
- /// A value.
- public DomainType DomainType
- {
- get
- {
- return networkConnection.GetDomainType();
- }
- }
- ///
- /// Gets a value that indicates whether this
- /// connection has Internet access.
- ///
- /// A value.
- public bool IsConnectedToInternet
- {
- get
- {
- return networkConnection.IsConnectedToInternet;
- }
- }
-
- ///
- /// Gets a value that indicates whether this connection has
- /// network connectivity.
- ///
- /// A value.
- public bool IsConnected
- {
- get
- {
- return networkConnection.IsConnected;
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/External/WindowsAPICodePack/Core/NetworkList/NetworkConnectionCollection.cs b/src/External/WindowsAPICodePack/Core/NetworkList/NetworkConnectionCollection.cs
deleted file mode 100644
index 4618e36..0000000
--- a/src/External/WindowsAPICodePack/Core/NetworkList/NetworkConnectionCollection.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-namespace Microsoft.WindowsAPICodePack.Net
-{
- ///
- /// An enumerable collection of objects.
- ///
- public class NetworkConnectionCollection : IEnumerable
- {
- #region Private Fields
-
- IEnumerable networkConnectionEnumerable;
-
- #endregion // Private Fields
-
- internal NetworkConnectionCollection(IEnumerable networkConnectionEnumerable)
- {
- this.networkConnectionEnumerable = networkConnectionEnumerable;
- }
-
- #region IEnumerable Members
-
- ///
- /// Returns the strongly typed enumerator for this collection.
- ///
- /// A object.
- public IEnumerator GetEnumerator()
- {
- foreach (INetworkConnection networkConnection in networkConnectionEnumerable)
- {
- yield return new NetworkConnection(networkConnection);
- }
- }
-
- #endregion
-
- #region IEnumerable Members
-
- ///
- /// Returns the enumerator for this collection.
- ///
- ///A object.
- IEnumerator IEnumerable.GetEnumerator()
- {
- foreach (INetworkConnection networkConnection in networkConnectionEnumerable)
- {
- yield return new NetworkConnection(networkConnection);
- }
- }
-
- #endregion
- }
-}
\ No newline at end of file
diff --git a/src/External/WindowsAPICodePack/Core/NetworkList/NetworkListEnums.cs b/src/External/WindowsAPICodePack/Core/NetworkList/NetworkListEnums.cs
deleted file mode 100644
index 9cda7cb..0000000
--- a/src/External/WindowsAPICodePack/Core/NetworkList/NetworkListEnums.cs
+++ /dev/null
@@ -1,132 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-namespace Microsoft.WindowsAPICodePack.Net
-{
- ///
- /// Specifies types of network connectivity.
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1714:FlagsEnumsShouldHavePluralNames"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1008:EnumsShouldHaveZeroValue", Justification = "Same name as the native API"), Flags]
- public enum Connectivity
- {
- ///
- /// The underlying network interfaces have no
- /// connectivity to any network.
- ///
- Disconnected = 0,
- ///
- /// There is connectivity to the Internet
- /// using the IPv4 protocol.
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Pv")]
- IPv4Internet = 0x40,
- ///
- /// There is connectivity to a routed network
- /// using the IPv4 protocol.
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Pv")]
- IPv4LocalNetwork = 0x20,
- ///
- /// There is connectivity to a network, but
- /// the service cannot detect any IPv4
- /// network traffic.
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Pv")]
- IPv4NoTraffic = 1,
- ///
- /// There is connectivity to the local
- /// subnet using the IPv4 protocol.
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Pv")]
- IPv4Subnet = 0x10,
- ///
- /// There is connectivity to the Internet
- /// using the IPv4 protocol.
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Pv")]
- IPv6Internet = 0x400,
- ///
- /// There is connectivity to a local
- /// network using the IPv6 protocol.
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Pv")]
- IPv6LocalNetwork = 0x200,
- ///
- /// There is connectivity to a network,
- /// but the service cannot detect any
- /// IPv6 network traffic
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Pv")]
- IPv6NoTraffic = 2,
- ///
- /// There is connectivity to the local
- /// subnet using the IPv6 protocol.
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Pv")]
- IPv6Subnet = 0x100
- }
-
- ///
- /// Specifies the domain type of a network.
- ///
- public enum DomainType
- {
- ///
- /// The network is not an Active Directory network.
- ///
- NonDomainNetwork = 0,
- ///
- /// The network is an Active Directory network, but this machine is not authenticated against it.
- ///
- DomainNetwork = 1,
- ///
- /// The network is an Active Directory network, and this machine is authenticated against it.
- ///
- DomainAuthenticated = 2,
- }
-
- ///
- /// Specifies the trust level for a
- /// network.
- ///
- public enum NetworkCategory
- {
- ///
- /// The network is a public (untrusted) network.
- ///
- Public,
- ///
- /// The network is a private (trusted) network.
- ///
- Private,
- ///
- /// The network is authenticated against an Active Directory domain.
- ///
- Authenticated
- }
-
- ///
- /// Specifies the level of connectivity for
- /// networks returned by the
- ///
- /// class.
- ///
- [Flags]
- public enum NetworkConnectivityLevels
- {
- ///
- /// Networks that the machine is connected to.
- ///
- Connected = 1,
- ///
- /// Networks that the machine is not connected to.
- ///
- Disconnected = 2,
- ///
- /// All networks.
- ///
- All = 3,
- }
-
-
-}
diff --git a/src/External/WindowsAPICodePack/Core/NetworkList/NetworkListManager.cs b/src/External/WindowsAPICodePack/Core/NetworkList/NetworkListManager.cs
deleted file mode 100644
index 030e8fd..0000000
--- a/src/External/WindowsAPICodePack/Core/NetworkList/NetworkListManager.cs
+++ /dev/null
@@ -1,132 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using MS.WindowsAPICodePack.Internal;
-
-namespace Microsoft.WindowsAPICodePack.Net
-{
- ///
- /// Provides access to objects that represent networks and network connections.
- ///
- public static class NetworkListManager
- {
- #region Private Fields
-
- static NetworkListManagerClass manager = new NetworkListManagerClass();
-
- #endregion // Private Fields
-
- ///
- /// Retrieves a collection of objects that represent the networks defined for this machine.
- ///
- ///
- /// The that specify the connectivity level of the returned objects.
- ///
- ///
- /// A of objects.
- ///
- public static NetworkCollection GetNetworks(NetworkConnectivityLevels level)
- {
- // Throw PlatformNotSupportedException if the user is not running Vista or beyond
- CoreHelpers.ThrowIfNotVista();
-
- return new NetworkCollection(manager.GetNetworks(level));
- }
-
- ///
- /// Retrieves the identified by the specified network identifier.
- ///
- ///
- /// A that specifies the unique identifier for the network.
- ///
- ///
- /// The that represents the network identified by the identifier.
- ///
- public static Network GetNetwork(Guid networkId)
- {
- // Throw PlatformNotSupportedException if the user is not running Vista or beyond
- CoreHelpers.ThrowIfNotVista();
-
- return new Network(manager.GetNetwork(networkId));
- }
-
- ///
- /// Retrieves a collection of objects that represent the connections for this machine.
- ///
- ///
- /// A containing the network connections.
- ///
- public static NetworkConnectionCollection GetNetworkConnections()
- {
- // Throw PlatformNotSupportedException if the user is not running Vista or beyond
- CoreHelpers.ThrowIfNotVista();
-
- return new NetworkConnectionCollection(manager.GetNetworkConnections());
- }
-
- ///
- /// Retrieves the identified by the specified connection identifier.
- ///
- ///
- /// A that specifies the unique identifier for the network connection.
- ///
- ///
- /// The identified by the specified identifier.
- ///
- public static NetworkConnection GetNetworkConnection(Guid networkConnectionId)
- {
- // Throw PlatformNotSupportedException if the user is not running Vista or beyond
- CoreHelpers.ThrowIfNotVista();
-
- return new NetworkConnection(manager.GetNetworkConnection(networkConnectionId));
- }
-
- ///
- /// Gets a value that indicates whether this machine
- /// has Internet connectivity.
- ///
- /// A value.
- public static bool IsConnectedToInternet
- {
- get
- {
- // Throw PlatformNotSupportedException if the user is not running Vista or beyond
- CoreHelpers.ThrowIfNotVista();
-
- return manager.IsConnectedToInternet;
- }
- }
-
- ///
- /// Gets a value that indicates whether this machine
- /// has network connectivity.
- ///
- /// A value.
- public static bool IsConnected
- {
- get
- {
- // Throw PlatformNotSupportedException if the user is not running Vista or beyond
- CoreHelpers.ThrowIfNotVista();
-
- return manager.IsConnected;
- }
- }
-
- ///
- /// Gets the connectivity state of this machine.
- ///
- /// A value.
- public static Connectivity Connectivity
- {
- get
- {
- // Throw PlatformNotSupportedException if the user is not running Vista or beyond
- CoreHelpers.ThrowIfNotVista();
-
- return manager.GetConnectivity();
- }
- }
- }
-
-}
\ No newline at end of file
diff --git a/src/External/WindowsAPICodePack/Core/PowerManagement/BatteryState.cs b/src/External/WindowsAPICodePack/Core/PowerManagement/BatteryState.cs
deleted file mode 100644
index 8684967..0000000
--- a/src/External/WindowsAPICodePack/Core/PowerManagement/BatteryState.cs
+++ /dev/null
@@ -1,151 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-
-namespace Microsoft.WindowsAPICodePack.ApplicationServices
-{
- ///
- /// A snapshot of the state of the battery.
- ///
- public class BatteryState
- {
- private bool acOnline;
- private int maxCharge;
- private int currentCharge;
- private int dischargeRate;
- private TimeSpan estimatedTimeRemaining;
- private int suggestedCriticalBatteryCharge;
- private int suggestedBatteryWarningCharge;
-
- internal BatteryState()
- {
- PowerManagementNativeMethods.SystemBatteryState battState = Power.GetSystemBatteryState();
- acOnline = battState.AcOnLine;
- maxCharge = (int)battState.MaxCapacity;
- currentCharge = (int)battState.RemainingCapacity;
- dischargeRate = (int)battState.Rate;
- long estimatedTime = (long)battState.EstimatedTime;
- int minutes = (int)(estimatedTime/60);
- int seconds = (int)(estimatedTime % 60);
- estimatedTimeRemaining = new TimeSpan(0, minutes, seconds);
- suggestedCriticalBatteryCharge = (int)battState.DefaultAlert1;
- suggestedBatteryWarningCharge = (int)battState.DefaultAlert2;
- }
-
- #region Public properties
-
- ///
- /// Gets a value that indicates whether the battery charger is
- /// operating on external power.
- ///
- /// A value. True indicates the battery charger is operating on AC power.
- public bool ACOnline
- {
- get
- {
- return acOnline;
- }
- }
-
- ///
- /// Gets the maximum charge of the battery (in mW).
- ///
- /// An value.
- public int MaxCharge
- {
- get
- {
- return maxCharge;
- }
- }
-
- ///
- /// Gets the current charge of the battery (in mW).
- ///
- /// An value.
- public int CurrentCharge
- {
- get
- {
- return currentCharge;
- }
- }
-
- ///
- /// Gets the rate of discharge for the battery (in mW).
- ///
- ///
- /// A negative value indicates the
- /// charge rate. Not all batteries support charge rate.
- ///
- /// An value.
- public int DischargeRate
- {
- get
- {
- return dischargeRate;
- }
- }
-
- ///
- /// Gets the estimated time remaining until the battery is empty.
- ///
- /// A object.
- public TimeSpan EstimatedTimeRemaining
- {
- get
- {
- return estimatedTimeRemaining;
- }
- }
-
- ///
- /// Gets the manufacturer's suggested battery charge level
- /// that should cause a critical alert to be sent to the user.
- ///
- /// An value.
- public int SuggestedCriticalBatteryCharge
- {
- get
- {
- return suggestedCriticalBatteryCharge;
- }
- }
-
- ///
- /// Gets the manufacturer's suggested battery charge level
- /// that should cause a warning to be sent to the user.
- ///
- /// An value.
- public int SuggestedBatteryWarningCharge
- {
- get
- {
- return suggestedBatteryWarningCharge;
- }
- }
-
- #endregion
-
- ///
- /// Generates a string that represents this BatteryState object.
- ///
- /// A representation of this object's current state.
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.String.Format(System.String,System.Object[])"
- , Justification = "We are not currently handling globalization or localization")]
- public override string ToString()
- {
- return string.Format(
- "ACOnline: {1}{0}Max Charge: {2} mWh{0}Current Charge: {3} mWh{0}Discharge Rate: {4} mWh{0}Estimated Time Remaining: {5}{0}Suggested Critical Battery Charge: {6} mWh{0}Suggested Battery Warning Charge: {7} mWh{0}",
- Environment.NewLine,
- acOnline,
- maxCharge,
- currentCharge,
- dischargeRate,
- estimatedTimeRemaining,
- suggestedCriticalBatteryCharge,
- suggestedBatteryWarningCharge
- );
- }
- }
-}
diff --git a/src/External/WindowsAPICodePack/Core/PowerManagement/EventManager.cs b/src/External/WindowsAPICodePack/Core/PowerManagement/EventManager.cs
deleted file mode 100644
index 4539e95..0000000
--- a/src/External/WindowsAPICodePack/Core/PowerManagement/EventManager.cs
+++ /dev/null
@@ -1,94 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Threading;
-
-namespace Microsoft.WindowsAPICodePack.ApplicationServices
-{
- ///
- /// This class keeps track of the current state of each type of event.
- /// The MessageManager class tracks event handlers.
- /// This class only deals with each event type (i.e.
- /// BatteryLifePercentChanged) as a whole.
- ///
- internal static class EventManager
- {
- // Prevents reading from PowerManager members while they are still null.
- // MessageManager notifies the PowerManager that the member
- // has been set and can be used.
- internal static AutoResetEvent personalityReset = new AutoResetEvent(false);
- internal static AutoResetEvent powerSrcReset = new AutoResetEvent(false);
- internal static AutoResetEvent batteryLifeReset = new AutoResetEvent(false);
- internal static AutoResetEvent monitorOnReset = new AutoResetEvent(false);
-
- #region Hardcoded GUIDS for each event
-
- internal static readonly Guid PowerPersonalityChange = new Guid(0x245d8541, 0x3943, 0x4422, 0xb0, 0x25, 0x13, 0xA7, 0x84, 0xF6, 0x79, 0xB7);
- internal static readonly Guid PowerSourceChange = new Guid(0x5d3e9a59, 0xe9D5, 0x4b00, 0xa6, 0xbd, 0xff, 0x34, 0xff, 0x51, 0x65, 0x48);
- internal static readonly Guid BatteryCapacityChange = new Guid(0xa7ad8041, 0xb45a, 0x4cae, 0x87, 0xa3, 0xee, 0xcb, 0xb4, 0x68, 0xa9, 0xe1);
- internal static readonly Guid BackgroundTaskNotification = new Guid(0x515c31d8, 0xf734, 0x163d, 0xa0, 0xfd, 0x11, 0xa0, 0x8c, 0x91, 0xe8, 0xf1);
- internal static readonly Guid MonitorPowerStatus = new Guid(0x02731015, 0x4510, 0x4526, 0x99, 0xe6, 0xe5, 0xa1, 0x7e, 0xbd, 0x1a, 0xea);
-
- #endregion
-
- #region private static members
-
- // Used to catch the initial message Windows sends when
- // you first register for a power notification.
- // We do not want to fire any event handlers when this happens.
- private static bool personalityCaught;
- private static bool powerSrcCaught;
- private static bool batteryLifeCaught;
- private static bool monitorOnCaught;
-
- #endregion
-
- ///
- /// Determines if a message should be caught, preventing
- /// the event handler from executing.
- /// This is needed when an event is initially registered.
- ///
- /// The event to check.
- /// A boolean value. Returns true if the
- /// message should be caught.
- internal static bool IsMessageCaught(Guid eventGuid)
- {
- bool isMessageCaught = false;
-
- if (eventGuid == EventManager.BatteryCapacityChange)
- {
- if (!batteryLifeCaught)
- {
- batteryLifeCaught = true;
- isMessageCaught = true;
- }
- }
- else if (eventGuid == EventManager.MonitorPowerStatus)
- {
- if (!monitorOnCaught)
- {
- monitorOnCaught = true;
- isMessageCaught = true;
- }
- }
- else if (eventGuid == EventManager.PowerPersonalityChange)
- {
- if (!personalityCaught)
- {
- personalityCaught = true;
- isMessageCaught = true;
- }
- }
- else if (eventGuid == EventManager.PowerSourceChange)
- {
- if (!powerSrcCaught)
- {
- powerSrcCaught = true;
- isMessageCaught = true;
- }
- }
-
- return isMessageCaught;
- }
- }
-}
diff --git a/src/External/WindowsAPICodePack/Core/PowerManagement/ExecutionState.cs b/src/External/WindowsAPICodePack/Core/PowerManagement/ExecutionState.cs
deleted file mode 100644
index d2c55c5..0000000
--- a/src/External/WindowsAPICodePack/Core/PowerManagement/ExecutionState.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-namespace Microsoft.WindowsAPICodePack.ApplicationServices
-{
- internal enum ExecutionState : uint
- {
- SystemRequired = 0x00000001,
- DisplayRequired = 0x00000002,
- Continuous = 0x80000000,
- }
-}
diff --git a/src/External/WindowsAPICodePack/Core/PowerManagement/MessageManager.cs b/src/External/WindowsAPICodePack/Core/PowerManagement/MessageManager.cs
deleted file mode 100644
index 6acf994..0000000
--- a/src/External/WindowsAPICodePack/Core/PowerManagement/MessageManager.cs
+++ /dev/null
@@ -1,216 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Collections;
-using System.Runtime.InteropServices;
-using System.Threading;
-using System.Windows.Forms;
-
-namespace Microsoft.WindowsAPICodePack.ApplicationServices
-{
- ///
- /// This class generates .NET events based on Windows messages.
- /// The PowerRegWindow class processes the messages from Windows.
- ///
- internal static class MessageManager
- {
- private static object lockObject = new object();
- private static PowerRegWindow window;
-
- #region Internal static methods
-
- ///
- /// Registers a callback for a power event.
- ///
- /// Guid for the event.
- /// Event handler for the specified event.
- internal static void RegisterPowerEvent(Guid eventId, EventHandler eventToRegister)
- {
- EnsureInitialized();
- window.RegisterPowerEvent(eventId, eventToRegister);
- }
-
- ///
- /// Unregisters an event handler for a power event.
- ///
- /// Guid for the event.
- /// Event handler to unregister.
- internal static void UnregisterPowerEvent(Guid eventId, EventHandler eventToUnregister)
- {
- EnsureInitialized();
- window.UnregisterPowerEvent(eventId, eventToUnregister);
- }
-
- #endregion
-
- ///
- /// Ensures that the hidden window is initialized and
- /// listening for messages.
- ///
- private static void EnsureInitialized()
- {
- if (window == null)
- {
- lock (lockObject)
- {
- if (window == null)
- {
- // Create a new hidden window to listen
- // for power management related window messages.
- window = new PowerRegWindow();
- }
- }
- }
- }
-
- ///
- /// Catch Windows messages and generates events for power specific
- /// messages.
- ///
- internal class PowerRegWindow : Form
- {
- private Hashtable eventList = new Hashtable();
- private ReaderWriterLock readerWriterLock = new ReaderWriterLock();
-
- internal PowerRegWindow()
- : base()
- {
-
- }
-
- #region Internal Methods
-
- ///
- /// Adds an event handler to call when Windows sends
- /// a message for an evebt.
- ///
- /// Guid for the event.
- /// Event handler for the event.
- internal void RegisterPowerEvent(Guid eventId, EventHandler eventToRegister)
- {
- readerWriterLock.AcquireWriterLock(Timeout.Infinite);
- if (!eventList.Contains(eventId))
- {
- Power.RegisterPowerSettingNotification(this.Handle, eventId);
- ArrayList newList = new ArrayList();
- newList.Add(eventToRegister);
- eventList.Add(eventId, newList);
- }
- else
- {
- ArrayList currList = (ArrayList)eventList[eventId];
- currList.Add(eventToRegister);
- }
- readerWriterLock.ReleaseWriterLock();
- }
-
- ///
- /// Removes an event handler.
- ///
- /// Guid for the event.
- /// Event handler to remove.
- /// Cannot unregister
- /// a function that is not registered.
- internal void UnregisterPowerEvent(Guid eventId, EventHandler eventToUnregister)
- {
- readerWriterLock.AcquireWriterLock(Timeout.Infinite);
- if (eventList.Contains(eventId))
- {
- ArrayList currList = (ArrayList)eventList[eventId];
- currList.Remove(eventToUnregister);
- }
- else
- {
- throw new InvalidOperationException(
- "The specified event handler has not been registered.");
- }
- readerWriterLock.ReleaseWriterLock();
- }
-
- #endregion
-
- ///
- /// Executes any registered event handlers.
- ///
- /// ArrayList of event handlers.
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")]
- private static void ExecuteEvents(ArrayList eventHandlerList)
- {
- ArrayList tempList = (ArrayList)eventHandlerList.Clone();
- foreach (EventHandler handler in tempList)
- {
- try
- {
- if (handler != null)
- handler.Invoke(null, new EventArgs());
- }
- // Don't crash if an event handler throws an exception.
- catch { ;}
- }
- }
-
- ///
- /// This method is called when a Windows message
- /// is sent to this window.
- /// The method calls the registered event handlers.
- ///
- protected override void WndProc(ref Message m)
- {
- // Make sure it is a Power Management message.
- if (m.Msg == PowerManagementNativeMethods.WM_POWERBROADCAST && (int)m.WParam == PowerManagementNativeMethods.PBT_POWERSETTINGCHANGE)
- {
- PowerManagementNativeMethods.PowerBroadcastSetting ps =
- (PowerManagementNativeMethods.PowerBroadcastSetting)Marshal.PtrToStructure(
- m.LParam, typeof(PowerManagementNativeMethods.PowerBroadcastSetting));
- IntPtr pData = new IntPtr(m.LParam.ToInt64() + Marshal.SizeOf(ps));
- Guid currentEvent = ps.PowerSetting;
-
- // Update the appropriate Property.
- // Power Personality
- if (ps.PowerSetting == EventManager.PowerPersonalityChange &&
- ps.DataLength == Marshal.SizeOf(typeof(Guid)))
- {
- Guid newPersonality =
- (Guid)Marshal.PtrToStructure(pData, typeof(Guid));
-
- PowerManager.powerPersonality = PersonalityGuids.GuidToEnum(newPersonality);
- // Tell PowerManager that is now safe to
- // read the powerPersonality member.
- EventManager.personalityReset.Set();
- }
- // Power Source
- else if (ps.PowerSetting == EventManager.PowerSourceChange &&
- ps.DataLength == Marshal.SizeOf(typeof(Int32)))
- {
- Int32 powerSrc = (Int32)Marshal.PtrToStructure(pData, typeof(Int32));
- PowerManager.powerSource = (PowerSource)powerSrc;
- EventManager.powerSrcReset.Set();
- }
- // Battery capacity
- else if (ps.PowerSetting == EventManager.BatteryCapacityChange &&
- ps.DataLength == Marshal.SizeOf(typeof(Int32)))
- {
- Int32 battCapacity = (Int32)Marshal.PtrToStructure(pData, typeof(Int32));
- PowerManager.batteryLifePercent = battCapacity;
- EventManager.batteryLifeReset.Set();
- }
- // IsMonitorOn
- else if (ps.PowerSetting == EventManager.MonitorPowerStatus &&
- ps.DataLength == Marshal.SizeOf(typeof(Int32)))
- {
- Int32 monitorStatus = (Int32)Marshal.PtrToStructure(pData, typeof(Int32));
- PowerManager.isMonitorOn = monitorStatus == 0 ? false : true;
- EventManager.monitorOnReset.Set();
- }
-
- if (!EventManager.IsMessageCaught(currentEvent))
- ExecuteEvents((ArrayList)eventList[currentEvent]);
- }
- else
- base.WndProc(ref m);
-
- }
-
- }
- }
-}
diff --git a/src/External/WindowsAPICodePack/Core/PowerManagement/PersonalityGuids.cs b/src/External/WindowsAPICodePack/Core/PowerManagement/PersonalityGuids.cs
deleted file mode 100644
index 5707b54..0000000
--- a/src/External/WindowsAPICodePack/Core/PowerManagement/PersonalityGuids.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-
-namespace Microsoft.WindowsAPICodePack.ApplicationServices
-{
- internal static class PersonalityGuids
- {
- internal static readonly Guid HighPerformance = new Guid(0x8c5e7fda, 0xe8bf, 0x4a96, 0x9a, 0x85, 0xa6, 0xe2, 0x3a, 0x8c, 0x63, 0x5c);
- internal static readonly Guid PowerSaver = new Guid(0xa1841308, 0x3541, 0x4fab, 0xbc, 0x81, 0xf7, 0x15, 0x56, 0xf2, 0x0b, 0x4a);
- internal static readonly Guid Automatic = new Guid(0x381b4222, 0xf694, 0x41f0, 0x96, 0x85, 0xff, 0x5b, 0xb2, 0x60, 0xdf, 0x2e);
-
- internal static PowerPersonality GuidToEnum(Guid convertee)
- {
- if (convertee == HighPerformance)
- return PowerPersonality.HighPerformance;
- else if (convertee == PowerSaver)
- return PowerPersonality.PowerSaver;
- else if (convertee == Automatic)
- return PowerPersonality.Automatic;
-
- throw new ArgumentOutOfRangeException("convertee");
- }
- }
-}
diff --git a/src/External/WindowsAPICodePack/Core/PowerManagement/Power.cs b/src/External/WindowsAPICodePack/Core/PowerManagement/Power.cs
deleted file mode 100644
index 5f891d2..0000000
--- a/src/External/WindowsAPICodePack/Core/PowerManagement/Power.cs
+++ /dev/null
@@ -1,113 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.ComponentModel;
-using System.Runtime.InteropServices;
-using MS.WindowsAPICodePack.Internal;
-
-namespace Microsoft.WindowsAPICodePack.ApplicationServices
-{
- internal static class Power
- {
- internal static PowerManagementNativeMethods.SystemPowerCapabilities
- GetSystemPowerCapabilities()
- {
- IntPtr status = IntPtr.Zero;
- PowerManagementNativeMethods.SystemPowerCapabilities powerCap;
-
- try
- {
- status = Marshal.AllocCoTaskMem(
- Marshal.SizeOf(typeof(PowerManagementNativeMethods.SystemPowerCapabilities)));
-
- uint retval = PowerManagementNativeMethods.CallNtPowerInformation(
- 4, // SystemPowerCapabilities
- (IntPtr)null,
- 0,
- status,
- (UInt32)Marshal.SizeOf(typeof(PowerManagementNativeMethods.SystemPowerCapabilities))
- );
-
- if (retval == CoreNativeMethods.STATUS_ACCESS_DENIED)
- {
- throw new UnauthorizedAccessException("The caller had insufficient access rights to get the system power capabilities.");
- }
-
- powerCap = (PowerManagementNativeMethods.SystemPowerCapabilities)Marshal.PtrToStructure(status, typeof(PowerManagementNativeMethods.SystemPowerCapabilities));
- }
- finally
- {
- Marshal.FreeCoTaskMem(status);
- }
-
- return powerCap;
- }
-
- internal static PowerManagementNativeMethods.SystemBatteryState GetSystemBatteryState()
- {
- IntPtr status = IntPtr.Zero;
- PowerManagementNativeMethods.SystemBatteryState batt_status;
-
- try
- {
- status = Marshal.AllocCoTaskMem(Marshal.SizeOf(typeof(PowerManagementNativeMethods.SystemBatteryState)));
- uint retval = PowerManagementNativeMethods.CallNtPowerInformation(
- 5, // SystemBatteryState
- (IntPtr)null,
- 0,
- status,
- (UInt32)Marshal.SizeOf(typeof(PowerManagementNativeMethods.SystemBatteryState))
- );
-
- if (retval == CoreNativeMethods.STATUS_ACCESS_DENIED)
- {
- throw new UnauthorizedAccessException("The caller had insufficient access rights to get the system battery state.");
- }
-
- batt_status = (PowerManagementNativeMethods.SystemBatteryState)Marshal.PtrToStructure(status, typeof(PowerManagementNativeMethods.SystemBatteryState));
- }
- finally
- {
- Marshal.FreeCoTaskMem(status);
- }
-
- return batt_status;
- }
-
- ///
- /// Registers the application to receive power setting notifications
- /// for the specific power setting event.
- ///
- /// Handle indicating where the power setting
- /// notifications are to be sent.
- /// The GUID of the power setting for
- /// which notifications are to be sent.
- /// Returns a notification handle for unregistering
- /// power notifications.
- internal static int RegisterPowerSettingNotification(
- IntPtr handle, Guid powerSetting)
- {
- int outHandle = PowerManagementNativeMethods.RegisterPowerSettingNotification(
- handle,
- ref powerSetting,
- 0);
-
- return outHandle;
- }
-
- ///
- /// Allows an application to inform the system that it
- /// is in use, thereby preventing the system from entering
- /// the sleeping power state or turning off the display
- /// while the application is running.
- ///
- /// The thread's execution requirements.
- /// Thrown if the SetThreadExecutionState call fails.
- internal static void SetThreadExecutionState(ExecutionState flags)
- {
- ExecutionState? ret = PowerManagementNativeMethods.SetThreadExecutionState(flags);
- if (ret == null)
- throw new Win32Exception("SetThreadExecutionState call failed.");
- }
- }
-}
\ No newline at end of file
diff --git a/src/External/WindowsAPICodePack/Core/PowerManagement/PowerManager.cs b/src/External/WindowsAPICodePack/Core/PowerManagement/PowerManager.cs
deleted file mode 100644
index a80d73b..0000000
--- a/src/External/WindowsAPICodePack/Core/PowerManagement/PowerManager.cs
+++ /dev/null
@@ -1,423 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using MS.WindowsAPICodePack.Internal;
-
-namespace Microsoft.WindowsAPICodePack.ApplicationServices
-{
- ///
- /// Enables registration for
- /// power-related event notifications and provides access to power settings.
- ///
- public static class PowerManager
- {
- internal static PowerPersonality? powerPersonality;
- internal static PowerSource? powerSource;
- internal static int? batteryLifePercent;
- internal static bool? isMonitorOn;
- internal static bool monitorRequired;
- internal static bool requestBlockSleep;
-
- private static readonly object personalitylock = new object();
- private static readonly object powersrclock = new object();
- private static readonly object batterylifelock = new object();
- private static readonly object monitoronlock = new object();
-
-
- #region Notifications
-
- ///
- /// Raised each time the active power scheme changes.
- ///
- /// The event handler specified for removal was not registered.
- /// Requires Vista/Windows Server 2008.
- public static event EventHandler PowerPersonalityChanged
- {
- add
- {
-
-
- MessageManager.RegisterPowerEvent(
- EventManager.PowerPersonalityChange, value);
- }
-
- remove
- {
- CoreHelpers.ThrowIfNotVista();
-
- MessageManager.UnregisterPowerEvent(
- EventManager.PowerPersonalityChange, value);
- }
- }
-
- ///
- /// Raised when the power source changes.
- ///
- /// The event handler specified for removal was not registered.
- /// Requires Vista/Windows Server 2008.
- public static event EventHandler PowerSourceChanged
- {
- add
- {
- CoreHelpers.ThrowIfNotVista();
-
- MessageManager.RegisterPowerEvent(
- EventManager.PowerSourceChange, value);
- }
-
- remove
- {
- CoreHelpers.ThrowIfNotVista();
-
- MessageManager.UnregisterPowerEvent(
- EventManager.PowerSourceChange, value);
- }
- }
-
- ///
- /// Raised when the remaining battery life changes.
- ///
- /// The event handler specified for removal was not registered.
- /// Requires Vista/Windows Server 2008.
- public static event EventHandler BatteryLifePercentChanged
- {
- add
- {
- CoreHelpers.ThrowIfNotVista();
-
- MessageManager.RegisterPowerEvent(
- EventManager.BatteryCapacityChange, value);
- }
- remove
- {
- CoreHelpers.ThrowIfNotVista();
-
- MessageManager.UnregisterPowerEvent(
- EventManager.BatteryCapacityChange, value);
- }
- }
-
- ///
- /// Raised when the monitor status changes.
- ///
- /// The event handler specified for removal was not registered.
- /// Requires Vista/Windows Server 2008.
- public static event EventHandler IsMonitorOnChanged
- {
- add
- {
- CoreHelpers.ThrowIfNotVista();
-
- MessageManager.RegisterPowerEvent(
- EventManager.MonitorPowerStatus, value);
- }
- remove
- {
- CoreHelpers.ThrowIfNotVista();
-
- MessageManager.UnregisterPowerEvent(
- EventManager.MonitorPowerStatus, value);
- }
- }
-
- ///
- /// Raised when the system will not be moving into an idle
- /// state in the near future so applications should
- /// perform any tasks that
- /// would otherwise prevent the computer from entering an idle state.
- ///
- /// The event handler specified for removal was not registered.
- /// Requires Vista/Windows Server 2008.
- public static event EventHandler SystemBusyChanged
- {
- add
- {
- CoreHelpers.ThrowIfNotVista();
-
- MessageManager.RegisterPowerEvent(
- EventManager.BackgroundTaskNotification, value);
- }
- remove
- {
- CoreHelpers.ThrowIfNotVista();
-
- MessageManager.UnregisterPowerEvent(
- EventManager.BackgroundTaskNotification, value);
- }
- }
- #endregion
-
- ///
- /// Gets a snapshot of the current battery state.
- ///
- /// A instance that represents
- /// the state of the battery at the time this method was called.
- /// The system does not have a battery.
- /// Requires XP/Windows Server 2003 or higher.
-
- public static BatteryState GetCurrentBatteryState()
- {
- CoreHelpers.ThrowIfNotXP();
-
- if (!Power.GetSystemBatteryState().BatteryPresent)
- throw new InvalidOperationException(
- "Battery is not present on this system.");
-
- return new BatteryState();
- }
-
- #region Power System Properties
-
- ///
- /// Gets or sets a value that indicates whether the monitor is
- /// set to remain active.
- ///
- /// Requires XP/Windows Server 2003 or higher.
- /// The caller does not have sufficient privileges to set this property.
- ///
- /// This information is typically used by applications
- /// that display information but do not require
- /// user interaction. For example, video playback applications.
- /// to set this property. Demand value: ; Named Permission Sets: FullTrust.
- /// A value. True if the monitor
- /// is required to remain on.
- public static bool MonitorRequired
- {
- get
- {
- CoreHelpers.ThrowIfNotXP();
- return monitorRequired;
- }
- [System.Security.Permissions.PermissionSetAttribute(System.Security.Permissions.SecurityAction.Demand, Name = "FullTrust")]
- set
- {
- CoreHelpers.ThrowIfNotXP();
-
- if (value)
- {
- Power.SetThreadExecutionState(ExecutionState.Continuous | ExecutionState.DisplayRequired);
- }
- else
- {
- Power.SetThreadExecutionState(ExecutionState.Continuous);
- }
-
- monitorRequired = value;
- }
- }
-
- ///
- /// Gets or sets a value that indicates whether the system
- /// is required to be in the working state.
- ///
- /// Requires XP/Windows Server 2003 or higher.
- /// The caller does not have sufficient privileges to set this property.
- ///
- /// to set this property. Demand value: ; Named Permission Sets: FullTrust.
- /// A value.
- public static bool RequestBlockSleep
- {
- get
- {
- CoreHelpers.ThrowIfNotXP();
-
- return requestBlockSleep;
- }
- [System.Security.Permissions.PermissionSetAttribute(System.Security.Permissions.SecurityAction.Demand, Name = "FullTrust")]
- set
- {
- CoreHelpers.ThrowIfNotXP();
-
- if (value)
- Power.SetThreadExecutionState(ExecutionState.Continuous | ExecutionState.SystemRequired);
- else
- Power.SetThreadExecutionState(ExecutionState.Continuous);
-
- requestBlockSleep = value;
- }
- }
-
- ///
- /// Gets a value that indicates whether a battery is present.
- /// The battery can be a short term battery.
- ///
- /// Requires XP/Windows Server 2003 or higher.
- /// A value.
- public static bool IsBatteryPresent
- {
- get
- {
- CoreHelpers.ThrowIfNotXP();
-
- return Power.GetSystemBatteryState().BatteryPresent;
- }
- }
-
- ///
- /// Gets a value that indicates whether the battery is a short term battery.
- ///
- /// Requires XP/Windows Server 2003 or higher.
- /// A value.
- public static bool IsBatteryShortTerm
- {
- get
- {
- CoreHelpers.ThrowIfNotXP();
- return Power.GetSystemPowerCapabilities().BatteriesAreShortTerm;
- }
- }
-
- ///
- /// Gets a value that indicates a UPS is present to prevent
- /// sudden loss of power.
- ///
- /// Requires XP/Windows Server 2003 or higher.
- /// A value.
- public static bool IsUpsPresent
- {
- get
- {
- CoreHelpers.ThrowIfNotXP();
-
- // Because the native method doesn't return the correct value for .UpsPresent,
- // use .BatteriesAreShortTerm and .SystemBatteriesPresent to check for UPS
- PowerManagementNativeMethods.SystemPowerCapabilities batt = Power.GetSystemPowerCapabilities();
-
- return (batt.BatteriesAreShortTerm && batt.SystemBatteriesPresent);
- }
- }
-
- ///
- /// Gets a value that indicates the current power scheme.
- ///
- /// Requires Vista/Windows Server 2008.
- /// A value.
- public static PowerPersonality PowerPersonality
- {
- get
- {
- CoreHelpers.ThrowIfNotVista();
-
- // The only way to get the current power personality is
- // to register for an event so if the
- // personality value has not been set yet,
- // a dummy event needs to be registered. All
- // subsequent calls to this property get the value from memory.
- if (powerPersonality == null)
- {
- lock (personalitylock)
- {
- if (powerPersonality == null)
- {
- EventHandler dummy = delegate(object sender, EventArgs args) { };
- PowerPersonalityChanged += dummy;
- // Wait until Windows updates the personality
- // (through RegisterPowerSettingNotification).
- EventManager.personalityReset.WaitOne();
- }
- }
- }
- return (PowerPersonality)powerPersonality;
- }
- }
-
- ///
- /// Gets a value that indicates the remaining battery life
- /// (as a percentage of the full battery charge).
- /// This value is in the range 0-100,
- /// where 0 is not charged and 100 is fully charged.
- ///
- /// The system does not have a battery.
- /// Requires Vista/Windows Server 2008.
- /// An value.
- public static int BatteryLifePercent
- {
- get
- {
- if (!Power.GetSystemBatteryState().BatteryPresent)
- throw new InvalidOperationException(
- "Battery is not present on the system.");
-
- CoreHelpers.ThrowIfNotVista();
-
- if (batteryLifePercent == null)
- {
- lock (batterylifelock)
- {
- if (batteryLifePercent == null)
- {
- EventHandler dummy = delegate(object sender, EventArgs args) { };
- BatteryLifePercentChanged += dummy;
- // Wait until Windows updates the personality
- // (through RegisterPowerSettingNotification).
- EventManager.batteryLifeReset.WaitOne();
- }
- }
- }
- return (int)batteryLifePercent;
- }
- }
-
- ///
- /// Gets a value that indictates whether the monitor is on.
- ///
- /// Requires Vista/Windows Server 2008.
- /// A value.
- public static bool IsMonitorOn
- {
- get
- {
- CoreHelpers.ThrowIfNotVista();
-
- if (isMonitorOn == null)
- {
- lock (monitoronlock)
- {
- if (isMonitorOn == null)
- {
- EventHandler dummy = delegate(object sender, EventArgs args) { };
- IsMonitorOnChanged += dummy;
- // Wait until Windows updates the power source
- // (through RegisterPowerSettingNotification)
- EventManager.monitorOnReset.WaitOne();
- }
- }
- }
-
- return (bool)isMonitorOn;
- }
- }
-
- ///
- /// Gets the current power source.
- ///
- /// Requires Vista/Windows Server 2008.
- /// A value.
- public static PowerSource PowerSource
- {
- get
- {
- CoreHelpers.ThrowIfNotVista();
-
- if (powerSource == null)
- {
- lock (powersrclock)
- {
- if (powerSource == null)
- {
- EventHandler dummy = delegate(object sender, EventArgs args) { ;};
- PowerSourceChanged += dummy;
- // Wait until Windows updates the power source
- // (through RegisterPowerSettingNotification).
- EventManager.powerSrcReset.WaitOne();
- }
- }
- }
-
- return (PowerSource)powerSource;
- }
- }
- #endregion
-
- }
-}
diff --git a/src/External/WindowsAPICodePack/Core/PowerManagement/PowerPersonality.cs b/src/External/WindowsAPICodePack/Core/PowerManagement/PowerPersonality.cs
deleted file mode 100644
index 421a45d..0000000
--- a/src/External/WindowsAPICodePack/Core/PowerManagement/PowerPersonality.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-namespace Microsoft.WindowsAPICodePack.ApplicationServices
-{
- ///
- /// Specifies the supported power personalities.
- ///
- public enum PowerPersonality
- {
- ///
- /// Power settings designed to deliver maximum performance
- /// at the expense of power consumption savings.
- ///
- HighPerformance,
-
- ///
- /// Power settings designed consume minimum power
- /// at the expense of system performance and responsiveness.
- ///
- PowerSaver,
-
- ///
- /// Power settings designed to balance performance
- /// and power consumption.
- ///
- Automatic
- }
-
-}
diff --git a/src/External/WindowsAPICodePack/Core/PowerManagement/PowerSource.cs b/src/External/WindowsAPICodePack/Core/PowerManagement/PowerSource.cs
deleted file mode 100644
index ca93f25..0000000
--- a/src/External/WindowsAPICodePack/Core/PowerManagement/PowerSource.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-namespace Microsoft.WindowsAPICodePack.ApplicationServices
-{
- ///
- /// Specifies the power source currently supplying power to the system.
- ///
- /// Application should be aware of the power source because
- /// some power sources provide a finite power supply.
- /// An application might take steps to conserve power while
- /// the system is using such a source.
- ///
- public enum PowerSource
- {
- ///
- /// The computer is powered by an AC power source
- /// or a similar device, such as a laptop powered
- /// by a 12V automotive adapter.
- ///
- AC = 0,
- ///
- /// The computer is powered by a built-in battery.
- /// A battery has a limited
- /// amount of power; applications should conserve resources
- /// where possible.
- ///
- Battery = 1,
- ///
- /// The computer is powered by a short-term power source
- /// such as a UPS device.
- ///
- Ups = 2
- }
-}
diff --git a/src/External/WindowsAPICodePack/Core/Properties/AssemblyInfo.cs b/src/External/WindowsAPICodePack/Core/Properties/AssemblyInfo.cs
deleted file mode 100644
index b1554a8..0000000
--- a/src/External/WindowsAPICodePack/Core/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("Microsoft.WindowsAPICodePack")]
-[assembly: AssemblyDescription("WindowsAPICodePack Core")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Microsoft")]
-[assembly: AssemblyProduct("Microsoft Windows API Code Pack for .NET Framework")]
-[assembly: AssemblyCopyright("Copyright © Microsoft 2009")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("ac9740bc-3035-43ee-9a68-1dde36ab1f5e")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/src/External/WindowsAPICodePack/Core/PropertySystem/PropVariant.cs b/src/External/WindowsAPICodePack/Core/PropertySystem/PropVariant.cs
deleted file mode 100644
index a9224c4..0000000
--- a/src/External/WindowsAPICodePack/Core/PropertySystem/PropVariant.cs
+++ /dev/null
@@ -1,958 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-namespace MS.WindowsAPICodePack.Internal
-{
- using System;
- using System.Runtime.InteropServices;
- using System.Diagnostics;
- using Microsoft.WindowsAPICodePack.Shell.PropertySystem;
-
- ///
- /// Represents the OLE struct PROPVARIANT.
- /// This class is intended for internal use only.
- ///
- ///
- /// Must call Clear when finished to avoid memory leaks. If you get the value of
- /// a VT_UNKNOWN prop, an implicit AddRef is called, thus your reference will
- /// be active even after the PropVariant struct is cleared.
- /// Correct usage:
- ///
- /// PropVariant propVar;
- /// GetProp(out propVar);
- /// try
- /// {
- /// object value = propVar.Value;
- /// }
- /// finally { propVar.Clear(); }
- ///
- /// Originally sourced from http://blogs.msdn.com/adamroot/pages/interop-with-propvariants-in-net.aspx
- /// and modified to support additional types inculding vectors and ability to set values
- ///
- [StructLayout(LayoutKind.Sequential)]
- public struct PropVariant
- {
- #region Fields
-
- // The layout of these elements needs to be maintained.
- //
- // NOTE: We could use LayoutKind.Explicit, but we want
- // to maintain that the IntPtr may be 8 bytes on
- // 64-bit architectures, so we'll let the CLR keep
- // us aligned.
- //
-
- // This is actually a VarEnum value, but the VarEnum type
- // requires 4 bytes instead of the expected 2.
- ushort valueType;
-
- // Reserved Fields
- ushort wReserved1;
- ushort wReserved2;
- ushort wReserved3;
-
-
- // In order to allow x64 compat, we need to allow for
- // expansion of the IntPtr. However, the BLOB struct
- // uses a 4-byte int, followed by an IntPtr, so
- // although the valueData field catches most pointer values,
- // we need an additional 4-bytes to get the BLOB
- // pointer. The valueDataExt field provides this, as well as
- // the last 4-bytes of an 8-byte value on 32-bit
- // architectures.
- IntPtr valueData;
- Int32 valueDataExt;
- #endregion // struct fields
-
- #region public Methods
-
- ///
- /// Creates a PropVariant from an object
- ///
- /// The object containing the data.
- /// An initialized PropVariant
- public static PropVariant FromObject( object value )
- {
- PropVariant propVar = new PropVariant( );
-
- if( value == null )
- {
- propVar.Clear( );
- return propVar;
- }
-
- if( value.GetType( ) == typeof( string ) )
- {
- //Strings require special consideration, because they cannot be empty as well
- if( String.IsNullOrEmpty( value as string ) || String.IsNullOrEmpty( (value as string).Trim( ) ) )
- throw new ArgumentException( "String argument cannot be null or empty." );
- propVar.SetString( value as string );
- }
- else if( value.GetType( ) == typeof( bool? ) )
- {
- propVar.SetBool( (value as bool?).Value );
- }
- else if( value.GetType( ) == typeof( bool ) )
- {
- propVar.SetBool( (bool)value );
- }
- else if( value.GetType( ) == typeof( byte? ) )
- {
- propVar.SetByte( (value as byte?).Value );
- }
- else if( value.GetType( ) == typeof( byte ) )
- {
- propVar.SetByte( (byte)value );
- }
- else if( value.GetType( ) == typeof( sbyte? ) )
- {
- propVar.SetSByte( (value as sbyte?).Value );
- }
- else if( value.GetType( ) == typeof( sbyte ) )
- {
- propVar.SetSByte( (sbyte)value );
- }
- else if( value.GetType( ) == typeof( short? ) )
- {
- propVar.SetShort( (value as short?).Value );
- }
- else if( value.GetType( ) == typeof( short ) )
- {
- propVar.SetShort( (short)value );
- }
- else if( value.GetType( ) == typeof( ushort? ) )
- {
- propVar.SetUShort( (value as ushort?).Value );
- }
- else if( value.GetType( ) == typeof( ushort ) )
- {
- propVar.SetUShort( (ushort)value );
- }
- else if( value.GetType( ) == typeof( int? ) )
- {
- propVar.SetInt( (value as int?).Value );
- }
- else if( value.GetType( ) == typeof( int ) )
- {
- propVar.SetInt( (int)value );
- }
- else if( value.GetType( ) == typeof( uint? ) )
- {
- propVar.SetUInt( (value as uint?).Value );
- }
- else if( value.GetType( ) == typeof( uint ) )
- {
- propVar.SetUInt( (uint)value );
- }
- else if( value.GetType( ) == typeof( long? ) )
- {
- propVar.SetLong( (value as long?).Value );
- }
- else if( value.GetType( ) == typeof( long ) )
- {
- propVar.SetLong( (long)value );
- }
- else if( value.GetType( ) == typeof( ulong? ) )
- {
- propVar.SetULong( (value as ulong?).Value );
- }
- else if( value.GetType( ) == typeof( ulong ) )
- {
- propVar.SetULong( (ulong)value );
- }
- else if( value.GetType( ) == typeof( double? ) )
- {
- propVar.SetDouble( (value as double?).Value );
- }
- else if( value.GetType( ) == typeof( double ) )
- {
- propVar.SetDouble( (double)value );
- }
- else if( value.GetType( ) == typeof( float? ) )
- {
- propVar.SetDouble( (double)((value as float?).Value) );
- }
- else if( value.GetType( ) == typeof( float ) )
- {
- propVar.SetDouble( (double)(float)value );
- }
- else if( value.GetType( ) == typeof( DateTime? ) )
- {
- propVar.SetDateTime( (value as DateTime?).Value );
- }
- else if( value.GetType( ) == typeof( DateTime ) )
- {
- propVar.SetDateTime( (DateTime)value );
- }
- else if( value.GetType( ) == typeof( string[ ] ) )
- {
- propVar.SetStringVector( (value as string[ ]) );
- }
- else if( value.GetType( ) == typeof( short[ ] ) )
- {
- propVar.SetShortVector( (value as short[ ]) );
- }
- else if( value.GetType( ) == typeof( ushort[ ] ) )
- {
- propVar.SetUShortVector( (value as ushort[ ]) );
- }
- else if( value.GetType( ) == typeof( int[ ] ) )
- {
- propVar.SetIntVector( (value as int[ ]) );
- }
- else if( value.GetType( ) == typeof( uint[ ] ) )
- {
- propVar.SetUIntVector( (value as uint[ ]) );
- }
- else if( value.GetType( ) == typeof( long[ ] ) )
- {
- propVar.SetLongVector( (value as long[ ]) );
- }
- else if( value.GetType( ) == typeof( ulong[ ] ) )
- {
- propVar.SetULongVector( (value as ulong[ ]) );
- }
- else if( value.GetType( ) == typeof( DateTime[ ] ) )
- {
- propVar.SetDateTimeVector( (value as DateTime[ ]) );
- }
- else if( value.GetType( ) == typeof( bool[ ] ) )
- {
- propVar.SetBoolVector( (value as bool[ ]) );
- }
- else
- {
- throw new ArgumentException( "This Value type is not supported." );
- }
-
- return propVar;
- }
-
-
- ///
- /// Called to clear the PropVariant's referenced and local memory.
- ///
- ///
- /// You must call Clear to avoid memory leaks.
- ///
- public void Clear()
- {
- // Can't pass "this" by ref, so make a copy to call PropVariantClear with
- PropVariant var = this;
- PropVariantNativeMethods.PropVariantClear(ref var);
-
- // Since we couldn't pass "this" by ref, we need to clear the member fields manually
- // NOTE: PropVariantClear already freed heap data for us, so we are just setting
- // our references to null.
- valueType = (ushort)VarEnum.VT_EMPTY;
- wReserved1 = wReserved2 = wReserved3 = 0;
- valueData = IntPtr.Zero;
- valueDataExt = 0;
- }
-
- ///
- /// Set a string value
- ///
- /// The new value to set.
- public void SetString(string value)
- {
- valueType = (ushort)VarEnum.VT_LPWSTR;
- valueData = Marshal.StringToCoTaskMemUni(value);
- }
-
- ///
- /// Set a string vector
- ///
- /// The new value to set.
- public void SetStringVector(string[] value)
- {
- PropVariant propVar;
- PropVariantNativeMethods.InitPropVariantFromStringVector(value, (uint) value.Length, out propVar);
- CopyData(propVar);
-
- }
-
- ///
- /// Set a bool vector
- ///
- /// The new value to set.
- public void SetBoolVector(bool[] value)
- {
- PropVariant propVar;
- PropVariantNativeMethods.InitPropVariantFromBooleanVector(value, (uint)value.Length, out propVar);
- CopyData(propVar);
- }
-
- ///
- /// Set a short vector
- ///
- /// The new value to set.
- public void SetShortVector(short[] value)
- {
- PropVariant propVar;
- PropVariantNativeMethods.InitPropVariantFromInt16Vector(value, (uint)value.Length, out propVar);
- CopyData(propVar);
- }
-
- ///
- /// Set a short vector
- ///
- /// The new value to set.
- public void SetUShortVector(ushort[] value)
- {
- PropVariant propVar;
- PropVariantNativeMethods.InitPropVariantFromUInt16Vector(value, (uint)value.Length, out propVar);
- CopyData(propVar);
- }
-
- ///
- /// Set an int vector
- ///
- /// The new value to set.
- public void SetIntVector(int[] value)
- {
- PropVariant propVar;
- PropVariantNativeMethods.InitPropVariantFromInt32Vector(value, (uint)value.Length, out propVar);
- CopyData(propVar);
- }
-
- ///
- /// Set an uint vector
- ///
- /// The new value to set.
- public void SetUIntVector(uint[] value)
- {
- PropVariant propVar;
- PropVariantNativeMethods.InitPropVariantFromUInt32Vector(value, (uint)value.Length, out propVar);
- CopyData(propVar);
- }
-
- ///
- /// Set a long vector
- ///
- /// The new value to set.
- public void SetLongVector(long[] value)
- {
- PropVariant propVar;
- PropVariantNativeMethods.InitPropVariantFromInt64Vector(value, (uint)value.Length, out propVar);
- CopyData(propVar);
- }
-
- ///
- /// Set a ulong vector
- ///
- /// The new value to set.
- public void SetULongVector(ulong[] value)
- {
- PropVariant propVar;
- PropVariantNativeMethods.InitPropVariantFromUInt64Vector(value, (uint)value.Length, out propVar);
- CopyData(propVar);
- }
-
- ///
- /// Set a double vector
- ///
- /// The new value to set.
- public void SetDoubleVector(double[] value)
- {
- PropVariant propVar;
- PropVariantNativeMethods.InitPropVariantFromDoubleVector(value, (uint)value.Length, out propVar);
- CopyData(propVar);
- }
-
- ///
- /// Set a DateTime vector
- ///
- /// The new value to set.
- public void SetDateTimeVector(DateTime[] value)
- {
- System.Runtime.InteropServices.ComTypes.FILETIME[] fileTimeArr =
- new System.Runtime.InteropServices.ComTypes.FILETIME[value.Length];
-
- for (int i = 0; i < value.Length; i++ )
- {
- fileTimeArr[i] = DateTimeTotFileTime(value[i]);
- }
-
- PropVariant propVar;
- PropVariantNativeMethods.InitPropVariantFromFileTimeVector(fileTimeArr, (uint)fileTimeArr.Length, out propVar);
- CopyData(propVar);
- }
-
- ///
- /// Set an IUnknown value
- ///
- /// The new value to set.
- public void SetIUnknown(object value)
- {
- valueType = (ushort)VarEnum.VT_UNKNOWN;
- valueData = Marshal.GetIUnknownForObject(value);
- }
-
- ///
- /// Set a bool value
- ///
- /// The new value to set.
- public void SetBool(bool value)
- {
- valueType = (ushort)VarEnum.VT_BOOL;
- valueData = (value == true) ? (IntPtr)(-1) : (IntPtr)0;
- }
-
- ///
- /// Set a DateTime value
- ///
- /// The new value to set.
- public void SetDateTime(DateTime value)
- {
- valueType = (ushort)VarEnum.VT_FILETIME;
-
- PropVariant propVar;
- System.Runtime.InteropServices.ComTypes.FILETIME ft = DateTimeTotFileTime(value);
- PropVariantNativeMethods.InitPropVariantFromFileTime(ref ft, out propVar);
- CopyData(propVar);
- }
-
- ///
- /// Set a safe array value
- ///
- /// The new value to set.
- public void SetSafeArray(Array array)
- {
- const ushort vtUnknown = 13;
- IntPtr psa = PropVariantNativeMethods.SafeArrayCreateVector(vtUnknown, 0, (uint)array.Length);
-
- IntPtr pvData = PropVariantNativeMethods.SafeArrayAccessData(psa);
- try // to remember to release lock on data
- {
- for (int i = 0; i < array.Length; ++i)
- {
- object obj = array.GetValue(i);
- IntPtr punk = (obj != null) ? Marshal.GetIUnknownForObject(obj) : IntPtr.Zero;
- Marshal.WriteIntPtr(pvData, i * IntPtr.Size, punk);
- }
- }
- finally
- {
- PropVariantNativeMethods.SafeArrayUnaccessData(psa);
- }
-
- this.valueType = (ushort)VarEnum.VT_ARRAY | (ushort)VarEnum.VT_UNKNOWN;
- this.valueData = psa;
- }
-
- ///
- /// Set a byte value
- ///
- /// The new value to set.
- public void SetByte(byte value)
- {
- valueType = (ushort)VarEnum.VT_UI1;
- valueData = (IntPtr)value;
- }
-
- ///
- /// Set a sbyte value
- ///
- /// The new value to set.
- public void SetSByte(sbyte value)
- {
- valueType = (ushort)VarEnum.VT_I1;
- valueData = (IntPtr)value;
- }
-
- ///
- /// Set a short value
- ///
- /// The new value to set.
- public void SetShort(short value)
- {
- valueType = (ushort)VarEnum.VT_I2;
- valueData = (IntPtr)value;
- }
-
- ///
- /// Set an unsigned short value
- ///
- /// The new value to set.
- public void SetUShort(ushort value)
- {
- valueType = (ushort)VarEnum.VT_UI2;
- valueData = (IntPtr)value;
- }
-
- ///
- /// Set an int value
- ///
- /// The new value to set.
- public void SetInt(int value)
- {
- valueType = (ushort)VarEnum.VT_I4;
- valueData = (IntPtr)value;
- }
-
- ///
- /// Set an unsigned int value
- ///
- /// The new value to set.
- public void SetUInt(uint value)
- {
- valueType = (ushort)VarEnum.VT_UI4;
- valueData = (IntPtr)(int)value;
- }
-
- ///
- /// Set a decimal value
- ///
- /// The new value to set.
- public void SetDecimal(decimal value)
- {
- int[] bits = Decimal.GetBits(value);
- valueData = (IntPtr)bits[0];
- valueDataExt = bits[1];
- wReserved3 = (ushort)(bits[2] >> 16);
- wReserved2 = (ushort)(bits[2] & 0x0000FFFF);
- wReserved1 = (ushort)(bits[3] >> 16);
- valueType = (ushort)VarEnum.VT_DECIMAL;
- }
-
- ///
- /// Set a long
- ///
- /// The new value to set.
- public void SetLong(long value)
- {
- long[] valueArr = new long[] { value };
-
- PropVariant propVar;
- PropVariantNativeMethods.InitPropVariantFromInt64Vector(valueArr, 1, out propVar);
-
- CreatePropVariantFromVectorElement(propVar);
- }
-
- ///
- /// Set a ulong
- ///
- /// The new value to set.
- public void SetULong(ulong value)
- {
- PropVariant propVar;
- ulong[] valueArr = new ulong[] { value };
- PropVariantNativeMethods.InitPropVariantFromUInt64Vector(valueArr, 1, out propVar);
-
- CreatePropVariantFromVectorElement(propVar);
- }
-
- ///
- /// Set a double
- ///
- /// The new value to set.
- public void SetDouble(double value)
- {
- double[] valueArr = new double[] { value };
-
- PropVariant propVar;
- PropVariantNativeMethods.InitPropVariantFromDoubleVector(valueArr, 1, out propVar);
-
- CreatePropVariantFromVectorElement(propVar);
- }
-
- ///
- /// Sets the value type to empty
- ///
- public void SetEmptyValue()
- {
- valueType = (ushort) VarEnum.VT_EMPTY;
- }
-
- ///
- /// Checks if this has an empty or null value
- ///
- ///
- public bool IsNullOrEmpty
- {
- get
- {
- return (valueType == (ushort)VarEnum.VT_EMPTY || valueType == (ushort)VarEnum.VT_NULL);
- }
- }
-
- #endregion
-
- #region public Properties
-
- ///
- /// Gets or sets the variant type.
- ///
- public VarEnum VarType
- {
- get { return (VarEnum)valueType; }
- set { valueType = (ushort) value; }
- }
-
- ///
- /// Gets the variant value.
- ///
- public object Value
- {
- get
- {
- switch ((VarEnum)valueType)
- {
- case VarEnum.VT_I1:
- return cVal;
- case VarEnum.VT_UI1:
- return bVal;
- case VarEnum.VT_I2:
- return iVal;
- case VarEnum.VT_UI2:
- return uiVal;
- case VarEnum.VT_I4:
- case VarEnum.VT_INT:
- return lVal;
- case VarEnum.VT_UI4:
- case VarEnum.VT_UINT:
- return ulVal;
- case VarEnum.VT_I8:
- return hVal;
- case VarEnum.VT_UI8:
- return uhVal;
- case VarEnum.VT_R4:
- return fltVal;
- case VarEnum.VT_R8:
- return dblVal;
- case VarEnum.VT_BOOL:
- return boolVal;
- case VarEnum.VT_ERROR:
- return scode;
- case VarEnum.VT_CY:
- return cyVal;
- case VarEnum.VT_DATE:
- return date;
- case VarEnum.VT_FILETIME:
- return DateTime.FromFileTime(hVal);
- case VarEnum.VT_BSTR:
- return Marshal.PtrToStringBSTR(valueData);
- case VarEnum.VT_BLOB:
- return GetBlobData();
- case VarEnum.VT_LPSTR:
- return Marshal.PtrToStringAnsi(valueData);
- case VarEnum.VT_LPWSTR:
- return Marshal.PtrToStringUni(valueData);
- case VarEnum.VT_UNKNOWN:
- return Marshal.GetObjectForIUnknown(valueData);
- case VarEnum.VT_DISPATCH:
- return Marshal.GetObjectForIUnknown(valueData);
- case VarEnum.VT_DECIMAL:
- return decVal;
- case VarEnum.VT_ARRAY | VarEnum.VT_UNKNOWN:
- return CrackSingleDimSafeArray(valueData);
- case (VarEnum.VT_VECTOR | VarEnum.VT_LPWSTR):
- return GetStringVector();
- case (VarEnum.VT_VECTOR | VarEnum.VT_I2):
- return GetVector();
- case (VarEnum.VT_VECTOR | VarEnum.VT_UI2):
- return GetVector();
- case (VarEnum.VT_VECTOR | VarEnum.VT_I4):
- return GetVector();
- case (VarEnum.VT_VECTOR | VarEnum.VT_UI4):
- return GetVector();
- case (VarEnum.VT_VECTOR | VarEnum.VT_I8):
- return GetVector();
- case (VarEnum.VT_VECTOR | VarEnum.VT_UI8):
- return GetVector();
- case (VarEnum.VT_VECTOR | VarEnum.VT_R8):
- return GetVector();
- case (VarEnum.VT_VECTOR | VarEnum.VT_BOOL):
- return GetVector();
- case (VarEnum.VT_VECTOR | VarEnum.VT_FILETIME):
- return GetVector();
- default:
- // if the value cannot be marshaled
- return null;
- }
- }
- }
-
- #endregion
-
- #region PropVariant Simple Data types
-
- sbyte cVal // CHAR cVal;
- {
- get { return (sbyte)GetDataBytes()[0]; }
- }
-
- byte bVal // UCHAR bVal;
- {
- get { return GetDataBytes()[0]; }
- }
-
- short iVal // SHORT iVal;
- {
- get { return BitConverter.ToInt16(GetDataBytes(), 0); }
- }
-
- ushort uiVal // USHORT uiVal;
- {
- get { return BitConverter.ToUInt16(GetDataBytes(), 0); }
- }
-
- int lVal // LONG lVal;
- {
- get { return BitConverter.ToInt32(GetDataBytes(), 0); }
- }
-
- uint ulVal // ULONG ulVal;
- {
- get { return BitConverter.ToUInt32(GetDataBytes(), 0); }
- }
-
- long hVal // LARGE_INTEGER hVal;
- {
- get { return BitConverter.ToInt64(GetDataBytes(), 0); }
- }
-
- ulong uhVal // ULARGE_INTEGER uhVal;
- {
- get { return BitConverter.ToUInt64(GetDataBytes(), 0); }
- }
-
- float fltVal // FLOAT fltVal;
- {
- get { return BitConverter.ToSingle(GetDataBytes(), 0); }
- }
-
- double dblVal // DOUBLE dblVal;
- {
- get { return BitConverter.ToDouble(GetDataBytes(), 0); }
- }
-
- bool boolVal // VARIANT_BOOL boolVal;
- {
- get { return (iVal == 0 ? false : true); }
- }
-
- int scode // SCODE scode;
- {
- get { return lVal; }
- }
-
- decimal cyVal // CY cyVal;
- {
- get { return decimal.FromOACurrency(hVal); }
- }
-
- DateTime date // DATE date;
- {
- get { return DateTime.FromOADate(dblVal); }
- }
-
- Decimal decVal // Decimal value
- {
- get
- {
- int[] bits = new int[4];
- bits[0] = (int)valueData;
- bits[1] = valueDataExt;
- bits[2] = (wReserved3 << 16) | wReserved2;
- bits[3] = (wReserved1 << 16);
- return new decimal(bits);
- }
- }
-
- #endregion
-
- #region Private Methods
-
- private void CopyData(PropVariant propVar)
- {
- this.valueType = propVar.valueType;
- this.valueData = propVar.valueData;
- this.valueDataExt = propVar.valueDataExt;
- }
-
- private void CreatePropVariantFromVectorElement(PropVariant propVar)
- {
- //Copy the first vector element to a new PropVariant
- CopyData(propVar);
- PropVariantNativeMethods.InitPropVariantFromPropVariantVectorElem(ref this, 0, out propVar);
-
- //Overwrite the existing data
- CopyData(propVar);
- }
-
- private static long FileTimeToDateTime(ref System.Runtime.InteropServices.ComTypes.FILETIME val)
- {
- return (((long)val.dwHighDateTime) << 32) + val.dwLowDateTime;
- }
-
- private static System.Runtime.InteropServices.ComTypes.FILETIME DateTimeTotFileTime(DateTime value)
- {
- long hFT = value.ToFileTime();
- System.Runtime.InteropServices.ComTypes.FILETIME ft =
- new System.Runtime.InteropServices.ComTypes.FILETIME();
- ft.dwLowDateTime = (int)(hFT & 0xFFFFFFFF);
- ft.dwHighDateTime = (int)(hFT >> 32);
- return ft;
- }
-
- private object GetBlobData()
- {
- byte[] blobData = new byte[lVal];
- IntPtr pBlobData;
- if (IntPtr.Size == 4)
- {
- pBlobData = new IntPtr(valueDataExt);
- }
- else if( IntPtr.Size == 8 )
- {
- // In this case, we need to derive a pointer at offset 12,
- // because the size of the blob is represented as a 4-byte int
- // but the pointer is immediately after that.
- pBlobData = new IntPtr(
- (Int64)(BitConverter.ToInt32( GetDataBytes( ), sizeof( int ) )) +
- (Int64)(BitConverter.ToInt32( GetDataBytes( ), 2 * sizeof( int ) ) << 32) );
- }
- else
- {
- throw new NotSupportedException( );
- }
- Marshal.Copy(pBlobData, blobData, 0, lVal);
-
- return blobData;
- }
-
- private Array GetVector() where T : struct
- {
- int count = PropVariantNativeMethods.PropVariantGetElementCount(ref this);
- if (count <= 0)
- return null;
-
- Array arr = new T[count];
-
- for (uint i = 0; i < count; i++)
- {
- if (typeof(T) == typeof(Int16))
- {
- short val;
- PropVariantNativeMethods.PropVariantGetInt16Elem(ref this, i, out val);
- arr.SetValue(val, i);
- }
- else if (typeof(T) == typeof(UInt16))
- {
- ushort val;
- PropVariantNativeMethods.PropVariantGetUInt16Elem(ref this, i, out val);
- arr.SetValue(val, i);
- }
- else if (typeof(T) == typeof(Int32))
- {
- int val;
- PropVariantNativeMethods.PropVariantGetInt32Elem(ref this, i, out val);
- arr.SetValue(val, i);
- }
- else if (typeof(T) == typeof(UInt32))
- {
- uint val;
- PropVariantNativeMethods.PropVariantGetUInt32Elem(ref this, i, out val);
- arr.SetValue(val, i);
- }
- else if (typeof(T) == typeof(Int64))
- {
- long val;
- PropVariantNativeMethods.PropVariantGetInt64Elem(ref this, i, out val);
- arr.SetValue(val, i);
- }
- else if (typeof(T) == typeof(UInt64))
- {
- ulong val;
- PropVariantNativeMethods.PropVariantGetUInt64Elem(ref this, i, out val);
- arr.SetValue(val, i);
- }
- else if (typeof(T) == typeof(DateTime))
- {
- System.Runtime.InteropServices.ComTypes.FILETIME val;
- PropVariantNativeMethods.PropVariantGetFileTimeElem(ref this, i, out val);
-
- long fileTime = FileTimeToDateTime(ref val);
-
-
- arr.SetValue(DateTime.FromFileTime(fileTime), i);
- }
- else if (typeof(T) == typeof(Boolean))
- {
- bool val;
- PropVariantNativeMethods.PropVariantGetBooleanElem(ref this, i, out val);
- arr.SetValue(val, i);
- }
- else if (typeof(T) == typeof(Double))
- {
- double val;
- PropVariantNativeMethods.PropVariantGetDoubleElem(ref this, i, out val);
- arr.SetValue(val, i);
- }
- else if (typeof(T) == typeof(String))
- {
- string val;
- PropVariantNativeMethods.PropVariantGetStringElem(ref this, i, out val);
- arr.SetValue(val, i);
- }
- }
-
- return arr;
- }
-
- // A string requires a special case because it's not a struct or value type
- private string[] GetStringVector()
- {
- int count = PropVariantNativeMethods.PropVariantGetElementCount(ref this);
- if (count <= 0)
- return null;
-
- string[] strArr = new string[count];
- for (uint i = 0; i < count; i++)
- {
- PropVariantNativeMethods.PropVariantGetStringElem(ref this, i, out strArr[i]);
- }
-
- return strArr;
- }
-
- ///
- /// Gets a byte array containing the data bits of the struct.
- ///
- /// A byte array that is the combined size of the data bits.
- private byte[] GetDataBytes()
- {
- byte[] ret = new byte[IntPtr.Size + sizeof(int)];
- if (IntPtr.Size == 4)
- BitConverter.GetBytes(valueData.ToInt32()).CopyTo(ret, 0);
- else if (IntPtr.Size == 8)
- BitConverter.GetBytes(valueData.ToInt64()).CopyTo(ret, 0);
- BitConverter.GetBytes(valueDataExt).CopyTo(ret, IntPtr.Size);
- return ret;
- }
-
- Array CrackSingleDimSafeArray(IntPtr psa)
- {
- uint cDims = PropVariantNativeMethods.SafeArrayGetDim(psa);
- if (cDims != 1)
- throw new ArgumentException("Multi-dimensional SafeArrays not supported.");
-
- int lBound = PropVariantNativeMethods.SafeArrayGetLBound(psa, 1U);
- int uBound = PropVariantNativeMethods.SafeArrayGetUBound(psa, 1U);
-
- int n = uBound - lBound + 1; // uBound is inclusive
-
- object[] array = new object[n];
- for (int i = lBound; i <= uBound; ++i)
- {
- array[i] = PropVariantNativeMethods.SafeArrayGetElement(psa, ref i);
- }
-
- return array;
- }
-
- #endregion
-
- }
-}
diff --git a/src/External/WindowsAPICodePack/Core/PropertySystem/PropVariantNativeMethods.cs b/src/External/WindowsAPICodePack/Core/PropertySystem/PropVariantNativeMethods.cs
deleted file mode 100644
index e197fee..0000000
--- a/src/External/WindowsAPICodePack/Core/PropertySystem/PropVariantNativeMethods.cs
+++ /dev/null
@@ -1,108 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Runtime.InteropServices;
-using MS.WindowsAPICodePack.Internal;
-
-namespace Microsoft.WindowsAPICodePack.Shell.PropertySystem
-{
- internal static class PropVariantNativeMethods
- {
- [DllImport("Ole32.dll", PreserveSig = false)] // returns hresult
- internal extern static void PropVariantClear([In, Out] ref PropVariant pvar);
-
- [DllImport("OleAut32.dll", PreserveSig = true)] // psa is actually returned, not hresult
- internal extern static IntPtr SafeArrayCreateVector(ushort vt, int lowerBound, uint cElems);
-
- [DllImport("OleAut32.dll", PreserveSig = false)] // returns hresult
- internal extern static IntPtr SafeArrayAccessData(IntPtr psa);
-
- [DllImport("OleAut32.dll", PreserveSig = false)] // returns hresult
- internal extern static void SafeArrayUnaccessData(IntPtr psa);
-
- [DllImport("OleAut32.dll", PreserveSig = true)] // retuns uint32
- internal extern static uint SafeArrayGetDim(IntPtr psa);
-
- [DllImport("OleAut32.dll", PreserveSig = false)] // returns hresult
- internal extern static int SafeArrayGetLBound(IntPtr psa, uint nDim);
-
- [DllImport("OleAut32.dll", PreserveSig = false)] // returns hresult
- internal extern static int SafeArrayGetUBound(IntPtr psa, uint nDim);
-
- // This decl for SafeArrayGetElement is only valid for cDims==1!
- [DllImport("OleAut32.dll", PreserveSig = false)] // returns hresult
- [return: MarshalAs(UnmanagedType.IUnknown)]
- internal extern static object SafeArrayGetElement(IntPtr psa, ref int rgIndices);
-
- [DllImport("propsys.dll", CharSet = CharSet.Unicode, SetLastError = true)]
- internal static extern int InitPropVariantFromPropVariantVectorElem([In] ref PropVariant propvarIn, uint iElem, [Out] out PropVariant ppropvar);
-
- [DllImport("propsys.dll", CharSet = CharSet.Unicode, SetLastError = true)]
- internal static extern uint InitPropVariantFromFileTime([In] ref System.Runtime.InteropServices.ComTypes.FILETIME pftIn, out PropVariant ppropvar);
-
- [DllImport("propsys.dll", CharSet = CharSet.Unicode, SetLastError = true)]
- [return: MarshalAs(UnmanagedType.I4)]
- internal static extern int PropVariantGetElementCount([In] ref PropVariant propVar);
-
- [DllImport("propsys.dll", CharSet = CharSet.Unicode, SetLastError = true)]
- internal static extern void PropVariantGetBooleanElem([In] ref PropVariant propVar, [In]uint iElem, [Out, MarshalAs(UnmanagedType.Bool)] out bool pfVal);
-
- [DllImport("propsys.dll", CharSet = CharSet.Unicode, SetLastError = true)]
- internal static extern void PropVariantGetInt16Elem([In] ref PropVariant propVar, [In] uint iElem, [Out] out short pnVal);
-
- [DllImport("propsys.dll", CharSet = CharSet.Unicode, SetLastError = true)]
- internal static extern void PropVariantGetUInt16Elem([In] ref PropVariant propVar, [In] uint iElem, [Out] out ushort pnVal);
-
- [DllImport("propsys.dll", CharSet = CharSet.Unicode, SetLastError = true)]
- internal static extern void PropVariantGetInt32Elem([In] ref PropVariant propVar, [In] uint iElem, [Out] out int pnVal);
-
- [DllImport("propsys.dll", CharSet = CharSet.Unicode, SetLastError = true)]
- internal static extern void PropVariantGetUInt32Elem([In] ref PropVariant propVar, [In] uint iElem, [Out] out uint pnVal);
-
- [DllImport("propsys.dll", CharSet = CharSet.Unicode, SetLastError = true)]
- internal static extern void PropVariantGetInt64Elem([In] ref PropVariant propVar, [In] uint iElem, [Out] out Int64 pnVal);
-
- [DllImport("propsys.dll", CharSet = CharSet.Unicode, SetLastError = true)]
- internal static extern void PropVariantGetUInt64Elem([In] ref PropVariant propVar, [In] uint iElem, [Out] out UInt64 pnVal);
-
- [DllImport("propsys.dll", CharSet = CharSet.Unicode, SetLastError = true)]
- internal static extern void PropVariantGetDoubleElem([In] ref PropVariant propVar, [In] uint iElem, [Out] out double pnVal);
-
- [DllImport("propsys.dll", CharSet = CharSet.Unicode, SetLastError = true)]
- internal static extern void PropVariantGetFileTimeElem([In] ref PropVariant propVar, [In] uint iElem, [Out, MarshalAs(UnmanagedType.Struct)] out System.Runtime.InteropServices.ComTypes.FILETIME pftVal);
-
- [DllImport("propsys.dll", CharSet = CharSet.Unicode, SetLastError = true)]
- internal static extern void PropVariantGetStringElem([In] ref PropVariant propVar, [In] uint iElem, [Out, MarshalAs(UnmanagedType.LPWStr)] out string ppszVal);
-
-
- [DllImport("propsys.dll", CharSet = CharSet.Unicode, SetLastError = true)]
- internal static extern void InitPropVariantFromBooleanVector([In, Out] bool [] prgf, uint cElems, out PropVariant ppropvar);
-
- [DllImport("propsys.dll", CharSet = CharSet.Unicode, SetLastError = true)]
- internal static extern void InitPropVariantFromInt16Vector([In, Out] Int16 [] prgn, uint cElems, out PropVariant ppropvar);
-
- [DllImport("propsys.dll", CharSet = CharSet.Unicode, SetLastError = true)]
- internal static extern void InitPropVariantFromUInt16Vector([In, Out] UInt16[] prgn, uint cElems, out PropVariant ppropvar);
-
- [DllImport("propsys.dll", CharSet = CharSet.Unicode, SetLastError = true)]
- internal static extern void InitPropVariantFromInt32Vector([In, Out] Int32[] prgn, uint cElems, out PropVariant ppropvar);
-
- [DllImport("propsys.dll", CharSet = CharSet.Unicode, SetLastError = true)]
- internal static extern void InitPropVariantFromUInt32Vector([In, Out] UInt32[] prgn, uint cElems, out PropVariant ppropvar);
-
- [DllImport("propsys.dll", CharSet = CharSet.Unicode, SetLastError = true)]
- internal static extern void InitPropVariantFromInt64Vector([In, Out] Int64[] prgn, uint cElems, out PropVariant ppropvar);
-
- [DllImport("propsys.dll", CharSet = CharSet.Unicode, SetLastError = true)]
- internal static extern void InitPropVariantFromUInt64Vector([In,Out] UInt64[] prgn, uint cElems, out PropVariant ppropvar);
-
- [DllImport("propsys.dll", CharSet = CharSet.Unicode, SetLastError = true)]
- internal static extern void InitPropVariantFromDoubleVector([In, Out] double[] prgn, uint cElems, out PropVariant ppropvar);
-
- [DllImport("propsys.dll", CharSet = CharSet.Unicode, SetLastError = true)]
- internal static extern void InitPropVariantFromFileTimeVector([In, Out] System.Runtime.InteropServices.ComTypes.FILETIME[] prgft, uint cElems, out PropVariant ppropvar);
-
- [DllImport("propsys.dll", CharSet = CharSet.Unicode, SetLastError = true)]
- internal static extern void InitPropVariantFromStringVector([In, Out] string[] prgsz, uint cElems, out PropVariant ppropvar);
- }
-}
diff --git a/src/External/WindowsAPICodePack/Core/PropertySystem/PropertyKey.cs b/src/External/WindowsAPICodePack/Core/PropertySystem/PropertyKey.cs
deleted file mode 100644
index 526c961..0000000
--- a/src/External/WindowsAPICodePack/Core/PropertySystem/PropertyKey.cs
+++ /dev/null
@@ -1,150 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Runtime.InteropServices;
-
-namespace Microsoft.WindowsAPICodePack.Shell.PropertySystem
-{
- ///
- /// Defines a unique key for a Shell Property
- ///
- [StructLayout(LayoutKind.Sequential, Pack = 4)]
- public struct PropertyKey : IEquatable
- {
- #region Private Fields
-
- private Guid formatId;
- private Int32 propertyId;
-
- #endregion
-
- #region Public Properties
- ///
- /// A unique GUID for the property
- ///
- public Guid FormatId
- {
- get
- {
- return formatId;
- }
- }
-
- ///
- /// Property identifier (PID)
- ///
- public Int32 PropertyId
- {
- get
- {
- return propertyId;
- }
- }
-
- #endregion
-
- #region Public Construction
-
- ///
- /// PropertyKey Constructor
- ///
- /// A unique GUID for the property
- /// Property identifier (PID)
- public PropertyKey( Guid formatId, Int32 propertyId )
- {
- this.formatId = formatId;
- this.propertyId = propertyId;
- }
-
- ///
- /// PropertyKey Constructor
- ///
- /// A string represenstion of a GUID for the property
- /// Property identifier (PID)
- public PropertyKey( string formatId, Int32 propertyId )
- {
- this.formatId = new Guid( formatId );
- this.propertyId = propertyId;
- }
-
- #endregion
-
- #region IEquatable Members
-
- ///
- /// Returns whether this object is equal to another. This is vital for performance of value types.
- ///
- /// The object to compare against.
- /// Equality result.
- public bool Equals( PropertyKey other )
- {
- return other.Equals((object)this);
- }
-
- #endregion
-
- #region equality and hashing
-
- ///
- /// Returns the hash code of the object. This is vital for performance of value types.
- ///
- ///
- public override int GetHashCode( )
- {
- return formatId.GetHashCode( ) ^ propertyId;
- }
-
- ///
- /// Returns whether this object is equal to another. This is vital for performance of value types.
- ///
- /// The object to compare against.
- /// Equality result.
- public override bool Equals( object obj )
- {
- if( obj == null )
- return false;
-
- if( !( obj is PropertyKey ) )
- return false;
-
- PropertyKey other = (PropertyKey)obj;
- return other.formatId.Equals( formatId ) && ( other.propertyId == propertyId );
- }
-
- ///
- /// Implements the == (equality) operator.
- ///
- /// Object a.
- /// Object b.
- /// true if object a equals object b. false otherwise.
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "b"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "a")]
- public static bool operator ==( PropertyKey a, PropertyKey b )
- {
- return a.Equals( b );
- }
-
- ///
- /// Implements the != (inequality) operator.
- ///
- /// Object a.
- /// Object b.
- /// true if object a does not equal object b. false otherwise.
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "b"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "a")]
- public static bool operator !=( PropertyKey a, PropertyKey b )
- {
- return !a.Equals( b );
- }
-
- ///
- /// Override ToString() to provide a user friendly string representation
- ///
- /// String representing the property key
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.String.Format(System.String,System.Object,System.Object)")]
- public override string ToString()
- {
- return String.Format("{0}, {1}", formatId.ToString("B"), propertyId);
- }
-
- #endregion
- }
-}
diff --git a/src/External/WindowsAPICodePack/Core/SafeHandles/SafeIconHandle.cs b/src/External/WindowsAPICodePack/Core/SafeHandles/SafeIconHandle.cs
deleted file mode 100644
index 33c9122..0000000
--- a/src/External/WindowsAPICodePack/Core/SafeHandles/SafeIconHandle.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-namespace MS.WindowsAPICodePack.Internal
-{
- ///
- /// Safe Icon Handle
- ///
- public class SafeIconHandle : ZeroInvalidHandle
- {
- ///
- /// Release the handle
- ///
- /// true if handled is release successfully, false otherwise
- protected override bool ReleaseHandle()
- {
- if (CoreNativeMethods.DestroyIcon(handle))
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- }
-}
diff --git a/src/External/WindowsAPICodePack/Core/SafeHandles/SafeRegionHandle.cs b/src/External/WindowsAPICodePack/Core/SafeHandles/SafeRegionHandle.cs
deleted file mode 100644
index 93e283f..0000000
--- a/src/External/WindowsAPICodePack/Core/SafeHandles/SafeRegionHandle.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-namespace MS.WindowsAPICodePack.Internal
-{
- ///
- /// Safe Region Handle
- ///
- public class SafeRegionHandle : ZeroInvalidHandle
- {
- ///
- /// Release the handle
- ///
- /// true if handled is release successfully, false otherwise
- protected override bool ReleaseHandle()
- {
- if (CoreNativeMethods.DeleteObject(handle))
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- }
-}
diff --git a/src/External/WindowsAPICodePack/Core/SafeHandles/SafeWindowHandle.cs b/src/External/WindowsAPICodePack/Core/SafeHandles/SafeWindowHandle.cs
deleted file mode 100644
index b2b8298..0000000
--- a/src/External/WindowsAPICodePack/Core/SafeHandles/SafeWindowHandle.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-namespace MS.WindowsAPICodePack.Internal
-{
- ///
- /// Safe Window Handle
- ///
- public class SafeWindowHandle : ZeroInvalidHandle
- {
- ///
- /// Release the handle
- ///
- /// true if handled is release successfully, false otherwise
- protected override bool ReleaseHandle()
- {
- if (IsInvalid)
- {
- return true;
- }
-
- if (CoreNativeMethods.DestroyWindow(handle) != 0)
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- }
-}
diff --git a/src/External/WindowsAPICodePack/Core/SafeHandles/ZeroInvalidHandle.cs b/src/External/WindowsAPICodePack/Core/SafeHandles/ZeroInvalidHandle.cs
deleted file mode 100644
index 33d6a31..0000000
--- a/src/External/WindowsAPICodePack/Core/SafeHandles/ZeroInvalidHandle.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Runtime.InteropServices;
-
-namespace MS.WindowsAPICodePack.Internal
-{
- ///
- /// Base class for Safe handles with Null IntPtr as invalid
- ///
- public abstract class ZeroInvalidHandle : SafeHandle
- {
- ///
- /// Default constructor
- ///
- protected ZeroInvalidHandle()
- : base(IntPtr.Zero, true)
- {
- }
-
- ///
- /// Determines if this is a valid handle
- ///
- public override bool IsInvalid
- {
- get { return handle == IntPtr.Zero; }
- }
-
- }
-}
-
diff --git a/src/External/WindowsAPICodePack/Shell/Common/DefaultShellImageSizes.cs b/src/External/WindowsAPICodePack/Shell/Common/DefaultShellImageSizes.cs
deleted file mode 100644
index 8c94f47..0000000
--- a/src/External/WindowsAPICodePack/Shell/Common/DefaultShellImageSizes.cs
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-
-
-namespace Microsoft.WindowsAPICodePack.Shell
-{
- ///
- /// Defines the read-only properties for default shell icon sizes.
- ///
- public static class DefaultIconSize
- {
- ///
- /// The small size property for a 16x16 pixel Shell Icon.
- ///
- public static readonly System.Windows.Size Small = new System.Windows.Size(16, 16);
-
- ///
- /// The medium size property for a 32x32 pixel Shell Icon.
- ///
- public static readonly System.Windows.Size Medium = new System.Windows.Size(32, 32);
-
- ///
- /// The large size property for a 48x48 pixel Shell Icon.
- ///
- public static readonly System.Windows.Size Large = new System.Windows.Size(48, 48);
-
- ///
- /// The extra-large size property for a 256x256 pixel Shell Icon.
- ///
- public static readonly System.Windows.Size ExtraLarge = new System.Windows.Size(256, 256);
-
- ///
- /// The maximum size for a Shell Icon, 256x256 pixels.
- ///
- public static readonly System.Windows.Size Maximum = new System.Windows.Size(256, 256);
-
- }
-
- ///
- /// Defines the read-only properties for default shell thumbnail sizes.
- ///
- public static class DefaultThumbnailSize
- {
- ///
- /// Gets the small size property for a 32x32 pixel Shell Thumbnail.
- ///
- public static readonly System.Windows.Size Small = new System.Windows.Size(32, 32);
-
- ///
- /// Gets the medium size property for a 96x96 pixel Shell Thumbnail.
- ///
- public static readonly System.Windows.Size Medium = new System.Windows.Size(96, 96);
-
- ///
- /// Gets the large size property for a 256x256 pixel Shell Thumbnail.
- ///
- public static readonly System.Windows.Size Large = new System.Windows.Size(256, 256);
-
- ///
- /// Gets the extra-large size property for a 1024x1024 pixel Shell Thumbnail.
- ///
- public static readonly System.Windows.Size ExtraLarge = new System.Windows.Size(1024, 1024);
-
- ///
- /// Maximum size for the Shell Thumbnail, 1024x1024 pixels.
- ///
- public static readonly System.Windows.Size Maximum = new System.Windows.Size(1024, 1024);
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/Common/EnumUnknown.cs b/src/External/WindowsAPICodePack/Shell/Common/EnumUnknown.cs
deleted file mode 100644
index 6773db0..0000000
--- a/src/External/WindowsAPICodePack/Shell/Common/EnumUnknown.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Collections.Generic;
-using System.Runtime.InteropServices;
-using MS.WindowsAPICodePack.Internal;
-
-namespace Microsoft.WindowsAPICodePack.Shell
-{
- internal class EnumUnknownClass : IEnumUnknown
- {
- List conditionList = new List();
- int current = -1;
-
- internal EnumUnknownClass(ICondition[] conditions)
- {
- conditionList.AddRange(conditions);
- }
-
- #region IEnumUnknown Members
-
- public HRESULT Next(uint requestedNumber, ref IntPtr buffer, ref uint fetchedNumber)
- {
- current++;
-
- if (current < conditionList.Count)
- {
- buffer = Marshal.GetIUnknownForObject(conditionList[current]);
- fetchedNumber = 1;
- return HRESULT.S_OK;
- }
- else
- {
- return HRESULT.S_FALSE;
- }
- }
-
- public HRESULT Skip(uint number)
- {
- int temp = current + (int)number;
-
- if (temp > (conditionList.Count - 1))
- return HRESULT.S_FALSE;
- else
- {
- current = temp;
- return HRESULT.S_OK;
- }
- }
-
- public HRESULT Reset()
- {
- current = -1;
- return HRESULT.S_OK;
- }
-
- public HRESULT Clone(out IEnumUnknown result)
- {
- result = new EnumUnknownClass(this.conditionList.ToArray());
- return HRESULT.S_OK;
- }
-
- #endregion
- }
-}
\ No newline at end of file
diff --git a/src/External/WindowsAPICodePack/Shell/Common/IconReference.cs b/src/External/WindowsAPICodePack/Shell/Common/IconReference.cs
deleted file mode 100644
index 85a7b42..0000000
--- a/src/External/WindowsAPICodePack/Shell/Common/IconReference.cs
+++ /dev/null
@@ -1,119 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-
-namespace Microsoft.WindowsAPICodePack.Shell
-{
- ///
- /// A refence to an icon resource
- ///
- public struct IconReference
- {
- #region Private members
-
- private string moduleName;
- private int resourceId;
- private string referencePath;
- static private char[] commaSeparator = new char[] { ',' };
-
- #endregion
-
- ///
- /// Overloaded constructor takes in the module name and resource id for the icon reference.
- ///
- /// String specifying the name of an executable file, DLL, or icon file
- /// Zero-based index of the icon
- public IconReference(string moduleName, int resourceId)
- {
- if (string.IsNullOrEmpty(moduleName))
- throw new ArgumentNullException("moduleName", "Module name cannot be null or empty string");
-
- this.moduleName = moduleName;
- this.resourceId = resourceId;
- referencePath = moduleName + "," + resourceId;
- }
-
- ///
- /// Overloaded constructor takes in the module name and resource id separated by a comma.
- ///
- /// Reference path for the icon consiting of the module name and resource id.
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.Int32.Parse(System.String)", Justification = "We are not currently handling globalization or localization")]
- public IconReference(string refPath)
- {
- if (string.IsNullOrEmpty(refPath))
- throw new ArgumentNullException("refPath", "Reference path cannot be null or empty string");
-
- string[] refParams = refPath.Split(commaSeparator);
-
- if (refParams.Length != 2 || string.IsNullOrEmpty(refParams[0]) || string.IsNullOrEmpty(refParams[1]))
- throw new ArgumentException("Reference path is invalid.");
-
- moduleName = refParams[0];
- resourceId = int.Parse(refParams[1]);
-
- this.referencePath = refPath;
- }
-
- ///
- /// String specifying the name of an executable file, DLL, or icon file
- ///
- public string ModuleName
- {
- get
- {
- return moduleName;
- }
- set
- {
- if (string.IsNullOrEmpty(value))
- throw new ArgumentNullException("value", "Module name cannot be null or empty string");
-
- moduleName = value;
- }
- }
-
- ///
- /// Zero-based index of the icon
- ///
- public int ResourceId
- {
- get
- {
- return resourceId;
- }
- set
- {
- resourceId = value;
- }
- }
-
- ///
- /// Reference to a specific icon within a EXE, DLL or icon file.
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.Int32.Parse(System.String)", Justification = "We are not currently handling globalization or localization")]
- public string ReferencePath
- {
- get
- {
- return referencePath;
- }
- set
- {
- if (string.IsNullOrEmpty(value))
- throw new ArgumentNullException("value", "Reference path cannot be null or empty string");
-
- string[] refParams = value.Split(commaSeparator);
-
- if (refParams.Length != 2 || string.IsNullOrEmpty(refParams[0]) || string.IsNullOrEmpty(refParams[1]))
- throw new ArgumentException("Reference path is invalid.");
-
- ModuleName = refParams[0];
- ResourceId = int.Parse(refParams[1]);
-
- referencePath = value;
- }
- }
-
- }
-
-}
diff --git a/src/External/WindowsAPICodePack/Shell/Common/SearchCondition.cs b/src/External/WindowsAPICodePack/Shell/Common/SearchCondition.cs
deleted file mode 100644
index 230c149..0000000
--- a/src/External/WindowsAPICodePack/Shell/Common/SearchCondition.cs
+++ /dev/null
@@ -1,198 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Collections.Generic;
-using System.Runtime.InteropServices;
-using Microsoft.WindowsAPICodePack.Shell.PropertySystem;
-using MS.WindowsAPICodePack.Internal;
-
-namespace Microsoft.WindowsAPICodePack.Shell
-{
- ///
- /// Exposes properties and methods for retrieving information about a search condition.
- ///
- public class SearchCondition : IDisposable
- {
- internal SearchCondition(ICondition nativeSearchCondition)
- {
- if (nativeSearchCondition == null)
- throw new ArgumentNullException("nativeSearchCondition");
-
- NativeSearchCondition = nativeSearchCondition;
-
- HRESULT hr = NativeSearchCondition.GetConditionType(out conditionType);
-
- if (!CoreErrorHelper.Succeeded((int)hr))
- Marshal.ThrowExceptionForHR((int)hr);
-
- if (ConditionType == SearchConditionType.Leaf)
- {
- PropVariant propVar;
- hr = NativeSearchCondition.GetComparisonInfo(out canonicalName, out conditionOperation, out propVar);
-
- if (!CoreErrorHelper.Succeeded((int)hr))
- Marshal.ThrowExceptionForHR((int)hr);
-
- try
- {
- propertyValue = propVar.Value.ToString();
- }
- finally
- {
- propVar.Clear();
- }
-
- }
- }
-
- private ICondition searchCondition = null;
- internal ICondition NativeSearchCondition
- {
- get
- {
- return searchCondition;
- }
- set
- {
- searchCondition = value;
- }
- }
-
- private string canonicalName;
- ///
- /// The name of a property to be compared or NULL for an unspecified property.
- ///
- public string PropertyCanonicalName
- {
- get { return canonicalName; }
- internal set { canonicalName = value; }
- }
-
- private PropertyKey propertyKey;
- private PropertyKey emptyPropertyKey = new PropertyKey();
- ///
- /// The property key for the property that is to be compared.
- ///
- public PropertyKey PropertyKey
- {
- get
- {
- if (propertyKey == emptyPropertyKey)
- {
- int hr = PropertySystemNativeMethods.PSGetPropertyKeyFromName(PropertyCanonicalName, out propertyKey);
-
- if (!CoreErrorHelper.Succeeded(hr))
- Marshal.ThrowExceptionForHR(hr);
- }
-
- return propertyKey;
- }
- internal set { propertyKey = value; }
- }
-
- private string propertyValue;
- ///
- /// A value (in format) to which the property is compared.
- ///
- public string PropertyValue
- {
- get { return propertyValue; }
- internal set { propertyValue = value; }
- }
-
- private SearchConditionOperation conditionOperation = SearchConditionOperation.Implicit;
- ///
- /// Search condition operation to be performed on the property/value combination.
- /// See for more details.
- ///
- public SearchConditionOperation ConditionOperation
- {
- get { return conditionOperation; }
- internal set { conditionOperation = value; }
- }
-
- private SearchConditionType conditionType = SearchConditionType.Leaf;
- ///
- /// Represents the condition type for the given node.
- ///
- public SearchConditionType ConditionType
- {
- get { return conditionType; }
- internal set { conditionType = value; }
- }
-
- ///
- /// Retrieves an array of the sub-conditions.
- ///
- public IEnumerable GetSubConditions()
- {
- // Our list that we'll return
- List subConditionsList = new List();
-
- // Get the sub-conditions from the native API
- object subConditionObj;
- Guid guid = new Guid(ShellIIDGuid.IEnumUnknown);
-
- HRESULT hr = NativeSearchCondition.GetSubConditions(ref guid, out subConditionObj);
-
- if (!CoreErrorHelper.Succeeded((int)hr))
- Marshal.ThrowExceptionForHR((int)hr);
-
- // Convert each ICondition to SearchCondition
- if (subConditionObj != null)
- {
- IEnumUnknown enumUnknown = subConditionObj as IEnumUnknown;
-
- IntPtr buffer = IntPtr.Zero;
- uint fetched = 0;
-
- while (hr == HRESULT.S_OK)
- {
- hr = enumUnknown.Next(1, ref buffer, ref fetched);
-
- if (hr == HRESULT.S_OK && fetched == 1)
- {
- subConditionsList.Add(new SearchCondition((ICondition)Marshal.GetObjectForIUnknown(buffer)));
- }
- }
- }
-
- return subConditionsList;
- }
-
- #region IDisposable Members
-
- ///
- ///
- ///
- ~SearchCondition()
- {
- Dispose(false);
- }
-
- ///
- /// Release the native objects.
- ///
- public void Dispose()
- {
- Dispose(true);
- GC.SuppressFinalize(this);
- }
-
- ///
- /// Release the native objects.
- ///
- ///
- public void Dispose(bool disposing)
- {
- if (NativeSearchCondition != null)
- {
- Marshal.ReleaseComObject(NativeSearchCondition);
- NativeSearchCondition = null;
- }
- }
-
- #endregion
-
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/Common/SearchConditionFactory.cs b/src/External/WindowsAPICodePack/Shell/Common/SearchConditionFactory.cs
deleted file mode 100644
index a29a5a5..0000000
--- a/src/External/WindowsAPICodePack/Shell/Common/SearchConditionFactory.cs
+++ /dev/null
@@ -1,445 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Collections.Generic;
-using System.Globalization;
-using System.Runtime.InteropServices;
-using Microsoft.WindowsAPICodePack.Shell.PropertySystem;
-using MS.WindowsAPICodePack.Internal;
-
-namespace Microsoft.WindowsAPICodePack.Shell
-{
- ///
- /// Provides methods for creating or resolving a condition tree
- /// that was obtained by parsing a query string.
- ///
- public static class SearchConditionFactory
- {
- ///
- /// Creates a leaf condition node that represents a comparison of property value and constant value.
- ///
- /// The name of a property to be compared, or null for an unspecified property.
- /// The locale name of the leaf node is LOCALE_NAME_USER_DEFAULT.
- /// The constant value against which the property value should be compared.
- /// Specific condition to be used when comparing the actual value and the expected value of the given property
- /// SearchCondition based on the given parameters
- ///
- /// The search will only work for files that are indexed, as well as the specific properties are indexed. To find
- /// the properties that are indexed, look for the specific property's property description and
- /// property for IsQueryable flag.
- ///
- public static SearchCondition CreateLeafCondition(string propertyName, string value, SearchConditionOperation operation)
- {
- PropVariant propVar = new PropVariant();
- propVar.SetString(value);
-
- return CreateLeafCondition(propertyName, propVar, null, operation);
- }
-
- ///
- /// Creates a leaf condition node that represents a comparison of property value and constant value.
- /// Overload method takes a DateTime parameter for the comparison value.
- ///
- /// The name of a property to be compared, or null for an unspecified property.
- /// The locale name of the leaf node is LOCALE_NAME_USER_DEFAULT.
- /// The DateTime value against which the property value should be compared.
- /// Specific condition to be used when comparing the actual value and the expected value of the given property
- /// SearchCondition based on the given parameters
- ///
- /// The search will only work for files that are indexed, as well as the specific properties are indexed. To find
- /// the properties that are indexed, look for the specific property's property description and
- /// property for IsQueryable flag.
- ///
- public static SearchCondition CreateLeafCondition(string propertyName, DateTime value, SearchConditionOperation operation)
- {
- PropVariant propVar = new PropVariant();
- propVar.SetDateTime(value);
-
- return CreateLeafCondition(propertyName, propVar, "System.StructuredQuery.CustomProperty.DateTime", operation);
- }
-
- ///
- /// Creates a leaf condition node that represents a comparison of property value and Integer value.
- ///
- /// The name of a property to be compared, or null for an unspecified property.
- /// The locale name of the leaf node is LOCALE_NAME_USER_DEFAULT.
- /// The Integer value against which the property value should be compared.
- /// Specific condition to be used when comparing the actual value and the expected value of the given property
- /// SearchCondition based on the given parameters
- ///
- /// The search will only work for files that are indexed, as well as the specific properties are indexed. To find
- /// the properties that are indexed, look for the specific property's property description and
- /// property for IsQueryable flag.
- ///
- public static SearchCondition CreateLeafCondition(string propertyName, int value, SearchConditionOperation operation)
- {
- PropVariant propVar = new PropVariant();
- propVar.SetInt(value);
-
- return CreateLeafCondition(propertyName, propVar, "System.StructuredQuery.CustomProperty.Integer", operation);
- }
-
- ///
- /// Creates a leaf condition node that represents a comparison of property value and Boolean value.
- ///
- /// The name of a property to be compared, or null for an unspecified property.
- /// The locale name of the leaf node is LOCALE_NAME_USER_DEFAULT.
- /// The Boolean value against which the property value should be compared.
- /// Specific condition to be used when comparing the actual value and the expected value of the given property
- /// SearchCondition based on the given parameters
- ///
- /// The search will only work for files that are indexed, as well as the specific properties are indexed. To find
- /// the properties that are indexed, look for the specific property's property description and
- /// property for IsQueryable flag.
- ///
- public static SearchCondition CreateLeafCondition(string propertyName, bool value, SearchConditionOperation operation)
- {
- PropVariant propVar = new PropVariant();
- propVar.SetBool(value);
-
- return CreateLeafCondition(propertyName, propVar, "System.StructuredQuery.CustomProperty.Boolean", operation);
- }
-
- ///
- /// Creates a leaf condition node that represents a comparison of property value and Floating Point value.
- ///
- /// The name of a property to be compared, or null for an unspecified property.
- /// The locale name of the leaf node is LOCALE_NAME_USER_DEFAULT.
- /// The Floating Point value against which the property value should be compared.
- /// Specific condition to be used when comparing the actual value and the expected value of the given property
- /// SearchCondition based on the given parameters
- ///
- /// The search will only work for files that are indexed, as well as the specific properties are indexed. To find
- /// the properties that are indexed, look for the specific property's property description and
- /// property for IsQueryable flag.
- ///
- public static SearchCondition CreateLeafCondition(string propertyName, double value, SearchConditionOperation operation)
- {
- PropVariant propVar = new PropVariant();
- propVar.SetDouble(value);
-
- return CreateLeafCondition(propertyName, propVar, "System.StructuredQuery.CustomProperty.FloatingPoint", operation);
- }
-
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1304:SpecifyCultureInfo", MessageId = "System.String.ToLower")]
- private static SearchCondition CreateLeafCondition(string propertyName, PropVariant propVar, string valueType, SearchConditionOperation operation)
- {
- IConditionFactory nativeConditionFactory = null;
- SearchCondition condition = null;
-
- try
- {
- // Same as the native "IConditionFactory:MakeLeaf" method
- nativeConditionFactory = (IConditionFactory)new ConditionFactoryCoClass();
-
- ICondition nativeCondition = null;
-
- if (string.IsNullOrEmpty(propertyName) || propertyName.ToLower() == "system.null")
- propertyName = null;
-
- HRESULT hr = HRESULT.E_FAIL;
-
- hr = nativeConditionFactory.MakeLeaf(propertyName, operation, valueType,
- ref propVar, null, null, null, false, out nativeCondition);
-
- if (!CoreErrorHelper.Succeeded((int)hr))
- Marshal.ThrowExceptionForHR((int)hr);
-
- // Create our search condition and set the various properties.
- condition = new SearchCondition(nativeCondition);
- }
- finally
- {
- if (nativeConditionFactory != null)
- Marshal.ReleaseComObject(nativeConditionFactory);
- }
-
- return condition;
- }
-
- ///
- /// Creates a leaf condition node that represents a comparison of property value and constant value.
- ///
- /// The property to be compared.
- /// The constant value against which the property value should be compared.
- /// Specific condition to be used when comparing the actual value and the expected value of the given property
- /// SearchCondition based on the given parameters
- ///
- /// The search will only work for files that are indexed, as well as the specific properties are indexed. To find
- /// the properties that are indexed, look for the specific property's property description and
- /// property for IsQueryable flag.
- ///
- public static SearchCondition CreateLeafCondition(PropertyKey propertyKey, string value, SearchConditionOperation operation)
- {
- string canonicalName;
- PropertySystemNativeMethods.PSGetNameFromPropertyKey(ref propertyKey, out canonicalName);
-
- if (!string.IsNullOrEmpty(canonicalName))
- return CreateLeafCondition(canonicalName, value, operation);
- else
- throw new ArgumentException("Given property key is invalid", "propertyKey");
- }
-
- ///
- /// Creates a leaf condition node that represents a comparison of property value and constant value.
- /// Overload method takes a DateTime parameter for the comparison value.
- ///
- /// The property to be compared.
- /// The DateTime value against which the property value should be compared.
- /// Specific condition to be used when comparing the actual value and the expected value of the given property
- /// SearchCondition based on the given parameters
- ///
- /// The search will only work for files that are indexed, as well as the specific properties are indexed. To find
- /// the properties that are indexed, look for the specific property's property description and
- /// property for IsQueryable flag.
- ///
- public static SearchCondition CreateLeafCondition(PropertyKey propertyKey, DateTime value, SearchConditionOperation operation)
- {
- string canonicalName;
- PropertySystemNativeMethods.PSGetNameFromPropertyKey(ref propertyKey, out canonicalName);
-
- if (!string.IsNullOrEmpty(canonicalName))
- return CreateLeafCondition(canonicalName, value, operation);
- else
- throw new ArgumentException("Given property key is invalid", "propertyKey");
- }
-
- ///
- /// Creates a leaf condition node that represents a comparison of property value and Boolean value.
- /// Overload method takes a DateTime parameter for the comparison value.
- ///
- /// The property to be compared.
- /// The boolean value against which the property value should be compared.
- /// Specific condition to be used when comparing the actual value and the expected value of the given property
- /// SearchCondition based on the given parameters
- ///
- /// The search will only work for files that are indexed, as well as the specific properties are indexed. To find
- /// the properties that are indexed, look for the specific property's property description and
- /// property for IsQueryable flag.
- ///
- public static SearchCondition CreateLeafCondition(PropertyKey propertyKey, bool value, SearchConditionOperation operation)
- {
- string canonicalName;
- PropertySystemNativeMethods.PSGetNameFromPropertyKey(ref propertyKey, out canonicalName);
-
- if (!string.IsNullOrEmpty(canonicalName))
- return CreateLeafCondition(canonicalName, value, operation);
- else
- throw new ArgumentException("Given property key is invalid", "propertyKey");
- }
-
- ///
- /// Creates a leaf condition node that represents a comparison of property value and Floating Point value.
- /// Overload method takes a DateTime parameter for the comparison value.
- ///
- /// The property to be compared.
- /// The Floating Point value against which the property value should be compared.
- /// Specific condition to be used when comparing the actual value and the expected value of the given property
- /// SearchCondition based on the given parameters
- ///
- /// The search will only work for files that are indexed, as well as the specific properties are indexed. To find
- /// the properties that are indexed, look for the specific property's property description and
- /// property for IsQueryable flag.
- ///
- public static SearchCondition CreateLeafCondition(PropertyKey propertyKey, double value, SearchConditionOperation operation)
- {
- string canonicalName;
- PropertySystemNativeMethods.PSGetNameFromPropertyKey(ref propertyKey, out canonicalName);
-
- if (!string.IsNullOrEmpty(canonicalName))
- return CreateLeafCondition(canonicalName, value, operation);
- else
- throw new ArgumentException("Given property key is invalid", "propertyKey");
- }
-
- ///
- /// Creates a leaf condition node that represents a comparison of property value and Integer value.
- /// Overload method takes a DateTime parameter for the comparison value.
- ///
- /// The property to be compared.
- /// The Integer value against which the property value should be compared.
- /// Specific condition to be used when comparing the actual value and the expected value of the given property
- /// SearchCondition based on the given parameters
- ///
- /// The search will only work for files that are indexed, as well as the specific properties are indexed. To find
- /// the properties that are indexed, look for the specific property's property description and
- /// property for IsQueryable flag.
- ///
- public static SearchCondition CreateLeafCondition(PropertyKey propertyKey, int value, SearchConditionOperation operation)
- {
- string canonicalName;
- PropertySystemNativeMethods.PSGetNameFromPropertyKey(ref propertyKey, out canonicalName);
-
- if (!string.IsNullOrEmpty(canonicalName))
- return CreateLeafCondition(canonicalName, value, operation);
- else
- throw new ArgumentException("Given property key is invalid", "propertyKey");
- }
-
- ///
- /// Creates a condition node that is a logical conjunction ("AND") or disjunction ("OR")
- /// of a collection of subconditions.
- ///
- /// The SearchConditionType of the condition node.
- /// Must be either AndCondition or OrCondition.
- /// TRUE to logically simplify the result, if possible;
- /// then the result will not necessarily to be of the specified kind. FALSE if the result should
- /// have exactly the prescribed structure. An application that plans to execute a query based on the
- /// condition tree would typically benefit from setting this parameter to TRUE.
- /// Array of subconditions
- /// New SearchCondition based on the operation
- public static SearchCondition CreateAndOrCondition(SearchConditionType conditionType, bool simplyfy, params SearchCondition[] conditionNodes)
- {
- // Same as the native "IConditionFactory:MakeAndOr" method
- IConditionFactory nativeConditionFactory = (IConditionFactory)new ConditionFactoryCoClass();
- ICondition result = null;
-
- try
- {
- //
- List conditionList = new List();
- foreach (SearchCondition c in conditionNodes)
- conditionList.Add(c.NativeSearchCondition);
-
- IEnumUnknown subConditions = new EnumUnknownClass(conditionList.ToArray());
-
- HRESULT hr = nativeConditionFactory.MakeAndOr(conditionType, subConditions, simplyfy, out result);
-
- if (!CoreErrorHelper.Succeeded((int)hr))
- Marshal.ThrowExceptionForHR((int)hr);
- }
- finally
- {
- if (nativeConditionFactory != null)
- Marshal.ReleaseComObject(nativeConditionFactory);
- }
-
- return new SearchCondition(result);
- }
-
- ///
- /// Creates a condition node that is a logical negation (NOT) of another condition
- /// (a subnode of this node).
- ///
- /// SearchCondition node to be negated.
- /// True to logically simplify the result if possible; False otherwise.
- /// In a query builder scenario, simplyfy should typically be set to false.
- /// New SearchCondition
- public static SearchCondition CreateNotCondition(SearchCondition conditionToBeNegated, bool simplyfy)
- {
- // Same as the native "IConditionFactory:MakeNot" method
- IConditionFactory nativeConditionFactory = (IConditionFactory)new ConditionFactoryCoClass();
- ICondition result;
-
- try
- {
- HRESULT hr = nativeConditionFactory.MakeNot(conditionToBeNegated.NativeSearchCondition, simplyfy, out result);
-
- if (!CoreErrorHelper.Succeeded((int)hr))
- Marshal.ThrowExceptionForHR((int)hr);
- }
- finally
- {
- if (nativeConditionFactory != null)
- Marshal.ReleaseComObject(nativeConditionFactory);
- }
-
- return new SearchCondition(result);
- }
-
- ///
- /// Parses an input string that contains Structured Query keywords (using Advanced Query Syntax
- /// or Natural Query Syntax) and produces a SearchCondition object.
- ///
- /// The query to be parsed
- /// Search condition resulting from the query
- /// For more information on structured query syntax, visit http://msdn.microsoft.com/en-us/library/bb233500.aspx and
- /// http://www.microsoft.com/windows/products/winfamily/desktopsearch/technicalresources/advquery.mspx
- public static SearchCondition ParseStructuredQuery(string query)
- {
- return ParseStructuredQuery(query, null);
- }
-
- ///
- /// Parses an input string that contains Structured Query keywords (using Advanced Query Syntax
- /// or Natural Query Syntax) and produces a SearchCondition object.
- ///
- /// The query to be parsed
- /// The culture used to select the localized language for keywords.
- /// Search condition resulting from the query
- /// For more information on structured query syntax, visit http://msdn.microsoft.com/en-us/library/bb233500.aspx and
- /// http://www.microsoft.com/windows/products/winfamily/desktopsearch/technicalresources/advquery.mspx
- public static SearchCondition ParseStructuredQuery(string query, CultureInfo cultureInfo)
- {
- if (string.IsNullOrEmpty(query))
- throw new ArgumentNullException("query");
- else
- {
- IQueryParserManager nativeQueryParserManager = (IQueryParserManager)new QueryParserManagerCoClass();
- IQueryParser queryParser = null;
- IQuerySolution querySolution = null;
- ICondition result = null;
-
- IEntity mainType = null;
-
- try
- {
- // First, try to create a new IQueryParser using IQueryParserManager
- Guid guid = new Guid(ShellIIDGuid.IQueryParser);
- HRESULT hr = nativeQueryParserManager.CreateLoadedParser(
- "SystemIndex",
- cultureInfo == null ? (ushort)0 : (ushort)cultureInfo.LCID,
- ref guid,
- out queryParser);
-
- if (!CoreErrorHelper.Succeeded((int)hr))
- throw Marshal.GetExceptionForHR((int)hr);
-
- if (queryParser != null)
- {
- // If user specified natural query, set the option on the query parser
- PropVariant optionValue = new PropVariant();
- optionValue.SetBool(true);
- hr = queryParser.SetOption(StructuredQuerySingleOption.NaturalSyntax, ref optionValue);
-
- if (!CoreErrorHelper.Succeeded((int)hr))
- throw Marshal.GetExceptionForHR((int)hr);
-
- // Next, try to parse the query.
- // Result would be IQuerySolution that we can use for getting the ICondition and other
- // details about the parsed query.
- hr = queryParser.Parse(query, null, out querySolution);
-
- if (!CoreErrorHelper.Succeeded((int)hr))
- throw Marshal.GetExceptionForHR((int)hr);
-
- if (querySolution != null)
- {
- // Lastly, try to get the ICondition from this parsed query
- hr = querySolution.GetQuery(out result, out mainType);
-
- if (!CoreErrorHelper.Succeeded((int)hr))
- throw Marshal.GetExceptionForHR((int)hr);
- }
- }
-
- return new SearchCondition(result);
- }
- finally
- {
- if (nativeQueryParserManager != null)
- Marshal.ReleaseComObject(nativeQueryParserManager);
-
- if (queryParser != null)
- Marshal.ReleaseComObject(queryParser);
-
- if (querySolution != null)
- Marshal.ReleaseComObject(querySolution);
-
- if (mainType != null)
- Marshal.ReleaseComObject(mainType);
- }
- }
- }
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/Common/ShellEnums.cs b/src/External/WindowsAPICodePack/Shell/Common/ShellEnums.cs
deleted file mode 100644
index fb2f19c..0000000
--- a/src/External/WindowsAPICodePack/Shell/Common/ShellEnums.cs
+++ /dev/null
@@ -1,527 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-
-namespace Microsoft.WindowsAPICodePack.Shell
-{
- ///
- /// CommonFileDialog AddPlace locations
- ///
- public enum FileDialogAddPlaceLocation
- {
- ///
- /// At the bottom of the Favorites or Places list.
- ///
- Bottom = 0x00000000,
-
- ///
- /// At the top of the Favorites or Places list.
- ///
- Top = 0x00000001,
- }
-
- ///
- /// One of the values that indicates how the ShellObject DisplayName should look.
- ///
- public enum DisplayNameType : uint
- {
- ///
- /// Returns the display name relative to the desktop.
- ///
- Default = 0x00000000,
-
- ///
- /// Returns the parsing name relative to the parent folder.
- ///
- RelativeToParent = 0x80018001,
-
- ///
- /// Returns the path relative to the parent folder in a
- /// friendly format as displayed in an address bar.
- ///
- RelativeToParentAddressBar = 0x8007c001,
-
- ///
- /// Returns the parsing name relative to the desktop.
- ///
- RelativeToDesktop = 0x80028000,
-
- ///
- /// Returns the editing name relative to the parent folder.
- ///
- RelativeToParentEditing = 0x80031001,
-
- ///
- /// Returns the editing name relative to the desktop.
- ///
- RelativeToDesktopEditing = 0x8004c000,
-
- ///
- /// Returns the display name relative to the file system path.
- ///
- FileSystemPath = 0x80058000,
-
- ///
- /// Returns the display name relative to a URL.
- ///
- Url = 0x80068000,
- }
- ///
- /// Available Library folder types
- ///
- public enum LibraryFolderType
- {
- ///
- /// General Items
- ///
- Generic = 0,
-
- ///
- /// Documents
- ///
- Documents,
-
- ///
- /// Music
- ///
- Music,
-
- ///
- /// Pictures
- ///
- Pictures,
-
- ///
- /// Videos
- ///
- Videos
-
- }
-
- ///
- /// Flags controlling the appearance of a window
- ///
- public enum WindowShowCommand : uint
- {
- ///
- /// Hides the window and activates another window.
- ///
- Hide = 0,
-
- ///
- /// Activates and displays the window (including restoring
- /// it to its original size and position).
- ///
- Normal = 1,
-
- ///
- /// Minimizes the window.
- ///
- Minimized = 2,
-
- ///
- /// Maximizes the window.
- ///
- Maximized = 3,
-
- ///
- /// Similar to , except that the window
- /// is not activated.
- ///
- ShowNoActivate = 4,
-
- ///
- /// Activates the window and displays it in its current size
- /// and position.
- ///
- Show = 5,
-
- ///
- /// Minimizes the window and activates the next top-level window.
- ///
- Minimize = 6,
-
- ///
- /// Minimizes the window and does not activate it.
- ///
- ShowMinimizedNoActivate = 7,
-
- ///
- /// Similar to , except that the window is not
- /// activated.
- ///
- ShowNA = 8,
-
- ///
- /// Activates and displays the window, restoring it to its original
- /// size and position.
- ///
- Restore = 9,
-
- ///
- /// Sets the show state based on the initial value specified when
- /// the process was created.
- ///
- Default = 10,
-
- ///
- /// Minimizes a window, even if the thread owning the window is not
- /// responding. Use this only to minimize windows from a different
- /// thread.
- ///
- ForceMinimize = 11
- }
-
- ///
- /// Provides a set of flags to be used with
- /// to indicate the operation in methods.
- ///
- public enum SearchConditionOperation
- {
- ///
- /// An implicit comparison between the value of the property and the value of the constant.
- ///
- Implicit = 0,
-
- ///
- /// The value of the property and the value of the constant must be equal.
- ///
- Equal = 1,
-
- ///
- /// The value of the property and the value of the constant must not be equal.
- ///
- NotEqual = 2,
-
- ///
- /// The value of the property must be less than the value of the constant.
- ///
- LessThan = 3,
-
- ///
- /// The value of the property must be greater than the value of the constant.
- ///
- GreaterThan = 4,
-
- ///
- /// The value of the property must be less than or equal to the value of the constant.
- ///
- LessThanOrEqual = 5,
-
- ///
- /// The value of the property must be greater than or equal to the value of the constant.
- ///
- GreaterThanOrEqual = 6,
-
- ///
- /// The value of the property must begin with the value of the constant.
- ///
- ValueStartsWith = 7,
-
- ///
- /// The value of the property must end with the value of the constant.
- ///
- ValueEndsWith = 8,
-
- ///
- /// The value of the property must contain the value of the constant.
- ///
- ValueContains = 9,
-
- ///
- /// The value of the property must not contain the value of the constant.
- ///
- ValueNotContains = 10,
-
- ///
- /// The value of the property must match the value of the constant, where '?'
- /// matches any single character and '*' matches any sequence of characters.
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "DOS")]
- DOSWildcards = 11,
-
- ///
- /// The value of the property must contain a word that is the value of the constant.
- ///
- WordEqual = 12,
-
- ///
- /// The value of the property must contain a word that begins with the value of the constant.
- ///
- WordStartsWith = 13,
-
- ///
- /// The application is free to interpret this in any suitable way.
- ///
- ApplicationSpecific = 14
- }
-
- ///
- /// Set of flags to be used with .
- ///
- public enum SearchConditionType
- {
- ///
- /// Indicates that the values of the subterms are combined by "AND".
- ///
- And = 0,
-
- ///
- /// Indicates that the values of the subterms are combined by "OR".
- ///
- Or = 1,
-
- ///
- /// Indicates a "NOT" comparison of subterms.
- ///
- Not = 2,
-
- ///
- /// Indicates that the node is a comparison between a property and a
- /// constant value using a .
- ///
- Leaf = 3,
- }
-
- ///
- /// Used to describe the view mode.
- ///
- public enum FolderLogicalViewMode
- {
- ///
- /// The view is not specified.
- ///
- Unspecified = -1,
-
- ///
- /// The minimum valid enumeration value. Used for validation purposes only.
- ///
- First = 1,
-
- ///
- /// Details view.
- ///
- Details = 1,
-
- ///
- /// Tiles view.
- ///
- Tiles = 2,
-
- ///
- /// Icons view.
- ///
- Icons = 3,
-
- ///
- /// Windows 7 and later. List view.
- ///
- List = 4,
-
- ///
- /// Windows 7 and later. Content view.
- ///
- Content = 5,
-
- ///
- /// The maximum valid enumeration value. Used for validation purposes only.
- ///
- Last = 5
- }
-
- ///
- /// The direction in which the items are sorted.
- ///
- public enum SortDirection
- {
- ///
- /// The items are sorted in descending order. Whether the sort is alphabetical, numerical,
- /// and so on, is determined by the data type of the column indicated in propkey.
- ///
- Descending = -1,
-
- ///
- /// The items are sorted in ascending order. Whether the sort is alphabetical, numerical,
- /// and so on, is determined by the data type of the column indicated in propkey.
- ///
- Ascending = 1,
- }
-
- ///
- /// Provides a set of flags to be used with IQueryParser::SetOption and
- /// IQueryParser::GetOption to indicate individual options.
- ///
- public enum StructuredQuerySingleOption
- {
- ///
- /// The value should be VT_LPWSTR and the path to a file containing a schema binary.
- ///
- Schema,
-
- ///
- /// The value must be VT_EMPTY (the default) or a VT_UI4 that is an LCID. It is used
- /// as the locale of contents (not keywords) in the query to be searched for, when no
- /// other information is available. The default value is the current keyboard locale.
- /// Retrieving the value always returns a VT_UI4.
- ///
- Locale,
-
- ///
- /// This option is used to override the default word breaker used when identifying keywords
- /// in queries. The default word breaker is chosen according to the language of the keywords
- /// (cf. SQSO_LANGUAGE_KEYWORDS below). When setting this option, the value should be VT_EMPTY
- /// for using the default word breaker, or a VT_UNKNOWN with an object supporting
- /// the IWordBreaker interface. Retrieving the option always returns a VT_UNKNOWN with an object
- /// supporting the IWordBreaker interface.
- ///
- WordBreaker,
-
- ///
- /// The value should be VT_EMPTY or VT_BOOL with VARIANT_TRUE to allow natural query
- /// syntax (the default) or VT_BOOL with VARIANT_FALSE to allow only advanced query syntax.
- /// Retrieving the option always returns a VT_BOOL.
- /// This option is now deprecated, use SQSO_SYNTAX.
- ///
- NaturalSyntax,
-
- ///
- /// The value should be VT_BOOL with VARIANT_TRUE to generate query expressions
- /// as if each word in the query had a star appended to it (unless followed by punctuation
- /// other than a parenthesis), or VT_EMPTY or VT_BOOL with VARIANT_FALSE to
- /// use the words as they are (the default). A word-wheeling application
- /// will generally want to set this option to true.
- /// Retrieving the option always returns a VT_BOOL.
- ///
- AutomaticWildcard,
-
- ///
- /// Reserved. The value should be VT_EMPTY (the default) or VT_I4.
- /// Retrieving the option always returns a VT_I4.
- ///
- TraceLevel,
-
- ///
- /// The value must be a VT_UI4 that is a LANGID. It defaults to the default user UI language.
- ///
- LanguageKeywords,
-
- ///
- /// The value must be a VT_UI4 that is a STRUCTURED_QUERY_SYNTAX value.
- /// It defaults to SQS_NATURAL_QUERY_SYNTAX.
- ///
- Syntax,
-
- ///
- /// The value must be a VT_BLOB that is a copy of a TIME_ZONE_INFORMATION structure.
- /// It defaults to the current time zone.
- ///
- TimeZone,
-
- ///
- /// This setting decides what connector should be assumed between conditions when none is specified.
- /// The value must be a VT_UI4 that is a CONDITION_TYPE. Only CT_AND_CONDITION and CT_OR_CONDITION
- /// are valid. It defaults to CT_AND_CONDITION.
- ///
- ImplicitConnector,
-
- ///
- /// This setting decides whether there are special requirements on the case of connector keywords (such
- /// as AND or OR). The value must be a VT_UI4 that is a CASE_REQUIREMENT value.
- /// It defaults to CASE_REQUIREMENT_UPPER_IF_AQS.
- ///
- ConnectorCase,
-
- }
-
- ///
- /// Provides a set of flags to be used with IQueryParser::SetMultiOption
- /// to indicate individual options.
- ///
- public enum StructuredQueryMultipleOption
- {
- ///
- /// The key should be property name P. The value should be a
- /// VT_UNKNOWN with an IEnumVARIANT which has two values: a VT_BSTR that is another
- /// property name Q and a VT_I4 that is a CONDITION_OPERATION cop. A predicate with
- /// property name P, some operation and a value V will then be replaced by a predicate
- /// with property name Q, operation cop and value V before further processing happens.
- ///
- VirtualProperty,
-
- ///
- /// The key should be a value type name V. The value should be a
- /// VT_LPWSTR with a property name P. A predicate with no property name and a value of type
- /// V (or any subtype of V) will then use property P.
- ///
- DefaultProperty,
-
- ///
- /// The key should be a value type name V. The value should be a
- /// VT_UNKNOWN with a IConditionGenerator G. The GenerateForLeaf method of
- /// G will then be applied to any predicate with value type V and if it returns a query
- /// expression, that will be used. If it returns NULL, normal processing will be used
- /// instead.
- ///
- GeneratorForType,
-
- ///
- /// The key should be a property name P. The value should be a VT_VECTOR|VT_LPWSTR,
- /// where each string is a property name. The count must be at least one. This "map" will be
- /// added to those of the loaded schema and used during resolution. A second call with the
- /// same key will replace the current map. If the value is VT_NULL, the map will be removed.
- ///
- MapProperty,
- }
-
- ///
- /// Used by IQueryParserManager::SetOption to set parsing options.
- /// This can be used to specify schemas and localization options.
- ///
- public enum QueryParserManagerOption
- {
- ///
- /// A VT_LPWSTR containing the name of the file that contains the schema binary.
- /// The default value is StructuredQuerySchema.bin for the SystemIndex catalog
- /// and StructuredQuerySchemaTrivial.bin for the trivial catalog.
- ///
- SchemaBiaryName = 0,
-
- ///
- /// Either a VT_BOOL or a VT_LPWSTR. If the value is a VT_BOOL and is FALSE,
- /// a pre-localized schema will not be used. If the value is a VT_BOOL and is TRUE,
- /// IQueryParserManager will use the pre-localized schema binary in
- /// "%ALLUSERSPROFILE%\Microsoft\Windows". If the value is a VT_LPWSTR, the value should
- /// contain the full path of the folder in which the pre-localized schema binary can be found.
- /// The default value is VT_BOOL with TRUE.
- ///
- PreLocalizedSchemaBinaryPath = (SchemaBiaryName + 1),
-
- ///
- /// A VT_LPWSTR containing the full path to the folder that contains the
- /// unlocalized schema binary. The default value is "%SYSTEMROOT%\System32".
- ///
- UnLocalizedSchemaBinaryPath = (PreLocalizedSchemaBinaryPath + 1),
-
- ///
- /// A VT_LPWSTR containing the full path to the folder that contains the
- /// localized schema binary that can be read and written to as needed.
- /// The default value is "%LOCALAPPDATA%\Microsoft\Windows".
- ///
- LocalizedSchemaBinaryPath = (UnLocalizedSchemaBinaryPath + 1),
-
- ///
- /// A VT_BOOL. If TRUE, then the paths for pre-localized and localized binaries
- /// have "\(LCID)" appended to them, where language code identifier (LCID) is
- /// the decimal locale ID for the localized language. The default is TRUE.
- ///
- AppendLCIDToLocalizedPath = (LocalizedSchemaBinaryPath + 1),
-
- ///
- /// A VT_UNKNOWN with an object supporting ISchemaLocalizerSupport.
- /// This object will be used instead of the default localizer support object.
- ///
- LocalizerSupport = (AppendLCIDToLocalizedPath + 1)
- }
-
-
-}
diff --git a/src/External/WindowsAPICodePack/Shell/Common/ShellFile.cs b/src/External/WindowsAPICodePack/Shell/Common/ShellFile.cs
deleted file mode 100644
index 6ae6aed..0000000
--- a/src/External/WindowsAPICodePack/Shell/Common/ShellFile.cs
+++ /dev/null
@@ -1,64 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.IO;
-
-namespace Microsoft.WindowsAPICodePack.Shell
-{
- ///
- /// A file in the Shell Namespace
- ///
- public class ShellFile : ShellObjectNode, IDisposable
- {
- #region Internal Constructor
-
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.String.Format(System.String,System.Object)")]
- internal ShellFile(string path)
- {
- // Get the absolute path
- string absPath = ShellHelper.GetAbsolutePath(path);
-
- // Make sure this is valid
- if (!File.Exists(absPath))
- throw new FileNotFoundException(string.Format("The given path does not exist ({0})", path));
-
- ParsingName = absPath;
- }
-
- internal ShellFile(IShellItem2 shellItem)
- {
- nativeShellItem = shellItem;
- }
-
- #endregion
-
- #region Public Methods
- ///
- /// Constructs a new ShellFile object given a file path
- ///
- /// The file or folder path
- /// ShellFile object created using given file path.
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.String.Format(System.String,System.Object)", Justification = "We are not currently handling globalization or localization")]
- static public ShellFile FromFilePath(string path)
- {
- return new ShellFile(path);
- }
-
- #endregion
-
- #region Public Properties
-
- ///
- /// The path for this file
- ///
- virtual public string Path
- {
- get
- {
- return this.ParsingName;
- }
- }
-
- #endregion
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/Common/ShellFileSystemFolder.cs b/src/External/WindowsAPICodePack/Shell/Common/ShellFileSystemFolder.cs
deleted file mode 100644
index e158578..0000000
--- a/src/External/WindowsAPICodePack/Shell/Common/ShellFileSystemFolder.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System.IO;
-
-namespace Microsoft.WindowsAPICodePack.Shell
-{
- ///
- /// A folder in the Shell Namespace
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "This will complicate the class hierarchy and naming convention used in the Shell area")]
- public class ShellFileSystemFolder : ShellFolder
- {
- #region Internal Constructor
-
- internal ShellFileSystemFolder()
- {
-
- }
-
- internal ShellFileSystemFolder(IShellItem2 shellItem)
- {
- nativeShellItem = shellItem;
- }
-
- #endregion
-
- #region Public Methods
- ///
- /// Constructs a new ShellFileSystemFolder object given a folder path
- ///
- /// The folder path
- /// ShellFileSystemFolder created from the given folder path.
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.String.Format(System.String,System.Object)", Justification = "We are not currently handling globalization or localization")]
- static public ShellFileSystemFolder FromFolderPath(string path)
- {
- // Get the absolute path
- string absPath = ShellHelper.GetAbsolutePath(path);
-
- // Make sure this is valid
- if(!Directory.Exists(absPath))
- throw new DirectoryNotFoundException(string.Format("The given path does not exist ({0})", path));
-
- ShellFileSystemFolder folder = new ShellFileSystemFolder();
- folder.ParsingName = absPath;
- return folder;
- }
-
- #endregion
-
- #region Public Properties
-
- ///
- /// The path for this Folder
- ///
- virtual public string Path
- {
- get
- {
- return this.ParsingName;
- }
- }
-
- #endregion
-
- }
-}
\ No newline at end of file
diff --git a/src/External/WindowsAPICodePack/Shell/Common/ShellFolder.cs b/src/External/WindowsAPICodePack/Shell/Common/ShellFolder.cs
deleted file mode 100644
index 6013036..0000000
--- a/src/External/WindowsAPICodePack/Shell/Common/ShellFolder.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-
-namespace Microsoft.WindowsAPICodePack.Shell
-{
- ///
- /// Represents the base class for all types of folders (filesystem and non filesystem)
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "This will complicate the class hierarchy and naming convention used in the Shell area")]
- public abstract class ShellFolder : ShellContainer
- {
-
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/Common/ShellFolderItems.cs b/src/External/WindowsAPICodePack/Shell/Common/ShellFolderItems.cs
deleted file mode 100644
index 292e37c..0000000
--- a/src/External/WindowsAPICodePack/Shell/Common/ShellFolderItems.cs
+++ /dev/null
@@ -1,118 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Runtime.InteropServices;
-using MS.WindowsAPICodePack.Internal;
-
-namespace Microsoft.WindowsAPICodePack.Shell
-{
- class ShellFolderItems : IEnumerator
- {
- #region Private Fields
-
- private IEnumIDList nativeEnumIdList = null;
- private ShellObject currentItem = null;
- ShellContainer nativeShellFolder;
-
- #endregion
-
- #region Internal Constructor
-
- internal ShellFolderItems(ShellContainer nativeShellFolder)
- {
- this.nativeShellFolder = nativeShellFolder;
-
- HRESULT hr = nativeShellFolder.NativeShellFolder.EnumObjects(
- IntPtr.Zero,
- ShellNativeMethods.SHCONT.SHCONTF_FOLDERS | ShellNativeMethods.SHCONT.SHCONTF_NONFOLDERS,
- out nativeEnumIdList);
-
-
- if( !CoreErrorHelper.Succeeded( (int)hr ) )
- {
- if( hr == HRESULT.E_ERROR_CANCELLED )
- {
- throw new System.IO.FileNotFoundException( );
- }
- else
- {
- Marshal.ThrowExceptionForHR( (int)hr );
- }
- }
- }
-
- #endregion
-
- #region IEnumerator Members
-
- public ShellObject Current
- {
- get
- {
- return currentItem;
- }
- }
-
- #endregion
-
- #region IDisposable Members
-
- public void Dispose()
- {
- if (nativeEnumIdList != null)
- {
- Marshal.ReleaseComObject(nativeEnumIdList);
- nativeEnumIdList = null;
- }
- }
-
- #endregion
-
- #region IEnumerator Members
-
- object IEnumerator.Current
- {
- get
- {
- return currentItem;
- }
-
- }
-
- ///
- ///
- ///
- ///
- public bool MoveNext()
- {
- if (nativeEnumIdList == null)
- return false;
-
- IntPtr item;
- uint numItemsReturned;
- uint itemsRequested = 1;
- HRESULT hr = nativeEnumIdList.Next(itemsRequested, out item, out numItemsReturned);
-
- if (numItemsReturned < itemsRequested || hr != HRESULT.S_OK)
- return false;
-
- currentItem = ShellObjectFactory.Create(item, nativeShellFolder);
-
- return true;
- }
-
- ///
- ///
- ///
- public void Reset()
- {
- if(nativeEnumIdList != null)
- nativeEnumIdList.Reset();
- }
-
-
- #endregion
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/Common/ShellHelper.cs b/src/External/WindowsAPICodePack/Shell/Common/ShellHelper.cs
deleted file mode 100644
index 3f19e0b..0000000
--- a/src/External/WindowsAPICodePack/Shell/Common/ShellHelper.cs
+++ /dev/null
@@ -1,96 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.IO;
-using System.Runtime.InteropServices;
-using Microsoft.WindowsAPICodePack.Shell.PropertySystem;
-using MS.WindowsAPICodePack.Internal;
-
-namespace Microsoft.WindowsAPICodePack.Shell
-{
- ///
- /// A helper class for Shell Objects
- ///
- internal sealed class ShellHelper
- {
- private ShellHelper()
- {
- // Private constructor so no one can construct this using the default
- // provided by the compiler.
- }
-
- internal static string GetParsingName(IShellItem shellItem)
- {
- if (shellItem == null)
- return null;
-
- string path = null;
-
- IntPtr pszPath = IntPtr.Zero;
- HRESULT hr = shellItem.GetDisplayName(ShellNativeMethods.SIGDN.SIGDN_DESKTOPABSOLUTEPARSING, out pszPath);
-
- if (false ==
- (hr == HRESULT.S_OK ||
- hr == HRESULT.E_INVALIDARG))
- throw new COMException("GetParsingName", (int)hr);
-
- if (pszPath != IntPtr.Zero)
- {
- path = Marshal.PtrToStringAuto(pszPath);
- Marshal.FreeCoTaskMem( pszPath );
- pszPath = IntPtr.Zero;
- }
-
- return path;
-
- }
-
- internal static string GetAbsolutePath(string path)
- {
- if (Uri.IsWellFormedUriString(path, UriKind.Absolute))
- return path;
- else
- return Path.GetFullPath((path));
-
- }
-
- internal static PropertyKey ItemTypePropertyKey = new PropertyKey(new Guid("28636AA6-953D-11D2-B5D6-00C04FD918D0"), 11);
-
- internal static string GetItemType(IShellItem2 shellItem)
- {
- if (shellItem != null)
- {
- string itemType = null;
-
- HRESULT hr = shellItem.GetString(ref ItemTypePropertyKey, out itemType);
-
- if (hr == HRESULT.S_OK)
- return itemType;
- }
-
- return null;
- }
-
- internal static IntPtr PidlFromParsingName(string name)
- {
- IntPtr pidl;
-
- ShellNativeMethods.SFGAO sfgao;
- int retCode = ShellNativeMethods.SHParseDisplayName(name, IntPtr.Zero, out pidl, (ShellNativeMethods.SFGAO)0,
- out sfgao);
-
- return (CoreErrorHelper.Succeeded(retCode) ? pidl : IntPtr.Zero);
- }
-
- internal static IntPtr PidlFromShellItem(IShellItem nativeShellItem)
- {
- IntPtr shellItem = Marshal.GetComInterfaceForObject(nativeShellItem, typeof(IShellItem));
- IntPtr pidl;
-
- int retCode = ShellNativeMethods.SHGetIDListFromObject(shellItem, out pidl);
-
- return (CoreErrorHelper.Succeeded(retCode) ? pidl : IntPtr.Zero);
- }
-
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/Common/ShellItemArray.cs b/src/External/WindowsAPICodePack/Shell/Common/ShellItemArray.cs
deleted file mode 100644
index 23dfdff..0000000
--- a/src/External/WindowsAPICodePack/Shell/Common/ShellItemArray.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Collections.Generic;
-using Microsoft.WindowsAPICodePack.Shell.PropertySystem;
-using MS.WindowsAPICodePack.Internal;
-
-namespace Microsoft.WindowsAPICodePack.Shell
-{
- internal class ShellItemArray : IShellItemArray
- {
- List shellItemsList = new List();
-
- internal ShellItemArray(IShellItem[] shellItems)
- {
- shellItemsList.AddRange(shellItems);
- }
-
- #region IShellItemArray Members
-
- public HRESULT BindToHandler(IntPtr pbc, ref Guid rbhid, ref Guid riid, out IntPtr ppvOut)
- {
- throw new NotSupportedException();
- }
-
- public HRESULT GetPropertyStore(int Flags, ref Guid riid, out IntPtr ppv)
- {
- throw new NotSupportedException();
- }
-
- public HRESULT GetPropertyDescriptionList(ref PropertyKey keyType, ref Guid riid, out IntPtr ppv)
- {
- throw new NotSupportedException();
- }
-
- public HRESULT GetAttributes(ShellNativeMethods.SIATTRIBFLAGS dwAttribFlags, ShellNativeMethods.SFGAO sfgaoMask, out ShellNativeMethods.SFGAO psfgaoAttribs)
- {
- throw new NotSupportedException();
- }
-
- public HRESULT GetCount(out uint pdwNumItems)
- {
- pdwNumItems = (uint)shellItemsList.Count;
- return HRESULT.S_OK;
- }
-
- public HRESULT GetItemAt(uint dwIndex, out IShellItem ppsi)
- {
- int index = (int)dwIndex;
-
- if (index < shellItemsList.Count)
- {
- ppsi = shellItemsList[index];
- return HRESULT.S_OK;
- }
- else
- {
- ppsi = null;
- return HRESULT.E_FAIL;
- }
- }
-
- public HRESULT EnumItems(out IntPtr ppenumShellItems)
- {
- throw new NotSupportedException();
- }
-
- #endregion
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/Common/ShellLibrary.cs b/src/External/WindowsAPICodePack/Shell/Common/ShellLibrary.cs
deleted file mode 100644
index fcc907d..0000000
--- a/src/External/WindowsAPICodePack/Shell/Common/ShellLibrary.cs
+++ /dev/null
@@ -1,927 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.IO;
-using System.Runtime.InteropServices;
-using System.Threading;
-using MS.WindowsAPICodePack.Internal;
-
-namespace Microsoft.WindowsAPICodePack.Shell
-{
- ///
- /// A Shell Library in the Shell Namespace
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "This will complicate the class hierarchy and naming convention used in the Shell area")]
- public sealed class ShellLibrary : ShellContainer, IList
- {
- #region Private Fields
-
- private INativeShellLibrary nativeShellLibrary = null;
- private IKnownFolder knownFolder = null;
-
- private static Guid[] FolderTypesGuids =
- {
- new Guid(ShellKFIDGuid.GenericLibrary),
- new Guid(ShellKFIDGuid.DocumentsLibrary),
- new Guid(ShellKFIDGuid.MusicLibrary),
- new Guid(ShellKFIDGuid.PicturesLibrary),
- new Guid(ShellKFIDGuid.VideosLibrary)
- };
-
- #endregion
-
- #region Private Constructor
-
- //Construct the ShellLibrary object from a native Shell Library
- private ShellLibrary(INativeShellLibrary nativeShellLibrary)
- {
- CoreHelpers.ThrowIfNotWin7();
- this.nativeShellLibrary = nativeShellLibrary;
- }
-
- #endregion
-
- #region Public Constructors
-
- ///
- /// Creates a shell library in the Libraries Known Folder,
- /// using the given IKnownFolder
- ///
- /// KnownFolder from which to create the new Shell Library
- /// If true , opens the library in read-only mode.
- private ShellLibrary(IKnownFolder sourceKnownFolder, bool isReadOnly)
- {
- CoreHelpers.ThrowIfNotWin7();
-
- Debug.Assert(sourceKnownFolder != null);
-
- // Keep a reference locally
- knownFolder = sourceKnownFolder;
-
- nativeShellLibrary = (INativeShellLibrary)new ShellLibraryCoClass();
-
- ShellNativeMethods.STGM flags =
- isReadOnly ?
- ShellNativeMethods.STGM.Read :
- ShellNativeMethods.STGM.ReadWrite;
-
- // Get the IShellItem2
- base.nativeShellItem = ((ShellObject)sourceKnownFolder).NativeShellItem2;
-
- Guid guid = sourceKnownFolder.FolderId;
-
- // Load the library from the IShellItem2
- try
- {
- nativeShellLibrary.LoadLibraryFromKnownFolder(ref guid, flags);
- }
- catch (InvalidCastException)
- {
- throw new ArgumentException("The given known folder is not a valid library.", "sourceKnownFolder");
- }
- catch (NotImplementedException)
- {
- throw new ArgumentException("The given known folder is not a valid library.", "sourceKnownFolder");
- }
- }
-
- ///
- /// Creates a shell library in the Libraries Known Folder,
- /// using the given shell library name.
- ///
- /// The name of this library
- /// Allow overwriting an existing library; if one exists with the same name
- public ShellLibrary(string libraryName, bool overwrite)
- {
- CoreHelpers.ThrowIfNotWin7();
-
- if (String.IsNullOrEmpty(libraryName))
- {
- throw new ArgumentNullException("libraryName", "libraryName cannot be empty.");
- }
-
- this.Name = libraryName;
- Guid guid = new Guid(ShellKFIDGuid.Libraries);
-
- ShellNativeMethods.LIBRARYSAVEFLAGS flags =
- overwrite ?
- ShellNativeMethods.LIBRARYSAVEFLAGS.LSF_OVERRIDEEXISTING :
- ShellNativeMethods.LIBRARYSAVEFLAGS.LSF_FAILIFTHERE;
-
- nativeShellLibrary = (INativeShellLibrary)new ShellLibraryCoClass();
- nativeShellLibrary.SaveInKnownFolder(ref guid, libraryName, flags, out nativeShellItem);
- }
-
- ///
- /// Creates a shell library in a given Known Folder,
- /// using the given shell library name.
- ///
- /// The name of this library
- /// The known folder
- /// Override an existing library with the same name
- public ShellLibrary(string libraryName, IKnownFolder sourceKnownFolder, bool overwrite)
- {
- CoreHelpers.ThrowIfNotWin7();
- if (String.IsNullOrEmpty(libraryName))
- {
- throw new ArgumentNullException("libraryName", "libraryName cannot be empty.");
- }
-
- knownFolder = sourceKnownFolder;
-
- this.Name = libraryName;
- Guid guid = knownFolder.FolderId;
-
- ShellNativeMethods.LIBRARYSAVEFLAGS flags =
- overwrite ?
- ShellNativeMethods.LIBRARYSAVEFLAGS.LSF_OVERRIDEEXISTING :
- ShellNativeMethods.LIBRARYSAVEFLAGS.LSF_FAILIFTHERE;
-
- nativeShellLibrary = (INativeShellLibrary)new ShellLibraryCoClass();
- nativeShellLibrary.SaveInKnownFolder(ref guid, libraryName, flags, out nativeShellItem);
- }
-
- ///
- /// Creates a shell library in a given local folder,
- /// using the given shell library name.
- ///
- /// The name of this library
- /// The path to the local folder
- /// Override an existing library with the same name
- public ShellLibrary(string libraryName, string folderPath, bool overwrite)
- {
- CoreHelpers.ThrowIfNotWin7();
-
- if (String.IsNullOrEmpty(libraryName))
- {
- throw new ArgumentNullException("libraryName", "libraryName cannot be empty.");
- }
-
- if (!Directory.Exists(folderPath))
- {
- throw new DirectoryNotFoundException("Folder path not found.");
- }
-
- this.Name = libraryName;
-
- ShellNativeMethods.LIBRARYSAVEFLAGS flags =
- overwrite ?
- ShellNativeMethods.LIBRARYSAVEFLAGS.LSF_OVERRIDEEXISTING :
- ShellNativeMethods.LIBRARYSAVEFLAGS.LSF_FAILIFTHERE;
-
- Guid guid = new Guid(ShellIIDGuid.IShellItem);
-
- IShellItem shellItemIn = null;
- ShellNativeMethods.SHCreateItemFromParsingName(folderPath, IntPtr.Zero, ref guid, out shellItemIn);
-
- nativeShellLibrary = (INativeShellLibrary)new ShellLibraryCoClass();
- nativeShellLibrary.Save(shellItemIn, libraryName, flags, out nativeShellItem);
- }
-
- #endregion
-
- #region Public Properties
-
- ///
- /// The name of the library, every library must
- /// have a name
- ///
- /// Will throw if no Icon is set
- public override string Name
- {
- get
- {
- if (base.Name == null && NativeShellItem != null)
- {
- base.Name = System.IO.Path.GetFileNameWithoutExtension(ShellHelper.GetParsingName(NativeShellItem));
- }
-
- return base.Name;
- }
- }
-
- ///
- /// The Resource Reference to the icon.
- ///
- public IconReference IconResourceId
- {
- get
- {
- string iconRef;
- nativeShellLibrary.GetIcon(out iconRef);
- return new IconReference(iconRef);
- }
-
- set
- {
- nativeShellLibrary.SetIcon(value.ReferencePath);
- nativeShellLibrary.Commit();
- }
- }
-
- ///
- /// One of predefined Library types
- ///
- /// Will throw if no Library Type is set
- public LibraryFolderType LibraryType
- {
- get
- {
- Guid folderTypeGuid;
- nativeShellLibrary.GetFolderType(out folderTypeGuid);
-
- return GetFolderTypefromGuid(folderTypeGuid);
- }
-
- set
- {
- Guid guid = FolderTypesGuids[(int)value];
- nativeShellLibrary.SetFolderType(ref guid);
- nativeShellLibrary.Commit();
- }
- }
-
- ///
- /// The Guid of the Library type
- ///
- /// Will throw if no Library Type is set
- public Guid LibraryTypeId
- {
- get
- {
- Guid folderTypeGuid;
- nativeShellLibrary.GetFolderType(out folderTypeGuid);
-
- return folderTypeGuid;
- }
- }
-
- private static LibraryFolderType GetFolderTypefromGuid(Guid folderTypeGuid)
- {
- for (int i = 0; i < FolderTypesGuids.Length; i++)
- {
- if (folderTypeGuid.Equals(FolderTypesGuids[i]))
- return (LibraryFolderType)i;
- }
- throw new ArgumentOutOfRangeException("folderTypeGuid", "Invalid FoldeType Guid");
- }
-
- ///
- /// By default, this folder is the first location
- /// added to the library. The default save folder
- /// is both the default folder where files can
- /// be saved, and also where the library XML
- /// file will be saved, if no other path is specified
- ///
- public string DefaultSaveFolder
- {
- get
- {
- Guid guid = new Guid(ShellIIDGuid.IShellItem);
-
- IShellItem saveFolderItem;
-
- nativeShellLibrary.GetDefaultSaveFolder(
- ShellNativeMethods.DEFAULTSAVEFOLDERTYPE.DSFT_DETECT,
- ref guid,
- out saveFolderItem);
-
- return ShellHelper.GetParsingName(saveFolderItem);
- }
-
- set
- {
- if (String.IsNullOrEmpty(value))
- {
- throw new ArgumentNullException("value");
- }
-
- if (!Directory.Exists(value))
- throw new DirectoryNotFoundException("DefaultSaveFolder Path not found.");
-
- string fullPath = new DirectoryInfo(value).FullName;
-
- Guid guid = new Guid(ShellIIDGuid.IShellItem);
- IShellItem saveFolderItem;
-
- ShellNativeMethods.SHCreateItemFromParsingName(fullPath, IntPtr.Zero, ref guid, out saveFolderItem);
-
- nativeShellLibrary.SetDefaultSaveFolder(
- ShellNativeMethods.DEFAULTSAVEFOLDERTYPE.DSFT_DETECT,
- saveFolderItem);
-
- nativeShellLibrary.Commit();
- }
- }
-
- ///
- /// Whether the library will be pinned to the
- /// Explorer Navigation Pane
- ///
- public bool IsPinnedToNavigationPane
- {
- get
- {
- ShellNativeMethods.LIBRARYOPTIONFLAGS flags =
- ShellNativeMethods.LIBRARYOPTIONFLAGS.LOF_PINNEDTONAVPANE;
-
- nativeShellLibrary.GetOptions(out flags);
-
- return (
- (flags & ShellNativeMethods.LIBRARYOPTIONFLAGS.LOF_PINNEDTONAVPANE) ==
- ShellNativeMethods.LIBRARYOPTIONFLAGS.LOF_PINNEDTONAVPANE);
- }
-
- set
- {
- ShellNativeMethods.LIBRARYOPTIONFLAGS flags =
- ShellNativeMethods.LIBRARYOPTIONFLAGS.LOF_DEFAULT;
-
- if (value)
- flags |= ShellNativeMethods.LIBRARYOPTIONFLAGS.LOF_PINNEDTONAVPANE;
- else
- flags &= ~ShellNativeMethods.LIBRARYOPTIONFLAGS.LOF_PINNEDTONAVPANE;
-
- nativeShellLibrary.SetOptions(ShellNativeMethods.LIBRARYOPTIONFLAGS.LOF_PINNEDTONAVPANE, flags);
- nativeShellLibrary.Commit();
-
- }
- }
-
- #endregion
-
- #region Public Methods
-
- ///
- /// Close the library, and release its associated file system resources
- ///
- public void Close()
- {
- this.Dispose();
- }
-
- #endregion
-
- #region Internal Properties
-
- internal const string FileExtension = ".library-ms";
-
- internal override IShellItem NativeShellItem
- {
- get
- {
- return NativeShellItem2;
- }
-
- }
-
- internal override IShellItem2 NativeShellItem2
- {
- get
- {
- return nativeShellItem;
- }
- }
-
- #endregion
-
- #region Static Shell Library methods
-
- ///
- /// Get a the known folder FOLDERID_Libraries
- ///
- public static IKnownFolder LibrariesKnownFolder
- {
- get
- {
- CoreHelpers.ThrowIfNotWin7();
- return KnownFolderHelper.FromKnownFolderId(new Guid(ShellKFIDGuid.Libraries));
- }
- }
-
- ///
- /// Load the library using a number of options
- ///
- /// The name of the library
- /// If true, loads the library in read-only mode.
- /// A ShellLibrary Object
- public static ShellLibrary Load(
- string libraryName,
- bool isReadOnly)
- {
- CoreHelpers.ThrowIfNotWin7();
-
- IKnownFolder kf = KnownFolders.Libraries;
- string librariesFolderPath = (kf != null) ? kf.Path : string.Empty;
-
- Guid guid = new Guid(ShellIIDGuid.IShellItem);
- IShellItem nativeShellItem;
- string shellItemPath = System.IO.Path.Combine(librariesFolderPath, libraryName + FileExtension);
- int hr = ShellNativeMethods.SHCreateItemFromParsingName(shellItemPath, IntPtr.Zero, ref guid, out nativeShellItem);
-
- if (!CoreErrorHelper.Succeeded(hr))
- throw Marshal.GetExceptionForHR(hr);
-
- INativeShellLibrary nativeShellLibrary = (INativeShellLibrary)new ShellLibraryCoClass();
- ShellNativeMethods.STGM flags =
- isReadOnly ?
- ShellNativeMethods.STGM.Read :
- ShellNativeMethods.STGM.ReadWrite;
- nativeShellLibrary.LoadLibraryFromItem(nativeShellItem, flags);
-
- ShellLibrary library = new ShellLibrary(nativeShellLibrary);
- library.nativeShellItem = (IShellItem2)nativeShellItem;
- library.Name = libraryName;
-
- return library;
- }
-
- ///
- /// Load the library using a number of options
- ///
- /// The name of the library.
- /// The path to the library.
- /// If true, opens the library in read-only mode.
- /// A ShellLibrary Object
- public static ShellLibrary Load(
- string libraryName,
- string folderPath,
- bool isReadOnly)
- {
-
- CoreHelpers.ThrowIfNotWin7();
-
- // Create the shell item path
- string shellItemPath = System.IO.Path.Combine(folderPath, libraryName + FileExtension);
- ShellFile item = ShellFile.FromFilePath(shellItemPath);
-
- IShellItem nativeShellItem = item.NativeShellItem;
- INativeShellLibrary nativeShellLibrary = (INativeShellLibrary)new ShellLibraryCoClass();
- ShellNativeMethods.STGM flags =
- isReadOnly ?
- ShellNativeMethods.STGM.Read :
- ShellNativeMethods.STGM.ReadWrite;
- nativeShellLibrary.LoadLibraryFromItem(nativeShellItem, flags);
-
- ShellLibrary library = new ShellLibrary(nativeShellLibrary);
- library.nativeShellItem = (IShellItem2)nativeShellItem;
- library.Name = libraryName;
-
- return library;
- }
-
- ///
- /// Load the library using a number of options
- ///
- /// IShellItem
- /// read-only flag
- /// A ShellLibrary Object
- internal static ShellLibrary FromShellItem(
- IShellItem nativeShellItem,
- bool isReadOnly)
- {
- CoreHelpers.ThrowIfNotWin7();
-
- INativeShellLibrary nativeShellLibrary = (INativeShellLibrary)new ShellLibraryCoClass();
-
- ShellNativeMethods.STGM flags =
- isReadOnly ?
- ShellNativeMethods.STGM.Read :
- ShellNativeMethods.STGM.ReadWrite;
-
- nativeShellLibrary.LoadLibraryFromItem(nativeShellItem, flags);
-
- ShellLibrary library = new ShellLibrary(nativeShellLibrary);
- library.nativeShellItem = (IShellItem2)nativeShellItem;
-
- return library;
- }
-
- ///
- /// Load the library using a number of options
- ///
- /// A known folder.
- /// If true, opens the library in read-only mode.
- /// A ShellLibrary Object
- public static ShellLibrary Load(
- IKnownFolder sourceKnownFolder,
- bool isReadOnly)
- {
- CoreHelpers.ThrowIfNotWin7();
- return new ShellLibrary(sourceKnownFolder, isReadOnly);
- }
-
- private static void ShowManageLibraryUI(ShellLibrary shellLibrary, IntPtr windowHandle, string title, string instruction, bool allowAllLocations)
- {
- int hr = 0;
-
- Thread staWorker = new Thread(() =>
- {
- hr = ShellNativeMethods.SHShowManageLibraryUI(
- shellLibrary.NativeShellItem,
- windowHandle,
- title,
- instruction,
- allowAllLocations ?
- ShellNativeMethods.LIBRARYMANAGEDIALOGOPTIONS.LMD_NOUNINDEXABLELOCATIONWARNING :
- ShellNativeMethods.LIBRARYMANAGEDIALOGOPTIONS.LMD_DEFAULT);
- });
-
- staWorker.SetApartmentState(ApartmentState.STA);
- staWorker.Start();
- staWorker.Join();
-
- if (!CoreErrorHelper.Succeeded(hr))
- Marshal.ThrowExceptionForHR(hr);
- }
-
- ///
- /// Shows the library management dialog which enables users to mange the library folders and default save location.
- ///
- /// The name of the library
- /// The path to the library.
- /// The parent window,or IntPtr.Zero for no parent
- /// A title for the library management dialog, or null to use the library name as the title
- /// An optional help string to display for the library management dialog
- /// If true, do not show warning dialogs about locations that cannot be indexed
- /// If the library is already open in read-write mode, the dialog will not save the changes.
- public static void ShowManageLibraryUI(string libraryName, string folderPath, IntPtr windowHandle, string title, string instruction, bool allowAllLocations)
- {
- // this method is not safe for MTA consumption and will blow
- // Access Violations if called from an MTA thread so we wrap this
- // call up into a Worker thread that performs all operations in a
- // single threaded apartment
- using (ShellLibrary shellLibrary = ShellLibrary.Load(libraryName, folderPath, true))
- {
- ShowManageLibraryUI(shellLibrary, windowHandle, title, instruction, allowAllLocations);
- }
- }
-
- ///
- /// Shows the library management dialog which enables users to mange the library folders and default save location.
- ///
- /// The name of the library
- /// The parent window,or IntPtr.Zero for no parent
- /// A title for the library management dialog, or null to use the library name as the title
- /// An optional help string to display for the library management dialog
- /// If true, do not show warning dialogs about locations that cannot be indexed
- /// If the library is already open in read-write mode, the dialog will not save the changes.
- public static void ShowManageLibraryUI(string libraryName, IntPtr windowHandle, string title, string instruction, bool allowAllLocations)
- {
- // this method is not safe for MTA consumption and will blow
- // Access Violations if called from an MTA thread so we wrap this
- // call up into a Worker thread that performs all operations in a
- // single threaded apartment
- using (ShellLibrary shellLibrary = ShellLibrary.Load(libraryName, true))
- {
- ShowManageLibraryUI(shellLibrary, windowHandle, title, instruction, allowAllLocations);
- }
- }
-
- ///
- /// Shows the library management dialog which enables users to mange the library folders and default save location.
- ///
- /// A known folder.
- /// The parent window,or IntPtr.Zero for no parent
- /// A title for the library management dialog, or null to use the library name as the title
- /// An optional help string to display for the library management dialog
- /// If true, do not show warning dialogs about locations that cannot be indexed
- /// If the library is already open in read-write mode, the dialog will not save the changes.
- public static void ShowManageLibraryUI(IKnownFolder sourceKnownFolder, IntPtr windowHandle, string title, string instruction, bool allowAllLocations)
- {
- // this method is not safe for MTA consumption and will blow
- // Access Violations if called from an MTA thread so we wrap this
- // call up into a Worker thread that performs all operations in a
- // single threaded apartment
- using (ShellLibrary shellLibrary = ShellLibrary.Load(sourceKnownFolder, true))
- {
- ShowManageLibraryUI(shellLibrary, windowHandle, title, instruction, allowAllLocations);
- }
- }
-
- #endregion
-
- #region Collection Members
-
- ///
- /// Add a new FileSystemFolder or SearchConnector
- ///
- /// The folder to add to the library.
- public void Add(ShellFileSystemFolder item)
- {
- nativeShellLibrary.AddFolder(item.NativeShellItem);
- nativeShellLibrary.Commit();
- }
-
- ///
- /// Add an existing folder to this library
- ///
- /// The path to the folder to be added to the library.
- public void Add(string folderPath)
- {
- if (!Directory.Exists(folderPath))
- {
- throw new DirectoryNotFoundException("Folder path not found.");
- }
-
- Add(ShellFileSystemFolder.FromFolderPath(folderPath));
- }
-
- ///
- /// Clear all items of this Library
- ///
- public void Clear()
- {
- List list = ItemsList;
- foreach (ShellFileSystemFolder folder in list)
- {
- nativeShellLibrary.RemoveFolder(folder.NativeShellItem);
- }
-
- nativeShellLibrary.Commit();
- }
-
- ///
- /// Remove a folder or search connector
- ///
- /// The item to remove.
- /// true if the item was removed.
- public bool Remove(ShellFileSystemFolder item)
- {
- try
- {
- nativeShellLibrary.RemoveFolder(item.NativeShellItem);
- nativeShellLibrary.Commit();
- }
- catch (COMException)
- {
- return false;
- }
-
- return true;
- }
-
- ///
- /// Remove a folder or search connector
- ///
- /// The path of the item to remove.
- /// true if the item was removed.
- public bool Remove(string folderPath)
- {
- ShellFileSystemFolder item = ShellFileSystemFolder.FromFolderPath(folderPath);
- return Remove(item);
- }
-
- #endregion
-
- #region Disposable Pattern
-
- ///
- /// Release resources
- ///
- /// Indicates that this was called from Dispose(), rather than from the finalizer.
- protected override void Dispose(bool disposing)
- {
- if (nativeShellLibrary != null)
- {
- Marshal.ReleaseComObject(nativeShellLibrary);
- nativeShellLibrary = null;
- }
-
- base.Dispose(disposing);
- }
-
- ///
- /// Release resources
- ///
- ~ShellLibrary()
- {
- Dispose(false);
- }
-
- #endregion
-
- #region Private Properties
-
- private List ItemsList
- {
- get
- {
- return GetFolders();
- }
-
- }
- private List GetFolders()
- {
- List list = new List();
- IShellItemArray itemArray;
-
- Guid shellItemArrayGuid = new Guid(ShellIIDGuid.IShellItemArray);
-
- HRESULT hr = nativeShellLibrary.GetFolders(ShellNativeMethods.LIBRARYFOLDERFILTER.LFF_ALLITEMS, ref shellItemArrayGuid, out itemArray);
-
- if(!CoreErrorHelper.Succeeded((int)hr))
- return list;
-
- uint count;
- itemArray.GetCount(out count);
-
- for (uint i = 0; i < count; ++i)
- {
- IShellItem shellItem;
- itemArray.GetItemAt(i, out shellItem);
- list.Add(new ShellFileSystemFolder(shellItem as IShellItem2));
- }
-
- if (itemArray != null)
- {
- Marshal.ReleaseComObject(itemArray);
- itemArray = null;
- }
-
- return list;
- }
-
- #endregion
-
- #region IEnumerable Members
-
- ///
- /// Retrieves the collection enumerator.
- ///
- /// The enumerator.
- new public IEnumerator GetEnumerator()
- {
- return ItemsList.GetEnumerator();
- }
-
- #endregion
-
- #region IEnumerable Members
-
- ///
- /// Retrieves the collection enumerator.
- ///
- /// The enumerator.
- System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
- {
- return ItemsList.GetEnumerator();
- }
-
- #endregion
-
- #region ICollection Members
-
-
- ///
- /// Determines if an item with the specified path exists in the collection.
- ///
- /// The path of the item.
- /// true if the item exists in the collection.
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1309:UseOrdinalStringComparison", MessageId = "System.String.Equals(System.String,System.StringComparison)", Justification = "We are not currently handling globalization or localization")]
- public bool Contains(string fullPath)
- {
- if (String.IsNullOrEmpty(fullPath))
- {
- throw new ArgumentNullException("fullPath");
- }
-
- List list = ItemsList;
-
- foreach (ShellFileSystemFolder folder in list)
- {
- if (fullPath.Equals(folder.Path, StringComparison.InvariantCultureIgnoreCase))
- return true;
- }
-
- return false;
- }
-
- ///
- /// Determines if a folder exists in the collection.
- ///
- /// The folder.
- /// true, if the folder exists in the collection.
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1309:UseOrdinalStringComparison", MessageId = "System.String.Equals(System.String,System.StringComparison)", Justification = "We are not currently handling globalization or localization")]
- public bool Contains(ShellFileSystemFolder item)
- {
- if (item == null)
- {
- throw new ArgumentNullException("item");
- }
-
- List list = ItemsList;
-
- foreach (ShellFileSystemFolder folder in list)
- {
- if (item.Path.Equals(folder.Path, StringComparison.InvariantCultureIgnoreCase))
- return true;
- }
-
- return false;
- }
-
- #endregion
-
- #region IList Members
-
- ///
- /// Searches for the specified FileSystemFolder and returns the zero-based index of the
- /// first occurrence within Library list.
- ///
- /// The item to search for.
- /// The index of the item in the collection, or -1 if the item does not exist.
- public int IndexOf(ShellFileSystemFolder item)
- {
- return ItemsList.IndexOf(item);
- }
-
- ///
- /// Inserts a FileSystemFolder at the specified index.
- ///
- /// The index to insert at.
- /// The FileSystemFolder to insert.
- void IList.Insert(int index, ShellFileSystemFolder item)
- {
- // Index related options are not supported by IShellLibrary
- // doesn't support them.
- throw new NotImplementedException();
- }
-
- ///
- /// Removes an item at the specified index.
- ///
- /// The index to remove.
- void IList.RemoveAt(int index)
- {
- // Index related options are not supported by IShellLibrary
- // doesn't support them.
- throw new NotImplementedException();
- }
-
- ///
- /// Retrieves the folder at the specified index
- ///
- /// The index of the folder to retrieve.
- /// A folder.
- public ShellFileSystemFolder this[int index]
- {
- get
- {
- return ItemsList[index];
- }
- set
- {
- // Index related options are not supported by IShellLibrary
- // doesn't support them.
- throw new NotImplementedException();
- }
- }
- #endregion
-
- #region ICollection Members
-
- ///
- /// Copies the collection to an array.
- ///
- /// The array to copy to.
- /// The index in the array at which to start the copy.
- void ICollection.CopyTo(ShellFileSystemFolder[] array, int arrayIndex)
- {
- throw new NotImplementedException();
- }
-
- ///
- /// The count of the items in the list.
- ///
- public int Count
- {
- get { return ItemsList.Count; }
- }
-
- ///
- /// Indicates whether this list is read-only or not.
- ///
- public bool IsReadOnly
- {
- get { return false; }
- }
-
- #endregion
-
- ///
- /// Indicates whether this feature is supported on the current platform.
- ///
- new public static bool IsPlatformSupported
- {
- get
- {
- // We need Windows 7 onwards ...
- return CoreHelpers.RunningOnWin7;
- }
- }
- }
-
-}
diff --git a/src/External/WindowsAPICodePack/Shell/Common/ShellLink.cs b/src/External/WindowsAPICodePack/Shell/Common/ShellLink.cs
deleted file mode 100644
index bbd12ed..0000000
--- a/src/External/WindowsAPICodePack/Shell/Common/ShellLink.cs
+++ /dev/null
@@ -1,107 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-
-namespace Microsoft.WindowsAPICodePack.Shell
-{
- ///
- /// Represents a link to existing FileSystem or Virtual item.
- ///
- public class ShellLink : ShellObject
- {
- ///
- /// Path for this file e.g. c:\Windows\file.txt,
- ///
- private string internalPath = null;
-
- #region Internal Constructors
-
- internal ShellLink(IShellItem2 shellItem)
- {
- nativeShellItem = shellItem;
- }
-
- #endregion
-
- #region Public Properties
-
- ///
- /// The path for this link
- ///
- virtual public string Path
- {
- get
- {
- if (internalPath == null && NativeShellItem != null)
- {
- internalPath = base.ParsingName;
- }
- return internalPath;
- }
- protected set
- {
- this.internalPath = value;
- }
- }
-
- private string internalTargetLocation;
- ///
- /// Gets the location to which this link points to.
- ///
- public string TargetLocation
- {
- get
- {
- if (string.IsNullOrEmpty(internalTargetLocation) && NativeShellItem2 != null)
- internalTargetLocation = this.Properties.System.Link.TargetParsingPath.Value;
-
- return internalTargetLocation;
- }
- set
- {
- if (value == null)
- return;
-
- internalTargetLocation = value;
-
- if (NativeShellItem2 != null)
- this.Properties.System.Link.TargetParsingPath.Value = internalTargetLocation;
- }
- }
-
- ///
- /// Gets the ShellObject to which this link points to.
- ///
- public ShellObject TargetShellObject
- {
- get
- {
- return ShellObjectFactory.Create(TargetLocation);
- }
- }
-
- ///
- /// Gets or sets the link's title
- ///
- public string Title
- {
- get
- {
- if (NativeShellItem2 != null)
- return this.Properties.System.Title.Value;
- else
- return null;
- }
- set
- {
- if (value == null)
- throw new ArgumentNullException("value");
-
- if (NativeShellItem2 != null)
- this.Properties.System.Title.Value = value;
- }
- }
-
- #endregion
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/Common/ShellNonFileSystemFolder.cs b/src/External/WindowsAPICodePack/Shell/Common/ShellNonFileSystemFolder.cs
deleted file mode 100644
index da77cc0..0000000
--- a/src/External/WindowsAPICodePack/Shell/Common/ShellNonFileSystemFolder.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-
-namespace Microsoft.WindowsAPICodePack.Shell
-{
- ///
- /// Represents a Non FileSystem folder (e.g. My Computer, Control Panel)
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "This will complicate the class hierarchy and naming convention used in the Shell area")]
- public class ShellNonFileSystemFolder : ShellFolder
- {
- #region Internal Constructors
-
- internal ShellNonFileSystemFolder()
- {
-
- }
-
- internal ShellNonFileSystemFolder(IShellItem2 shellItem)
- {
- nativeShellItem = shellItem;
- }
-
- #endregion
-
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/Common/ShellNonFileSystemItem.cs b/src/External/WindowsAPICodePack/Shell/Common/ShellNonFileSystemItem.cs
deleted file mode 100644
index f4d63bb..0000000
--- a/src/External/WindowsAPICodePack/Shell/Common/ShellNonFileSystemItem.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-namespace Microsoft.WindowsAPICodePack.Shell
-{
- ///
- /// Represents a non filesystem item (e.g. virtual items inside Control Panel)
- ///
- public class ShellNonFileSystemItem : ShellObjectNode
- {
- internal ShellNonFileSystemItem(IShellItem2 shellItem)
- {
- nativeShellItem = shellItem;
- }
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/Common/ShellObject.cs b/src/External/WindowsAPICodePack/Shell/Common/ShellObject.cs
deleted file mode 100644
index c6694e0..0000000
--- a/src/External/WindowsAPICodePack/Shell/Common/ShellObject.cs
+++ /dev/null
@@ -1,517 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.IO;
-using System.Runtime.InteropServices;
-using System.Security.Cryptography;
-using Microsoft.WindowsAPICodePack.Shell.PropertySystem;
-using MS.WindowsAPICodePack.Internal;
-
-namespace Microsoft.WindowsAPICodePack.Shell
-{
- ///
- /// The base class for all Shell objects in Shell Namespace.
- ///
- abstract public class ShellObject : IDisposable, IEquatable
- {
-
- #region Public Static Methods
-
- ///
- /// Creates a ShellObject subclass given a parsing name.
- /// For file system items, this method will only accept absolute paths.
- ///
- /// The parsing name of the object.
- /// A newly constructed ShellObject object.
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1304:SpecifyCultureInfo", MessageId = "System.String.ToLower")]
- public static ShellObject FromParsingName(string parsingName)
- {
- return ShellObjectFactory.Create(parsingName);
- }
-
- ///
- /// Indicates whether this feature is supported on the current platform.
- ///
- public static bool IsPlatformSupported
- {
- get
- {
- // We need Windows Vista onwards ...
- return CoreHelpers.RunningOnVista;
- }
- }
-
- #endregion
-
- #region Internal Fields
-
- ///
- /// Internal member to keep track of the native IShellItem2
- ///
- internal IShellItem2 nativeShellItem;
-
- #endregion
-
- #region Constructors
-
- internal ShellObject()
- {
- }
-
- internal ShellObject(IShellItem2 shellItem)
- {
- nativeShellItem = shellItem;
- }
-
- #endregion
-
- #region Protected Fields
-
- ///
- /// Parsing name for this Object e.g. c:\Windows\file.txt,
- /// or ::{Some Guid}
- ///
- private string internalParsingName = null;
-
- ///
- /// A friendly name for this object that' suitable for display
- ///
- private string internalName = null;
-
- ///
- /// PID List (PIDL) for this object
- ///
- private IntPtr internalPIDL = IntPtr.Zero;
-
- #endregion
-
- #region Internal Properties
-
- ///
- /// Return the native ShellFolder object as newer IShellItem2
- ///
- /// If the native object cannot be created.
- /// The ErrorCode member will contain the external error code.
- virtual internal IShellItem2 NativeShellItem2
- {
- get
- {
- if (nativeShellItem == null && ParsingName != null)
- {
- Guid guid = new Guid(ShellIIDGuid.IShellItem2);
- int retCode = ShellNativeMethods.SHCreateItemFromParsingName(ParsingName, IntPtr.Zero, ref guid, out nativeShellItem);
-
- if (nativeShellItem == null || !CoreErrorHelper.Succeeded(retCode))
- {
- throw new ExternalException("Shell item could not be created.", Marshal.GetExceptionForHR(retCode));
- }
- }
- return nativeShellItem;
- }
- }
-
- ///
- /// Return the native ShellFolder object
- ///
- virtual internal IShellItem NativeShellItem
- {
- get
- {
- return NativeShellItem2;
- }
- }
-
- ///
- /// Gets access to the native IPropertyStore (if one is already
- /// created for this item and still valid. This is usually done by the
- /// ShellPropertyWriter class. The reference will be set to null
- /// when the writer has been closed/commited).
- ///
- internal IPropertyStore NativePropertyStore
- {
- get;
- set;
- }
-
- #endregion
-
- #region Public Properties
-
- private ShellProperties properties = null;
- ///
- /// Gets an object that allows the manipulation of ShellProperties for this shell item.
- ///
- public ShellProperties Properties
- {
- get
- {
- if (properties == null)
- {
- properties = new ShellProperties(this);
- }
- return properties;
- }
- }
-
- ///
- /// Gets the parsing name for this ShellItem.
- ///
- virtual public string ParsingName
- {
- get
- {
- if (internalParsingName == null && nativeShellItem != null)
- {
- internalParsingName = ShellHelper.GetParsingName(nativeShellItem);
- }
- return internalParsingName;
- }
- protected set
- {
- this.internalParsingName = value;
- }
- }
-
- ///
- /// Gets the normal display for this ShellItem.
- ///
- virtual public string Name
- {
- get
- {
- if (internalName == null && NativeShellItem != null)
- {
- IntPtr pszString = IntPtr.Zero;
- HRESULT hr = NativeShellItem.GetDisplayName(ShellNativeMethods.SIGDN.SIGDN_NORMALDISPLAY, out pszString);
- if (hr == HRESULT.S_OK && pszString != IntPtr.Zero)
- {
- internalName = Marshal.PtrToStringAuto(pszString);
-
- // Free the string
- Marshal.FreeCoTaskMem(pszString);
-
- }
- }
- return internalName;
- }
-
- protected set
- {
- this.internalName = value;
- }
- }
-
- ///
- /// Gets the PID List (PIDL) for this ShellItem.
- ///
- virtual internal IntPtr PIDL
- {
- get
- {
- // Get teh PIDL for the ShellItem
- if (internalPIDL == IntPtr.Zero && NativeShellItem != null)
- internalPIDL = ShellHelper.PidlFromShellItem(NativeShellItem);
-
- return internalPIDL;
- }
- set
- {
- this.internalPIDL = value;
- }
- }
-
- ///
- /// Overrides object.ToString()
- ///
- /// A string representation of the object.
- public override string ToString()
- {
- return this.Name;
- }
-
- ///
- /// Returns the display name of the ShellFolder object. DisplayNameType represents one of the
- /// values that indicates how the name should look.
- /// See for a list of possible values.
- ///
- /// A disaply name type.
- /// A string.
- virtual public string GetDisplayName(DisplayNameType displayNameType)
- {
- string returnValue = null;
-
- HRESULT hr = HRESULT.S_OK;
-
- if (NativeShellItem2 != null)
- hr = NativeShellItem2.GetDisplayName((ShellNativeMethods.SIGDN)displayNameType, out returnValue);
-
- if (hr != HRESULT.S_OK)
- throw new COMException("Can't get the display name", (int)hr);
-
- return returnValue;
- }
-
- ///
- /// Gets a value that determines if this ShellObject is a link or shortcut.
- ///
- public bool IsLink
- {
- get
- {
- try
- {
- ShellNativeMethods.SFGAO sfgao;
- NativeShellItem.GetAttributes(ShellNativeMethods.SFGAO.SFGAO_LINK, out sfgao);
- return (sfgao & ShellNativeMethods.SFGAO.SFGAO_LINK) != 0;
- }
- catch (FileNotFoundException)
- {
- return false;
- }
- catch (NullReferenceException)
- {
- // NativeShellItem is null
- return false;
- }
- }
- }
-
- ///
- /// Gets a value that determines if this ShellObject is a file system object.
- ///
- public bool IsFileSystemObject
- {
- get
- {
- try
- {
- ShellNativeMethods.SFGAO sfgao;
- NativeShellItem.GetAttributes(ShellNativeMethods.SFGAO.SFGAO_FILESYSTEM, out sfgao);
- return (sfgao & ShellNativeMethods.SFGAO.SFGAO_FILESYSTEM) != 0;
- }
- catch (FileNotFoundException)
- {
- return false;
- }
- catch (NullReferenceException)
- {
- // NativeShellItem is null
- return false;
- }
- }
- }
-
- private ShellThumbnail thumbnail;
- ///
- /// Gets the thumbnail of the ShellObject.
- ///
- public ShellThumbnail Thumbnail
- {
- get
- {
- if (thumbnail == null)
- thumbnail = new ShellThumbnail(this);
-
- return thumbnail;
- }
- }
-
- private ShellObject parentShellObject = null;
- ///
- /// Gets the parent ShellObject.
- /// Returns null if the object has no parent, i.e. if this object is the Desktop folder.
- ///
- public ShellObject Parent
- {
- get
- {
- if (parentShellObject == null && NativeShellItem2 != null)
- {
- IShellItem parentShellItem = null;
-
- HRESULT hr = NativeShellItem2.GetParent(out parentShellItem);
-
- if (hr == HRESULT.S_OK && parentShellItem != null)
- parentShellObject = ShellObjectFactory.Create(parentShellItem);
- else if (hr == HRESULT.NO_OBJECT)
- {
- // Should return null if the parent is desktop
- return null;
- }
- else
- {
- throw Marshal.GetExceptionForHR((int)hr);
- }
- }
-
- return parentShellObject;
- }
- }
-
-
- #endregion
-
- #region IDisposable Members
-
- ///
- /// Release the native and managed objects
- ///
- /// Indicates that this is being called from Dispose(), rather than the finalizer.
- protected virtual void Dispose(bool disposing)
- {
- if (disposing)
- {
- internalName = null;
- internalParsingName = null;
- properties = null;
- thumbnail = null;
- parentShellObject = null;
- }
-
- if (internalPIDL != IntPtr.Zero)
- {
- ShellNativeMethods.ILFree(internalPIDL);
- internalPIDL = IntPtr.Zero;
- }
-
- if (nativeShellItem != null)
- {
- Marshal.ReleaseComObject(nativeShellItem);
- nativeShellItem = null;
- }
-
- if (NativePropertyStore != null)
- {
- Marshal.ReleaseComObject(NativePropertyStore);
- NativePropertyStore = null;
- }
-
- }
-
- ///
- /// Release the native objects.
- ///
- public void Dispose()
- {
- Dispose(true);
- GC.SuppressFinalize(this);
- }
-
- ///
- /// Implement the finalizer.
- ///
- ~ShellObject()
- {
- Dispose(false);
- }
-
- #endregion
-
- #region equality and hashing
-
- ///
- /// Returns the hash code of the object.
- ///
- ///
- public override int GetHashCode( )
- {
- if( !hashValue.HasValue )
- {
- uint size = ShellNativeMethods.ILGetSize( PIDL );
- if( size != 0 )
- {
- byte[ ] pidlData = new byte[ size ];
- Marshal.Copy( PIDL, pidlData, 0, (int)size );
- byte[ ] hashData = ShellObject.hashProvider.ComputeHash( pidlData );
- hashValue = BitConverter.ToInt32( hashData, 0 );
- }
- else
- {
- hashValue = 0;
- }
-
- }
- return hashValue.Value;
- }
- private static MD5CryptoServiceProvider hashProvider = new MD5CryptoServiceProvider( );
- private int? hashValue;
-
- ///
- /// Determines if two ShellObjects are identical.
- ///
- /// The ShellObject to comare this one to.
- /// True if the ShellObjects are equal, false otherwise.
- public bool Equals(ShellObject other)
- {
- bool areEqual = false;
-
- if ((object)other != null)
- {
- IShellItem ifirst = this.NativeShellItem;
- IShellItem isecond = other.NativeShellItem;
- if (((ifirst != null) && (isecond != null)))
- {
- int result = 0;
- HRESULT hr = ifirst.Compare(
- isecond, SICHINTF.SICHINT_ALLFIELDS, out result);
-
- if ((hr == HRESULT.S_OK) && (result == 0))
- areEqual = true;
- }
- }
-
- return areEqual;
- }
-
- ///
- /// Returns whether this object is equal to another.
- ///
- /// The object to compare against.
- /// Equality result.
- public override bool Equals(object obj)
- {
- return this.Equals(obj as ShellObject);
- }
-
- ///
- /// Implements the == (equality) operator.
- ///
- /// Object a.
- /// Object b.
- /// true if object a equals object b; false otherwise.
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "a"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "b")]
- public static bool operator ==(ShellObject a, ShellObject b)
- {
- if ((object)a == null)
- {
- return ((object)b == null);
- }
- else
- {
- return a.Equals(b);
- }
- }
-
- ///
- /// Implements the != (inequality) operator.
- ///
- /// Object a.
- /// Object b.
- /// true if object a does not equal object b; false otherwise.
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "a"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "b")]
- public static bool operator !=(ShellObject a, ShellObject b)
- {
- if ((object)a == null)
- {
- return ((object)b != null);
- }
- else
- {
- return !a.Equals(b);
- }
- }
-
-
- #endregion
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/Common/ShellObjectCollection.cs b/src/External/WindowsAPICodePack/Shell/Common/ShellObjectCollection.cs
deleted file mode 100644
index 09fa838..0000000
--- a/src/External/WindowsAPICodePack/Shell/Common/ShellObjectCollection.cs
+++ /dev/null
@@ -1,397 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.IO;
-using System.Runtime.InteropServices;
-
-namespace Microsoft.WindowsAPICodePack.Shell
-{
- ///
- /// An ennumerable list of ShellObjects
- ///
- public class ShellObjectCollection : IEnumerable, IDisposable, IList
- {
- private List content;
-
- bool readOnly = false;
- bool isDisposed = false;
-
- #region construction/disposal/finialization
- ///
- /// Creates a ShellObject collection from an IShellItemArray
- ///
- /// IShellItemArray pointer
- /// Indicates whether the collection shouldbe read-only or not
- internal ShellObjectCollection(IShellItemArray iArray, bool readOnly)
- {
- this.readOnly = readOnly;
-
- if (iArray != null)
- {
- try
- {
- uint itemCount = 0;
- iArray.GetCount(out itemCount);
-
- content = new List((int)itemCount);
-
- for (uint index = 0; index < itemCount; index++)
- {
- IShellItem iShellItem = null;
- iArray.GetItemAt(index, out iShellItem);
- content.Add(ShellObjectFactory.Create(iShellItem));
- }
- }
- finally
- {
- Marshal.ReleaseComObject(iArray);
- }
- }
- }
-
- ///
- /// Creates a ShellObjectCollection from an IDataObject passed during Drop operation.
- ///
- /// An object that implements the IDataObject COM interface.
- /// ShellObjectCollection created from the given IDataObject
- public static ShellObjectCollection FromDataObject(object dataObject)
- {
- System.Runtime.InteropServices.ComTypes.IDataObject iDataObject = dataObject as
- System.Runtime.InteropServices.ComTypes.IDataObject;
-
- IShellItemArray shellItemArray;
- Guid iid = new Guid(ShellIIDGuid.IShellItemArray);
- ShellNativeMethods.SHCreateShellItemArrayFromDataObject(iDataObject, ref iid, out shellItemArray);
- return new ShellObjectCollection(shellItemArray, true);
- }
-
- ///
- /// Constructs an empty ShellObjectCollection
- ///
- public ShellObjectCollection()
- {
- content = new List();
- }
-
- ///
- ///
- ///
- ~ShellObjectCollection()
- {
- Dispose(false);
- GC.SuppressFinalize(this);
- }
-
- ///
- /// Standard Dispose pattern
- ///
- public void Dispose()
- {
- Dispose(true);
- GC.SuppressFinalize(this);
- }
-
- ///
- /// Standard Dispose patterns
- ///
- /// Indicates that this is being called from Dispose(), rather than the finalizer.
- protected void Dispose(bool disposing)
- {
- if (isDisposed == false)
- {
- if (disposing && content != null)
- {
- foreach (ShellObject obj in content)
- obj.Dispose();
-
- content.Clear();
- content = null;
- }
-
- isDisposed = true;
- }
- }
- #endregion
-
- #region implementation
-
- ///
- /// Item count
- ///
- public int Count
- {
- get
- {
- if (content != null)
- return content.Count;
- else
- return 0;
- }
- }
-
- ///
- /// Collection enumeration
- ///
- ///
- public System.Collections.IEnumerator GetEnumerator()
- {
- for (int index = 0; index < Count; index++)
- {
- yield return content[index];
- }
- }
-
- ///
- /// Builds the data for the CFSTR_SHELLIDLIST Drag and Clipboard data format from the
- /// ShellObjects in the collection.
- ///
- /// A memory stream containing the drag/drop data.
- public MemoryStream BuildShellIDList()
- {
- if (content == null || content.Count < 1)
- throw new ArgumentException("Must have at least one shell object in the collection.");
-
- MemoryStream mstream = new MemoryStream();
- BinaryWriter bwriter = new BinaryWriter(mstream);
-
- // number of IDLs to be written (shell objects + parent folder)
- uint itemCount = (uint)(content.Count + 1);
-
- // grab the object IDLs
- IntPtr[] idls = new IntPtr[itemCount];
-
- for (int index = 0; index < itemCount; index++)
- {
- if (index == 0)
- {
- // Because the ShellObjects passed in may be from anywhere, the
- // parent folder reference must be the desktop.
- idls[index] = ((ShellObject)KnownFolders.Desktop).PIDL;
- }
- else
- {
- idls[index] = content[index - 1].PIDL;
- }
- }
-
- // calculate offset array (folder IDL + item IDLs)
- uint[] offsets = new uint[itemCount + 1];
- for (int index = 0; index < itemCount; index++)
- {
- if (index == 0)
- {
- // first offset equals size of CIDA header data
- offsets[0] = (uint)(sizeof(uint) * (offsets.Length + 1));
- }
- else
- {
- offsets[index] = offsets[index - 1] + ShellNativeMethods.ILGetSize(idls[index - 1]);
- }
- }
-
- // Fill out the CIDA header
- //
- // typedef struct _IDA {
- // UINT cidl; // number of relative IDList
- // UINT aoffset[1]; // [0]: folder IDList, [1]-[cidl]: item IDList
- // } CIDA, * LPIDA;
- //
- bwriter.Write(content.Count);
- foreach (uint offset in offsets)
- {
- bwriter.Write(offset);
- }
-
- // copy idls
- foreach (IntPtr idl in idls)
- {
- byte[] data = new byte[ShellNativeMethods.ILGetSize(idl)];
- Marshal.Copy(idl, data, 0, data.Length);
- bwriter.Write(data, 0, data.Length);
- }
-
- // return CIDA stream
- return mstream;
- }
- #endregion
-
- #region IList Members
-
- ///
- /// Returns the index of a particualr shell object in the collection
- ///
- /// The item to search for.
- /// The index of the item found, or -1 if not found.
- public int IndexOf(ShellObject item)
- {
- if (content != null)
- return content.FindIndex(x => x.Equals(item));
- else
- return -1;
- }
-
- ///
- /// Inserts a new shell object into the collection.
- ///
- /// The index at which to insert.
- /// The item to insert.
- public void Insert(int index, ShellObject item)
- {
- if (readOnly)
- throw new ArgumentException("Can not insert items into a read only list.");
-
- content.Insert(index, item);
- }
-
- ///
- /// Removes the specified ShellObject from the collection
- ///
- /// The index to remove at.
- public void RemoveAt(int index)
- {
- if (readOnly)
- throw new ArgumentException("Can not remove items from a read only list.");
-
- content.RemoveAt(index);
- }
-
- ///
- /// The collection indexer
- ///
- /// The index of the item to retrieve.
- /// The ShellObject at the specified index
- public ShellObject this[int index]
- {
- get
- {
- if (content != null)
- return content[index];
- else
- return null;
- }
- set
- {
- if (readOnly)
- throw new ArgumentException("Can not insert items into a read only list");
-
- content[index] = value;
- }
- }
-
- #endregion
-
- #region ICollection Members
-
- ///
- /// Adds a ShellObject to the collection,
- ///
- /// The ShellObject to add.
- public void Add(ShellObject item)
- {
- if (readOnly)
- throw new ArgumentException("Can not add items to a read only list.");
-
- if (content != null)
- content.Add(item);
- }
-
- ///
- /// Clears the collection of ShellObjects.
- ///
- public void Clear()
- {
- if (readOnly)
- throw new ArgumentException("Can not clear a read only list.");
-
- if (content != null)
- content.Clear();
- }
-
- ///
- /// Determines if the collection contains a particular ShellObject.
- ///
- /// The ShellObject.
- /// true, if the ShellObject is in the list, false otherwise.
- public bool Contains(ShellObject item)
- {
- if (content != null)
- return content.Contains(item);
- else
- return false;
- }
-
- ///
- /// Copies the ShellObjects in the collection to a ShellObject array.
- ///
- /// The destination to copy to.
- /// The index into the array at which copying will commence.
- public void CopyTo(ShellObject[] array, int arrayIndex)
- {
- if (array.Length < arrayIndex + content.Count)
- throw new ArgumentException("Destination array too small, or invalid arrayIndex.");
-
- for (int index = 0; index < content.Count; index++)
- {
- array[index + arrayIndex] = content[index];
- }
- }
-
- ///
- /// Retrieves the number of ShellObjects in the collection
- ///
- int ICollection.Count
- {
- get
- {
- if (content != null)
- return content.Count;
- else
- return 0;
- }
- }
-
- ///
- /// If true, the contents of the collection are immutable.
- ///
- public bool IsReadOnly
- {
- get
- {
- return readOnly;
- }
- }
-
- ///
- /// Removes a particular ShellObject from the list.
- ///
- /// The ShellObject to remove.
- /// True if the item could be removed, false otherwise.
- public bool Remove(ShellObject item)
- {
- if (readOnly)
- throw new ArgumentException("Can not remove an item from a read only list.");
-
- if (content != null)
- return content.Remove(item);
- else
- return false;
- }
-
- #endregion
-
- #region IEnumerable Members
-
- ///
- /// Allows for enumeration through the list of ShellObjects in the collection.
- ///
- /// The IEnumerator interface to use for enumeration.
- IEnumerator IEnumerable.GetEnumerator()
- {
- return content as IEnumerator;
- }
-
- #endregion
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/Common/ShellObjectContainer.cs b/src/External/WindowsAPICodePack/Shell/Common/ShellObjectContainer.cs
deleted file mode 100644
index 4b3d058..0000000
--- a/src/External/WindowsAPICodePack/Shell/Common/ShellObjectContainer.cs
+++ /dev/null
@@ -1,133 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Collections.Generic;
-using System.Runtime.InteropServices;
-using MS.WindowsAPICodePack.Internal;
-
-namespace Microsoft.WindowsAPICodePack.Shell
-{
- ///
- /// Represents the base class for all types of Shell "containers". Any class deriving from this class
- /// can contain other ShellObjects (e.g. ShellFolder, FileSystemKnownFolder, ShellLibrary, etc)
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "This will complicate the class hierarchy and naming convention used in the Shell area")]
- public abstract class ShellContainer : ShellObject, IEnumerable, IDisposable
- {
-
- #region Private Fields
-
- private IShellFolder desktopFolderEnumeration;
- private IShellFolder nativeShellFolder;
-
- #endregion
-
- #region Internal Properties
-
- internal IShellFolder NativeShellFolder
- {
- get
- {
- if (nativeShellFolder == null)
- {
- Guid guid = new Guid(ShellIIDGuid.IShellFolder);
- Guid handler = new Guid( ShellBHIDGuid.ShellFolderObject );
-
- HRESULT hr = NativeShellItem.BindToHandler(
- IntPtr.Zero, ref handler, ref guid, out nativeShellFolder );
-
- if (CoreErrorHelper.Failed(hr))
- {
- string str = ShellHelper.GetParsingName(NativeShellItem);
- if (str != null)
- {
- if (str == Environment.GetFolderPath(Environment.SpecialFolder.Desktop))
- {
- return null;
- }
- else
- {
- throw Marshal.GetExceptionForHR((int) hr);
- }
- }
- }
- }
-
- return nativeShellFolder;
- }
- }
-
- #endregion
-
- #region Internal Constructor
-
- internal ShellContainer()
- {
-
- }
-
- internal ShellContainer(IShellItem2 shellItem):base(shellItem)
- {
-
- }
-
- #endregion
-
- #region Disposable Pattern
-
- ///
- /// Release resources
- ///
- /// True indicates that this is being called from Dispose(), rather than the finalizer.
- protected override void Dispose(bool disposing)
- {
- if (nativeShellFolder != null)
- {
- Marshal.ReleaseComObject(nativeShellFolder);
- nativeShellFolder = null;
- }
-
- if (desktopFolderEnumeration != null)
- {
- Marshal.ReleaseComObject(desktopFolderEnumeration);
- desktopFolderEnumeration = null;
- }
-
- base.Dispose(disposing);
- }
-
- #endregion
-
- #region IEnumerable Members
-
- ///
- ///
- ///
- ///
- public IEnumerator GetEnumerator()
- {
- if (NativeShellFolder == null)
- {
- if (desktopFolderEnumeration == null)
- {
- ShellNativeMethods.SHGetDesktopFolder(out desktopFolderEnumeration);
- }
-
- nativeShellFolder = desktopFolderEnumeration;
- }
-
- return new ShellFolderItems(this);
- }
-
- #endregion
-
- #region IEnumerable Members
-
- System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
- {
- return new ShellFolderItems(this);
- }
-
- #endregion
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/Common/ShellObjectFactory.cs b/src/External/WindowsAPICodePack/Shell/Common/ShellObjectFactory.cs
deleted file mode 100644
index 2c532d5..0000000
--- a/src/External/WindowsAPICodePack/Shell/Common/ShellObjectFactory.cs
+++ /dev/null
@@ -1,236 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Diagnostics;
-using System.Runtime.InteropServices;
-using MS.WindowsAPICodePack.Internal;
-
-namespace Microsoft.WindowsAPICodePack.Shell
-{
- internal static class ShellObjectFactory
- {
- internal const string STR_PARSE_PREFER_FOLDER_BROWSING = "Parse Prefer Folder Browsing";
-
- ///
- /// Creates a ShellObject given a native IShellItem interface
- ///
- ///
- /// A newly constructed ShellObject object
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1304:SpecifyCultureInfo", MessageId = "System.String.ToLower", Justification = "We are not currently handling globalization or localization")]
- internal static ShellObject Create(IShellItem nativeShellItem)
- {
- // Sanity check
- Debug.Assert(nativeShellItem != null, "nativeShellItem should not be null");
-
- // Need to make sure we're running on Vista or higher
- if (!CoreHelpers.RunningOnVista)
- {
- throw new PlatformNotSupportedException("Shell Object creation requires Windows Vista or higher operating system.");
- }
-
- // A lot of APIs need IShellItem2, so just keep a copy of it here
- IShellItem2 nativeShellItem2 = nativeShellItem as IShellItem2;
-
- // Get the System.ItemType property
- string itemType = ShellHelper.GetItemType(nativeShellItem2);
-
- if (!string.IsNullOrEmpty(itemType))
- itemType = itemType.ToLower();
-
- // Get some IShellItem attributes
- ShellNativeMethods.SFGAO sfgao;
- nativeShellItem2.GetAttributes(ShellNativeMethods.SFGAO.SFGAO_FILESYSTEM | ShellNativeMethods.SFGAO.SFGAO_FOLDER, out sfgao);
-
- // Is this item a FileSystem item?
- bool isFileSystem = (sfgao & ShellNativeMethods.SFGAO.SFGAO_FILESYSTEM) != 0;
-
- // Is this item a Folder?
- bool isFolder = (sfgao & ShellNativeMethods.SFGAO.SFGAO_FOLDER) != 0;
-
- // Shell Library
- ShellLibrary shellLibrary = null;
-
- // For KnownFolders
- bool isKnownFolderVirtual = false;
-
- // Create the right type of ShellObject based on the above information
-
- // 1. First check if this is a Shell Link
- if (itemType == ".lnk")
- {
- return new ShellLink(nativeShellItem2);
- }
- // 2. Check if this is a container or a single item (entity)
- else if (isFolder)
- {
- // 3. If this is a folder, check for types: Shell Library, Shell Folder or Search Container
- if ((itemType == ".library-ms") && (shellLibrary = ShellLibrary.FromShellItem(nativeShellItem2, true)) != null)
- return shellLibrary; // we already created this above while checking for Library
- else if (itemType == ".searchconnector-ms")
- return new ShellSearchConnector(nativeShellItem2);
- else if ((itemType == ".search-ms"))
- return new ShellSavedSearchCollection(nativeShellItem2);
- else
- {
- // 4. It's a ShellFolder
- if (isFileSystem)
- {
- // 5. Is it a (File-System / Non-Virtual) Known Folder
- if ((GetNativeKnownFolder(nativeShellItem2, out isKnownFolderVirtual) != null) && !isKnownFolderVirtual)
- {
- FileSystemKnownFolder kf = new FileSystemKnownFolder(nativeShellItem2);
- return kf;
- }
- else
- return new ShellFileSystemFolder(nativeShellItem2);
- }
- else
- {
- // 5. Is it a (Non File-System / Virtual) Known Folder
- if ((GetNativeKnownFolder(nativeShellItem2, out isKnownFolderVirtual) != null) && isKnownFolderVirtual)
- {
- NonFileSystemKnownFolder kf = new NonFileSystemKnownFolder(nativeShellItem2);
- return kf;
- }
- else
- return new ShellNonFileSystemFolder(nativeShellItem2);
- }
-
- }
-
- }
- else
- {
- // 6. If this is an entity (single item), check if its filesystem or not
- if (isFileSystem)
- return new ShellFile(nativeShellItem2);
- else
- return new ShellNonFileSystemItem(nativeShellItem2);
-
- }
- }
-
- private static IKnownFolderNative GetNativeKnownFolder(IShellItem nativeShellItem, out bool isVirtual)
- {
- IntPtr pidl = IntPtr.Zero;
-
- try
- {
- // Get the PIDL for the ShellItem
- pidl = ShellHelper.PidlFromShellItem(nativeShellItem);
-
- if (pidl == IntPtr.Zero)
- {
- isVirtual = false;
- return null;
- }
-
- IKnownFolderNative knownFolderNative = KnownFolderHelper.FromPIDL(pidl);
-
- if (knownFolderNative != null)
- {
- // If we have a valid IKnownFolder, try to get its category
- KnownFoldersSafeNativeMethods.NativeFolderDefinition nativeFolderDefinition;
- knownFolderNative.GetFolderDefinition(out nativeFolderDefinition);
-
- // Get the category type and see if it's virtual
- if (nativeFolderDefinition.category == FolderCategory.Virtual)
- isVirtual = true;
- else
- isVirtual = false;
-
- return knownFolderNative;
- }
- else
- {
- // KnownFolderHelper.FromPIDL could not create a valid KnownFolder from the given PIDL.
- // Return null to indicate the given IShellItem is not a KnownFolder. Also set our out parameter
- // to default value.
- isVirtual = false;
- return null;
- }
- }
- finally
- {
- ShellNativeMethods.ILFree(pidl);
- }
- }
-
- ///
- /// Creates a ShellObject given a parsing name
- ///
- ///
- /// A newly constructed ShellObject object
- internal static ShellObject Create(string parsingName)
- {
- if (string.IsNullOrEmpty(parsingName))
- throw new ArgumentNullException("parsingName");
-
- // Create a native shellitem from our path
- IShellItem2 nativeShellItem;
- Guid guid = new Guid(ShellIIDGuid.IShellItem2);
- int retCode = ShellNativeMethods.SHCreateItemFromParsingName(parsingName, IntPtr.Zero, ref guid, out nativeShellItem);
-
- if (CoreErrorHelper.Succeeded(retCode))
- {
- return ShellObjectFactory.Create(nativeShellItem);
- }
- else
- {
- throw new ExternalException("Unable to Create Shell Item.", Marshal.GetExceptionForHR(retCode));
- }
- }
-
- ///
- /// Constructs a new Shell object from IDList pointer
- ///
- ///
- ///
- internal static ShellObject Create(IntPtr idListPtr)
- {
- // Throw exception if not running on Win7 or newer.
- CoreHelpers.ThrowIfNotVista();
-
- Guid guid = new Guid(ShellIIDGuid.IShellItem2);
- IShellItem2 nativeShellItem;
- int retCode = ShellNativeMethods.SHCreateItemFromIDList(idListPtr, ref guid, out nativeShellItem);
- if (CoreErrorHelper.Succeeded(retCode))
- {
- return ShellObjectFactory.Create(nativeShellItem);
- }
- else
- {
- // Since this is an internal method, return null instead of throwing an exception.
- // Let the caller know we weren't able to create a valid ShellObject with the given PIDL
- return null;
- }
- }
-
- ///
- /// Constructs a new Shell object from IDList pointer
- ///
- ///
- ///
- ///
- internal static ShellObject Create(IntPtr idListPtr, ShellContainer parent)
- {
- IShellItem nativeShellItem;
-
- int retCode = ShellNativeMethods.SHCreateShellItem(
- IntPtr.Zero,
- parent.NativeShellFolder,
- idListPtr, out nativeShellItem);
-
- if (CoreErrorHelper.Succeeded(retCode))
- {
- return ShellObjectFactory.Create(nativeShellItem);
- }
- else
- {
- // Since this is an internal method, return null instead of throwing an exception.
- // Let the caller know we weren't able to create a valid ShellObject with the given PIDL
- return null;
- }
- }
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/Common/ShellObjectNode.cs b/src/External/WindowsAPICodePack/Shell/Common/ShellObjectNode.cs
deleted file mode 100644
index 325b885..0000000
--- a/src/External/WindowsAPICodePack/Shell/Common/ShellObjectNode.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-namespace Microsoft.WindowsAPICodePack.Shell
-{
- ///
- /// Represents a base class for individual shell entities (file system files, non-file system items, etc)
- ///
- public abstract class ShellObjectNode : ShellObject
- {
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/Common/ShellSavedSearchCollection.cs b/src/External/WindowsAPICodePack/Shell/Common/ShellSavedSearchCollection.cs
deleted file mode 100644
index 70e162e..0000000
--- a/src/External/WindowsAPICodePack/Shell/Common/ShellSavedSearchCollection.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using MS.WindowsAPICodePack.Internal;
-
-namespace Microsoft.WindowsAPICodePack.Shell
-{
- ///
- /// Represents a saved search
- ///
- public class ShellSavedSearchCollection : ShellSearchCollection
- {
- internal ShellSavedSearchCollection(IShellItem2 shellItem)
- :base(shellItem)
- {
- CoreHelpers.ThrowIfNotVista();
- }
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/Common/ShellSearchCollection.cs b/src/External/WindowsAPICodePack/Shell/Common/ShellSearchCollection.cs
deleted file mode 100644
index 73b59b3..0000000
--- a/src/External/WindowsAPICodePack/Shell/Common/ShellSearchCollection.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using MS.WindowsAPICodePack.Internal;
-
-namespace Microsoft.WindowsAPICodePack.Shell
-{
- ///
- /// Represents the base class for all search-related classes.
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "This will complicate the class hierarchy and naming convention used in the Shell area")]
- public class ShellSearchCollection : ShellContainer
- {
- internal ShellSearchCollection()
- {
- }
-
- internal ShellSearchCollection(IShellItem2 shellItem):base(shellItem)
- {
- }
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/Common/ShellSearchConnector.cs b/src/External/WindowsAPICodePack/Shell/Common/ShellSearchConnector.cs
deleted file mode 100644
index 47f6c59..0000000
--- a/src/External/WindowsAPICodePack/Shell/Common/ShellSearchConnector.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using MS.WindowsAPICodePack.Internal;
-
-namespace Microsoft.WindowsAPICodePack.Shell
-{
- ///
- /// A Serch Connector folder in the Shell Namespace
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "This will complicate the class hierarchy and naming convention used in the Shell area")]
- public sealed class ShellSearchConnector : ShellSearchCollection
- {
-
- #region Private Constructor
-
- internal ShellSearchConnector()
- {
- CoreHelpers.ThrowIfNotWin7();
- }
-
- internal ShellSearchConnector(IShellItem2 shellItem)
- {
- CoreHelpers.ThrowIfNotWin7();
-
- nativeShellItem = shellItem;
- }
-
- #endregion
-
- ///
- /// Indicates whether this feature is supported on the current platform.
- ///
- new public static bool IsPlatformSupported
- {
- get
- {
- // We need Windows 7 onwards ...
- return CoreHelpers.RunningOnWin7;
- }
- }
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/Common/ShellSearchFolder.cs b/src/External/WindowsAPICodePack/Shell/Common/ShellSearchFolder.cs
deleted file mode 100644
index 54d9613..0000000
--- a/src/External/WindowsAPICodePack/Shell/Common/ShellSearchFolder.cs
+++ /dev/null
@@ -1,285 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Collections.Generic;
-using System.Runtime.InteropServices;
-using Microsoft.WindowsAPICodePack.Shell.PropertySystem;
-using MS.WindowsAPICodePack.Internal;
-
-namespace Microsoft.WindowsAPICodePack.Shell
-{
- ///
- /// Create and modify search folders.
- ///
- public class ShellSearchFolder : ShellSearchCollection
- {
- ///
- /// Create a simple search folder. Once the appropriate parameters are set,
- /// the search folder can be enumerated to get the search results.
- ///
- /// Specific condition on which to perform the search (property and expected value)
- /// List of folders/paths to perform the search on. These locations need to be indexed by the system.
- public ShellSearchFolder(SearchCondition searchCondition, params ShellContainer[] searchScopePath)
- {
- CoreHelpers.ThrowIfNotVista();
-
- NativeSearchFolderItemFactory = (ISearchFolderItemFactory)new SearchFolderItemFactoryCoClass();
-
- this.SearchCondition = searchCondition;
-
- if (searchScopePath != null && searchScopePath.Length > 0 && searchScopePath[0] != null)
- {
- List paths = new List();
- foreach (ShellContainer cont in searchScopePath)
- paths.Add(cont.ParsingName);
-
- this.SearchScopePaths = paths.ToArray();
- }
- }
-
- ///
- /// Create a simple search folder. Once the appropiate parameters are set,
- /// the search folder can be enumerated to get the search results.
- ///
- /// Specific condition on which to perform the search (property and expected value)
- /// List of folders/paths to perform the search on. These locations need to be indexed by the system.
- public ShellSearchFolder(SearchCondition searchCondition, params string[] searchScopePath)
- {
- CoreHelpers.ThrowIfNotVista();
-
- NativeSearchFolderItemFactory = (ISearchFolderItemFactory)new SearchFolderItemFactoryCoClass();
-
- if (searchScopePath != null && searchScopePath.Length > 0 && searchScopePath[0] != null)
- {
- this.SearchScopePaths = searchScopePath;
- }
-
- this.SearchCondition = searchCondition;
- }
-
- internal ISearchFolderItemFactory NativeSearchFolderItemFactory
- {
- get;
- set;
- }
-
- private SearchCondition searchCondition;
- ///
- /// Gets the of the search.
- /// When this property is not set, the resulting search will have no filters applied.
- ///
- public SearchCondition SearchCondition
- {
- get { return searchCondition; }
- private set
- {
- searchCondition = value;
-
- NativeSearchFolderItemFactory.SetCondition(searchCondition.NativeSearchCondition);
- }
- }
-
- private string[] searchScopePaths;
- ///
- /// Gets the search scope, as specified using an array of locations to search.
- /// The search will include this location and all its subcontainers. The default is FOLDERID_Profile
- ///
- public string[] SearchScopePaths
- {
- get
- {
- return searchScopePaths;
- }
- private set
- {
- searchScopePaths = value;
- List shellItems = new List();
-
- Guid shellItemGuid = new Guid(ShellIIDGuid.IShellItem);
- Guid shellItemArrayGuid = new Guid(ShellIIDGuid.IShellItemArray);
-
- // Create IShellItem for all the scopes we were given
- foreach (string path in searchScopePaths)
- {
- IShellItem scopeShellItem;
-
- int hr = ShellNativeMethods.SHCreateItemFromParsingName(path, IntPtr.Zero, ref shellItemGuid, out scopeShellItem);
-
- if (CoreErrorHelper.Succeeded(hr))
- shellItems.Add(scopeShellItem);
- }
-
- // Create a new IShellItemArray
- IShellItemArray scopeShellItemArray = new ShellItemArray(shellItems.ToArray());
-
- // Set the scope on the native ISearchFolderItemFactory
- HRESULT hResult = NativeSearchFolderItemFactory.SetScope(scopeShellItemArray);
-
- if (!CoreErrorHelper.Succeeded((int)hResult))
- Marshal.ThrowExceptionForHR((int)hResult);
- }
- }
-
- internal override IShellItem NativeShellItem
- {
- get
- {
- IShellItem shellItem;
- Guid guid = new Guid(ShellIIDGuid.IShellItem);
-
- if (NativeSearchFolderItemFactory != null)
- {
- int hr = NativeSearchFolderItemFactory.GetShellItem(ref guid, out shellItem);
-
- if (!CoreErrorHelper.Succeeded(hr))
- Marshal.ThrowExceptionForHR(hr);
-
- return shellItem;
- }
- else
- return null;
- }
- }
-
-
- ///
- /// Creates a list of stack keys, as specified. If this method is not called,
- /// by default the folder will not be stacked.
- ///
- /// Array of canonical names for properties on which the folder is stacked.
- /// If one of the given canonical names is invalid.
- public void SetStacks(params string[] canonicalNames)
- {
- List propertyKeyList = new List();
-
- foreach (string prop in canonicalNames)
- {
- // Get the PropertyKey using the canonicalName passed in
- PropertyKey propKey;
- int result = PropertySystemNativeMethods.PSGetPropertyKeyFromName(prop, out propKey);
-
- if (!CoreErrorHelper.Succeeded(result))
- throw new ArgumentException("The given CanonicalName is not valid.", "canonicalNames", Marshal.GetExceptionForHR(result));
-
- propertyKeyList.Add(propKey);
- }
-
- if (propertyKeyList.Count > 0)
- SetStacks(propertyKeyList.ToArray());
- }
-
- ///
- /// Creates a list of stack keys, as specified. If this method is not called,
- /// by default the folder will not be stacked.
- ///
- /// Array of property keys on which the folder is stacked.
- public void SetStacks(params PropertyKey[] propertyKeys)
- {
- if (propertyKeys.Length > 0)
- NativeSearchFolderItemFactory.SetStacks((uint)propertyKeys.Length, propertyKeys);
- }
-
- ///
- /// Sets the search folder display name.
- ///
- public string DisplayName
- {
- set
- {
- HRESULT hr = NativeSearchFolderItemFactory.SetDisplayName(value);
-
- if (!CoreErrorHelper.Succeeded((int)hr))
- Marshal.ThrowExceptionForHR((int)hr);
- }
- }
-
- ///
- /// Sets the search folder icon size.
- /// The default settings are based on the FolderTypeID which is set by the
- /// SearchFolder::SetFolderTypeID method.
- ///
- public int IconSize
- {
- set
- {
- HRESULT hr = NativeSearchFolderItemFactory.SetIconSize(value);
-
- if (!CoreErrorHelper.Succeeded((int)hr))
- Marshal.ThrowExceptionForHR((int)hr);
- }
- }
-
- ///
- /// Sets a search folder type ID, as specified.
- ///
- public Guid FolderTypeID
- {
- set
- {
- HRESULT hr = NativeSearchFolderItemFactory.SetFolderTypeID(value);
-
- if (!CoreErrorHelper.Succeeded((int)hr))
- Marshal.ThrowExceptionForHR((int)hr);
- }
- }
-
- ///
- /// Sets folder logical view mode. The default settings are based on the FolderTypeID which is set
- /// by the SearchFolder::SetFolderTypeID method.
- ///
- /// The logical view mode to set.
- public void SetFolderLogicalViewMode(FolderLogicalViewMode mode)
- {
- HRESULT hr = NativeSearchFolderItemFactory.SetFolderLogicalViewMode(mode);
-
- if (!CoreErrorHelper.Succeeded((int)hr))
- Marshal.ThrowExceptionForHR((int)hr);
- }
-
- ///
- /// Creates a new column list whose columns are all visible,
- /// given an array of PropertyKey structures. The default is based on FolderTypeID.
- ///
- /// This property may not work correctly with the ExplorerBrowser control.
- public PropertyKey[] VisibleColumns
- {
- set
- {
- HRESULT hr = NativeSearchFolderItemFactory.SetVisibleColumns((uint)value.Length, value);
-
- if (!CoreErrorHelper.Succeeded((int)hr))
- Marshal.ThrowExceptionForHR((int)hr);
- }
- }
-
- ///
- /// Creates a list of sort column directions, as specified.
- ///
- /// This property may not work correctly with the ExplorerBrowser control.
- public SortColumn[] SortColumns
- {
- set
- {
- HRESULT hr = NativeSearchFolderItemFactory.SetSortColumns((uint)value.Length, value);
-
- if (!CoreErrorHelper.Succeeded((int)hr))
- Marshal.ThrowExceptionForHR((int)hr);
- }
- }
-
- ///
- /// Sets a group column, as specified. If no group column is specified, no grouping occurs.
- ///
- /// This property may not work correctly with the ExplorerBrowser control.
- public PropertyKey GroupColumn
- {
- set
- {
- HRESULT hr = NativeSearchFolderItemFactory.SetGroupColumn(ref value);
-
- if (!CoreErrorHelper.Succeeded((int)hr))
- Marshal.ThrowExceptionForHR((int)hr);
- }
- }
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/Common/ShellThumbnail.cs b/src/External/WindowsAPICodePack/Shell/Common/ShellThumbnail.cs
deleted file mode 100644
index 4d316dd..0000000
--- a/src/External/WindowsAPICodePack/Shell/Common/ShellThumbnail.cs
+++ /dev/null
@@ -1,419 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Drawing;
-using System.Runtime.InteropServices;
-using System.Windows.Interop;
-using System.Windows.Media.Imaging;
-using MS.WindowsAPICodePack.Internal;
-
-namespace Microsoft.WindowsAPICodePack.Shell
-{
- ///
- /// Represents a thumbnail or an icon for a ShellObject.
- ///
- public class ShellThumbnail
- {
- #region Private members
-
- ///
- /// Native shellItem
- ///
- private IShellItem shellItemNative = null;
-
- ///
- /// Internal member to keep track of the current size
- ///
- private System.Windows.Size currentSize = new System.Windows.Size(256, 256);
-
- #endregion
-
- #region Constructors
-
- ///
- /// Internal constructor that takes in a parent ShellObject.
- ///
- ///
- internal ShellThumbnail(ShellObject shellObject)
- {
- if (shellObject == null || shellObject.NativeShellItem == null)
- throw new ArgumentNullException("shellObject");
-
- shellItemNative = shellObject.NativeShellItem;
- }
-
- ///
- /// No public default constructor. User should not be able to create a ShellThumbnail,
- /// only retrive it from an existing ShellFolder
- ///
- private ShellThumbnail() { }
-
- #endregion
-
- #region Public properties
-
- ///
- /// Gets or sets the default size of the thumbnail or icon. The default is 32x32 pixels for icons and
- /// 256x256 pixels for thumbnails.
- ///
- /// If the size specified is larger than the maximum size of 1024x1024 for thumbnails and 256x256 for icons,
- /// an is thrown.
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.String.Format(System.String,System.Object)", Justification = "We are not currently handling globalization or localization")]
- public System.Windows.Size CurrentSize
- {
- get
- {
- return currentSize;
- }
- set
- {
- // Check for 0; negative number check not required as System.Windows.Size only allows positive numbers.
- if (value.Height == 0 || value.Width == 0)
- throw new System.ArgumentOutOfRangeException("value", "CurrentSize (width or height) cannot be 0");
-
- if (FormatOption == ShellThumbnailFormatOptions.IconOnly)
- {
- if (value.Height > DefaultIconSize.Maximum.Height || value.Width > DefaultIconSize.Maximum.Width)
- throw new System.ArgumentOutOfRangeException("value", string.Format("CurrentSize (width or height) cannot be greater than the maximum size", DefaultIconSize.Maximum));
- }
- else
- {
- // Covers the default mode (Thumbnail Or Icon) as well as ThumbnailOnly
- if (value.Height > DefaultThumbnailSize.Maximum.Height || value.Width > DefaultThumbnailSize.Maximum.Width)
- throw new System.ArgumentOutOfRangeException("value", string.Format("CurrentSize (width or height) cannot be greater than the maximum size", DefaultThumbnailSize.Maximum));
- }
-
- currentSize = value;
- }
- }
-
- ///
- /// Gets the thumbnail or icon image in format.
- /// Null is returned if the ShellObject does not have a thumbnail or icon image.
- ///
- public Bitmap Bitmap
- {
- get
- {
- return GetBitmap(CurrentSize);
- }
- }
-
- ///
- /// Gets the thumbnail or icon image in format.
- /// Null is returned if the ShellObject does not have a thumbnail or icon image.
- ///
- public BitmapSource BitmapSource
- {
- get
- {
- return GetBitmapSource(CurrentSize);
- }
- }
-
- ///
- /// Gets the thumbnail or icon image in format.
- /// Null is returned if the ShellObject does not have a thumbnail or icon image.
- ///
- public Icon Icon
- {
- get
- {
- return Icon.FromHandle(Bitmap.GetHicon());
- }
- }
-
- ///
- /// Gets the thumbnail or icon in small size and format.
- ///
- public Bitmap SmallBitmap
- {
- get
- {
- if (FormatOption == ShellThumbnailFormatOptions.IconOnly)
- return GetBitmap(DefaultIconSize.Small);
- else
- return GetBitmap(DefaultThumbnailSize.Small);
- }
- }
-
- ///
- /// Gets the thumbnail or icon in small size and format.
- ///
- public BitmapSource SmallBitmapSource
- {
- get
- {
- if (FormatOption == ShellThumbnailFormatOptions.IconOnly)
- return GetBitmapSource(DefaultIconSize.Small);
- else
- return GetBitmapSource(DefaultThumbnailSize.Small);
- }
- }
-
- ///
- /// Gets the thumbnail or icon in small size and format.
- ///
- public Icon SmallIcon
- {
- get
- {
- return Icon.FromHandle(SmallBitmap.GetHicon());
- }
- }
-
- ///
- /// Gets the thumbnail or icon in Medium size and format.
- ///
- public Bitmap MediumBitmap
- {
- get
- {
- if (FormatOption == ShellThumbnailFormatOptions.IconOnly)
- return GetBitmap(DefaultIconSize.Medium);
- else
- return GetBitmap(DefaultThumbnailSize.Medium);
- }
- }
-
- ///
- /// Gets the thumbnail or icon in medium size and format.
- ///
- public BitmapSource MediumBitmapSource
- {
- get
- {
- if (FormatOption == ShellThumbnailFormatOptions.IconOnly)
- return GetBitmapSource(DefaultIconSize.Medium);
- else
- return GetBitmapSource(DefaultThumbnailSize.Medium);
- }
- }
-
- ///
- /// Gets the thumbnail or icon in Medium size and format.
- ///
- public Icon MediumIcon
- {
- get
- {
- return Icon.FromHandle(MediumBitmap.GetHicon());
- }
- }
-
- ///
- /// Gets the thumbnail or icon in large size and format.
- ///
- public Bitmap LargeBitmap
- {
- get
- {
- if (FormatOption == ShellThumbnailFormatOptions.IconOnly)
- return GetBitmap(DefaultIconSize.Large);
- else
- return GetBitmap(DefaultThumbnailSize.Large);
- }
- }
-
- ///
- /// Gets the thumbnail or icon in large size and format.
- ///
- public BitmapSource LargeBitmapSource
- {
- get
- {
- if (FormatOption == ShellThumbnailFormatOptions.IconOnly)
- return GetBitmapSource(DefaultIconSize.Large);
- else
- return GetBitmapSource(DefaultThumbnailSize.Large);
- }
- }
-
- ///
- /// Gets the thumbnail or icon in Large size and format.
- ///
- public Icon LargeIcon
- {
- get
- {
- return Icon.FromHandle(LargeBitmap.GetHicon());
- }
- }
-
- ///
- /// Gets the thumbnail or icon in extra large size and format.
- ///
- public Bitmap ExtraLargeBitmap
- {
- get
- {
- if (FormatOption == ShellThumbnailFormatOptions.IconOnly)
- return GetBitmap(DefaultIconSize.ExtraLarge);
- else
- return GetBitmap(DefaultThumbnailSize.ExtraLarge);
-
- }
- }
-
- ///
- /// Gets the thumbnail or icon in Extra Large size and format.
- ///
- public BitmapSource ExtraLargeBitmapSource
- {
- get
- {
- if (FormatOption == ShellThumbnailFormatOptions.IconOnly)
- return GetBitmapSource(DefaultIconSize.ExtraLarge);
- else
- return GetBitmapSource(DefaultThumbnailSize.ExtraLarge);
- }
- }
-
- ///
- /// Gets the thumbnail or icon in Extra Large size and format.
- ///
- public Icon ExtraLargeIcon
- {
- get
- {
- return Icon.FromHandle(ExtraLargeBitmap.GetHicon());
- }
- }
-
- ///
- /// Gets or sets a value that determines if the current retrieval option is cache or extract, cache only, or from memory only.
- /// The default is cache or extract.
- ///
- public ShellThumbnailRetrievalOptions RetrievalOption
- {
- get;
- set;
- }
-
- private ShellThumbnailFormatOptions formatOption = ShellThumbnailFormatOptions.Default;
- ///
- /// Gets or sets a value that determines if the current format option is thumbnail or icon, thumbnail only, or icon only.
- /// The default is thumbnail or icon.
- ///
- public ShellThumbnailFormatOptions FormatOption
- {
- get
- {
- return formatOption;
- }
- set
- {
- formatOption = value;
-
- // Do a similar check as we did in CurrentSize property setter,
- // If our mode is IconOnly, then our max is defined by DefaultIconSize.Maximum. We should make sure
- // our CurrentSize is within this max range
- if (FormatOption == ShellThumbnailFormatOptions.IconOnly)
- {
- if (CurrentSize.Height > DefaultIconSize.Maximum.Height || CurrentSize.Width > DefaultIconSize.Maximum.Width)
- CurrentSize = DefaultIconSize.Maximum;
- }
- }
-
- }
-
- ///
- /// Gets or sets a value that determines if the user can manually stretch the returned image.
- /// The default value is false.
- ///
- ///
- /// For example, if the caller passes in 80x80 a 96x96 thumbnail could be returned.
- /// This could be used as a performance optimization if the caller will need to stretch
- /// the image themselves anyway. Note that the Shell implementation performs a GDI stretch blit.
- /// If the caller wants a higher quality image stretch, they should pass this flag and do it themselves.
- ///
- public bool AllowBiggerSize
- {
- get;
- set;
- }
-
- #endregion
-
- #region Private Methods
-
- private ShellNativeMethods.SIIGBF CalculateFlags()
- {
- ShellNativeMethods.SIIGBF flags = 0x0000;
-
- if (AllowBiggerSize)
- flags |= ShellNativeMethods.SIIGBF.SIIGBF_BIGGERSIZEOK;
-
- if (RetrievalOption == ShellThumbnailRetrievalOptions.CacheOnly)
- flags |= ShellNativeMethods.SIIGBF.SIIGBF_INCACHEONLY;
- else if (RetrievalOption == ShellThumbnailRetrievalOptions.MemoryOnly)
- flags |= ShellNativeMethods.SIIGBF.SIIGBF_MEMORYONLY;
-
- if (FormatOption == ShellThumbnailFormatOptions.IconOnly)
- flags |= ShellNativeMethods.SIIGBF.SIIGBF_ICONONLY;
- else if (FormatOption == ShellThumbnailFormatOptions.ThumbnailOnly)
- flags |= ShellNativeMethods.SIIGBF.SIIGBF_THUMBNAILONLY;
-
- return flags;
- }
-
- private IntPtr GetHBitmap(System.Windows.Size size)
- {
- IntPtr hbitmap = IntPtr.Zero;
-
- // Create a size structure to pass to the native method
- CoreNativeMethods.SIZE nativeSIZE = new CoreNativeMethods.SIZE();
- nativeSIZE.cx = Convert.ToInt32(size.Width);
- nativeSIZE.cy = Convert.ToInt32(size.Height);
-
- // Use IShellItemImageFactory to get an icon
- // Options passed in: Resize to fit
- HRESULT hr = ((IShellItemImageFactory)shellItemNative).GetImage(nativeSIZE, CalculateFlags(), out hbitmap);
-
- if (hr == HRESULT.S_OK)
- return hbitmap;
- else if ((uint)hr == 0x8004B200 && FormatOption == ShellThumbnailFormatOptions.ThumbnailOnly)
- {
- // Thumbnail was requested, but this ShellItem doesn't have a thumbnail.
- throw new InvalidOperationException("The current ShellObject does not have a thumbnail. Try using ShellThumbnailFormatOptions.Default to get the icon for this item.", Marshal.GetExceptionForHR((int)hr));
- }
- else if ((uint)hr == 0x80040154) // REGDB_E_CLASSNOTREG
- {
- throw new NotSupportedException("The current ShellObject does not have a valid thumbnail handler or there was a problem in extracting the thumbnail for this specific shell object.", Marshal.GetExceptionForHR((int)hr));
- }
- else
- throw Marshal.GetExceptionForHR((int)hr);
- }
-
- private Bitmap GetBitmap(System.Windows.Size size)
- {
- IntPtr hBitmap = GetHBitmap(size);
-
- // return a System.Drawing.Bitmap from the hBitmap
- Bitmap returnValue = Bitmap.FromHbitmap(hBitmap);
-
- // delete HBitmap to avoid memory leaks
- ShellNativeMethods.DeleteObject(hBitmap);
-
- return returnValue;
- }
-
- private BitmapSource GetBitmapSource(System.Windows.Size size)
- {
- IntPtr hBitmap = GetHBitmap(size);
-
- // return a System.Media.Imaging.BitmapSource
- // Use interop to create a BitmapSource from hBitmap.
- BitmapSource returnValue = Imaging.CreateBitmapSourceFromHBitmap(hBitmap, IntPtr.Zero, System.Windows.Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions());
-
- // delete HBitmap to avoid memory leaks
- ShellNativeMethods.DeleteObject(hBitmap);
-
- return returnValue;
- }
-
- #endregion
-
- }
-}
\ No newline at end of file
diff --git a/src/External/WindowsAPICodePack/Shell/Common/ShellThumbnailEnums.cs b/src/External/WindowsAPICodePack/Shell/Common/ShellThumbnailEnums.cs
deleted file mode 100644
index 6c8eb90..0000000
--- a/src/External/WindowsAPICodePack/Shell/Common/ShellThumbnailEnums.cs
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-
-namespace Microsoft.WindowsAPICodePack.Shell
-{
- ///
- /// Represents the different retrieval options for the thumbnail or icon,
- /// such as extracting the thumbnail or icon from a file,
- /// from the cache only, or from memory only.
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1027:MarkEnumsWithFlags", Justification = "The members of this enum do not represent flags")]
- public enum ShellThumbnailRetrievalOptions
- {
- ///
- /// The default behavior loads a thumbnail. If there is no thumbnail for the current ShellItem,
- /// the icon is retrieved. The thumbnail or icon is extracted if it is not currently cached.
- ///
- Default,
-
- ///
- /// The CacheOnly behavior returns a cached thumbnail if it is available. Allows access to the disk,
- /// but only to retrieve a cached item. If no cached thumbnail is available, a cached per-instance icon is returned but
- /// a thumbnail or icon is not extracted.
- ///
- CacheOnly = ShellNativeMethods.SIIGBF.SIIGBF_INCACHEONLY,
-
- ///
- /// The MemoryOnly behavior returns the item only if it is in memory. The disk is not accessed even if the item is cached.
- /// Note that this only returns an already-cached icon and can fall back to a per-class icon if
- /// an item has a per-instance icon that has not been cached yet. Retrieving a thumbnail,
- /// even if it is cached, always requires the disk to be accessed, so this method should not be
- /// called from the user interface (UI) thread without passing ShellThumbnailCacheOptions.MemoryOnly.
- ///
- MemoryOnly = ShellNativeMethods.SIIGBF.SIIGBF_MEMORYONLY,
- }
-
- ///
- /// Represents the format options for the thumbnails and icons.
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1027:MarkEnumsWithFlags", Justification = "The members of this enum do not represent flags")]
- public enum ShellThumbnailFormatOptions
- {
- ///
- /// The default behavior loads a thumbnail. An HBITMAP for the icon of the item is retrieved if there is no thumbnail for the current Shell Item.
- ///
- Default,
-
- ///
- /// The ThumbnailOnly behavior returns only the thumbnails, never the icon. Note that not all items have thumbnails
- /// so ShellThumbnailFormatOptions.ThumbnailOnly can fail in these cases.
- ///
- ThumbnailOnly = ShellNativeMethods.SIIGBF.SIIGBF_THUMBNAILONLY,
-
- ///
- /// The IconOnly behavior returns only the icon, never the thumbnail.
- ///
- IconOnly = ShellNativeMethods.SIIGBF.SIIGBF_ICONONLY,
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/Common/SortColumn.cs b/src/External/WindowsAPICodePack/Shell/Common/SortColumn.cs
deleted file mode 100644
index b3c0979..0000000
--- a/src/External/WindowsAPICodePack/Shell/Common/SortColumn.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System.Runtime.InteropServices;
-using Microsoft.WindowsAPICodePack.Shell.PropertySystem;
-
-namespace Microsoft.WindowsAPICodePack.Shell
-{
- ///
- /// Stores information about how to sort a column that is displayed in the folder view.
- ///
- [StructLayout(LayoutKind.Sequential)]
- public struct SortColumn
- {
- ///
- /// Creates a sort column with the specified direction for the given property.
- ///
- /// Property key for the property that the user will sort.
- /// The direction in which the items are sorted.
- public SortColumn(PropertyKey propertyKey, SortDirection direction)
- {
- PropertyKey = propertyKey;
- Direction = direction;
- }
-
- ///
- /// The ID of the column by which the user will sort. A PropertyKey structure.
- /// For example, for the "Name" column, the property key is PKEY_ItemNameDisplay or
- /// .
- ///
- public PropertyKey PropertyKey;
-
- ///
- /// The direction in which the items are sorted.
- ///
- public SortDirection Direction;
- };
-
-}
diff --git a/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialog.cs b/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialog.cs
deleted file mode 100644
index 26ba485..0000000
--- a/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialog.cs
+++ /dev/null
@@ -1,1290 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
-using System.Diagnostics;
-using System.Runtime.InteropServices;
-using System.Windows;
-using System.Windows.Interop;
-using System.Windows.Markup;
-using Microsoft.WindowsAPICodePack.Dialogs.Controls;
-using Microsoft.WindowsAPICodePack.Shell;
-using MS.WindowsAPICodePack.Internal;
-
-namespace Microsoft.WindowsAPICodePack.Dialogs
-{
- ///
- /// Defines the abstract base class for the common file dialogs.
- ///
- [ContentProperty("Controls")]
- public abstract class CommonFileDialog : IDialogControlHost, IDisposable
- {
- ///
- /// The collection of names selected by the user.
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes")]
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields", Justification = "This is an internal field used by the CommonOpenFileDialog and possibly other dialogs deriving from this base class.")]
- protected readonly Collection fileNames;
- internal readonly Collection items;
- internal DialogShowState showState = DialogShowState.PreShow;
-
- private IFileDialog nativeDialog;
- private IFileDialogCustomize customize;
- private NativeDialogEventSink nativeEventSink;
- private bool? canceled;
- private bool resetSelections;
- private IntPtr parentWindow = IntPtr.Zero;
-
- private bool filterSet = false; // filters can be set only once
-
- ///
- /// Contains a common error message string shared by classes that
- /// inherit from this class.
- ///
- protected const string IllegalPropertyChangeString = " cannot be changed while dialog is showing";
-
- #region Constructors
-
- ///
- /// Creates a new instance of this class.
- ///
- protected CommonFileDialog()
- {
- if (!CoreHelpers.RunningOnVista)
- throw new PlatformNotSupportedException(
- "Common File Dialog requires Windows Vista or later.");
-
- fileNames = new Collection();
- filters = new CommonFileDialogFilterCollection();
- items = new Collection();
- controls = new CommonFileDialogControlCollection(this);
- }
-
- ///
- /// Creates a new instance of this class with the specified title.
- ///
- /// The title to display in the dialog.
- protected CommonFileDialog(string title)
- : this()
- {
- this.title = title;
- }
-
- #endregion
-
- // Template method to allow derived dialog to create actual
- // specific COM coclass (e.g. FileOpenDialog or FileSaveDialog).
- internal abstract void InitializeNativeFileDialog();
- internal abstract IFileDialog GetNativeFileDialog();
- internal abstract void PopulateWithFileNames(Collection names);
- internal abstract void PopulateWithIShellItems(Collection shellItems);
- internal abstract void CleanUpNativeFileDialog();
- internal abstract ShellNativeMethods.FOS GetDerivedOptionFlags(ShellNativeMethods.FOS flags);
-
- #region Public API
-
- // Events.
- ///
- /// Raised just before the dialog is about to return with a result. Occurs when the user clicks on the Open
- /// or Save button on a file dialog box.
- ///
- public event CancelEventHandler FileOk;
- ///
- /// Raised just before the user navigates to a new folder.
- ///
- public event EventHandler FolderChanging;
- ///
- /// Raised when the user navigates to a new folder.
- ///
- public event EventHandler FolderChanged;
- ///
- /// Raised when the user changes the selection in the dialog's view.
- ///
- public event EventHandler SelectionChanged;
- ///
- /// Raised when the dialog is opened to notify the application of the initial chosen filetype.
- ///
- public event EventHandler FileTypeChanged;
- ///
- /// Raised when the dialog is opening.
- ///
- public event EventHandler DialogOpening;
-
- private CommonFileDialogControlCollection controls;
- ///
- /// Gets the collection of controls for the dialog.
- ///
- public CommonFileDialogControlCollection Controls
- {
- get { return controls; }
- }
-
- private CommonFileDialogFilterCollection filters;
- ///
- /// Gets the filters used by the dialog.
- ///
- public CommonFileDialogFilterCollection Filters
- {
- get { return filters; }
- }
-
- private string title;
- ///
- /// Gets or sets the dialog title.
- ///
- /// A object.
- public string Title
- {
- get { return title; }
- set
- {
- title = value;
- if (NativeDialogShowing)
- nativeDialog.SetTitle(value);
- }
- }
-
- // This is the first of many properties that are backed by the FOS_*
- // bitflag options set with IFileDialog.SetOptions().
- // SetOptions() fails
- // if called while dialog is showing (e.g. from a callback).
- private bool ensureFileExists;
- ///
- /// Gets or sets a value that determines whether the file must exist beforehand.
- ///
- /// A value. true if the file must exist.
- /// This property cannot be set when the dialog is visible.
- public bool EnsureFileExists
- {
- get { return ensureFileExists; }
- set
- {
- ThrowIfDialogShowing("EnsureFileExists" + IllegalPropertyChangeString);
- ensureFileExists = value;
- }
- }
-
- private bool ensurePathExists;
- ///
- /// Gets or sets a value that specifies whether the returned file must be in an existing folder.
- ///
- /// A value. true if the file must exist.
- /// This property cannot be set when the dialog is visible.
- public bool EnsurePathExists
- {
- get { return ensurePathExists; }
- set
- {
- ThrowIfDialogShowing("EnsurePathExists" + IllegalPropertyChangeString);
- ensurePathExists = value;
- }
- }
-
- private bool ensureValidNames;
- /// Gets or sets a value that determines whether to validate file names.
- ///
- ///A value. true to check for situations that would prevent an application from opening the selected file, such as sharing violations or access denied errors.
- /// This property cannot be set when the dialog is visible.
- ///
- public bool EnsureValidNames
- {
- get { return ensureValidNames; }
- set
- {
- ThrowIfDialogShowing("EnsureValidNames" + IllegalPropertyChangeString);
- ensureValidNames = value;
- }
- }
-
- private bool ensureReadOnly;
- ///
- /// Gets or sets a value that determines whether read-only items are returned.
- /// Default value for CommonOpenFileDialog is true (allow read-only files) and
- /// CommonSaveFileDialog is false (don't allow read-only files).
- ///
- /// A value. true includes read-only items.
- /// This property cannot be set when the dialog is visible.
- public bool EnsureReadOnly
- {
- get { return ensureReadOnly; }
- set
- {
- ThrowIfDialogShowing("EnsureReadOnly" + IllegalPropertyChangeString);
- ensureReadOnly = value;
- }
- }
-
- private bool restoreDirectory;
- ///
- /// Gets or sets a value that determines the restore directory.
- ///
- ///
- /// This property cannot be set when the dialog is visible.
- public bool RestoreDirectory
- {
- get { return restoreDirectory; }
- set
- {
- ThrowIfDialogShowing("RestoreDirectory" + IllegalPropertyChangeString);
- restoreDirectory = value;
- }
- }
-
- private bool showPlacesList = true;
- ///
- /// Gets or sets a value that controls whether
- /// to show or hide the list of pinned places that
- /// the user can choose.
- ///
- /// A value. true if the list is visible; otherwise false.
- /// This property cannot be set when the dialog is visible.
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "ShowPlaces", Justification = "The property is for showing or hiding the _Places_ section in Vista")]
- public bool ShowPlacesList
- {
-
- get { return showPlacesList; }
- set
- {
- ThrowIfDialogShowing("ShowPlacesList" + IllegalPropertyChangeString);
- showPlacesList = value;
- }
- }
-
- private bool addToMruList = true;
- ///
- /// Gets or sets a value that controls whether to show or hide the list of places where the user has recently opened or saved items.
- ///
- /// A value.
- /// This property cannot be set when the dialog is visible.
- public bool AddToMostRecentlyUsedList
- {
- get { return addToMruList; }
- set
- {
- ThrowIfDialogShowing("AddToMostRecentlyUsedList" + IllegalPropertyChangeString);
- addToMruList = value;
- }
- }
-
- private bool showHiddenItems;
- ///
- /// Gets or sets a value that controls whether to show hidden items.
- ///
- /// A value.true to show the items; otherwise false.
- /// This property cannot be set when the dialog is visible.
- public bool ShowHiddenItems
- {
- get { return showHiddenItems; }
- set
- {
- ThrowIfDialogShowing("ShowHiddenItems" + IllegalPropertyChangeString);
- showHiddenItems = value;
- }
- }
- private bool allowPropertyEditing;
- ///
- /// Gets or sets a value that controls whether
- /// properties can be edited.
- ///
- /// A value.
- public bool AllowPropertyEditing
- {
- get { return allowPropertyEditing; }
- set { allowPropertyEditing = value; }
- }
-
- private bool navigateToShortcut = true;
- ///
- /// Gets or sets a value that controls whether shortcuts should be treated as their target items, allowing an application to open a .lnk file.
- ///
- /// A value. true indicates that shortcuts should be treated as their targets.
- /// This property cannot be set when the dialog is visible.
- public bool NavigateToShortcut
- {
- get { return navigateToShortcut; }
- set
- {
- ThrowIfDialogShowing("NavigateToShortcut" + IllegalPropertyChangeString);
- navigateToShortcut = value;
- }
- }
-
- ///
- /// Gets or sets the default file extension to be added to file names. If the value is null
- /// or String.Empty, the extension is not added to the file names.
- ///
- public string DefaultExtension
- {
- get;
- set;
- }
-
- ///
- /// Gets the index for the currently selected file type.
- ///
- public int SelectedFileTypeIndex
- {
- get
- {
- uint fileType;
-
- if (nativeDialog != null)
- {
- nativeDialog.GetFileTypeIndex(out fileType);
- return (int)fileType;
- }
-
- return -1;
- }
- }
-
- ///
- /// Tries to set the File(s) Type Combo to match the value in
- /// 'DefaultExtension'. Only doing this if 'this' is a Save dialog
- /// as it makes no sense to do this if only Opening a file.
- ///
- ///
- /// The native/IFileDialog instance.
- ///
- private void SyncFileTypeComboToDefaultExtension(IFileDialog dialog)
- {
- // make sure it's a Save dialog and that there is a default
- // extension to sync to.
- if (!(this is CommonSaveFileDialog) || DefaultExtension == null ||
- filters.Count <= 0)
- {
- return;
- }
-
- // The native version of SetFileTypeIndex() requires an
- // unsigned integer as its parameter. This (having it be defined
- // as a uint right up front) avoids a cast, and the potential
- // problems of casting a signed value to an unsigned one.
- uint filtersCounter = 0;
-
- CommonFileDialogFilter filter = null;
-
- for (filtersCounter = 0; filtersCounter < filters.Count;
- filtersCounter++)
- {
- filter = (CommonFileDialogFilter)filters[(int)filtersCounter];
-
- if (filter.Extensions.Contains(DefaultExtension))
- {
- // set the docType combo to match this
- // extension. property is a 1-based index.
- dialog.SetFileTypeIndex(filtersCounter + 1);
-
- // we're done, exit for
- break;
- }
- }
-
- }
-
- ///
- /// Gets the selected filename.
- ///
- /// A object.
- /// This property cannot be used when multiple files are selected.
- public string FileName
- {
- get
- {
- CheckFileNamesAvailable();
-
- if (fileNames.Count > 1)
- throw new InvalidOperationException("Multiple files selected - the FileNames property should be used instead.");
-
- string returnFilename = fileNames[0];
-
- // "If extension is a null reference (Nothing in Visual
- // Basic), the returned string contains the specified
- // path with its extension removed." Since we do not want
- // to remove any existing extension, make sure the
- // DefaultExtension property is NOT null.
-
- // if we should, and there is one to set...
- if (!string.IsNullOrEmpty(DefaultExtension))
- {
- returnFilename = System.IO.Path.ChangeExtension(returnFilename, DefaultExtension);
- }
-
- return returnFilename;
- }
- }
-
- ///
- /// Gets the selected item as a ShellObject.
- ///
- /// A object.
- /// This property cannot be used when multiple files
- /// are selected.
- public ShellObject FileAsShellObject
- {
- get
- {
- CheckFileItemsAvailable();
-
- if (items.Count > 1)
- throw new InvalidOperationException("Multiple files selected - the Items property should be used instead.");
-
- if (items.Count == 1)
- return ShellObjectFactory.Create(items[0]);
- else
- return null;
- }
- }
-
- ///
- /// Adds a location, such as a folder, library, search connector, or known folder, to the list of
- /// places available for a user to open or save items. This method actually adds an item
- /// to the Favorite Links or Places section of the Open/Save dialog.
- ///
- /// The item to add to the places list.
- /// One of the enumeration values that indicates placement of the item in the list.
- public void AddPlace(ShellContainer place, FileDialogAddPlaceLocation location)
- {
- // Get our native dialog
- if (nativeDialog == null)
- {
- InitializeNativeFileDialog();
- nativeDialog = GetNativeFileDialog();
- }
-
- // Add the shellitem to the places list
- if (nativeDialog != null)
- nativeDialog.AddPlace(((ShellObject)place).NativeShellItem, (ShellNativeMethods.FDAP)location);
- }
-
- ///
- /// Adds a location (folder, library, search connector, known folder) to the list of
- /// places available for the user to open or save items. This method actually adds an item
- /// to the Favorite Links or Places section of the Open/Save dialog. Overload method
- /// takes in a string for the path.
- ///
- /// The item to add to the places list.
- /// One of the enumeration values that indicates placement of the item in the list.
- public void AddPlace(string path, FileDialogAddPlaceLocation location)
- {
- if (string.IsNullOrEmpty(path))
- throw new ArgumentNullException("path");
-
- // Get our native dialog
- if (nativeDialog == null)
- {
- InitializeNativeFileDialog();
- nativeDialog = GetNativeFileDialog();
- }
-
- // Create a native shellitem from our path
- IShellItem2 nativeShellItem;
- Guid guid = new Guid(ShellIIDGuid.IShellItem2);
- int retCode = ShellNativeMethods.SHCreateItemFromParsingName(path, IntPtr.Zero, ref guid, out nativeShellItem);
-
- if (!CoreErrorHelper.Succeeded(retCode))
- throw new ExternalException("Shell item could not be created.", Marshal.GetExceptionForHR(retCode));
-
- // Add the shellitem to the places list
- if (nativeDialog != null)
- nativeDialog.AddPlace(nativeShellItem, (ShellNativeMethods.FDAP)location);
- }
-
- // Null = use default directory.
- private string initialDirectory;
- ///
- /// Gets or sets the initial directory displayed when the dialog is shown.
- /// A null or empty string indicates that the dialog is using the default directory.
- ///
- /// A object.
- public string InitialDirectory
- {
- get { return initialDirectory; }
- set { initialDirectory = value; }
- }
-
- private ShellContainer initialDirectoryShellContainer;
- ///
- /// Gets or sets a location that is always selected when the dialog is opened,
- /// regardless of previous user action. A null value implies that the dialog is using
- /// the default location.
- ///
- public ShellContainer InitialDirectoryShellContainer
- {
- get
- {
- return initialDirectoryShellContainer;
- }
- set
- {
- initialDirectoryShellContainer = value;
- }
- }
-
- private string defaultDirectory;
- ///
- /// Sets the folder and path used as a default if there is not a recently used folder value available.
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1044:PropertiesShouldNotBeWriteOnly", Justification = "This is following the native API")]
- public string DefaultDirectory
- {
- set { defaultDirectory = value; }
- }
-
- private ShellContainer defaultDirectoryShellContainer;
- ///
- /// Sets the location (ShellContainer
- /// used as a default if there is not a recently used folder value available.
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1044:PropertiesShouldNotBeWriteOnly", Justification = "This is following the native API")]
- public ShellContainer DefaultDirectoryShellContainer
- {
- set { defaultDirectoryShellContainer = value; }
- }
-
- // Null = use default identifier.
- private Guid cookieIdentifier;
- ///
- /// Gets or sets a value that enables a calling application
- /// to associate a GUID with a dialog's persisted state.
- ///
- public Guid CookieIdentifier
- {
- get { return cookieIdentifier; }
- set { cookieIdentifier = value; }
- }
-
- ///
- /// Displays the dialog.
- ///
- /// Window handle of any top-level window that will own the modal dialog box.
- /// A object.
- public CommonFileDialogResult ShowDialog(IntPtr ownerWindowHandle)
- {
- if (ownerWindowHandle == IntPtr.Zero)
- throw new ArgumentException("ownerWindowHandle");
-
- // Set the parent / owner window
- parentWindow = ownerWindowHandle;
-
- // Show the modal dialog
- return ShowDialog();
- }
-
- ///
- /// Displays the dialog.
- ///
- /// Top-level WPF window that will own the modal dialog box.
- /// A object.
- public CommonFileDialogResult ShowDialog(Window window)
- {
- if (window == null)
- throw new ArgumentNullException("window");
-
- // Set the parent / owner window
- parentWindow = (new WindowInteropHelper(window)).Handle;
-
- // Show the modal dialog
- return ShowDialog();
- }
-
- ///
- /// Displays the dialog.
- ///
- /// A object.
- public CommonFileDialogResult ShowDialog()
- {
- CommonFileDialogResult result;
-
- // Fetch derived native dialog (i.e. Save or Open).
- InitializeNativeFileDialog();
- nativeDialog = GetNativeFileDialog();
-
- // Apply outer properties to native dialog instance.
- ApplyNativeSettings(nativeDialog);
- InitializeEventSink(nativeDialog);
-
- // Clear user data if Reset has been called
- // since the last show.
- if (resetSelections)
- {
- resetSelections = false;
- }
-
- // Show dialog.
- showState = DialogShowState.Showing;
- int hresult = nativeDialog.Show(parentWindow);
- showState = DialogShowState.Closed;
-
- // Create return information.
- if (CoreErrorHelper.Matches(hresult, (int)HRESULT.ERROR_CANCELLED))
- {
- canceled = true;
- result = CommonFileDialogResult.Cancel;
- fileNames.Clear();
- }
- else
- {
- canceled = false;
- result = CommonFileDialogResult.OK;
-
- // Populate filenames if user didn't cancel.
- PopulateWithFileNames(fileNames);
-
- // Populate the actual IShellItems
- PopulateWithIShellItems(items);
- }
-
- return result;
- }
- ///
- /// Removes the current selection.
- ///
- public void ResetUserSelections()
- {
- resetSelections = true;
- }
-
- ///
- /// Default file name.
- ///
- public string DefaultFileName
- {
- get;
- set;
- }
-
- #endregion
-
- #region Configuration
-
- private void InitializeEventSink(IFileDialog nativeDlg)
- {
- // Check if we even need to have a sink.
- if (FileOk != null
- || FolderChanging != null
- || FolderChanged != null
- || SelectionChanged != null
- || FileTypeChanged != null
- || DialogOpening != null
- || (controls != null && controls.Count > 0))
- {
- uint cookie;
- nativeEventSink = new NativeDialogEventSink(this);
- nativeDlg.Advise(nativeEventSink, out cookie);
- nativeEventSink.Cookie = cookie;
- }
- }
-
- private void ApplyNativeSettings(IFileDialog dialog)
- {
- Debug.Assert(dialog != null, "No dialog instance to configure");
-
- if (parentWindow == IntPtr.Zero)
- {
- if (System.Windows.Application.Current != null && System.Windows.Application.Current.MainWindow != null)
- parentWindow = (new WindowInteropHelper(System.Windows.Application.Current.MainWindow)).Handle;
- else if (System.Windows.Forms.Application.OpenForms.Count > 0)
- parentWindow = System.Windows.Forms.Application.OpenForms[0].Handle;
- }
-
- Guid guid = new Guid(ShellIIDGuid.IShellItem2);
-
- // Apply option bitflags.
- dialog.SetOptions(CalculateNativeDialogOptionFlags());
-
- // Other property sets.
- if (title != null)
- dialog.SetTitle(title);
- if (initialDirectoryShellContainer != null)
- {
- dialog.SetFolder(((ShellObject)initialDirectoryShellContainer).NativeShellItem);
- }
- if (defaultDirectoryShellContainer != null)
- {
- dialog.SetDefaultFolder(((ShellObject)defaultDirectoryShellContainer).NativeShellItem);
- }
- if (!String.IsNullOrEmpty(initialDirectory))
- {
- // Create a native shellitem from our path
- IShellItem2 initialDirectoryShellItem;
- ShellNativeMethods.SHCreateItemFromParsingName(initialDirectory, IntPtr.Zero, ref guid, out initialDirectoryShellItem);
-
- // If we get a real shell item back,
- // then use that as the initial folder - otherwise,
- // we'll allow the dialog to revert to the default folder.
- // (OR should we fail loudly?)
- if (initialDirectoryShellItem != null)
- dialog.SetFolder(initialDirectoryShellItem);
- }
- if (!string.IsNullOrEmpty(defaultDirectory))
- {
- // Create a native shellitem from our path
- IShellItem2 defaultDirectoryShellItem;
- ShellNativeMethods.SHCreateItemFromParsingName(defaultDirectory, IntPtr.Zero, ref guid, out defaultDirectoryShellItem);
-
- // If we get a real shell item back,
- // then use that as the initial folder - otherwise,
- // we'll allow the dialog to revert to the default folder.
- // (OR should we fail loudly?)
- if (defaultDirectoryShellItem != null)
- dialog.SetDefaultFolder(defaultDirectoryShellItem);
- }
-
- // Apply file type filters, if available.
- if (filters.Count > 0 && !filterSet)
- {
- dialog.SetFileTypes(
- (uint)filters.Count,
- filters.GetAllFilterSpecs());
-
- filterSet = true;
-
- SyncFileTypeComboToDefaultExtension(dialog);
- }
-
- if (cookieIdentifier != Guid.Empty)
- dialog.SetClientGuid(ref cookieIdentifier);
-
- // Set the default extension
- if (!string.IsNullOrEmpty(DefaultExtension))
- dialog.SetDefaultExtension(DefaultExtension);
-
- // Set the default filename
- dialog.SetFileName(DefaultFileName);
- }
-
- private ShellNativeMethods.FOS CalculateNativeDialogOptionFlags()
- {
- // We start with only a few flags set by default,
- // then go from there based on the current state
- // of the managed dialog's property values.
- ShellNativeMethods.FOS flags =
- ShellNativeMethods.FOS.FOS_NOTESTFILECREATE;
-
- // Call to derived (concrete) dialog to
- // set dialog-specific flags.
- flags = GetDerivedOptionFlags(flags);
-
- // Apply other optional flags.
- if (ensureFileExists)
- flags |= ShellNativeMethods.FOS.FOS_FILEMUSTEXIST;
- if (ensurePathExists)
- flags |= ShellNativeMethods.FOS.FOS_PATHMUSTEXIST;
- if (!ensureValidNames)
- flags |= ShellNativeMethods.FOS.FOS_NOVALIDATE;
- if (!EnsureReadOnly)
- flags |= ShellNativeMethods.FOS.FOS_NOREADONLYRETURN;
- if (restoreDirectory)
- flags |= ShellNativeMethods.FOS.FOS_NOCHANGEDIR;
- if (!showPlacesList)
- flags |= ShellNativeMethods.FOS.FOS_HIDEPINNEDPLACES;
- if (!addToMruList)
- flags |= ShellNativeMethods.FOS.FOS_DONTADDTORECENT;
- if (showHiddenItems)
- flags |= ShellNativeMethods.FOS.FOS_FORCESHOWHIDDEN;
- if (!navigateToShortcut)
- flags |= ShellNativeMethods.FOS.FOS_NODEREFERENCELINKS;
- return flags;
- }
-
- #endregion
-
- #region IDialogControlHost Members
-
- private static void GenerateNotImplementedException()
- {
- throw new NotImplementedException(
- "The method or operation is not implemented.");
- }
-
- bool IDialogControlHost.IsCollectionChangeAllowed()
- {
- return true;
- }
-
- void IDialogControlHost.ApplyCollectionChanged()
- {
- // Query IFileDialogCustomize interface before adding controls
- GetCustomizedFileDialog();
- // Populate all the custom controls and add them to the dialog
- foreach (CommonFileDialogControl control in controls)
- {
- if (!control.IsAdded)
- {
- control.HostingDialog = this;
- control.Attach(customize);
- control.IsAdded = true;
- }
- }
-
- }
-
- bool IDialogControlHost.IsControlPropertyChangeAllowed(string propertyName, DialogControl control)
- {
- CommonFileDialog.GenerateNotImplementedException();
- return false;
- }
-
- void IDialogControlHost.ApplyControlPropertyChange(string propertyName, DialogControl control)
- {
- if (propertyName == "Text")
- {
- if (control is CommonFileDialogTextBox)
- customize.SetEditBoxText(control.Id, ((CommonFileDialogControl)control).Text);
- else
- customize.SetControlLabel(control.Id, ((CommonFileDialogControl)control).Text);
- }
- else if (propertyName == "Visible")
- {
- CommonFileDialogControl dialogControl = control as CommonFileDialogControl;
- ShellNativeMethods.CDCONTROLSTATE state;
-
- customize.GetControlState(control.Id, out state);
-
- if (dialogControl.Visible == true)
- state |= ShellNativeMethods.CDCONTROLSTATE.CDCS_VISIBLE;
- else if (dialogControl.Visible == false)
- {
- state &= ~ShellNativeMethods.CDCONTROLSTATE.CDCS_VISIBLE;
- }
-
- customize.SetControlState(control.Id, state);
- }
- else if (propertyName == "Enabled")
- {
- CommonFileDialogControl dialogControl = control as CommonFileDialogControl;
- ShellNativeMethods.CDCONTROLSTATE state;
-
- customize.GetControlState(control.Id, out state);
-
- if (dialogControl.Enabled == true)
- state |= ShellNativeMethods.CDCONTROLSTATE.CDCS_ENABLED;
- else if (dialogControl.Enabled == false)
- {
- state &= ~ShellNativeMethods.CDCONTROLSTATE.CDCS_ENABLED;
- }
-
- customize.SetControlState(control.Id, state);
- }
- else if (propertyName == "SelectedIndex")
- {
- if (control is CommonFileDialogRadioButtonList)
- {
- CommonFileDialogRadioButtonList list = control as CommonFileDialogRadioButtonList;
- customize.SetSelectedControlItem(control.Id, list.SelectedIndex);
- }
- else if (control is CommonFileDialogComboBox)
- {
- CommonFileDialogComboBox box = control as CommonFileDialogComboBox;
- customize.SetSelectedControlItem(control.Id, box.SelectedIndex);
- }
- }
- else if (propertyName == "IsChecked")
- {
- if (control is CommonFileDialogCheckBox)
- {
- CommonFileDialogCheckBox checkBox = control as CommonFileDialogCheckBox;
- customize.SetCheckButtonState(control.Id, checkBox.IsChecked);
- }
- }
- }
-
- #endregion
-
- #region Helpers
-
- ///
- /// Ensures that the user has selected one or more files.
- ///
- ///
- /// The dialog has not been dismissed yet or the dialog was cancelled.
- ///
- protected void CheckFileNamesAvailable()
- {
- if (showState != DialogShowState.Closed)
- throw new InvalidOperationException(
- "Filename not available - dialog has not closed yet.");
-
- if (canceled.GetValueOrDefault())
- throw new InvalidOperationException(
- "Filename not available - dialog was canceled.");
-
- Debug.Assert(fileNames.Count != 0,
- "FileNames empty - shouldn't happen unless dialog canceled or not yet shown.");
- }
-
- ///
- /// Ensures that the user has selected one or more files.
- ///
- ///
- /// The dialog has not been dismissed yet or the dialog was cancelled.
- ///
- protected void CheckFileItemsAvailable()
- {
- if (showState != DialogShowState.Closed)
- throw new InvalidOperationException(
- "Filename not available - dialog has not closed yet.");
-
- if (canceled.GetValueOrDefault())
- throw new InvalidOperationException(
- "Filename not available - dialog was canceled.");
-
- Debug.Assert(items.Count != 0,
- "Items list empty - shouldn't happen unless dialog canceled or not yet shown.");
- }
-
- static IntPtr GetHandleFromWindow(Window window)
- {
- if (window == null)
- return IntPtr.Zero;
-
- return (new WindowInteropHelper(window)).Handle;
- }
-
- private bool NativeDialogShowing
- {
- get
- {
- return (nativeDialog != null)
- && (showState == DialogShowState.Showing ||
- showState == DialogShowState.Closing);
- }
- }
-
- internal static string GetFileNameFromShellItem(IShellItem item)
- {
- string filename = null;
- IntPtr pszString = IntPtr.Zero;
- HRESULT hr = item.GetDisplayName(ShellNativeMethods.SIGDN.SIGDN_DESKTOPABSOLUTEPARSING, out pszString);
- if (hr == HRESULT.S_OK && pszString != IntPtr.Zero)
- {
- filename = Marshal.PtrToStringAuto(pszString);
- Marshal.FreeCoTaskMem(pszString);
- }
- return filename;
- }
-
- internal static IShellItem GetShellItemAt(IShellItemArray array, int i)
- {
- IShellItem result;
- uint index = (uint)i;
- array.GetItemAt(index, out result);
- return result;
- }
-
- ///
- /// Throws an exception when the dialog is showing preventing
- /// a requested change to a property or the visible set of controls.
- ///
- /// The message to include in the exception.
- /// The dialog is in an
- /// invalid state to perform the requested operation.
- protected void ThrowIfDialogShowing(string message)
- {
- if (NativeDialogShowing)
- throw new InvalidOperationException(message);
- }
- ///
- /// Get the IFileDialogCustomize interface, preparing to add controls.
- ///
- private void GetCustomizedFileDialog()
- {
- if (customize == null)
- {
- if (nativeDialog == null)
- {
- InitializeNativeFileDialog();
- nativeDialog = GetNativeFileDialog();
- }
- customize = (IFileDialogCustomize)nativeDialog;
- }
- }
- #endregion
-
- #region CheckChanged handling members
- ///
- /// Raises the event just before the dialog is about to return with a result.
- ///
- /// The event data.
- protected virtual void OnFileOk(CancelEventArgs e)
- {
- CancelEventHandler handler = FileOk;
- if (handler != null)
- {
- handler(this, e);
- }
- }
- ///
- /// Raises the to stop navigation to a particular location.
- ///
- /// Cancelable event arguments.
- protected virtual void OnFolderChanging(CommonFileDialogFolderChangeEventArgs e)
- {
- EventHandler handler = FolderChanging;
- if (handler != null)
- {
- handler(this, e);
- }
- }
- ///
- /// Raises the event when the user navigates to a new folder.
- ///
- /// The event data.
- protected virtual void OnFolderChanged(EventArgs e)
- {
- EventHandler handler = FolderChanged;
- if (handler != null)
- {
- handler(this, e);
- }
- }
- ///
- /// Raises the event when the user changes the selection in the dialog's view.
- ///
- /// The event data.
- protected virtual void OnSelectionChanged(EventArgs e)
- {
- EventHandler handler = SelectionChanged;
- if (handler != null)
- {
- handler(this, e);
- }
- }
- ///
- /// Raises the event when the dialog is opened to notify the
- /// application of the initial chosen filetype.
- ///
- /// The event data.
- protected virtual void OnFileTypeChanged(EventArgs e)
- {
- EventHandler handler = FileTypeChanged;
- if (handler != null)
- {
- handler(this, e);
- }
- }
- ///
- /// Raises the event when the dialog is opened.
- ///
- /// The event data.
- protected virtual void OnOpening(EventArgs e)
- {
- EventHandler handler = DialogOpening;
- if (handler != null)
- {
- handler(this, e);
- }
- }
-
- #endregion
-
- #region NativeDialogEventSink Nested Class
-
- private class NativeDialogEventSink : IFileDialogEvents, IFileDialogControlEvents
- {
- private CommonFileDialog parent;
- private bool firstFolderChanged = true;
-
- public NativeDialogEventSink(CommonFileDialog commonDialog)
- {
- this.parent = commonDialog;
- }
-
- private uint cookie;
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This can be called from an application using our library")]
- public uint Cookie
- {
- get { return cookie; }
- set { cookie = value; }
- }
-
- public HRESULT OnFileOk(IFileDialog pfd)
- {
- CancelEventArgs args = new CancelEventArgs();
- parent.OnFileOk(args);
-
- if (!args.Cancel)
- {
- // Make sure all custom properties are sync'ed
- if (parent.Controls != null)
- {
- foreach (CommonFileDialogControl control in parent.Controls)
- {
- if (control is CommonFileDialogTextBox)
- {
- (control as CommonFileDialogTextBox).SyncValue();
- (control as CommonFileDialogTextBox).Closed = true;
- }
- // Also check subcontrols
- else if (control is CommonFileDialogGroupBox)
- {
- CommonFileDialogGroupBox groupbox = control as CommonFileDialogGroupBox;
- foreach (CommonFileDialogControl subcontrol in groupbox.Items)
- {
- if (subcontrol is CommonFileDialogTextBox)
- {
- (subcontrol as CommonFileDialogTextBox).SyncValue();
- (subcontrol as CommonFileDialogTextBox).Closed = true;
- }
- }
- }
- }
- }
- }
-
- return (args.Cancel ? HRESULT.S_FALSE : HRESULT.S_OK);
- }
-
- public HRESULT OnFolderChanging(IFileDialog pfd, IShellItem psiFolder)
- {
- CommonFileDialogFolderChangeEventArgs args =
- new CommonFileDialogFolderChangeEventArgs(CommonFileDialog.GetFileNameFromShellItem(psiFolder));
- if (!firstFolderChanged)
- parent.OnFolderChanging(args);
- return (args.Cancel ? HRESULT.S_FALSE : HRESULT.S_OK);
- }
-
- public void OnFolderChange(IFileDialog pfd)
- {
- if (firstFolderChanged)
- {
- firstFolderChanged = false;
- parent.OnOpening(EventArgs.Empty);
- }
- else
- parent.OnFolderChanged(EventArgs.Empty);
- }
-
- public void OnSelectionChange(IFileDialog pfd)
- {
- parent.OnSelectionChanged(EventArgs.Empty);
- }
-
- public void OnShareViolation(
- IFileDialog pfd,
- IShellItem psi,
- out ShellNativeMethods.FDE_SHAREVIOLATION_RESPONSE pResponse)
- {
- // Do nothing: we will ignore share violations,
- // and don't register
- // for them, so this method should never be called.
- pResponse = ShellNativeMethods.FDE_SHAREVIOLATION_RESPONSE.FDESVR_ACCEPT;
- }
-
- public void OnTypeChange(IFileDialog pfd)
- {
- parent.OnFileTypeChanged(EventArgs.Empty);
- }
-
- public void OnOverwrite(IFileDialog pfd, IShellItem psi, out ShellNativeMethods.FDE_OVERWRITE_RESPONSE pResponse)
- {
- // Don't accept or reject the dialog, keep default settings
- pResponse = ShellNativeMethods.FDE_OVERWRITE_RESPONSE.FDEOR_DEFAULT;
- }
-
- public void OnItemSelected(IFileDialogCustomize pfdc, int dwIDCtl, int dwIDItem)
- {
- // Find control
- DialogControl control = this.parent.controls.GetControlbyId(dwIDCtl);
-
- // Process ComboBox and/or RadioButtonList
- if (control is ICommonFileDialogIndexedControls)
- {
- // Update selected item and raise SelectedIndexChanged event
- ICommonFileDialogIndexedControls controlInterface = control as ICommonFileDialogIndexedControls;
- controlInterface.SelectedIndex = dwIDItem;
- controlInterface.RaiseSelectedIndexChangedEvent();
- }
- // Process Menu
- else if (control is CommonFileDialogMenu)
- {
- CommonFileDialogMenu menu = control as CommonFileDialogMenu;
-
- // Find the menu item that was clicked and invoke it's click event
- foreach (CommonFileDialogMenuItem item in menu.Items)
- {
- if (item.Id == dwIDItem)
- {
- item.RaiseClickEvent();
- break;
- }
- }
- }
- }
-
- public void OnButtonClicked(IFileDialogCustomize pfdc, int dwIDCtl)
- {
- // Find control
- DialogControl control = this.parent.controls.GetControlbyId(dwIDCtl);
-
- // Call corresponding event
- if (control is CommonFileDialogButton)
- {
- ((CommonFileDialogButton)control).RaiseClickEvent();
- }
- }
-
- public void OnCheckButtonToggled(IFileDialogCustomize pfdc, int dwIDCtl, bool bChecked)
- {
- // Find control
- DialogControl control = this.parent.controls.GetControlbyId(dwIDCtl);
-
- // Update control and call corresponding event
- if (control is CommonFileDialogCheckBox)
- {
- CommonFileDialogCheckBox box = control as CommonFileDialogCheckBox;
- box.IsChecked = bChecked;
- box.RaiseCheckedChangedEvent();
- }
- }
-
- public void OnControlActivating(IFileDialogCustomize pfdc, int dwIDCtl)
- {
- }
- }
-
- #endregion
-
- #region IDisposable Members
-
- ///
- /// Releases the unmanaged resources used by the CommonFileDialog class and optionally
- /// releases the managed resources.
- ///
- /// true to release both managed and unmanaged resources;
- /// false to release only unmanaged resources.
- public void Dispose(bool disposing)
- {
- if (disposing)
- {
- CleanUpNativeFileDialog();
- }
- }
-
- ///
- /// Releases the resources used by the current instance of the CommonFileDialog class.
- ///
- public void Dispose()
- {
- Dispose(true);
- }
-
- #endregion
-
- ///
- /// Indicates whether this feature is supported on the current platform.
- ///
- public static bool IsPlatformSupported
- {
- get
- {
- // We need Windows Vista onwards ...
- return CoreHelpers.RunningOnVista;
- }
- }
- }
-
-
-}
diff --git a/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialogButton.cs b/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialogButton.cs
deleted file mode 100644
index 7bc438d..0000000
--- a/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialogButton.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Diagnostics;
-
-namespace Microsoft.WindowsAPICodePack.Dialogs.Controls
-{
- ///
- /// Creates the push button controls used by the Common File Dialog.
- ///
- public class CommonFileDialogButton : CommonFileDialogProminentControl
- {
- ///
- /// Initializes a new instance of this class.
- ///
- public CommonFileDialogButton()
- : base(String.Empty)
- {
- }
-
- ///
- /// Initializes a new instance of this class with the text only.
- ///
- /// The text to display for this control.
- public CommonFileDialogButton(string text)
- : base(text)
- {
- }
-
- ///
- /// Initializes a new instance of this class with the specified name and text.
- ///
- /// The name of this control.
- /// The text to display for this control.
- public CommonFileDialogButton(string name, string text)
- : base(name, text)
- {
- }
-
- ///
- /// Attach the PushButton control to the dialog object
- ///
- /// Target dialog
- internal override void Attach(IFileDialogCustomize dialog)
- {
- Debug.Assert(dialog != null, "CommonFileDialogButton.Attach: dialog parameter can not be null");
-
- // Add a push button control
- dialog.AddPushButton(this.Id, this.Text);
-
- // Make this control prominent if needed
- if (IsProminent)
- dialog.MakeProminent(this.Id);
-
- // Sync unmanaged properties with managed properties
- SyncUnmanagedProperties();
- }
-
- ///
- /// Occurs when the user clicks the control. This event is routed from COM via the event sink.
- ///
- public event EventHandler Click = delegate { };
- internal void RaiseClickEvent()
- {
- // Make sure that this control is enabled and has a specified delegate
- if (Enabled)
- this.Click(this, EventArgs.Empty);
- }
- }
-}
\ No newline at end of file
diff --git a/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialogCheckBox.cs b/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialogCheckBox.cs
deleted file mode 100644
index fdcf274..0000000
--- a/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialogCheckBox.cs
+++ /dev/null
@@ -1,113 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Diagnostics;
-
-namespace Microsoft.WindowsAPICodePack.Dialogs.Controls
-{
- ///
- /// Creates the check button controls used by the Common File Dialog.
- ///
- public class CommonFileDialogCheckBox : CommonFileDialogProminentControl
- {
- private bool isChecked = false;
- ///
- /// Gets or sets the state of the check box.
- ///
- public bool IsChecked
- {
- get { return isChecked; }
- set
- {
- // Check if property has changed
- if (isChecked != value)
- {
- isChecked = value;
- ApplyPropertyChange("IsChecked");
- }
- }
- }
-
- ///
- /// Creates a new instance of this class.
- ///
- public CommonFileDialogCheckBox()
- {
- }
-
- ///
- /// Creates a new instance of this class with the specified text.
- ///
- /// The text to display for this control.
- public CommonFileDialogCheckBox(string text)
- : base(text)
- {
- }
-
- ///
- /// Creates a new instance of this class with the specified name and text.
- ///
- /// The name of this control.
- /// The text to display for this control.
- public CommonFileDialogCheckBox(string name, string text)
- : base(name, text)
- {
- }
-
- ///
- /// Creates a new instance of this class with the specified text and check state.
- ///
- /// The text to display for this control.
- /// The check state of this control.
- public CommonFileDialogCheckBox(string text, bool isChecked)
- : base(text)
- {
- this.isChecked = isChecked;
- }
-
- ///
- /// Creates a new instance of this class with the specified name, text and check state.
- ///
- /// The name of this control.
- /// The text to display for this control.
- /// The check state of this control.
- public CommonFileDialogCheckBox(string name, string text, bool isChecked)
- : base(name, text)
- {
- this.isChecked = isChecked;
- }
-
- ///
- /// Occurs when the user changes the check state.
- ///
- public event EventHandler CheckedChanged = delegate { };
- internal void RaiseCheckedChangedEvent()
- {
- // Make sure that this control is enabled and has a specified delegate
- if (Enabled)
- this.CheckedChanged(this, EventArgs.Empty);
- }
-
- ///
- /// Attach the CheckButton control to the dialog object.
- ///
- /// the target dialog
- internal override void Attach(IFileDialogCustomize dialog)
- {
- Debug.Assert(dialog != null, "CommonFileDialogCheckBox.Attach: dialog parameter can not be null");
-
- // Add a check button control
- dialog.AddCheckButton(this.Id, this.Text, this.isChecked);
-
- // Make this control prominent if needed
- if (IsProminent)
- dialog.MakeProminent(this.Id);
-
- // Make sure this property is set
- ApplyPropertyChange("IsChecked");
-
- // Sync unmanaged properties with managed properties
- SyncUnmanagedProperties();
- }
- }
-}
\ No newline at end of file
diff --git a/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialogComboBox.cs b/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialogComboBox.cs
deleted file mode 100644
index 56d235c..0000000
--- a/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialogComboBox.cs
+++ /dev/null
@@ -1,170 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Collections.ObjectModel;
-using System.Diagnostics;
-using System.Windows.Markup;
-
-namespace Microsoft.WindowsAPICodePack.Dialogs.Controls
-{
- ///
- /// Creates the ComboBox controls in the Common File Dialog.
- ///
- [ContentProperty("Items")]
- public class CommonFileDialogComboBox : CommonFileDialogProminentControl, ICommonFileDialogIndexedControls
- {
- private readonly Collection items = new Collection();
- ///
- /// Gets the collection of CommonFileDialogComboBoxItem objects.
- ///
- public Collection Items
- {
- get { return items; }
- }
-
- ///
- /// Creates a new instance of this class.
- ///
- public CommonFileDialogComboBox()
- {
- }
-
- ///
- /// Creates a new instance of this class with the specified name.
- ///
- /// Text to display for this control
- public CommonFileDialogComboBox(string name): base (name, String.Empty)
- {
- }
-
- #region ICommonFileDialogIndexedControls Members
-
- private int selectedIndex = -1;
- ///
- /// Gets or sets the current index of the selected item.
- ///
- public int SelectedIndex
- {
- get { return selectedIndex; }
- set
- {
- // Don't update property if it hasn't changed
- if (selectedIndex == value)
- return;
-
- if (HostingDialog == null)
- {
- selectedIndex = value;
- return;
- }
-
- // Only update this property if it has a valid value
- if (value >= 0 && value < items.Count)
- {
- selectedIndex = value;
- ApplyPropertyChange("SelectedIndex");
- }
- else
- {
- throw new IndexOutOfRangeException("Index was outside the bounds of the CommonFileDialogComboBox.");
- }
- }
- }
-
- ///
- /// Occurs when the SelectedIndex is changed.
- ///
- ///
- ///
- /// By initializing the SelectedIndexChanged event with an empty
- /// delegate, it is not necessary to check
- /// if the SelectedIndexChanged is not null.
- ///
- ///
- public event EventHandler SelectedIndexChanged = delegate { };
-
- ///
- /// Raises the SelectedIndexChanged event if this control is
- /// enabled.
- ///
- /// Because this method is defined in an interface, we can either
- /// have it as public, or make it private and explicitly implement (like below).
- /// Making it public doesn't really help as its only internal (but can't have this
- /// internal because of the interface)
- ///
- void ICommonFileDialogIndexedControls.RaiseSelectedIndexChangedEvent()
- {
- // Make sure that this control is enabled and has a specified delegate
- if (Enabled)
- SelectedIndexChanged(this, EventArgs.Empty);
- }
-
- #endregion
-
- ///
- /// Attach the ComboBox control to the dialog object
- ///
- /// The target dialog
- internal override void Attach(IFileDialogCustomize dialog)
- {
- Debug.Assert(dialog != null, "CommonFileDialogComboBox.Attach: dialog parameter can not be null");
-
- // Add the combo box control
- dialog.AddComboBox(this.Id);
-
- // Add the combo box items
- for (int index = 0; index < items.Count; index++)
- dialog.AddControlItem(this.Id, index, items[index].Text);
-
- // Set the currently selected item
- if (selectedIndex >= 0 && selectedIndex < items.Count)
- {
- dialog.SetSelectedControlItem(this.Id, this.selectedIndex);
- }
- else if (selectedIndex != -1)
- {
- throw new IndexOutOfRangeException("Index was outside the bounds of the CommonFileDialogComboBox.");
- }
-
- // Make this control prominent if needed
- if (IsProminent)
- dialog.MakeProminent(this.Id);
-
- // Sync additional properties
- SyncUnmanagedProperties();
- }
-
- }
-
- ///
- /// Creates a ComboBoxItem for the Common File Dialog.
- ///
- public class CommonFileDialogComboBoxItem
- {
- private string text = String.Empty;
- ///
- /// Gets or sets the string that is displayed for this item.
- ///
- public string Text
- {
- get { return text; }
- set { text = value; }
- }
-
- ///
- /// Creates a new instance of this class.
- ///
- public CommonFileDialogComboBoxItem()
- {
- }
-
- ///
- /// Creates a new instance of this class with the specified text.
- ///
- /// The text to use for the combo box item.
- public CommonFileDialogComboBoxItem(string text)
- {
- this.text = text;
- }
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialogControl.cs b/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialogControl.cs
deleted file mode 100644
index c1007a9..0000000
--- a/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialogControl.cs
+++ /dev/null
@@ -1,121 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using Microsoft.WindowsAPICodePack.Dialogs;
-
-namespace Microsoft.WindowsAPICodePack.Dialogs.Controls
-{
- ///
- /// Defines an abstract class that supports shared functionality for the
- /// common file dialog controls.
- ///
- public abstract class CommonFileDialogControl : DialogControl
- {
- ///
- /// Holds the text that is displayed for this control.
- ///
- private string textValue;
-
- ///
- /// Gets or sets the text string that is displayed on the control.
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1307:SpecifyStringComparison", MessageId = "System.String.Compare(System.String,System.String)", Justification = "We are not currently handling globalization or localization")]
- public virtual string Text
- {
- get { return textValue; }
- set
- {
- // Don't update this property if it hasn't changed
- if (string.Compare(value, textValue) == 0)
- return;
-
- textValue = value;
- ApplyPropertyChange("Text");
- }
- }
-
- private bool enabled = true;
- ///
- /// Gets or sets a value that determines if this control is enabled.
- ///
- public bool Enabled
- {
- get { return enabled; }
- set
- {
- // Don't update this property if it hasn't changed
- if (value == enabled)
- return;
-
- enabled = value;
- ApplyPropertyChange("Enabled");
- }
- }
-
- private bool visible = true;
- ///
- /// Gets or sets a boolean value that indicates whether
- /// this control is visible.
- ///
- public bool Visible
- {
- get { return visible; }
- set
- {
- // Don't update this property if it hasn't changed
- if (value == visible)
- return;
-
- visible = value;
- ApplyPropertyChange("Visible");
- }
- }
-
- private bool isAdded = false;
- ///
- /// Has this control been added to the dialog
- ///
- internal bool IsAdded
- {
- get { return isAdded; }
- set { isAdded = value; }
- }
-
- ///
- /// Creates a new instance of this class.
- ///
- protected CommonFileDialogControl() : base()
- {
- }
-
- ///
- /// Creates a new instance of this class with the text.
- ///
- /// The text of the common file dialog control.
- protected CommonFileDialogControl(string text) : base()
- {
- this.textValue = text;
- }
-
- ///
- /// Creates a new instance of this class with the specified name and text.
- ///
- /// The name of the common file dialog control.
- /// The text of the common file dialog control.
- protected CommonFileDialogControl(string name, string text) : base(name)
- {
- this.textValue = text;
- }
-
- ///
- /// Attach the custom control itself to the specified dialog
- ///
- /// the target dialog
- internal abstract void Attach(IFileDialogCustomize dialog);
-
- internal virtual void SyncUnmanagedProperties()
- {
- ApplyPropertyChange("Enabled");
- ApplyPropertyChange("Visible");
- }
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialogControlCollection.cs b/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialogControlCollection.cs
deleted file mode 100644
index 77d84ec..0000000
--- a/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialogControlCollection.cs
+++ /dev/null
@@ -1,186 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-
-namespace Microsoft.WindowsAPICodePack.Dialogs.Controls
-{
- ///
- /// Provides a strongly typed collection for dialog controls.
- ///
- /// DialogControl
- public sealed class CommonFileDialogControlCollection : Collection where T : DialogControl
- {
- private IDialogControlHost hostingDialog;
-
- internal CommonFileDialogControlCollection(IDialogControlHost host)
- {
- hostingDialog = host;
- }
-
- ///
- /// Inserts an dialog control at the specified index.
- ///
- /// The location to insert the control.
- /// The item to insert.
- /// A control with
- /// the same name already exists in this collection -or-
- /// the control is being hosted by another dialog -or- the associated dialog is
- /// showing and cannot be modified.
- protected override void InsertItem(int index, T control)
- {
- // Check for duplicates, lack of host,
- // and during-show adds.
- if (Items.Contains(control))
- throw new InvalidOperationException(
- "Dialog cannot have more than one control with the same name.");
- if (control.HostingDialog != null)
- throw new InvalidOperationException(
- "Dialog control must be removed from current collections first.");
- if (!hostingDialog.IsCollectionChangeAllowed())
- throw new InvalidOperationException(
- "Modifying controls collection while dialog is showing is not supported.");
- if (control is CommonFileDialogMenuItem)
- throw new InvalidOperationException(
- "CommonFileDialogMenuItem controls can only be added to CommonFileDialogMenu controls.");
-
- // Reparent, add control.
- control.HostingDialog = hostingDialog;
- base.InsertItem(index, control);
-
- // Notify that we've added a control.
- hostingDialog.ApplyCollectionChanged();
- }
-
- ///
- /// Removes the control at the specified index.
- ///
- /// The location of the control to remove.
- ///
- /// The associated dialog is
- /// showing and cannot be modified.
- protected override void RemoveItem(int index)
- {
- throw new NotSupportedException("Custom controls cannot be removed from a File dialog once added.");
- }
-
- ///
- /// Defines the indexer that supports accessing controls by name.
- ///
- ///
- /// Control names are case sensitive.
- /// This indexer is useful when the dialog is created in XAML
- /// rather than constructed in code.
- ///
- /// The name cannot be null or a zero-length string.
- /// If there is more than one control with the same name, only the first control will be returned.
- public T this[string name]
- {
- get
- {
- if (String.IsNullOrEmpty(name))
- throw new ArgumentException(
- "Control name must not be null or zero length.");
-
- foreach (T control in base.Items)
- {
- // NOTE: we don't ToLower() the strings - casing effects
- // hash codes, so we are case-sensitive.
- if (control.Name == name)
- return control;
- else if (control is CommonFileDialogGroupBox)
- {
- foreach (T subControl in (control as CommonFileDialogGroupBox).Items)
- {
- if (subControl.Name == name)
- return subControl;
- }
- }
- }
- return null;
- }
- }
-
- ///
- /// Recursively searches for the control who's id matches the value
- /// passed in the parameter.
- ///
- ///
- /// An integer containing the identifier of the
- /// control being searched for.
- ///
- /// A DialogControl who's id matches the value of the
- /// parameter.
- ///
- internal DialogControl GetControlbyId(int id)
- {
- return GetSubControlbyId(
- Items as IEnumerable,
- id);
- }
-
-
- ///
- /// Recursively searches for a given control id in the
- /// collection passed via the parameter.
- ///
- ///
- /// A Collection<CommonFileDialogControl>
- /// An int containing the identifier of the control
- /// being searched for.
- ///
- /// A DialogControl who's Id matches the value of the
- /// parameter.
- ///
- internal DialogControl GetSubControlbyId(IEnumerable ctrlColl,
- int id)
- {
- DialogControl foundControl = null;
- int iSubCtrlCount = 0;
-
- // if ctrlColl is null, it will throw in the foreach.
- if (ctrlColl == null)
- return null;
-
- foreach (DialogControl control in ctrlColl)
- {
- // Match?
- if (control.Id == id)
- {
- return control;
- }
-
- // Search GroupBox child items
- if (control is CommonFileDialogGroupBox)
- {
- CommonFileDialogGroupBox groupBox = control as CommonFileDialogGroupBox;
-
- // recurse and search the GroupBox
- iSubCtrlCount =
- ((CommonFileDialogGroupBox)control).Items.Count;
-
- if (iSubCtrlCount > 0)
- {
- foundControl = this.GetSubControlbyId(
- groupBox.Items as IEnumerable,
- id);
-
- // make sure something was actually found
- if (foundControl != null)
- {
- return foundControl;
- }
- }
- }
- }
-
- // Control id not found - likely an error, but the calling
- // function should ultimately decide.
- return null;
-
- }
-
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialogFilter.cs b/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialogFilter.cs
deleted file mode 100644
index 2961a72..0000000
--- a/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialogFilter.cs
+++ /dev/null
@@ -1,163 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Collections.ObjectModel;
-using System.Text;
-using Microsoft.WindowsAPICodePack.Shell;
-
-namespace Microsoft.WindowsAPICodePack.Dialogs
-{
- ///
- /// Stores the file extensions used when filtering files in File Open and File Save dialogs.
- ///
- public class CommonFileDialogFilter
- {
- // We'll keep a parsed list of separate
- // extensions and rebuild as needed.
-
- private Collection extensions;
- private string rawDisplayName;
-
- ///
- /// Creates a new instance of this class.
- ///
- public CommonFileDialogFilter()
- {
- extensions = new Collection();
- }
- ///
- /// Creates a new instance of this class with the specified display name and
- /// file extension list.
- ///
- /// The name of this filter.
- /// The list of extensions in
- /// this filter. See remarks.
- /// The can use a semicolon(";")
- /// or comma (",") to separate extensions. Extensions can be prefaced
- /// with a period (".") or with the file wild card specifier "*.".
- ///
- /// The cannot be null or a
- /// zero-length string.
- ///
- public CommonFileDialogFilter(string rawDisplayName, string extensionList)
- : this()
- {
- if (String.IsNullOrEmpty(extensionList))
- throw new ArgumentNullException(
- "extensionList",
- "extensionList must be non-null.");
-
- this.rawDisplayName = rawDisplayName;
-
- // Parse string and create extension strings.
- // Format: "bat,cmd", or "bat;cmd", or "*.bat;*.cmd"
- // Can support leading "." or "*." - these will be stripped.
- string[] rawExtensions = extensionList.Split(',', ';');
- foreach (string extension in rawExtensions)
- extensions.Add(CommonFileDialogFilter.NormalizeExtension(extension));
- }
- ///
- /// Gets or sets the display name for this filter.
- ///
- ///
- /// The value for this property cannot be set to null or a
- /// zero-length string.
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.String.Format(System.String,System.Object,System.Object)", Justification = "We are not currently handling globalization or localization")]
- public string DisplayName
- {
- get
- {
- if (showExtensions)
- return String.Format("{0} ({1})",
- rawDisplayName, CommonFileDialogFilter.GetDisplayExtensionList(extensions));
- else
- return rawDisplayName;
- }
-
- set
- {
- if (String.IsNullOrEmpty(value))
- throw new ArgumentNullException(
- "value",
- "DisplayName must be non-null.");
- rawDisplayName = value;
- }
- }
-
- ///
- /// Gets a collection of the individual extensions
- /// described by this filter.
- ///
- public Collection Extensions
- {
- get { return extensions; }
- }
-
- private bool showExtensions = true;
- ///
- /// Gets or sets a value that controls whether the extensions are displayed.
- ///
- public bool ShowExtensions
- {
- get { return showExtensions; }
- set { showExtensions = value; }
- }
-
- private static string NormalizeExtension(string rawExtension)
- {
- rawExtension = rawExtension.Trim();
- rawExtension = rawExtension.Replace("*.", null);
- rawExtension = rawExtension.Replace(".", null);
- return rawExtension;
- }
-
- private static string GetDisplayExtensionList(Collection extensions)
- {
- StringBuilder extensionList = new StringBuilder();
- foreach (string extension in extensions)
- {
- if (extensionList.Length > 0)
- extensionList.Append(", ");
- extensionList.Append("*.");
- extensionList.Append(extension);
- }
-
- return extensionList.ToString();
- }
-
- ///
- /// Internal helper that generates a single filter
- /// specification for this filter, used by the COM API.
- ///
- /// Filter specification for this filter
- ///
- internal ShellNativeMethods.COMDLG_FILTERSPEC GetFilterSpec()
- {
- StringBuilder filterList = new StringBuilder();
- foreach (string extension in extensions)
- {
- if (filterList.Length > 0)
- filterList.Append(";");
-
- filterList.Append("*.");
- filterList.Append(extension);
-
- }
- return new ShellNativeMethods.COMDLG_FILTERSPEC(DisplayName, filterList.ToString());
- }
-
- ///
- /// Returns a string representation for this filter that includes
- /// the display name and the list of extensions.
- ///
- /// A .
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.String.Format(System.String,System.Object,System.Object)", Justification = "We are not currently handling globalization or localization")]
- public override string ToString()
- {
- return String.Format("{0} ({1})",
- rawDisplayName,
- CommonFileDialogFilter.GetDisplayExtensionList(extensions));
- }
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialogFilterCollection.cs b/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialogFilterCollection.cs
deleted file mode 100644
index df23806..0000000
--- a/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialogFilterCollection.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System.Collections.ObjectModel;
-using Microsoft.WindowsAPICodePack.Shell;
-
-namespace Microsoft.WindowsAPICodePack.Dialogs
-{
- ///
- /// Provides a strongly typed collection for file dialog filters.
- ///
- public class CommonFileDialogFilterCollection : Collection
- {
- internal CommonFileDialogFilterCollection()
- : base()
- {
- // Make the default constructor internal so users can't instantiate this
- // collection by themselves.
- }
-
- internal ShellNativeMethods.COMDLG_FILTERSPEC[] GetAllFilterSpecs()
- {
- ShellNativeMethods.COMDLG_FILTERSPEC[] filterSpecs =
- new ShellNativeMethods.COMDLG_FILTERSPEC[this.Count];
-
- for (int i = 0; i < this.Count; i++)
- filterSpecs[i] = this[i].GetFilterSpec();
-
- return filterSpecs;
- }
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialogFolderChangeEventArgs.cs b/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialogFolderChangeEventArgs.cs
deleted file mode 100644
index 3314208..0000000
--- a/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialogFolderChangeEventArgs.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System.ComponentModel;
-
-namespace Microsoft.WindowsAPICodePack.Dialogs
-{
- ///
- /// Creates the event data associated with event.
- ///
- ///
- public class CommonFileDialogFolderChangeEventArgs : CancelEventArgs
- {
- ///
- /// Creates a new instance of this class.
- ///
- /// The name of the folder.
- public CommonFileDialogFolderChangeEventArgs(string folder)
- {
- this.folder = folder;
- }
-
- private string folder;
- ///
- /// Gets or sets the name of the folder.
- ///
- public string Folder
- {
- get { return folder; }
- set { folder = value; }
- }
-
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialogGroupBox.cs b/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialogGroupBox.cs
deleted file mode 100644
index d66ec04..0000000
--- a/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialogGroupBox.cs
+++ /dev/null
@@ -1,93 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Collections.ObjectModel;
-using System.Diagnostics;
-using System.Windows.Markup;
-
-namespace Microsoft.WindowsAPICodePack.Dialogs.Controls
-{
- ///
- /// Represents a group box control for the Common File Dialog.
- /// note
- [ContentProperty("Items")]
- public class CommonFileDialogGroupBox : CommonFileDialogProminentControl
- {
- private Collection items;
- ///
- /// Gets the collection of controls for this group box.
- ///
- public Collection Items
- {
- get { return items; }
- }
-
- ///
- /// Creates a new instance of this class.
- ///
- public CommonFileDialogGroupBox()
- : base(String.Empty)
- {
- Initialize();
- }
-
- ///
- /// Create a new instance of this class with the specified text.
- ///
- /// The text to display for this control.
- public CommonFileDialogGroupBox(string text)
- : base(text)
- {
- Initialize();
- }
-
- ///
- /// Creates a new instance of this class with the specified name and text.
- ///
- /// The name of this control.
- /// The text to display for this control.
- public CommonFileDialogGroupBox(string name, string text)
- : base(name, text)
- {
- Initialize();
- }
-
- ///
- /// Initializes the item collection for this class.
- ///
- private void Initialize()
- {
- items = new Collection();
- }
-
- ///
- /// Attach the GroupBox control to the dialog object
- ///
- /// Target dialog
- internal override void Attach(IFileDialogCustomize dialog)
- {
- Debug.Assert(dialog != null, "CommonFileDialogGroupBox.Attach: dialog parameter can not be null");
-
- // Start a visual group
- dialog.StartVisualGroup(this.Id, this.Text);
-
- // Add child controls
- foreach (CommonFileDialogControl item in this.items)
- {
- item.HostingDialog = HostingDialog;
- item.Attach(dialog);
- }
-
- // End visual group
- dialog.EndVisualGroup();
-
- // Make this control prominent if needed
- if (IsProminent)
- dialog.MakeProminent(this.Id);
-
- // Sync unmanaged properties with managed properties
- SyncUnmanagedProperties();
- }
-
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialogLabel.cs b/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialogLabel.cs
deleted file mode 100644
index 15889e3..0000000
--- a/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialogLabel.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System.Diagnostics;
-
-namespace Microsoft.WindowsAPICodePack.Dialogs.Controls
-{
- ///
- /// Defines the label controls in the Common File Dialog.
- ///
- public class CommonFileDialogLabel : CommonFileDialogControl
- {
- ///
- /// Creates a new instance of this class.
- ///
- public CommonFileDialogLabel()
- {
- }
-
- ///
- /// Creates a new instance of this class with the specified text.
- ///
- /// The text to display for this control.
- public CommonFileDialogLabel(string text)
- : base(text)
- {
- }
-
- ///
- /// Creates a new instance of this class with the specified name and text.
- ///
- /// The name of this control.
- /// The text to display for this control.
- public CommonFileDialogLabel(string name, string text)
- : base(name, text)
- {
- }
-
- ///
- /// Attach this control to the dialog object
- ///
- /// Target dialog
- internal override void Attach(IFileDialogCustomize dialog)
- {
- Debug.Assert(dialog != null, "CommonFileDialog.Attach: dialog parameter can not be null");
-
- // Add a text control
- dialog.AddText(this.Id, this.Text);
-
- // Sync unmanaged properties with managed properties
- SyncUnmanagedProperties();
- }
- }
-}
\ No newline at end of file
diff --git a/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialogMenu.cs b/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialogMenu.cs
deleted file mode 100644
index 2adfc40..0000000
--- a/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialogMenu.cs
+++ /dev/null
@@ -1,129 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Collections.ObjectModel;
-using System.Diagnostics;
-using System.Windows.Markup;
-
-namespace Microsoft.WindowsAPICodePack.Dialogs.Controls
-{
- ///
- /// Defines the menu controls for the Common File Dialog.
- ///
- [ContentProperty("Items")]
- public class CommonFileDialogMenu : CommonFileDialogProminentControl
- {
- private Collection items;
- ///
- /// Gets the collection of CommonFileDialogMenuItem objects.
- ///
- public Collection Items
- {
- get { return items; }
- }
-
- ///
- /// Creates a new instance of this class.
- ///
- public CommonFileDialogMenu()
- : base()
- {
- Initialize();
- }
-
- ///
- /// Creates a new instance of this class with the specified text.
- ///
- /// The text to display for this control.
- public CommonFileDialogMenu(string text)
- : base(text)
- {
- Initialize();
- }
-
- ///
- /// Creates a new instance of this class with the specified name and text.
- ///
- /// The name of this control.
- /// The text to display for this control.
- public CommonFileDialogMenu(string name, string text)
- : base(name, text)
- {
- Initialize();
- }
-
- ///
- /// Initializes the item collection for this class.
- ///
- private void Initialize()
- {
- items = new Collection();
- }
-
- ///
- /// Attach the Menu control to the dialog object.
- ///
- /// the target dialog
- internal override void Attach(IFileDialogCustomize dialog)
- {
- Debug.Assert(dialog != null, "CommonFileDialogMenu.Attach: dialog parameter can not be null");
-
- // Add the menu control
- dialog.AddMenu(this.Id, this.Text);
-
- // Add the menu items
- foreach (CommonFileDialogMenuItem item in this.items)
- dialog.AddControlItem(this.Id, item.Id, item.Text);
-
- // Make prominent as needed
- if (IsProminent)
- dialog.MakeProminent(this.Id);
-
- // Sync unmanaged properties with managed properties
- SyncUnmanagedProperties();
- }
- }
-
- ///
- /// Creates the CommonFileDialogMenuItem items for the Common File Dialog.
- ///
- public class CommonFileDialogMenuItem : CommonFileDialogControl
- {
- ///
- /// Creates a new instance of this class.
- ///
- public CommonFileDialogMenuItem()
- : base(String.Empty)
- {
- }
-
- ///
- /// Creates a new instance of this class with the specified text.
- ///
- /// The text to display for this control.
- public CommonFileDialogMenuItem(string text)
- : base(text)
- {
- }
-
- ///
- /// Occurs when a user clicks a menu item.
- ///
- public event EventHandler Click = delegate { };
- internal void RaiseClickEvent()
- {
- // Make sure that this control is enabled and has a specified delegate
- if (Enabled)
- Click(this, EventArgs.Empty);
- }
-
- ///
- /// Attach this control to the dialog object
- ///
- /// Target dialog
- internal override void Attach(IFileDialogCustomize dialog)
- {
- // Items are added via the menu itself
- }
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialogProminentControl.cs b/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialogProminentControl.cs
deleted file mode 100644
index f2b595a..0000000
--- a/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialogProminentControl.cs
+++ /dev/null
@@ -1,56 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System.Windows.Markup;
-
-namespace Microsoft.WindowsAPICodePack.Dialogs.Controls
-{
- ///
- /// Defines the properties and constructors for all prominent controls in the Common File Dialog.
- ///
- [ContentProperty("Items")]
- public abstract class CommonFileDialogProminentControl : CommonFileDialogControl
- {
- private bool isProminent;
-
- ///
- /// Gets or sets the prominent value of this control.
- ///
- /// Only one control can be specified as prominent. If more than one control is specified prominent,
- /// then an 'E_UNEXPECTED' exception will be thrown when these controls are added to the dialog.
- /// A group box control can only be specified as prominent if it contains one control and that control is of type 'CommonFileDialogProminentControl'.
- ///
- public bool IsProminent
- {
- get { return isProminent; }
- set { isProminent = value; }
- }
-
-
- ///
- /// Creates a new instance of this class.
- ///
- protected CommonFileDialogProminentControl()
- : base()
- {
- }
-
- ///
- /// Creates a new instance of this class with the specified text.
- ///
- /// The text to display for this control.
- protected CommonFileDialogProminentControl(string text)
- : base(text)
- {
- }
-
- ///
- /// Creates a new instance of this class with the specified name and text.
- ///
- /// The name of this control.
- /// The text to display for this control.
- protected CommonFileDialogProminentControl(string name, string text)
- : base(name, text)
- {
- }
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialogRadioButtonList.cs b/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialogRadioButtonList.cs
deleted file mode 100644
index 125728e..0000000
--- a/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialogRadioButtonList.cs
+++ /dev/null
@@ -1,177 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Collections.ObjectModel;
-using System.Diagnostics;
-using System.Windows.Markup;
-
-namespace Microsoft.WindowsAPICodePack.Dialogs.Controls
-{
- ///
- /// Represents a radio button list for the Common File Dialog.
- ///
- [ContentProperty("Items")]
- public class CommonFileDialogRadioButtonList : CommonFileDialogControl, ICommonFileDialogIndexedControls
- {
- private Collection items;
- ///
- /// Gets the collection of CommonFileDialogRadioButtonListItem objects
- ///
- public Collection Items
- {
- get { return items; }
- }
-
- ///
- /// Creates a new instance of this class.
- ///
- public CommonFileDialogRadioButtonList()
- {
- Initialize();
- }
-
- ///
- /// Creates a new instance of this class with the specified name.
- ///
- /// The name of this control.
- public CommonFileDialogRadioButtonList(string name): base (name, String.Empty)
- {
- Initialize();
- }
-
- ///
- /// Initializes the item collection for this class.
- ///
- private void Initialize()
- {
- items = new Collection();
- }
-
- #region ICommonFileDialogIndexedControls Members
-
- private int selectedIndex = -1;
- ///
- /// Gets or sets the current index of the selected item.
- ///
- public int SelectedIndex
- {
- get { return selectedIndex; }
- set
- {
- // Don't update this property if it hasn't changed
- if (selectedIndex == value)
- return;
-
- // If the native dialog has not been created yet
- if (HostingDialog == null)
- {
- selectedIndex = value;
- return;
- }
-
- // Check for valid index
- if (value >= 0 && value < items.Count)
- {
- selectedIndex = value;
- ApplyPropertyChange("SelectedIndex");
- }
- else
- {
- throw new IndexOutOfRangeException("Index was outside the bounds of the CommonFileDialogRadioButtonList.");
- }
- }
- }
-
- ///
- /// Occurs when the user changes the SelectedIndex.
- ///
- ///
- ///
- /// By initializing the SelectedIndexChanged event with an empty
- /// delegate, we can skip the test to determine
- /// if the SelectedIndexChanged is null.
- /// test.
- ///
- public event EventHandler SelectedIndexChanged = delegate { };
-
- ///
- /// Occurs when the user changes the SelectedIndex.
- ///
- /// Because this method is defined in an interface, we can either
- /// have it as public, or make it private and explicitly implement (like below).
- /// Making it public doesn't really help as its only internal (but can't have this
- /// internal because of the interface)
- ///
- void ICommonFileDialogIndexedControls.RaiseSelectedIndexChangedEvent()
- {
- // Make sure that this control is enabled and has a specified delegate
- if (Enabled)
- SelectedIndexChanged(this, EventArgs.Empty);
- }
-
- #endregion
-
- ///
- /// Attach the RadioButtonList control to the dialog object
- ///
- /// The target dialog
- internal override void Attach(IFileDialogCustomize dialog)
- {
- Debug.Assert(dialog != null, "CommonFileDialogRadioButtonList.Attach: dialog parameter can not be null");
-
- // Add the radio button list control
- dialog.AddRadioButtonList(this.Id);
-
- // Add the radio button list items
- for (int index = 0; index < items.Count; index++)
- dialog.AddControlItem(this.Id, index, items[index].Text);
-
- // Set the currently selected item
- if (selectedIndex >= 0 && selectedIndex < items.Count)
- {
- dialog.SetSelectedControlItem(this.Id, this.selectedIndex);
- }
- else if (selectedIndex != -1)
- {
- throw new IndexOutOfRangeException("Index was outside the bounds of the CommonFileDialogRadioButtonList.");
- }
-
-
- // Sync unmanaged properties with managed properties
- SyncUnmanagedProperties();
- }
- }
-
- ///
- /// Represents a list item for the CommonFileDialogRadioButtonList object.
- ///
- public class CommonFileDialogRadioButtonListItem
- {
- private string text;
- ///
- /// Gets or sets the string that will be displayed for this list item.
- ///
- public string Text
- {
- get { return text; }
- set { text = value; }
- }
-
- ///
- /// Creates a new instance of this class.
- ///
- public CommonFileDialogRadioButtonListItem()
- {
- this.text = String.Empty;
- }
-
- ///
- /// Creates a new instance of this class with the specified text.
- ///
- /// The string that you want to display for this list item.
- public CommonFileDialogRadioButtonListItem(string text)
- {
- this.text = text;
- }
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialogResult.cs b/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialogResult.cs
deleted file mode 100644
index cb94035..0000000
--- a/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialogResult.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-namespace Microsoft.WindowsAPICodePack.Dialogs
-{
- ///
- /// Specifies identifiers to indicate the return value of a CommonFileDialog dialog.
- ///
- public enum CommonFileDialogResult
- {
- ///
- /// The dialog box return value is OK (usually sent from a button labeled OK or Save).
- ///
- OK = 1,
-
- ///
- /// The dialog box return value is Cancel (usually sent from a button labeled Cancel).
- ///
- Cancel = 2,
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialogSeperator.cs b/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialogSeperator.cs
deleted file mode 100644
index c2d1d11..0000000
--- a/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialogSeperator.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System.Diagnostics;
-
-namespace Microsoft.WindowsAPICodePack.Dialogs.Controls
-{
- ///
- /// Defines the class for the simplest separator controls.
- ///
- public class CommonFileDialogSeparator : CommonFileDialogControl
- {
- ///
- /// Attach the Separator control to the dialog object
- ///
- /// Target dialog
- internal override void Attach(IFileDialogCustomize dialog)
- {
- Debug.Assert(dialog != null, "CommonFileDialogSeparator.Attach: dialog parameter can not be null");
-
- // Add a separator
- dialog.AddSeparator(this.Id);
-
- // Sync unmanaged properties with managed properties
- SyncUnmanagedProperties();
- }
- }
-}
\ No newline at end of file
diff --git a/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialogStandardFilters.cs b/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialogStandardFilters.cs
deleted file mode 100644
index eccb1b8..0000000
--- a/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialogStandardFilters.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-namespace Microsoft.WindowsAPICodePack.Dialogs
-{
- ///
- /// Defines the class of commonly used file filters.
- ///
- public static class CommonFileDialogStandardFilters
- {
- private static CommonFileDialogFilter textFilesFilter;
- ///
- /// Gets a value that specifies the filter for *.txt files.
- ///
- public static CommonFileDialogFilter TextFiles
- {
- get
- {
- if (textFilesFilter == null)
- textFilesFilter = new CommonFileDialogFilter("Text Files", "*.txt");
- return textFilesFilter;
- }
- }
-
- private static CommonFileDialogFilter pictureFilesFilter;
- ///
- /// Gets a value that specifies the filter for picture files.
- ///
- public static CommonFileDialogFilter PictureFiles
- {
- get
- {
- if (pictureFilesFilter == null)
- pictureFilesFilter = new CommonFileDialogFilter("All Picture Files",
- "*.bmp, *.jpg, *.jpeg, *.png, *.ico");
- return pictureFilesFilter;
- }
-
- }
- private static CommonFileDialogFilter officeFilesFilter;
- ///
- /// Gets a value that specifies the filter for Microsoft Office files.
- ///
- public static CommonFileDialogFilter OfficeFiles
- {
- get
- {
- if (officeFilesFilter == null)
- officeFilesFilter = new CommonFileDialogFilter("Office Files",
- "*.doc, *.docx, *.xls, *.xlsx, *.ppt, *.pptx");
- return officeFilesFilter;
- }
- }
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialogTextBox.cs b/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialogTextBox.cs
deleted file mode 100644
index 78d6785..0000000
--- a/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialogTextBox.cs
+++ /dev/null
@@ -1,113 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Diagnostics;
-
-namespace Microsoft.WindowsAPICodePack.Dialogs.Controls
-{
- ///
- /// Defines the text box controls in the Common File Dialog.
- ///
- public class CommonFileDialogTextBox : CommonFileDialogControl
- {
- ///
- /// Creates a new instance of this class.
- ///
- public CommonFileDialogTextBox()
- : base(String.Empty)
- {
- }
-
- ///
- /// Creates a new instance of this class with the specified text.
- ///
- /// The text to display for this control.
- public CommonFileDialogTextBox(string text)
- : base(text)
- {
- }
-
- ///
- /// Creates a new instance of this class with the specified name and text.
- ///
- /// The name of this control.
- /// The text to display for this control.
- public CommonFileDialogTextBox(string name, string text)
- : base(name, text)
- {
- }
-
- internal bool Closed
- {
- set;
- get;
- }
- ///
- /// Gets or sets a value for the text string contained in the CommonFileDialogTextBox.
- ///
- public override string Text
- {
- get
- {
- if (!Closed)
- {
- SyncValue();
- }
-
- return base.Text;
- }
-
- set
- {
- if (customizedDialog != null)
- {
- customizedDialog.SetEditBoxText( this.Id, value );
- }
-
- base.Text = value;
- }
- }
-
- ///
- /// Holds an instance of the customized (/native) dialog and should
- /// be null until after the Attach() call is made.
- ///
- private IFileDialogCustomize customizedDialog = null;
-
- ///
- /// Attach the TextBox control to the dialog object
- ///
- /// Target dialog
- internal override void Attach(IFileDialogCustomize dialog)
- {
- Debug.Assert(dialog != null, "CommonFileDialogTextBox.Attach: dialog parameter can not be null");
-
- // Add a text entry control
- dialog.AddEditBox(this.Id, this.Text);
-
- // Set to local instance in order to gate access to same.
- customizedDialog = dialog;
-
- // Sync unmanaged properties with managed properties
- SyncUnmanagedProperties();
-
- Closed = false;
- }
-
- internal void SyncValue()
- {
- // Make sure that the local native dialog instance is NOT
- // null. If it's null, just return the "textValue" var,
- // otherwise, use the native call to get the text value,
- // setting the textValue member variable then return it.
-
- if (customizedDialog != null)
- {
- string textValue;
- customizedDialog.GetEditBoxText(this.Id, out textValue);
-
- base.Text = textValue;
- }
- }
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonOpenFileDialog.cs b/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonOpenFileDialog.cs
deleted file mode 100644
index 9924f56..0000000
--- a/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonOpenFileDialog.cs
+++ /dev/null
@@ -1,175 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System.Collections;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Diagnostics;
-using System.Runtime.InteropServices;
-using System.Security.Permissions;
-using Microsoft.WindowsAPICodePack.Shell;
-
-namespace Microsoft.WindowsAPICodePack.Dialogs
-{
- ///
- /// Creates a Vista or Windows 7 Common File Dialog, allowing the user to select one or more files.
- ///
- ///
- [FileDialogPermissionAttribute(SecurityAction.LinkDemand, Open = true)]
- public sealed class CommonOpenFileDialog : CommonFileDialog
- {
- private NativeFileOpenDialog openDialogCoClass;
-
- ///
- /// Creates a new instance of this class.
- ///
- public CommonOpenFileDialog() : base()
- {
- // For Open file dialog, allow read only files.
- base.EnsureReadOnly = true;
- }
-
- ///
- /// Creates a new instance of this class with the specified name.
- ///
- /// The name of this dialog.
- public CommonOpenFileDialog(string name) : base(name)
- {
- // For Open file dialog, allow read only files.
- base.EnsureReadOnly = true;
- }
-
- #region Public API specific to Open
-
- ///
- /// Gets a collection of the selected file names.
- ///
- /// This property should only be used when the
- ///
- /// property is true.
- public Collection FileNames
- {
- get
- {
- CheckFileNamesAvailable();
- return fileNames;
- }
- }
-
- ///
- /// Gets a collection of the selected items as ShellObject objects.
- ///
- /// This property should only be used when the
- ///
- /// property is true.
- public ICollection FilesAsShellObject
- {
- get
- {
- // Check if we have selected files from the user.
- CheckFileItemsAvailable();
-
- // temp collection to hold our shellobjects
- ICollection resultItems = new Collection();
-
- // Loop through our existing list of filenames, and try to create a concrete type of
- // ShellObject (e.g. ShellLibrary, FileSystemFolder, ShellFile, etc)
- foreach (IShellItem si in items)
- resultItems.Add(ShellObjectFactory.Create(si));
-
- return resultItems;
- }
- }
-
-
- private bool multiselect;
- ///
- /// Gets or sets a value that determines whether the user can select more than one file.
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Multiselect", Justification="This is following the same convention as the Winforms CFD")]
- public bool Multiselect
- {
- get { return multiselect; }
- set { multiselect = value; }
- }
-
- private bool isFolderPicker;
- ///
- /// Gets or sets a value that determines whether the user can select folders or files.
- /// Default value is false.
- ///
- public bool IsFolderPicker
- {
- get { return isFolderPicker; }
- set { isFolderPicker = value; }
- }
-
- private bool allowNonFileSystem;
- ///
- /// Gets or sets a value that determines whether the user can select non-filesystem items,
- /// such as Library, Search Connectors, or Known Folders.
- ///
- public bool AllowNonFileSystemItems
- {
- get { return allowNonFileSystem; }
- set { allowNonFileSystem = value; }
- }
- #endregion
-
- internal override IFileDialog GetNativeFileDialog()
- {
- Debug.Assert(openDialogCoClass != null,
- "Must call Initialize() before fetching dialog interface");
- return (IFileDialog)openDialogCoClass;
- }
-
- internal override void InitializeNativeFileDialog()
- {
- if (openDialogCoClass == null)
- openDialogCoClass = new NativeFileOpenDialog();
- }
-
- internal override void CleanUpNativeFileDialog()
- {
- if (openDialogCoClass != null)
- Marshal.ReleaseComObject(openDialogCoClass);
- }
-
- internal override void PopulateWithFileNames(Collection names)
- {
- IShellItemArray resultsArray;
- uint count;
-
- openDialogCoClass.GetResults(out resultsArray);
- resultsArray.GetCount(out count);
- names.Clear();
- for (int i = 0; i < count; i++)
- names.Add(GetFileNameFromShellItem(GetShellItemAt(resultsArray, i)));
- }
-
- internal override void PopulateWithIShellItems(Collection items)
- {
- IShellItemArray resultsArray;
- uint count;
-
- openDialogCoClass.GetResults(out resultsArray);
- resultsArray.GetCount(out count);
- items.Clear();
- for (int i = 0; i < count; i++)
- items.Add(GetShellItemAt(resultsArray, i));
- }
-
- internal override ShellNativeMethods.FOS GetDerivedOptionFlags(ShellNativeMethods.FOS flags)
- {
- if (multiselect)
- flags |= ShellNativeMethods.FOS.FOS_ALLOWMULTISELECT;
- if (isFolderPicker)
- flags |= ShellNativeMethods.FOS.FOS_PICKFOLDERS;
- if (!allowNonFileSystem)
- flags |= ShellNativeMethods.FOS.FOS_FORCEFILESYSTEM;
- if (allowNonFileSystem)
- flags |= ShellNativeMethods.FOS.FOS_ALLNONSTORAGEITEMS;
-
- return flags;
- }
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonSaveFileDialog.cs b/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonSaveFileDialog.cs
deleted file mode 100644
index f1fd935..0000000
--- a/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/CommonSaveFileDialog.cs
+++ /dev/null
@@ -1,308 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Diagnostics;
-using System.Runtime.InteropServices;
-using System.Security.Permissions;
-using Microsoft.WindowsAPICodePack.Shell;
-using Microsoft.WindowsAPICodePack.Shell.PropertySystem;
-using MS.WindowsAPICodePack.Internal;
-
-namespace Microsoft.WindowsAPICodePack.Dialogs
-{
- ///
- /// Creates a Vista or Windows 7 Common File Dialog, allowing the user to select the filename and location for a saved file.
- ///
- ///
- /// to save a file. Associated enumeration: .
- ///
- [FileDialogPermissionAttribute(SecurityAction.LinkDemand, Save = true)]
- public sealed class CommonSaveFileDialog : CommonFileDialog
- {
- private NativeFileSaveDialog saveDialogCoClass;
-
- ///
- /// Creates a new instance of this class.
- ///
- public CommonSaveFileDialog() : base() { }
- ///
- /// Creates a new instance of this class with the specified name.
- ///
- /// The name of this dialog.
- public CommonSaveFileDialog(string name) : base(name) { }
-
- #region Public API specific to Save
-
- private bool overwritePrompt = true;
- ///
- /// Gets or sets a value that controls whether to prompt before
- /// overwriting an existing file of the same name. Default value is true.
- ///
- ///
- /// This property cannot be changed when the dialog is showing.
- ///
- public bool OverwritePrompt
- {
- get { return overwritePrompt; }
- set
- {
- ThrowIfDialogShowing("OverwritePrompt" + IllegalPropertyChangeString);
- overwritePrompt = value;
- }
- }
-
- private bool createPrompt;
- ///
- /// Gets or sets a value that controls whether to prompt for creation if the item returned in the save dialog does not exist.
- ///
- /// Note that this does not actually create the item.
- ///
- /// This property cannot be changed when the dialog is showing.
- ///
- public bool CreatePrompt
- {
- get { return createPrompt; }
- set
- {
- ThrowIfDialogShowing("CreatePrompt" + IllegalPropertyChangeString);
- createPrompt = value;
- }
- }
-
- private bool isExpandedMode;
- ///
- /// Gets or sets a value that controls whether to the save dialog
- /// displays in expanded mode.
- ///
- /// Expanded mode controls whether the dialog
- /// shows folders for browsing or hides them.
- ///
- /// This property cannot be changed when the dialog is showing.
- ///
- public bool IsExpandedMode
- {
- get { return isExpandedMode; }
- set
- {
- ThrowIfDialogShowing("IsExpandedMode" + IllegalPropertyChangeString);
- isExpandedMode = value;
- }
- }
-
- private bool alwaysAppendDefaultExtension;
- ///
- /// Gets or sets a value that controls whether the
- /// returned file name has a file extension that matches the
- /// currently selected file type. If necessary, the dialog appends the correct
- /// file extension.
- ///
- ///
- /// This property cannot be changed when the dialog is showing.
- ///
- public bool AlwaysAppendDefaultExtension
- {
- get { return alwaysAppendDefaultExtension; }
- set
- {
- ThrowIfDialogShowing("AlwaysAppendDefaultExtension" + IllegalPropertyChangeString);
- alwaysAppendDefaultExtension = value;
- }
- }
-
- ///
- /// Sets an item to appear as the initial entry in a Save As dialog.
- ///
- /// The initial entry to be set in the dialog.
- /// The name of the item is displayed in the file name edit box,
- /// and the containing folder is opened in the view. This would generally be
- /// used when the application is saving an item that already exists.
- public void SetSaveAsItem(ShellObject item)
- {
- IFileSaveDialog nativeDialog = null;
-
- if (nativeDialog == null)
- {
- InitializeNativeFileDialog();
- nativeDialog = GetNativeFileDialog() as IFileSaveDialog;
- }
-
- // Get the native IShellItem from ShellObject
- if (nativeDialog != null)
- nativeDialog.SetSaveAsItem(item.NativeShellItem);
- }
-
- ///
- /// Specifies which properties will be collected in the save dialog.
- ///
- /// True to show default properties for the currently selected
- /// filetype in addition to the properties specified by propertyList. False to show only properties
- /// specified by pList.
- /// List of properties to collect. This parameter can be null.
- ///
- ///
- /// SetCollectedPropertyKeys can be called at any time before the dialog is displayed or while it
- /// is visible. If different properties are to be collected depending on the chosen filetype,
- /// then SetCollectedProperties can be called in response to CommonFileDialog::FileTypeChanged event.
- /// Note: By default, no properties are collected in the save dialog.
- ///
- public void SetCollectedPropertyKeys(bool appendDefault, params PropertyKey[] propertyList)
- {
- string propertyListStr = null;
-
- // Loop through all our property keys and create a semicolon-delimited property list string.
- if (propertyList != null && propertyList.Length > 0 && propertyList[0] != null)
- {
- foreach (PropertyKey key in propertyList)
- {
- string canonicalName = ShellPropertyDescriptionsCache.Cache.GetPropertyDescription(key).CanonicalName;
-
- // The string we pass to PSGetPropertyDescriptionListFromString must
- // start with "prop:", followed a list of canonical names for each
- // property that is to collected.
- //
- // Add "prop:" at the start of the string if we are starting our for loop.
- if (propertyListStr == null)
- propertyListStr = "prop:";
-
- // For each property, append the canonical name, followed by a semicolon
- if (!string.IsNullOrEmpty(canonicalName))
- propertyListStr += canonicalName + ";";
- }
- }
-
- // If the string was created correctly, get IPropertyDescriptionList for it
- if (!string.IsNullOrEmpty(propertyListStr))
- {
- Guid guid = new Guid(ShellIIDGuid.IPropertyDescriptionList);
- IPropertyDescriptionList propertyDescriptionList = null;
-
- try
- {
- int hr = PropertySystemNativeMethods.PSGetPropertyDescriptionListFromString(propertyListStr, ref guid, out propertyDescriptionList);
-
- // If we get a IPropertyDescriptionList, setit on the native dialog.
- if (CoreErrorHelper.Succeeded(hr))
- {
- IFileSaveDialog nativeDialog = null;
-
- if (nativeDialog == null)
- {
- InitializeNativeFileDialog();
- nativeDialog = GetNativeFileDialog() as IFileSaveDialog;
- }
-
- if (nativeDialog != null)
- {
- hr = nativeDialog.SetCollectedProperties(propertyDescriptionList, appendDefault);
-
- if (!CoreErrorHelper.Succeeded(hr))
- Marshal.ThrowExceptionForHR(hr);
- }
- }
- }
- finally
- {
- if (propertyDescriptionList != null)
- Marshal.ReleaseComObject(propertyDescriptionList);
- }
- }
- }
-
- ///
- /// Retrieves the set of property values for a saved item or an item in the process of being saved.
- ///
- /// Collection of property values collected from the save dialog
- /// This property can be called while the dialog is showing to retrieve the current
- /// set of values in the metadata collection pane. It can also be called after the dialog
- /// has closed, to retrieve the final set of values. The call to this method will fail
- /// unless property collection has been turned on with a call to SetCollectedPropertyKeys method.
- ///
- public ShellPropertyCollection CollectedProperties
- {
- get
- {
- IFileSaveDialog nativeDialog = null;
-
- if (nativeDialog == null)
- {
- InitializeNativeFileDialog();
- nativeDialog = GetNativeFileDialog() as IFileSaveDialog;
- }
-
- if (nativeDialog != null)
- {
- IPropertyStore propertyStore;
- HRESULT hr = nativeDialog.GetProperties(out propertyStore);
-
- if (!CoreErrorHelper.Succeeded((int)hr))
- throw Marshal.GetExceptionForHR((int)hr);
-
- if (propertyStore != null)
- return new ShellPropertyCollection(propertyStore);
- }
-
- return null;
- }
- }
-
- #endregion
-
- internal override void InitializeNativeFileDialog()
- {
- if (saveDialogCoClass == null)
- saveDialogCoClass = new NativeFileSaveDialog();
- }
-
- internal override IFileDialog GetNativeFileDialog()
- {
- Debug.Assert(saveDialogCoClass != null,
- "Must call Initialize() before fetching dialog interface");
- return (IFileDialog)saveDialogCoClass;
- }
-
- internal override void PopulateWithFileNames(
- System.Collections.ObjectModel.Collection names)
- {
- IShellItem item;
- saveDialogCoClass.GetResult(out item);
-
- if (item == null)
- throw new InvalidOperationException(
- "Retrieved a null shell item from dialog");
- names.Clear();
- names.Add(GetFileNameFromShellItem(item));
- }
-
- internal override void PopulateWithIShellItems(
- System.Collections.ObjectModel.Collection items)
- {
- IShellItem item;
- saveDialogCoClass.GetResult(out item);
-
- if (item == null)
- throw new InvalidOperationException(
- "Retrieved a null shell item from dialog");
- items.Clear();
- items.Add(item);
- }
-
- internal override void CleanUpNativeFileDialog()
- {
- if (saveDialogCoClass != null)
- Marshal.ReleaseComObject(saveDialogCoClass);
- }
-
- internal override ShellNativeMethods.FOS GetDerivedOptionFlags(ShellNativeMethods.FOS flags)
- {
- if (overwritePrompt)
- flags |= ShellNativeMethods.FOS.FOS_OVERWRITEPROMPT;
- if (createPrompt)
- flags |= ShellNativeMethods.FOS.FOS_CREATEPROMPT;
- if (!isExpandedMode)
- flags |= ShellNativeMethods.FOS.FOS_DEFAULTNOMINIMODE;
- if (alwaysAppendDefaultExtension)
- flags |= ShellNativeMethods.FOS.FOS_STRICTFILETYPES;
- return flags;
- }
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/ICommonFileDialogIndexedControls.cs b/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/ICommonFileDialogIndexedControls.cs
deleted file mode 100644
index 0cd44de..0000000
--- a/src/External/WindowsAPICodePack/Shell/CommonFileDialogs/ICommonFileDialogIndexedControls.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-
-namespace Microsoft.WindowsAPICodePack.Dialogs.Controls
-{
- ///
- /// Specifies a property, event and method that indexed controls need
- /// to implement.
- ///
- ///
- ///
- /// not sure where else to put this, so leaving here for now.
- ///
- interface ICommonFileDialogIndexedControls
- {
- int SelectedIndex
- {
- get;
- set;
- }
-
- event EventHandler SelectedIndexChanged;
-
- void RaiseSelectedIndexChangedEvent();
- }
-}
\ No newline at end of file
diff --git a/src/External/WindowsAPICodePack/Shell/Controls/CommandLinkWPF.xaml b/src/External/WindowsAPICodePack/Shell/Controls/CommandLinkWPF.xaml
deleted file mode 100644
index 34a7de5..0000000
--- a/src/External/WindowsAPICodePack/Shell/Controls/CommandLinkWPF.xaml
+++ /dev/null
@@ -1,171 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/src/External/WindowsAPICodePack/Shell/Controls/CommandLinkWPF.xaml.cs b/src/External/WindowsAPICodePack/Shell/Controls/CommandLinkWPF.xaml.cs
deleted file mode 100644
index d263992..0000000
--- a/src/External/WindowsAPICodePack/Shell/Controls/CommandLinkWPF.xaml.cs
+++ /dev/null
@@ -1,145 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System.ComponentModel;
-using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Navigation;
-using System.Windows.Shapes;
-using System.Windows;
-using MS.WindowsAPICodePack.Internal;
-
-namespace Microsoft.WindowsAPICodePack.Controls.WindowsPresentationFoundation
-{
- ///
- /// Implements a CommandLink button that can be used in WPF user interfaces.
- ///
- public partial class CommandLink : UserControl, INotifyPropertyChanged
- {
- ///
- /// Creates a new instance of this class.
- ///
- public CommandLink()
- {
- // Throw PlatformNotSupportedException if the user is not running Vista or beyond
- CoreHelpers.ThrowIfNotVista();
-
- this.DataContext = this;
- InitializeComponent();
- this.button.Click += new RoutedEventHandler(button_Click);
- }
-
- void button_Click(object sender, RoutedEventArgs e)
- {
- e.Source = this;
- if (Click != null)
- Click(sender, e);
- }
-
- RoutedUICommand command;
-
- ///
- /// Routed UI command to use for this button
- ///
- public RoutedUICommand Command
- {
- get { return command; }
- set { command = value; }
- }
-
- ///
- /// Occurs when the control is clicked.
- ///
- public event RoutedEventHandler Click;
-
- private string link;
-
- ///
- /// Specifies the main instruction text
- ///
- public string Link
- {
- get { return link; }
- set
- {
- link = value;
-
- if (PropertyChanged != null)
- {
- PropertyChanged(this, new PropertyChangedEventArgs("Link"));
- }
- }
- }
- private string note;
-
- ///
- /// Specifies the supporting note text
- ///
- public string Note
- {
- get { return note; }
- set
- {
- note = value;
- if (PropertyChanged != null)
- {
- PropertyChanged(this, new PropertyChangedEventArgs("Note"));
- }
- }
- }
- private ImageSource icon;
-
- ///
- /// Icon to set for the command link button
- ///
- public ImageSource Icon
- {
- get { return icon; }
- set
- {
- icon = value;
- if (PropertyChanged != null)
- {
- PropertyChanged(this, new PropertyChangedEventArgs("Icon"));
- }
- }
- }
-
- ///
- /// Indicates if the button is in a checked state
- ///
- public bool? IsCheck
- {
- get
- {
- return button.IsChecked;
- }
- set { button.IsChecked = value; }
- }
-
-
- #region INotifyPropertyChanged Members
-
- ///
- /// Occurs when a property value changes.
- ///
- public event PropertyChangedEventHandler PropertyChanged;
-
- #endregion
-
- ///
- /// Indicates whether this feature is supported on the current platform.
- ///
- public static bool IsPlatformSupported
- {
- get
- {
- // We need Windows Vista onwards ...
- return CoreHelpers.RunningOnVista;
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/External/WindowsAPICodePack/Shell/Controls/CommandLinkWinforms.cs b/src/External/WindowsAPICodePack/Shell/Controls/CommandLinkWinforms.cs
deleted file mode 100644
index 33ab97e..0000000
--- a/src/External/WindowsAPICodePack/Shell/Controls/CommandLinkWinforms.cs
+++ /dev/null
@@ -1,156 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.ComponentModel;
-using System.Text;
-using System.Windows.Forms;
-using MS.WindowsAPICodePack.Internal;
-using Microsoft.WindowsAPICodePack.Shell;
-
-namespace Microsoft.WindowsAPICodePack.Controls.WindowsForms
-{
- ///
- /// Implements a CommandLink button that can be used in
- /// WinForms user interfaces.
- ///
- public class CommandLink : Button
- {
- ///
- /// Gets a System.Windows.Forms.CreateParams on the base class when
- /// creating a window.
- ///
- protected override CreateParams CreateParams
- {
- get
- {
- // Add BS_COMMANDLINK style before control creation.
- CreateParams cp = base.CreateParams;
-
- cp.Style = AddCommandLinkStyle(cp.Style);
-
- return (cp);
- }
- }
-
- // Let Windows handle the rendering.
- ///
- /// Creates a new instance of this class.
- ///
- public CommandLink()
- {
- // Throw PlatformNotSupportedException if the user is not running Vista or beyond
- CoreHelpers.ThrowIfNotVista();
-
- FlatStyle = FlatStyle.System;
- }
-
- // Add Design-Time Support.
-
- ///
- /// Increase default width.
- ///
- protected override System.Drawing.Size DefaultSize
- {
- get { return new System.Drawing.Size(180, 60); }
- }
-
- ///
- /// Specifies the supporting note text
- ///
- [Category("Appearance")]
- [Description("Specifies the supporting note text.")]
- [BrowsableAttribute(true)]
- [DefaultValue("(Note Text)")]
- public string NoteText
- {
- get { return (GetNote(this)); }
- set
- {
- SetNote(this, value);
- }
- }
-
- ///
- /// Enable shield icon to be set at design-time.
- ///
- [Category("Appearance")]
- [Description("Indicates whether the button should be decorated with the security shield icon (Windows Vista only).")]
- [BrowsableAttribute(true)]
- [DefaultValue(false)]
- public bool ShieldIcon
- {
- get { return (shieldIconDisplayed); }
- set
- {
- shieldIconDisplayed = value;
- SetShieldIcon(this, this.shieldIconDisplayed);
- }
- }
- private bool shieldIconDisplayed;
-
-
- #region Interop helpers
-
- private static int AddCommandLinkStyle(int Style)
- {
- int newStyle = Style;
-
- // Only add BS_COMMANDLINK style on Windows Vista or above.
- // Otherwise, button creation will fail.
- if (Environment.OSVersion.Version.Major >= 6)
- {
- newStyle |= ShellNativeMethods.BS_COMMANDLINK;
- }
-
- return (newStyle);
- }
-
- private static string GetNote(System.Windows.Forms.Button Button)
- {
- IntPtr retVal = CoreNativeMethods.SendMessage(
- Button.Handle,
- ShellNativeMethods.BCM_GETNOTELENGTH,
- IntPtr.Zero,
- IntPtr.Zero);
-
- // Add 1 for null terminator, to get the entire string back.
- int len = ((int)retVal) + 1;
- StringBuilder strBld = new StringBuilder(len);
-
- retVal = CoreNativeMethods.SendMessage(Button.Handle, ShellNativeMethods.BCM_GETNOTE, ref len, strBld);
- return (strBld.ToString());
- }
-
- private static void SetNote(System.Windows.Forms.Button button, string text)
- {
- // This call will be ignored on versions earlier than
- // Windows Vista.
- CoreNativeMethods.SendMessage(button.Handle, ShellNativeMethods.BCM_SETNOTE, 0, text);
- }
-
- static internal void SetShieldIcon(
- System.Windows.Forms.Button Button, bool Show)
- {
- IntPtr fRequired = new IntPtr(Show ? 1 : 0);
- CoreNativeMethods.SendMessage(
- Button.Handle,
- ShellNativeMethods.BCM_SETSHIELD,
- IntPtr.Zero,
- fRequired);
- }
-
- #endregion
-
- ///
- /// Indicates whether this feature is supported on the current platform.
- ///
- public static bool IsPlatformSupported
- {
- get
- {
- // We need Windows Vista onwards ...
- return CoreHelpers.RunningOnVista;
- }
- }
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/Design/ShellObjects.cd b/src/External/WindowsAPICodePack/Shell/Design/ShellObjects.cd
deleted file mode 100644
index ae8f19c..0000000
--- a/src/External/WindowsAPICodePack/Shell/Design/ShellObjects.cd
+++ /dev/null
@@ -1,130 +0,0 @@
-
-
-
-
-
- AAoAAAgAAGAACQANgAJASAYAQABAAIAAAAAAAAAiAiQ=
- Common\ShellObject.cs
-
-
-
-
-
-
- AGIAoEAQACAAABBRCIAARCQCAAIABAAMCAEEAAPQKAQ=
- Common\ShellLibrary.cs
-
-
-
-
-
-
- BAAAABAAACAgAAoAAkSCIIAAQARAAAAIAoAEIAAACAA=
- KnownFolders\FileSystemKnownFolder.cs
-
-
-
-
-
-
- ACAAAAIAAKAAABAAAAAABAAAAAAAAIAAAAAAAAAAAAA=
- Common\ShellObjectContainer.cs
-
-
-
-
-
-
- AAQAAACAAAAAAEKAAIAAAIAABAAgESAAIAACAAQAAAA=
- Common\ShellLink.cs
-
-
-
-
-
- BAAAABAAACAgAAoAAkSCIIAAQARAAAAIAoAEIAAACAA=
- KnownFolders\NonFileSystemKnownFolder.cs
-
-
-
-
-
-
- AAAAAAgAAAAAAAIAAAAAAAAABAAAAAAAAAABAAAAAAA=
- Common\ShellFile.cs
-
-
-
-
-
-
- AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
- Common\ShellFolder.cs
- ShellFolder.cs
-
-
-
-
-
- AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
- Common\ShellObjectNode.cs
-
-
-
-
-
- AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
- Common\ShellNonFileSystemItem.cs
-
-
-
-
-
- AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
- Common\ShellSearchCollection.cs
-
-
-
-
-
- AAAAAAAAAAAAAAIAIAAAAAAABAAAAAAAAAAAAAAAAAA=
- Common\ShellFileSystemFolder.cs
-
-
-
-
-
- AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
- Common\ShellNonFileSystemFolder.cs
-
-
-
-
-
- AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
- Common\ShellSavedSearchCollection.cs
-
-
-
-
-
- AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
- Common\ShellSearchConnector.cs
-
-
-
-
-
- AAQAEBAAAAAQAAABBEAAAQAIAIAAAAAAAJBAAgAAAAA=
- Common\ShellSearchFolder.cs
-
-
-
-
-
- BAAAABAAAAAgAAoAAkCAIIAAQARAAAAIAoAEIAAACAA=
- KnownFolders\IKnownFolder.cs
-
-
-
-
\ No newline at end of file
diff --git a/src/External/WindowsAPICodePack/Shell/Design/ShellThumbnailClassDiagram.cd b/src/External/WindowsAPICodePack/Shell/Design/ShellThumbnailClassDiagram.cd
deleted file mode 100644
index b60a69a..0000000
--- a/src/External/WindowsAPICodePack/Shell/Design/ShellThumbnailClassDiagram.cd
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
-
- QAABAABAAAAAAASAABkIABggAQAACgABgBIQAAEAAEI=
- Common\ShellThumbnail.cs
-
-
-
-
-
- gAAAAAAAAAAAAAAQAAAAAABgAAAAAAAAAAAAAAAEAAA=
- Common\DefaultShellImageSizes.cs
-
-
-
-
-
- gAAAAAAAAAAAAAAQAAAAAABgAAAAAAAAAAAAAAAEAAA=
- Common\DefaultShellImageSizes.cs
-
-
-
-
-
- AAAAAAAAAAAAAACAAAAAIAAAAAAAAAAAAAAAIAAAAAA=
- Common\ShellThumbnailEnums.cs
-
-
-
-
-
- BAAAAAAAAAAAAAAAACAAIAAAAAAAAAAAAAAAAAAAAAA=
- Common\ShellThumbnailEnums.cs
-
-
-
-
\ No newline at end of file
diff --git a/src/External/WindowsAPICodePack/Shell/DesktopWindowManager/DesktopWindowManagerNativeMethods.cs b/src/External/WindowsAPICodePack/Shell/DesktopWindowManager/DesktopWindowManagerNativeMethods.cs
deleted file mode 100644
index 865acbc..0000000
--- a/src/External/WindowsAPICodePack/Shell/DesktopWindowManager/DesktopWindowManagerNativeMethods.cs
+++ /dev/null
@@ -1,84 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Runtime.InteropServices;
-using System.Security;
-using MS.WindowsAPICodePack.Internal;
-
-namespace MS.WindowsAPICodePack.Internal
-{
- internal static class DWMMessages
- {
- internal const int WM_DWMCOMPOSITIONCHANGED = 0x031E;
- internal const int WM_DWMNCRENDERINGCHANGED = 0x031F;
- }
-
- [StructLayout( LayoutKind.Sequential )]
- internal struct MARGINS
- {
- public int cxLeftWidth; // width of left border that retains its size
- public int cxRightWidth; // width of right border that retains its size
- public int cyTopHeight; // height of top border that retains its size
- public int cyBottomHeight; // height of bottom border that retains its size
-
- public MARGINS( bool fullWindow )
- {
- cxLeftWidth = cxRightWidth = cyTopHeight = cyBottomHeight = (fullWindow ? -1 : 0);
- }
- };
-
- internal enum DwmBlurBehindDwFlags : uint
- {
- DWM_BB_ENABLE = 0x00000001,
- DWM_BB_BLURREGION = 0x00000002,
- DWM_BB_TRANSITIONONMAXIMIZED = 0x00000004
- }
-
- [StructLayout( LayoutKind.Sequential )]
- internal struct DWM_BLURBEHIND
- {
- public DwmBlurBehindDwFlags dwFlags;
- public bool fEnable;
- public IntPtr hRgnBlur;
- public bool fTransitionOnMaximized;
- };
-
- internal enum CompositionEnable : uint
- {
- DWM_EC_DISABLECOMPOSITION = 0,
- DWM_EC_ENABLECOMPOSITION = 1
- }
-
- ///
- /// Internal class that contains interop declarations for
- /// functions that are not benign and are performance critical.
- ///
- [SuppressUnmanagedCodeSecurity]
- internal static class DesktopWindowManagerNativeMethods
- {
- [DllImport( "DwmApi.dll" )]
- internal static extern int DwmEnableBlurBehindWindow(
- IntPtr hwnd,
- ref DWM_BLURBEHIND bb );
-
- [DllImport( "DwmApi.dll" )]
- internal static extern int DwmExtendFrameIntoClientArea(
- IntPtr hwnd,
- ref MARGINS m );
-
- [DllImport( "DwmApi.dll", PreserveSig = false )]
- internal static extern bool DwmIsCompositionEnabled( );
-
- [DllImport( "DwmApi.dll" )]
- internal static extern int DwmEnableComposition(
- CompositionEnable compositionAction );
-
- [DllImport( "user32.dll" )]
- [return: MarshalAs( UnmanagedType.Bool )]
- internal static extern bool GetWindowRect( IntPtr hwnd, ref CoreNativeMethods.RECT rect );
-
- [DllImport( "user32.dll" )]
- [return: MarshalAs( UnmanagedType.Bool )]
- internal static extern bool GetClientRect( IntPtr hwnd, ref CoreNativeMethods.RECT rect );
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/DesktopWindowManager/GlassEvents.cs b/src/External/WindowsAPICodePack/Shell/DesktopWindowManager/GlassEvents.cs
deleted file mode 100644
index 5553210..0000000
--- a/src/External/WindowsAPICodePack/Shell/DesktopWindowManager/GlassEvents.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace Microsoft.WindowsAPICodePack.Shell
-{
- ///
- /// Event argument for The GlassAvailabilityChanged event
- ///
- public class AeroGlassCompositionChangedEvenArgs : EventArgs
- {
- private bool availability;
-
- internal AeroGlassCompositionChangedEvenArgs( bool avilability )
- {
- this.availability = avilability;
- }
-
- ///
- /// The new GlassAvailable state
- ///
- public bool GlassAvailable
- {
- get
- {
- return availability;
- }
- }
- }
-
- ///
- /// Sent when the availability of the desktop Glass effect is changed
- ///
- /// The AeroGlassWindow that is affected by this change
- /// The new state of the glass availability
- public delegate void AeroGlassCompositionChangedEvent( object sender, AeroGlassCompositionChangedEvenArgs e );
-}
diff --git a/src/External/WindowsAPICodePack/Shell/DesktopWindowManager/GlassForm.cs b/src/External/WindowsAPICodePack/Shell/DesktopWindowManager/GlassForm.cs
deleted file mode 100644
index 9efb211..0000000
--- a/src/External/WindowsAPICodePack/Shell/DesktopWindowManager/GlassForm.cs
+++ /dev/null
@@ -1,142 +0,0 @@
-using System;
-using System.Windows.Forms;
-using System.Drawing;
-using MS.WindowsAPICodePack.Internal;
-
-
-namespace Microsoft.WindowsAPICodePack.Shell
-{
- ///
- /// Windows Glass Form
- /// Inherit from this form to be able to enable glass on Windows Form
- ///
- public class GlassForm : Form
- {
- #region properties
-
- ///
- /// Get determines if AeroGlass is enabled on the desktop. Set enables/disables AreoGlass on the desktop.
- ///
- public bool AeroGlassCompositionEnabled
- {
- set
- {
- DesktopWindowManagerNativeMethods.DwmEnableComposition(
- value ? CompositionEnable.DWM_EC_ENABLECOMPOSITION : CompositionEnable.DWM_EC_DISABLECOMPOSITION );
- }
- get
- {
- return DesktopWindowManagerNativeMethods.DwmIsCompositionEnabled( );
- }
- }
-
- #endregion
-
- #region events
-
- ///
- /// Fires when the availability of Glass effect changes.
- ///
- public event AeroGlassCompositionChangedEvent AeroGlassCompositionChanged;
-
- #endregion
-
- #region operations
-
- ///
- /// Makes the background of current window transparent
- ///
- public void SetAeroGlassTransparency( )
- {
- this.BackColor = Color.Transparent;
- }
-
- ///
- /// Excludes a Control from the AeroGlass frame.
- ///
- /// The control to exclude.
- /// Many non-WPF rendered controls (i.e., the ExplorerBrowser control) will not
- /// render properly on top of an AeroGlass frame.
- public void ExcludeControlFromAeroGlass( Control control )
- {
- if( AeroGlassCompositionEnabled )
- {
- Rectangle clientScreen = this.RectangleToScreen( this.ClientRectangle );
- Rectangle controlScreen = control.RectangleToScreen( control.ClientRectangle );
-
- MARGINS margins = new MARGINS( );
- margins.cxLeftWidth = controlScreen.Left - clientScreen.Left;
- margins.cxRightWidth = clientScreen.Right - controlScreen.Right;
- margins.cyTopHeight = controlScreen.Top - clientScreen.Top;
- margins.cyBottomHeight = clientScreen.Bottom - controlScreen.Bottom;
-
- // Extend the Frame into client area
- DesktopWindowManagerNativeMethods.DwmExtendFrameIntoClientArea( Handle, ref margins );
- }
- }
-
- ///
- /// Resets the AeroGlass exclusion area.
- ///
- public void ResetAreoGlass( )
- {
- if( this.Handle != IntPtr.Zero )
- {
- MARGINS margins = new MARGINS( true );
- DesktopWindowManagerNativeMethods.DwmExtendFrameIntoClientArea( this.Handle, ref margins );
- }
- }
- #endregion
-
- #region implementation
- ///
- /// Catches the DWM messages to this window and fires the appropriate event.
- ///
- ///
- protected override void WndProc( ref Message m )
- {
- if( m.Msg == DWMMessages.WM_DWMCOMPOSITIONCHANGED
- || m.Msg == DWMMessages.WM_DWMNCRENDERINGCHANGED )
- {
- if( AeroGlassCompositionChanged != null )
- {
- AeroGlassCompositionChanged.Invoke(
- this,
- new AeroGlassCompositionChangedEvenArgs( AeroGlassCompositionEnabled ) );
- }
- }
-
- base.WndProc( ref m );
- }
-
- ///
- /// Initializes the Form for AeroGlass
- ///
- /// The arguments for this event
- protected override void OnLoad( EventArgs e )
- {
- base.OnLoad( e );
- ResetAreoGlass( );
- }
-
- ///
- /// Overide OnPaint to paint the background as black.
- ///
- /// PaintEventArgs
- protected override void OnPaint( PaintEventArgs e )
- {
- base.OnPaint( e );
-
- if( DesignMode == false )
- {
- if( AeroGlassCompositionEnabled )
- {
- // Paint the all the regions black to enable glass
- e.Graphics.FillRectangle( Brushes.Black, this.ClientRectangle );
- }
- }
- }
-
- #endregion
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/DesktopWindowManager/GlassWindow.cs b/src/External/WindowsAPICodePack/Shell/DesktopWindowManager/GlassWindow.cs
deleted file mode 100644
index da1990b..0000000
--- a/src/External/WindowsAPICodePack/Shell/DesktopWindowManager/GlassWindow.cs
+++ /dev/null
@@ -1,156 +0,0 @@
-using System;
-using System.Windows;
-using System.Windows.Interop;
-using System.Windows.Media;
-using System.Runtime.InteropServices;
-using MS.WindowsAPICodePack.Internal;
-
-
-namespace Microsoft.WindowsAPICodePack.Shell
-{
-
- ///
- /// WPF Glass Window
- /// Inherit from this window class to enable glass on a WPF window
- ///
- public class GlassWindow : Window
- {
- #region properties
-
- ///
- /// Get determines if AeroGlass is enabled on the desktop. Set enables/disables AreoGlass on the desktop.
- ///
- public bool AeroGlassCompositionEnabled
- {
- set
- {
- DesktopWindowManagerNativeMethods.DwmEnableComposition(
- value ? CompositionEnable.DWM_EC_ENABLECOMPOSITION : CompositionEnable.DWM_EC_DISABLECOMPOSITION );
- }
- get
- {
- return DesktopWindowManagerNativeMethods.DwmIsCompositionEnabled( );
- }
- }
-
- #endregion
-
- #region events
-
- ///
- /// Fires when the availability of Glass effect changes.
- ///
- public event AeroGlassCompositionChangedEvent AeroGlassCompositionChanged;
-
- #endregion
-
- #region operations
-
- ///
- /// Makes the background of current window transparent from both Wpf and Windows Perspective
- ///
- public void SetAeroGlassTransparency( )
- {
- // Set the Background to transparent from Win32 perpective
- HwndSource.FromHwnd( windowHandle ).CompositionTarget.BackgroundColor = System.Windows.Media.Colors.Transparent;
-
- // Set the Background to transparent from WPF perpective
- this.Background = Brushes.Transparent;
- }
-
- ///
- /// Excludes a UI element from the AeroGlass frame.
- ///
- /// The element to exclude.
- /// Many non-WPF rendered controls (i.e., the ExplorerBrowser control) will not
- /// render properly on top of an AeroGlass frame.
- public void ExcludeElementFromAeroGlass( FrameworkElement element )
- {
- if( AeroGlassCompositionEnabled )
- {
- // calculate total size of window nonclient area
- HwndSource hwndSource = PresentationSource.FromVisual( this ) as HwndSource;
- CoreNativeMethods.RECT windowRect = new CoreNativeMethods.RECT( );
- CoreNativeMethods.RECT clientRect = new CoreNativeMethods.RECT( );
- DesktopWindowManagerNativeMethods.GetWindowRect( hwndSource.Handle, ref windowRect );
- DesktopWindowManagerNativeMethods.GetClientRect( hwndSource.Handle, ref clientRect );
- Size nonClientSize =
- new Size(
- (double)(windowRect.right - windowRect.left) - (double)(clientRect.right - clientRect.left),
- (double)(windowRect.bottom - windowRect.top) - (double)(clientRect.bottom - clientRect.top) );
-
- // calculate size of element relative to nonclient area
- GeneralTransform transform = element.TransformToAncestor( this );
- Point topLeftFrame =
- transform.Transform( new Point( 0, 0 ) );
- Point bottomRightFrame =
- transform.Transform(
- new Point(
- element.ActualWidth + nonClientSize.Width,
- element.ActualHeight + nonClientSize.Height ) );
-
- // Create a margin structure
- MARGINS margins = new MARGINS( );
- margins.cxLeftWidth = (int)topLeftFrame.X;
- margins.cxRightWidth = (int)(this.ActualWidth - bottomRightFrame.X);
- margins.cyTopHeight = (int)(topLeftFrame.Y);
- margins.cyBottomHeight = (int)(this.ActualHeight - bottomRightFrame.Y);
-
- // Extend the Frame into client area
- DesktopWindowManagerNativeMethods.DwmExtendFrameIntoClientArea( windowHandle, ref margins );
- }
- }
-
- ///
- /// Resets the AeroGlass exclusion area.
- ///
- public void ResetAreoGlass()
- {
- MARGINS margins = new MARGINS( true );
- DesktopWindowManagerNativeMethods.DwmExtendFrameIntoClientArea( windowHandle, ref margins );
- }
-
- #endregion
-
- #region implementation
- private IntPtr windowHandle;
-
- private IntPtr WndProc( IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled )
- {
- if( msg == DWMMessages.WM_DWMCOMPOSITIONCHANGED
- || msg == DWMMessages.WM_DWMNCRENDERINGCHANGED )
- {
- if( AeroGlassCompositionChanged != null )
- {
- AeroGlassCompositionChanged.Invoke(
- this,
- new AeroGlassCompositionChangedEvenArgs( AeroGlassCompositionEnabled ) );
- }
-
- handled = true;
- }
- return IntPtr.Zero;
- }
-
- ///
- /// OnSourceInitialized
- /// Override SourceInitialized to initialize windowHandle for this window.
- /// A valid windowHandle is available only after the sourceInitialized is completed
- ///
- /// EventArgs
- protected override void OnSourceInitialized( EventArgs e )
- {
- base.OnSourceInitialized( e );
- WindowInteropHelper interopHelper = new WindowInteropHelper( this );
- this.windowHandle = interopHelper.Handle;
-
- // add Window Proc hook to capture DWM messages
- HwndSource source = HwndSource.FromHwnd( windowHandle );
- source.AddHook( new HwndSourceHook( WndProc ) );
-
- ResetAreoGlass( );
- }
-
- #endregion
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/ExplorerBrowser/ExplorerBrowser.WPF.xaml b/src/External/WindowsAPICodePack/Shell/ExplorerBrowser/ExplorerBrowser.WPF.xaml
deleted file mode 100644
index 9d5cee9..0000000
--- a/src/External/WindowsAPICodePack/Shell/ExplorerBrowser/ExplorerBrowser.WPF.xaml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Explorer Browser Control
-
-
diff --git a/src/External/WindowsAPICodePack/Shell/ExplorerBrowser/ExplorerBrowser.WPF.xaml.cs b/src/External/WindowsAPICodePack/Shell/ExplorerBrowser/ExplorerBrowser.WPF.xaml.cs
deleted file mode 100644
index fde0c9e..0000000
--- a/src/External/WindowsAPICodePack/Shell/ExplorerBrowser/ExplorerBrowser.WPF.xaml.cs
+++ /dev/null
@@ -1,940 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Text;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Navigation;
-using System.Windows.Shapes;
-using System.Windows.Forms.Integration;
-using Microsoft.WindowsAPICodePack.Shell;
-using Microsoft.WindowsAPICodePack.Controls;
-using System.Windows.Threading;
-using System.Threading;
-
-
-namespace Microsoft.WindowsAPICodePack.Controls.WindowsPresentationFoundation
-{
- ///
- /// Interaction logic for ExplorerBrowser.xaml
- ///
- public partial class ExplorerBrowser : UserControl
- {
- ///
- /// The underlying WinForms control
- ///
- public Microsoft.WindowsAPICodePack.Controls.WindowsForms.ExplorerBrowser ExplorerBrowserControl
- {
- get;
- set;
- }
-
- private ObservableCollection selectedItems = null;
- private ObservableCollection items = null;
- private ObservableCollection navigationLog = null;
- private DispatcherTimer dtCLRUpdater = new DispatcherTimer( );
-
- private ShellObject initialNavigationTarget = null;
- private ExplorerBrowserViewMode? initialViewMode = null;
-
- private AutoResetEvent itemsChanged = new AutoResetEvent( false );
- private AutoResetEvent selectionChanged = new AutoResetEvent( false );
- private int selectionChangeWaitCount = 0;
-
- ///
- /// Hosts the ExplorerBrowser WinForms wrapper in this control
- ///
- public ExplorerBrowser( )
- {
- InitializeComponent( );
-
- // the ExplorerBrowser WinForms control
- ExplorerBrowserControl = new Microsoft.WindowsAPICodePack.Controls.WindowsForms.ExplorerBrowser( );
-
- // back the dependency collection properties with instances
- SelectedItems = selectedItems = new ObservableCollection();
- Items = items = new ObservableCollection();
- NavigationLog = navigationLog = new ObservableCollection( );
-
- // hook up events for collection synchronization
- ExplorerBrowserControl.ItemsChanged += new ExplorerBrowserItemsChangedEventHandler( ItemsChanged );
- ExplorerBrowserControl.SelectionChanged += new ExplorerBrowserSelectionChangedEventHandler( SelectionChanged );
- ExplorerBrowserControl.ViewEnumerationComplete += new ExplorerBrowserViewEnumerationCompleteHandler( ExplorerBrowserControl_ViewEnumerationComplete );
- ExplorerBrowserControl.ViewSelectedItemChanged += new ExplorerBrowserViewSelectedItemChangedHandler( ExplorerBrowserControl_ViewSelectedItemChanged );
- ExplorerBrowserControl.NavigationLog.NavigationLogChanged += new NavigationLogChangedEventHandler( NavigationLogChanged );
-
- // host the control
- WindowsFormsHost host = new WindowsFormsHost( );
- host.Child = ExplorerBrowserControl;
- this.root.Children.Clear( );
- this.root.Children.Add( host );
-
-
- Loaded += new RoutedEventHandler( ExplorerBrowser_Loaded );
- }
-
- void ExplorerBrowserControl_ViewSelectedItemChanged( object sender, EventArgs e )
- {
- }
-
- void ExplorerBrowserControl_ViewEnumerationComplete( object sender, EventArgs e )
- {
- itemsChanged.Set( );
- selectionChanged.Set( );
- }
-
- ///
- /// To avoid the 'Dispatcher processing has been suspended' InvalidOperationException on Win7,
- /// the ExplorerBorwser native control is initialized after this control is fully loaded.
- ///
- ///
- ///
- void ExplorerBrowser_Loaded( object sender, RoutedEventArgs e )
- {
- // setup timer to update dependency properties from CLR properties of WinForms ExplorerBrowser object
- dtCLRUpdater.Tick += new EventHandler( UpdateDependencyPropertiesFromCLRPRoperties );
- dtCLRUpdater.Interval = new TimeSpan( 100 * 10000 ); // 100ms
- dtCLRUpdater.Start( );
-
- if (initialNavigationTarget != null )
- {
- ExplorerBrowserControl.Navigate(initialNavigationTarget);
- initialNavigationTarget = null;
- }
-
- if (initialViewMode != null)
- {
- ExplorerBrowserControl.ContentOptions.ViewMode = (ExplorerBrowserViewMode)initialViewMode;
- initialViewMode = null;
- }
- }
-
- ///
- /// Map changes to the CLR flags to the dependency properties
- ///
- ///
- ///
- void UpdateDependencyPropertiesFromCLRPRoperties( object sender, EventArgs e )
- {
- if( AlignLeft != ExplorerBrowserControl.ContentOptions.AlignLeft )
- AlignLeft = ExplorerBrowserControl.ContentOptions.AlignLeft;
- if( AutoArrange != ExplorerBrowserControl.ContentOptions.AutoArrange )
- AutoArrange = ExplorerBrowserControl.ContentOptions.AutoArrange;
- if( CheckSelect != ExplorerBrowserControl.ContentOptions.CheckSelect )
- CheckSelect = ExplorerBrowserControl.ContentOptions.CheckSelect;
- if( ExtendedTiles != ExplorerBrowserControl.ContentOptions.ExtendedTiles )
- ExtendedTiles = ExplorerBrowserControl.ContentOptions.ExtendedTiles;
- if( FullRowSelect != ExplorerBrowserControl.ContentOptions.FullRowSelect )
- FullRowSelect = ExplorerBrowserControl.ContentOptions.FullRowSelect;
- if( HideFileNames != ExplorerBrowserControl.ContentOptions.HideFileNames )
- HideFileNames = ExplorerBrowserControl.ContentOptions.HideFileNames;
- if( NoBrowserViewState != ExplorerBrowserControl.ContentOptions.NoBrowserViewState )
- NoBrowserViewState = ExplorerBrowserControl.ContentOptions.NoBrowserViewState;
- if( NoColumnHeader != ExplorerBrowserControl.ContentOptions.NoColumnHeader )
- NoColumnHeader = ExplorerBrowserControl.ContentOptions.NoColumnHeader;
- if( NoHeaderInAllViews != ExplorerBrowserControl.ContentOptions.NoHeaderInAllViews )
- NoHeaderInAllViews = ExplorerBrowserControl.ContentOptions.NoHeaderInAllViews;
- if( NoIcons != ExplorerBrowserControl.ContentOptions.NoIcons )
- NoIcons = ExplorerBrowserControl.ContentOptions.NoIcons;
- if( NoSubfolders != ExplorerBrowserControl.ContentOptions.NoSubfolders )
- NoSubfolders = ExplorerBrowserControl.ContentOptions.NoSubfolders;
- if( SingleClickActivate != ExplorerBrowserControl.ContentOptions.SingleClickActivate )
- SingleClickActivate = ExplorerBrowserControl.ContentOptions.SingleClickActivate;
- if( SingleSelection != ExplorerBrowserControl.ContentOptions.SingleSelection )
- SingleSelection = ExplorerBrowserControl.ContentOptions.SingleSelection;
-
- if( ThumbnailSize != ExplorerBrowserControl.ContentOptions.ThumbnailSize )
- ThumbnailSize = ExplorerBrowserControl.ContentOptions.ThumbnailSize;
-
- if( ViewMode != ExplorerBrowserControl.ContentOptions.ViewMode )
- ViewMode = ExplorerBrowserControl.ContentOptions.ViewMode;
-
- if( AlwaysNavigate != ExplorerBrowserControl.NavigationOptions.AlwaysNavigate )
- AlwaysNavigate = ExplorerBrowserControl.NavigationOptions.AlwaysNavigate;
- if( NavigateOnce != ExplorerBrowserControl.NavigationOptions.NavigateOnce )
- NavigateOnce = ExplorerBrowserControl.NavigationOptions.NavigateOnce;
-
- if( AdvancedQueryPane != ExplorerBrowserControl.NavigationOptions.PaneVisibility.AdvancedQuery )
- AdvancedQueryPane = ExplorerBrowserControl.NavigationOptions.PaneVisibility.AdvancedQuery;
- if( CommandsPane != ExplorerBrowserControl.NavigationOptions.PaneVisibility.Commands )
- CommandsPane = ExplorerBrowserControl.NavigationOptions.PaneVisibility.Commands;
- if( CommandsOrganizePane != ExplorerBrowserControl.NavigationOptions.PaneVisibility.CommandsOrganize )
- CommandsOrganizePane = ExplorerBrowserControl.NavigationOptions.PaneVisibility.CommandsOrganize;
- if( CommandsViewPane != ExplorerBrowserControl.NavigationOptions.PaneVisibility.CommandsView )
- CommandsViewPane = ExplorerBrowserControl.NavigationOptions.PaneVisibility.CommandsView;
- if( DetailsPane != ExplorerBrowserControl.NavigationOptions.PaneVisibility.Details )
- DetailsPane = ExplorerBrowserControl.NavigationOptions.PaneVisibility.Details;
- if( NavigationPane != ExplorerBrowserControl.NavigationOptions.PaneVisibility.Navigation )
- NavigationPane = ExplorerBrowserControl.NavigationOptions.PaneVisibility.Navigation;
- if( PreviewPane != ExplorerBrowserControl.NavigationOptions.PaneVisibility.Preview )
- PreviewPane = ExplorerBrowserControl.NavigationOptions.PaneVisibility.Preview;
- if( QueryPane != ExplorerBrowserControl.NavigationOptions.PaneVisibility.Query )
- QueryPane = ExplorerBrowserControl.NavigationOptions.PaneVisibility.Query;
-
- if( NavigationLogIndex != ExplorerBrowserControl.NavigationLog.CurrentLocationIndex )
- NavigationLogIndex = ExplorerBrowserControl.NavigationLog.CurrentLocationIndex;
-
- if( itemsChanged.WaitOne( 1 ) )
- {
- items.Clear( );
- foreach( ShellObject obj in ExplorerBrowserControl.Items )
- {
- items.Add( obj );
- }
- }
-
-
- if( selectionChanged.WaitOne( 1 ) )
- {
- selectionChangeWaitCount = 4;
- }
- else
- {
- if( selectionChangeWaitCount > 0 )
- {
- selectionChangeWaitCount--;
-
- if( selectionChangeWaitCount == 0 )
- {
- selectedItems.Clear( );
- foreach( ShellObject obj in ExplorerBrowserControl.SelectedItems )
- {
- selectedItems.Add( obj );
- }
- }
- }
- }
- }
-
- ///
- /// Synchronize NavigationLog collection to dependency collection
- ///
- ///
- ///
- void NavigationLogChanged( object sender, NavigationLogEventArgs args )
- {
- navigationLog.Clear( );
- foreach( ShellObject obj in ExplorerBrowserControl.NavigationLog.Locations )
- {
- navigationLog.Add( obj );
- }
- }
-
- ///
- /// Synchronize SelectedItems collection to dependency collection
- ///
- ///
- ///
- void SelectionChanged( object sender, EventArgs e )
- {
- selectionChanged.Set( );
- }
-
- // Synchronize ItemsCollection to dependency collection
- void ItemsChanged( object sender, EventArgs e )
- {
- itemsChanged.Set( );
- }
-
- ///
- /// The items in the ExplorerBrowser window
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly", Justification="This needs to be read-write collection for WPF databinding")]
- public ObservableCollection Items
- {
- get
- {
- return (ObservableCollection)GetValue( ItemsProperty );
- }
- set
- {
- SetValue( ItemsPropertyKey, value );
- }
- }
-
- private static readonly DependencyPropertyKey ItemsPropertyKey =
- DependencyProperty.RegisterReadOnly(
- "Items", typeof( ObservableCollection ),
- typeof( ExplorerBrowser ),
- new PropertyMetadata( null ) );
-
- ///
- /// The items in the ExplorerBrowser window
- ///
- public static readonly DependencyProperty ItemsProperty = ItemsPropertyKey.DependencyProperty;
-
- ///
- /// The selected items in the ExplorerBrowser window
- ///
- public ObservableCollection SelectedItems
- {
- get
- {
- return (ObservableCollection)GetValue( SelectedItemsProperty );
- }
- internal set
- {
- SetValue( SelectedItemsPropertyKey, value );
- }
- }
-
- private static readonly DependencyPropertyKey SelectedItemsPropertyKey =
- DependencyProperty.RegisterReadOnly(
- "SelectedItems", typeof( ObservableCollection ),
- typeof( ExplorerBrowser ),
- new PropertyMetadata( null ) );
-
- ///
- /// The selected items in the ExplorerBrowser window
- ///
- public ObservableCollection NavigationLog
- {
- get
- {
- return (ObservableCollection)GetValue( NavigationLogProperty );
- }
- internal set
- {
- SetValue( NavigationLogPropertyKey, value );
- }
- }
-
- private static readonly DependencyPropertyKey NavigationLogPropertyKey =
- DependencyProperty.RegisterReadOnly(
- "NavigationLog", typeof( ObservableCollection ),
- typeof( ExplorerBrowser ),
- new PropertyMetadata( null ) );
-
- ///
- /// The NavigaitonLog
- ///
- public static readonly DependencyProperty NavigationLogProperty = NavigationLogPropertyKey.DependencyProperty;
-
- ///
- /// The selected items in the ExplorerBrowser window
- ///
- public static readonly DependencyProperty SelectedItemsProperty = SelectedItemsPropertyKey.DependencyProperty;
-
-
- ///
- /// The location the explorer browser is navigating to
- ///
- public ShellObject NavigationTarget
- {
- get
- {
- return (ShellObject)GetValue( NavigationTargetProperty );
- }
- set
- {
- SetValue( NavigationTargetProperty, value );
- }
- }
-
- private static readonly DependencyProperty NavigationTargetProperty =
- DependencyProperty.Register(
- "NavigationTarget", typeof( ShellObject ),
- typeof( ExplorerBrowser ),
- new PropertyMetadata( null, navigationTargetChanged ) );
-
- private static void navigationTargetChanged( DependencyObject d, DependencyPropertyChangedEventArgs e )
- {
- ExplorerBrowser instance = d as ExplorerBrowser;
-
- if (instance.ExplorerBrowserControl.explorerBrowserControl != null)
- instance.ExplorerBrowserControl.Navigate((ShellObject)e.NewValue);
- else
- instance.initialNavigationTarget = (ShellObject)e.NewValue;
- }
-
- ///
- /// The view should be left-aligned.
- ///
- public bool AlignLeft
- {
- get { return (bool)GetValue( AlignLeftProperty ); }
- set { SetValue( AlignLeftProperty, value ); }
- }
-
- internal static DependencyProperty AlignLeftProperty =
- DependencyProperty.Register(
- "AlignLeft", typeof( bool ),
- typeof( ExplorerBrowser ),
- new PropertyMetadata( false, OnAlignLeftChanged ) );
-
- private static void OnAlignLeftChanged( DependencyObject d, DependencyPropertyChangedEventArgs e )
- {
- ExplorerBrowser instance = d as ExplorerBrowser;
- if( instance.ExplorerBrowserControl != null )
- instance.ExplorerBrowserControl.ContentOptions.AlignLeft = (bool)e.NewValue;
- }
-
-
- ///
- /// Automatically arrange the elements in the view.
- ///
- public bool AutoArrange
- {
- get { return (bool)GetValue( AutoArrangeProperty ); }
- set { SetValue( AutoArrangeProperty, value ); }
- }
-
- internal static DependencyProperty AutoArrangeProperty =
- DependencyProperty.Register(
- "AutoArrange", typeof( bool ),
- typeof( ExplorerBrowser ),
- new PropertyMetadata( false, OnAutoArrangeChanged ) );
-
- private static void OnAutoArrangeChanged( DependencyObject d, DependencyPropertyChangedEventArgs e )
- {
- ExplorerBrowser instance = d as ExplorerBrowser;
- if( instance.ExplorerBrowserControl != null )
- instance.ExplorerBrowserControl.ContentOptions.AutoArrange = (bool)e.NewValue;
- }
-
- ///
- /// Turns on check mode for the view
- ///
- public bool CheckSelect
- {
- get { return (bool)GetValue( CheckSelectProperty ); }
- set { SetValue( CheckSelectProperty, value ); }
- }
-
- internal static DependencyProperty CheckSelectProperty =
- DependencyProperty.Register(
- "CheckSelect", typeof( bool ),
- typeof( ExplorerBrowser ),
- new PropertyMetadata( false, OnCheckSelectChanged ) );
-
- private static void OnCheckSelectChanged( DependencyObject d, DependencyPropertyChangedEventArgs e )
- {
- ExplorerBrowser instance = d as ExplorerBrowser;
- if( instance.ExplorerBrowserControl != null )
- instance.ExplorerBrowserControl.ContentOptions.CheckSelect = (bool)e.NewValue;
- }
-
- ///
- /// When the view is in "tile view mode" the layout of a single item should be extended to the width of the view.
- ///
- public bool ExtendedTiles
- {
- get { return (bool)GetValue( ExtendedTilesProperty ); }
- set { SetValue( ExtendedTilesProperty, value ); }
- }
-
- internal static DependencyProperty ExtendedTilesProperty =
- DependencyProperty.Register(
- "ExtendedTiles", typeof( bool ),
- typeof( ExplorerBrowser ),
- new PropertyMetadata( false, OnExtendedTilesChanged ) );
-
- private static void OnExtendedTilesChanged( DependencyObject d, DependencyPropertyChangedEventArgs e )
- {
- ExplorerBrowser instance = d as ExplorerBrowser;
- if( instance.ExplorerBrowserControl != null )
- instance.ExplorerBrowserControl.ContentOptions.ExtendedTiles = (bool)e.NewValue;
- }
-
- ///
- /// When an item is selected, the item and all its sub-items are highlighted.
- ///
- public bool FullRowSelect
- {
- get { return (bool)GetValue( FullRowSelectProperty ); }
- set { SetValue( FullRowSelectProperty, value ); }
- }
-
- internal static DependencyProperty FullRowSelectProperty =
- DependencyProperty.Register(
- "FullRowSelect", typeof( bool ),
- typeof( ExplorerBrowser ),
- new PropertyMetadata( false, OnFullRowSelectChanged ) );
-
- private static void OnFullRowSelectChanged( DependencyObject d, DependencyPropertyChangedEventArgs e )
- {
- ExplorerBrowser instance = d as ExplorerBrowser;
- if( instance.ExplorerBrowserControl != null )
- instance.ExplorerBrowserControl.ContentOptions.FullRowSelect = (bool)e.NewValue;
- }
-
- ///
- /// The view should not display file names
- ///
- public bool HideFileNames
- {
- get { return (bool)GetValue( HideFileNamesProperty ); }
- set { SetValue( HideFileNamesProperty, value ); }
- }
-
- internal static DependencyProperty HideFileNamesProperty =
- DependencyProperty.Register(
- "HideFileNames", typeof( bool ),
- typeof( ExplorerBrowser ),
- new PropertyMetadata( false, OnHideFileNamesChanged ) );
-
- private static void OnHideFileNamesChanged( DependencyObject d, DependencyPropertyChangedEventArgs e )
- {
- ExplorerBrowser instance = d as ExplorerBrowser;
- if( instance.ExplorerBrowserControl != null )
- instance.ExplorerBrowserControl.ContentOptions.HideFileNames = (bool)e.NewValue;
- }
-
- ///
- /// The view should not save view state in the browser.
- ///
- public bool NoBrowserViewState
- {
- get { return (bool)GetValue( NoBrowserViewStateProperty ); }
- set { SetValue( NoBrowserViewStateProperty, value ); }
- }
-
- internal static DependencyProperty NoBrowserViewStateProperty =
- DependencyProperty.Register(
- "NoBrowserViewState", typeof( bool ),
- typeof( ExplorerBrowser ),
- new PropertyMetadata( false, OnNoBrowserViewStateChanged ) );
-
- private static void OnNoBrowserViewStateChanged( DependencyObject d, DependencyPropertyChangedEventArgs e )
- {
- ExplorerBrowser instance = d as ExplorerBrowser;
- if( instance.ExplorerBrowserControl != null )
- instance.ExplorerBrowserControl.ContentOptions.NoBrowserViewState = (bool)e.NewValue;
- }
-
- ///
- /// Do not display a column header in the view in any view mode.
- ///
- public bool NoColumnHeader
- {
- get { return (bool)GetValue( NoColumnHeaderProperty ); }
- set { SetValue( NoColumnHeaderProperty, value ); }
- }
-
- internal static DependencyProperty NoColumnHeaderProperty =
- DependencyProperty.Register(
- "NoColumnHeader", typeof( bool ),
- typeof( ExplorerBrowser ),
- new PropertyMetadata( false, OnNoColumnHeaderChanged ) );
-
- private static void OnNoColumnHeaderChanged( DependencyObject d, DependencyPropertyChangedEventArgs e )
- {
- ExplorerBrowser instance = d as ExplorerBrowser;
- if( instance.ExplorerBrowserControl != null )
- instance.ExplorerBrowserControl.ContentOptions.NoColumnHeader = (bool)e.NewValue;
- }
-
- ///
- /// Only show the column header in details view mode.
- ///
- public bool NoHeaderInAllViews
- {
- get { return (bool)GetValue( NoHeaderInAllViewsProperty ); }
- set { SetValue( NoHeaderInAllViewsProperty, value ); }
- }
-
- internal static DependencyProperty NoHeaderInAllViewsProperty =
- DependencyProperty.Register(
- "NoHeaderInAllViews", typeof( bool ),
- typeof( ExplorerBrowser ),
- new PropertyMetadata( false, OnNoHeaderInAllViewsChanged ) );
-
- private static void OnNoHeaderInAllViewsChanged( DependencyObject d, DependencyPropertyChangedEventArgs e )
- {
- ExplorerBrowser instance = d as ExplorerBrowser;
- if( instance.ExplorerBrowserControl != null )
- instance.ExplorerBrowserControl.ContentOptions.NoHeaderInAllViews = (bool)e.NewValue;
- }
-
- ///
- /// The view should not display icons.
- ///
- public bool NoIcons
- {
- get { return (bool)GetValue( NoIconsProperty ); }
- set { SetValue( NoIconsProperty, value ); }
- }
-
- internal static DependencyProperty NoIconsProperty =
- DependencyProperty.Register(
- "NoIcons", typeof( bool ),
- typeof( ExplorerBrowser ),
- new PropertyMetadata( false, OnNoIconsChanged ) );
-
- private static void OnNoIconsChanged( DependencyObject d, DependencyPropertyChangedEventArgs e )
- {
- ExplorerBrowser instance = d as ExplorerBrowser;
- if( instance.ExplorerBrowserControl != null )
- instance.ExplorerBrowserControl.ContentOptions.NoIcons = (bool)e.NewValue;
- }
-
- ///
- /// Do not show subfolders.
- ///
- public bool NoSubfolders
- {
- get { return (bool)GetValue( NoSubfoldersProperty ); }
- set { SetValue( NoSubfoldersProperty, value ); }
- }
-
- internal static DependencyProperty NoSubfoldersProperty =
- DependencyProperty.Register(
- "NoSubfolders", typeof( bool ),
- typeof( ExplorerBrowser ),
- new PropertyMetadata( false, OnNoSubfoldersChanged ) );
-
- private static void OnNoSubfoldersChanged( DependencyObject d, DependencyPropertyChangedEventArgs e )
- {
- ExplorerBrowser instance = d as ExplorerBrowser;
- if( instance.ExplorerBrowserControl != null )
- instance.ExplorerBrowserControl.ContentOptions.NoSubfolders = (bool)e.NewValue;
- }
-
- ///
- /// Navigate with a single click
- ///
- public bool SingleClickActivate
- {
- get { return (bool)GetValue( SingleClickActivateProperty ); }
- set { SetValue( SingleClickActivateProperty, value ); }
- }
-
- internal static DependencyProperty SingleClickActivateProperty =
- DependencyProperty.Register(
- "SingleClickActivate", typeof( bool ),
- typeof( ExplorerBrowser ),
- new PropertyMetadata( false, OnSingleClickActivateChanged ) );
-
- private static void OnSingleClickActivateChanged( DependencyObject d, DependencyPropertyChangedEventArgs e )
- {
- ExplorerBrowser instance = d as ExplorerBrowser;
- if( instance.ExplorerBrowserControl != null )
- instance.ExplorerBrowserControl.ContentOptions.SingleClickActivate = (bool)e.NewValue;
- }
-
- ///
- /// Do not allow more than a single item to be selected.
- ///
- public bool SingleSelection
- {
- get { return (bool)GetValue( SingleSelectionProperty ); }
- set { SetValue( SingleSelectionProperty, value ); }
- }
-
- internal static DependencyProperty SingleSelectionProperty =
- DependencyProperty.Register(
- "SingleSelection", typeof( bool ),
- typeof( ExplorerBrowser ),
- new PropertyMetadata( false, OnSingleSelectionChanged ) );
-
- private static void OnSingleSelectionChanged( DependencyObject d, DependencyPropertyChangedEventArgs e )
- {
- ExplorerBrowser instance = d as ExplorerBrowser;
- if( instance.ExplorerBrowserControl != null )
- instance.ExplorerBrowserControl.ContentOptions.SingleSelection = (bool)e.NewValue;
- }
-
- ///
- /// The size of the thumbnails in the explorer browser
- ///
- public int ThumbnailSize
- {
- get { return (int)GetValue( ThumbnailSizeProperty ); }
- set { SetValue( ThumbnailSizeProperty, value ); }
- }
-
- internal static DependencyProperty ThumbnailSizeProperty =
- DependencyProperty.Register(
- "ThumbnailSize", typeof( int ),
- typeof( ExplorerBrowser ),
- new PropertyMetadata( 32, OnThumbnailSizeChanged ) );
-
- private static void OnThumbnailSizeChanged( DependencyObject d, DependencyPropertyChangedEventArgs e )
- {
- ExplorerBrowser instance = d as ExplorerBrowser;
- if( instance.ExplorerBrowserControl != null )
- instance.ExplorerBrowserControl.ContentOptions.ThumbnailSize = (int)e.NewValue;
- }
-
-
-
- ///
- /// The various view modes of the explorer browser control
- ///
- public ExplorerBrowserViewMode ViewMode
- {
- get { return (ExplorerBrowserViewMode)GetValue( ViewModeProperty ); }
- set { SetValue( ViewModeProperty, value ); }
- }
-
- internal static DependencyProperty ViewModeProperty =
- DependencyProperty.Register(
- "ViewMode", typeof( ExplorerBrowserViewMode ),
- typeof( ExplorerBrowser ),
- new PropertyMetadata( ExplorerBrowserViewMode.Auto, OnViewModeChanged ) );
-
- private static void OnViewModeChanged( DependencyObject d, DependencyPropertyChangedEventArgs e )
- {
- ExplorerBrowser instance = d as ExplorerBrowser;
-
- if (instance.ExplorerBrowserControl != null)
- {
- if (instance.ExplorerBrowserControl.explorerBrowserControl == null)
- instance.initialViewMode = (ExplorerBrowserViewMode)e.NewValue;
- else
- instance.ExplorerBrowserControl.ContentOptions.ViewMode = (ExplorerBrowserViewMode)e.NewValue;
- }
- }
-
-
- ///
- /// Always navigate, even if you are attempting to navigate to the current folder.
- ///
- public bool AlwaysNavigate
- {
- get { return (bool)GetValue( AlwaysNavigateProperty ); }
- set { SetValue( AlwaysNavigateProperty, value ); }
- }
-
- internal static DependencyProperty AlwaysNavigateProperty =
- DependencyProperty.Register(
- "AlwaysNavigate", typeof( bool ),
- typeof( ExplorerBrowser ),
- new PropertyMetadata( false, OnAlwaysNavigateChanged ) );
-
- private static void OnAlwaysNavigateChanged( DependencyObject d, DependencyPropertyChangedEventArgs e )
- {
- ExplorerBrowser instance = d as ExplorerBrowser;
- if( instance.ExplorerBrowserControl != null )
- instance.ExplorerBrowserControl.NavigationOptions.AlwaysNavigate = (bool)e.NewValue;
- }
-
- ///
- /// Do not navigate further than the initial navigation.
- ///
- public bool NavigateOnce
- {
- get { return (bool)GetValue( NavigateOnceProperty ); }
- set { SetValue( NavigateOnceProperty, value ); }
- }
-
- internal static DependencyProperty NavigateOnceProperty =
- DependencyProperty.Register(
- "NavigateOnce", typeof( bool ),
- typeof( ExplorerBrowser ),
- new PropertyMetadata( false, OnNavigateOnceChanged ) );
-
- private static void OnNavigateOnceChanged( DependencyObject d, DependencyPropertyChangedEventArgs e )
- {
- ExplorerBrowser instance = d as ExplorerBrowser;
- if( instance.ExplorerBrowserControl != null )
- instance.ExplorerBrowserControl.NavigationOptions.NavigateOnce = (bool)e.NewValue;
- }
-
- ///
- /// Show/Hide the AdvancedQuery pane on subsequent navigation
- ///
- public PaneVisibilityState AdvancedQueryPane
- {
- get { return (PaneVisibilityState)GetValue( AdvancedQueryPaneProperty ); }
- set { SetValue( AdvancedQueryPaneProperty, value ); }
- }
-
- internal static DependencyProperty AdvancedQueryPaneProperty =
- DependencyProperty.Register(
- "AdvancedQueryPane", typeof( PaneVisibilityState ),
- typeof( ExplorerBrowser ),
- new PropertyMetadata( PaneVisibilityState.DontCare, OnAdvancedQueryPaneChanged ) );
-
- private static void OnAdvancedQueryPaneChanged( DependencyObject d, DependencyPropertyChangedEventArgs e )
- {
- ExplorerBrowser instance = d as ExplorerBrowser;
- if( instance.ExplorerBrowserControl != null )
- instance.ExplorerBrowserControl.NavigationOptions.PaneVisibility.AdvancedQuery = (PaneVisibilityState)e.NewValue;
- }
-
- ///
- /// Show/Hide the Commands pane on subsequent navigation
- ///
- public PaneVisibilityState CommandsPane
- {
- get { return (PaneVisibilityState)GetValue( CommandsPaneProperty ); }
- set { SetValue( CommandsPaneProperty, value ); }
- }
-
- internal static DependencyProperty CommandsPaneProperty =
- DependencyProperty.Register(
- "CommandsPane", typeof( PaneVisibilityState ),
- typeof( ExplorerBrowser ),
- new PropertyMetadata( PaneVisibilityState.DontCare, OnCommandsPaneChanged ) );
-
- private static void OnCommandsPaneChanged( DependencyObject d, DependencyPropertyChangedEventArgs e )
- {
- ExplorerBrowser instance = d as ExplorerBrowser;
- if( instance.ExplorerBrowserControl != null )
- instance.ExplorerBrowserControl.NavigationOptions.PaneVisibility.Commands = (PaneVisibilityState)e.NewValue;
- }
-
- ///
- /// Show/Hide the Organize menu in the Commands pane on subsequent navigation
- ///
- public PaneVisibilityState CommandsOrganizePane
- {
- get { return (PaneVisibilityState)GetValue( CommandsOrganizePaneProperty ); }
- set { SetValue( CommandsOrganizePaneProperty, value ); }
- }
-
- internal static DependencyProperty CommandsOrganizePaneProperty =
- DependencyProperty.Register(
- "CommandsOrganizePane", typeof( PaneVisibilityState ),
- typeof( ExplorerBrowser ),
- new PropertyMetadata( PaneVisibilityState.DontCare, OnCommandsOrganizePaneChanged ) );
-
- private static void OnCommandsOrganizePaneChanged( DependencyObject d, DependencyPropertyChangedEventArgs e )
- {
- ExplorerBrowser instance = d as ExplorerBrowser;
- if( instance.ExplorerBrowserControl != null )
- instance.ExplorerBrowserControl.NavigationOptions.PaneVisibility.CommandsOrganize = (PaneVisibilityState)e.NewValue;
- }
-
- ///
- /// Show/Hide the View menu in the Commands pane on subsequent navigation
- ///
- public PaneVisibilityState CommandsViewPane
- {
- get { return (PaneVisibilityState)GetValue( CommandsViewPaneProperty ); }
- set { SetValue( CommandsViewPaneProperty, value ); }
- }
-
- internal static DependencyProperty CommandsViewPaneProperty =
- DependencyProperty.Register(
- "CommandsViewPane", typeof( PaneVisibilityState ),
- typeof( ExplorerBrowser ),
- new PropertyMetadata( PaneVisibilityState.DontCare, OnCommandsViewPaneChanged ) );
-
- private static void OnCommandsViewPaneChanged( DependencyObject d, DependencyPropertyChangedEventArgs e )
- {
- ExplorerBrowser instance = d as ExplorerBrowser;
- if( instance.ExplorerBrowserControl != null )
- instance.ExplorerBrowserControl.NavigationOptions.PaneVisibility.CommandsView = (PaneVisibilityState)e.NewValue;
- }
-
- ///
- /// Show/Hide the Details pane on subsequent navigation
- ///
- public PaneVisibilityState DetailsPane
- {
- get { return (PaneVisibilityState)GetValue( DetailsPaneProperty ); }
- set { SetValue( DetailsPaneProperty, value ); }
- }
-
- internal static DependencyProperty DetailsPaneProperty =
- DependencyProperty.Register(
- "DetailsPane", typeof( PaneVisibilityState ),
- typeof( ExplorerBrowser ),
- new PropertyMetadata( PaneVisibilityState.DontCare, OnDetailsPaneChanged ) );
-
- private static void OnDetailsPaneChanged( DependencyObject d, DependencyPropertyChangedEventArgs e )
- {
- ExplorerBrowser instance = d as ExplorerBrowser;
- if( instance.ExplorerBrowserControl != null )
- instance.ExplorerBrowserControl.NavigationOptions.PaneVisibility.Details = (PaneVisibilityState)e.NewValue;
- }
-
- ///
- /// Show/Hide the Navigation pane on subsequent navigation
- ///
- public PaneVisibilityState NavigationPane
- {
- get { return (PaneVisibilityState)GetValue( NavigationPaneProperty ); }
- set { SetValue( NavigationPaneProperty, value ); }
- }
-
- internal static DependencyProperty NavigationPaneProperty =
- DependencyProperty.Register(
- "NavigationPane", typeof( PaneVisibilityState ),
- typeof( ExplorerBrowser ),
- new PropertyMetadata( PaneVisibilityState.DontCare, OnNavigationPaneChanged ) );
-
- private static void OnNavigationPaneChanged( DependencyObject d, DependencyPropertyChangedEventArgs e )
- {
- ExplorerBrowser instance = d as ExplorerBrowser;
- if( instance.ExplorerBrowserControl != null )
- instance.ExplorerBrowserControl.NavigationOptions.PaneVisibility.Navigation = (PaneVisibilityState)e.NewValue;
- }
-
- ///
- /// Show/Hide the Preview pane on subsequent navigation
- ///
- public PaneVisibilityState PreviewPane
- {
- get { return (PaneVisibilityState)GetValue( PreviewPaneProperty ); }
- set { SetValue( PreviewPaneProperty, value ); }
- }
-
- internal static DependencyProperty PreviewPaneProperty =
- DependencyProperty.Register(
- "PreviewPane", typeof( PaneVisibilityState ),
- typeof( ExplorerBrowser ),
- new PropertyMetadata( PaneVisibilityState.DontCare, OnPreviewPaneChanged ) );
-
- private static void OnPreviewPaneChanged( DependencyObject d, DependencyPropertyChangedEventArgs e )
- {
- ExplorerBrowser instance = d as ExplorerBrowser;
- if( instance.ExplorerBrowserControl != null )
- instance.ExplorerBrowserControl.NavigationOptions.PaneVisibility.Preview = (PaneVisibilityState)e.NewValue;
- }
-
- ///
- /// Show/Hide the Query pane on subsequent navigation
- ///
- public PaneVisibilityState QueryPane
- {
- get { return (PaneVisibilityState)GetValue( QueryPaneProperty ); }
- set { SetValue( QueryPaneProperty, value ); }
- }
-
- internal static DependencyProperty QueryPaneProperty =
- DependencyProperty.Register(
- "QueryPane", typeof( PaneVisibilityState ),
- typeof( ExplorerBrowser ),
- new PropertyMetadata( PaneVisibilityState.DontCare, OnQueryPaneChanged ) );
-
- private static void OnQueryPaneChanged( DependencyObject d, DependencyPropertyChangedEventArgs e )
- {
- ExplorerBrowser instance = d as ExplorerBrowser;
- if( instance.ExplorerBrowserControl != null )
- instance.ExplorerBrowserControl.NavigationOptions.PaneVisibility.Query = (PaneVisibilityState)e.NewValue;
- }
-
-
- ///
- /// Navigation log index
- ///
- public int NavigationLogIndex
- {
- get { return (int)GetValue( NavigationLogIndexProperty ); }
- set { SetValue( NavigationLogIndexProperty, value ); }
- }
-
- internal static DependencyProperty NavigationLogIndexProperty =
- DependencyProperty.Register(
- "NavigationLogIndex", typeof( int ),
- typeof( ExplorerBrowser ),
- new PropertyMetadata( 0, OnNavigationLogIndexChanged ) );
-
- private static void OnNavigationLogIndexChanged( DependencyObject d, DependencyPropertyChangedEventArgs e )
- {
- ExplorerBrowser instance = d as ExplorerBrowser;
- if( instance.ExplorerBrowserControl != null )
- instance.ExplorerBrowserControl.NavigationLog.NavigateLog( (int)e.NewValue );
- }
-
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/ExplorerBrowser/ExplorerBrowser.cs b/src/External/WindowsAPICodePack/Shell/ExplorerBrowser/ExplorerBrowser.cs
deleted file mode 100644
index b0b7232..0000000
--- a/src/External/WindowsAPICodePack/Shell/ExplorerBrowser/ExplorerBrowser.cs
+++ /dev/null
@@ -1,811 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Windows.Forms;
-using System.Drawing;
-using System.Drawing.Drawing2D;
-using System.Runtime.InteropServices;
-using System.Diagnostics;
-using System.Collections.Generic;
-using System.Threading;
-using MS.WindowsAPICodePack.Internal;
-using System.Reflection;
-using Microsoft.WindowsAPICodePack.Shell;
-
-namespace Microsoft.WindowsAPICodePack.Controls.WindowsForms
-{
- ///
- /// This class is a wrapper around the Windows Explorer Browser control.
- ///
- public class ExplorerBrowser :
- System.Windows.Forms.UserControl,
- Microsoft.WindowsAPICodePack.Controls.IServiceProvider,
- IExplorerPaneVisibility,
- IExplorerBrowserEvents,
- ICommDlgBrowser,
- IMessageFilter
- {
- #region properties
- ///
- /// Options that control how the ExplorerBrowser navigates
- ///
- public ExplorerBrowserNavigationOptions NavigationOptions
- {
- get;
- private set;
- }
-
- ///
- /// Options that control how the content of the ExplorerBorwser looks
- ///
- public ExplorerBrowserContentOptions ContentOptions
- {
- get;
- private set;
- }
-
- private IShellItemArray shellItemsArray;
- private ShellObjectCollection itemsCollection;
- ///
- /// The set of ShellObjects in the Explorer Browser
- ///
- public ShellObjectCollection Items
- {
- get
- {
- if (shellItemsArray != null)
- Marshal.ReleaseComObject(shellItemsArray);
-
- if (itemsCollection != null)
- {
- itemsCollection.Dispose();
- itemsCollection = null;
- }
-
- shellItemsArray = GetItemsArray();
- itemsCollection = new ShellObjectCollection(shellItemsArray, true);
-
- return itemsCollection;
- }
- }
-
- private IShellItemArray selectedShellItemsArray;
- private ShellObjectCollection selectedItemsCollection;
- ///
- /// The set of selected ShellObjects in the Explorer Browser
- ///
- public ShellObjectCollection SelectedItems
- {
- get
- {
- if (selectedShellItemsArray != null)
- Marshal.ReleaseComObject(selectedShellItemsArray);
-
- if (selectedItemsCollection != null)
- {
- selectedItemsCollection.Dispose();
- selectedItemsCollection = null;
- }
-
- selectedShellItemsArray = GetSelectedItemsArray();
- selectedItemsCollection = new ShellObjectCollection(selectedShellItemsArray, true);
-
-
- return selectedItemsCollection;
- }
- }
-
- ///
- /// Contains the navigation history of the ExplorerBrowser
- ///
- public ExplorerBrowserNavigationLog NavigationLog
- {
- get;
- private set;
- }
-
- ///
- /// The name of the property bag used to persist changes to the ExplorerBrowser's view state.
- ///
- public string PropertyBagName
- {
- get
- {
- return propertyBagName;
- }
- set
- {
- propertyBagName = value;
- if (explorerBrowserControl != null)
- explorerBrowserControl.SetPropertyBag(propertyBagName);
- }
- }
-
- #endregion
-
- #region operations
- ///
- /// Clears the Explorer Browser of existing content, fills it with
- /// content from the specified container, and adds a new point to the Travel Log.
- ///
- /// The shell container to navigate to.
- /// Will throw if navigation fails for any other reason.
- public void Navigate(ShellObject shellObject)
- {
- if (explorerBrowserControl == null)
- {
- antecreationNavigationTarget = shellObject;
- }
- else
- {
- HRESULT hr = explorerBrowserControl.BrowseToObject(shellObject.NativeShellItem, 0);
- if (hr != HRESULT.S_OK)
- {
- if (hr == HRESULT.RESOURCE_IN_USE)
- {
- if (NavigationFailed != null)
- {
- NavigationFailedEventArgs args = new NavigationFailedEventArgs();
- args.FailedLocation = shellObject;
- NavigationFailed(this, args);
- }
- }
- else
- throw new COMException("BrowseToObject failed", (int)hr);
- }
- }
- }
-
- ///
- /// Navigates within the navigation log. This does not change the set of
- /// locations in the navigation log.
- ///
- /// Forward of Backward
- /// True if the navigation succeeded, false if it failed for any reason.
- public bool NavigateLogLocation(NavigationLogDirection direction)
- {
- return NavigationLog.NavigateLog(direction);
- }
-
- ///
- /// Navigate within the navigation log. This does not change the set of
- /// locations in the navigation log.
- ///
- /// An index into the navigation logs Locations collection.
- /// True if the navigation succeeded, false if it failed for any reason.
- public bool NavigateLogLocation(int navigationLogIndex)
- {
- return NavigationLog.NavigateLog(navigationLogIndex);
- }
- #endregion
-
- #region events
-
- ///
- /// Fires when the SelectedItems collection changes.
- ///
- public event ExplorerBrowserSelectionChangedEventHandler SelectionChanged;
-
- ///
- /// Fires when the Items colection changes.
- ///
- public event ExplorerBrowserItemsChangedEventHandler ItemsChanged;
-
- ///
- /// Fires when a navigation has been initiated, but is not yet complete.
- ///
- public event ExplorerBrowserNavigationPendingEventHandler NavigationPending;
-
- ///
- /// Fires when a navigation has been 'completed': no NavigationPending listener
- /// has cancelled, and the ExplorerBorwser has created a new view. The view
- /// will be populated with new items asynchronously, and ItemsChanged will be
- /// fired to reflect this some time later.
- ///
- public event ExplorerBrowserNavigationCompleteEventHandler NavigationComplete;
-
- ///
- /// Fires when either a NavigationPending listener cancels the navigation, or
- /// if the operating system determines that navigation is not possible.
- ///
- public event ExplorerBrowserNavigationFailedEventHandler NavigationFailed;
-
- ///
- /// Fires when the ExplorerBorwser view has finished enumerating files.
- ///
- public event ExplorerBrowserViewEnumerationCompleteHandler ViewEnumerationComplete;
-
- ///
- /// Fires when the item selected in the view has changed (i.e., a rename ).
- /// This is not the same as SelectionChanged.
- ///
- public event ExplorerBrowserViewSelectedItemChangedHandler ViewSelectedItemChanged;
-
- #endregion
-
- #region implementation
-
- #region construction
- internal ExplorerBrowserClass explorerBrowserControl = null;
-
- // for the IExplorerBrowserEvents Advise call
- internal uint eventsCookie = 0;
-
- // name of the property bag that contains the view state options of the browser
- string propertyBagName = typeof(ExplorerBrowser).FullName;
-
- ///
- /// Initializes the ExplorerBorwser WinForms wrapper.
- ///
- public ExplorerBrowser()
- : base()
- {
- NavigationOptions = new ExplorerBrowserNavigationOptions(this);
- ContentOptions = new ExplorerBrowserContentOptions(this);
- NavigationLog = new ExplorerBrowserNavigationLog(this);
- }
-
- #endregion
-
- #region message handlers
-
- ///
- /// Displays a placeholder for the explorer browser in design mode
- ///
- /// Contains information about the paint event.
- protected override void OnPaint(PaintEventArgs e)
- {
- if (DesignMode)
- {
- LinearGradientBrush linGrBrush = new LinearGradientBrush(
- ClientRectangle,
- Color.Aqua,
- Color.CadetBlue,
- LinearGradientMode.ForwardDiagonal);
-
-
- e.Graphics.FillRectangle(linGrBrush, ClientRectangle);
-
- StringFormat sf = new StringFormat();
- sf.Alignment = StringAlignment.Center;
- sf.LineAlignment = StringAlignment.Center;
- e.Graphics.DrawString(
- "ExplorerBrowserControl",
- new Font("Garamond", 30),
- Brushes.White,
- ClientRectangle,
- sf);
- }
-
- base.OnPaint(e);
- }
-
- ShellObject antecreationNavigationTarget = null;
- ExplorerBrowserViewEvents viewEvents = null;
-
- ///
- /// Creates and initializes the native ExplorerBrowser control
- ///
- protected override void OnCreateControl()
- {
- base.OnCreateControl();
-
- HRESULT hr = HRESULT.S_OK;
-
- if (this.DesignMode == false)
- {
- explorerBrowserControl = new ExplorerBrowserClass();
-
- // hooks up IExplorerPaneVisibility and ICommDlgBrowser event notifications
- hr = ExplorerBrowserNativeMethods.IUnknown_SetSite(explorerBrowserControl, this);
-
- // hooks up IExplorerBrowserEvents event notification
- hr = explorerBrowserControl.Advise(
- Marshal.GetComInterfaceForObject(this, typeof(IExplorerBrowserEvents)),
- out eventsCookie);
-
- // sets up ExplorerBrowser view connection point events
- viewEvents = new ExplorerBrowserViewEvents( this );
-
- CoreNativeMethods.RECT rect = new CoreNativeMethods.RECT();
- rect.top = ClientRectangle.Top;
- rect.left = ClientRectangle.Left;
- rect.right = ClientRectangle.Right;
- rect.bottom = ClientRectangle.Bottom;
-
- explorerBrowserControl.Initialize(this.Handle, ref rect, null);
-
- // Force an initial show frames so that IExplorerPaneVisibility works the first time it is set.
- // This also enables the control panel to be browsed to. If it is not set, then navigating to
- // the control panel succeeds, but no items are visible in the view.
- explorerBrowserControl.SetOptions(EXPLORER_BROWSER_OPTIONS.EBO_SHOWFRAMES);
-
- explorerBrowserControl.SetPropertyBag(propertyBagName);
-
- if (antecreationNavigationTarget != null)
- {
- BeginInvoke(new MethodInvoker(
- delegate
- {
- Navigate(antecreationNavigationTarget);
- antecreationNavigationTarget = null;
- }));
- }
- }
-
- Application.AddMessageFilter(this);
- }
-
- ///
- /// Sizes the native control to match the WinForms control wrapper.
- ///
- /// Contains information about the size changed event.
- protected override void OnSizeChanged(EventArgs e)
- {
- if (explorerBrowserControl != null)
- {
- CoreNativeMethods.RECT rect = new CoreNativeMethods.RECT();
- rect.top = ClientRectangle.Top;
- rect.left = ClientRectangle.Left;
- rect.right = ClientRectangle.Right;
- rect.bottom = ClientRectangle.Bottom;
- IntPtr ptr = IntPtr.Zero;
- explorerBrowserControl.SetRect(ref ptr, rect);
- }
-
- base.OnSizeChanged(e);
- }
-
- ///
- /// Cleans up the explorer browser events+object when the window is being taken down.
- ///
- /// An EventArgs that contains event data.
- protected override void OnHandleDestroyed(EventArgs e)
- {
- if (explorerBrowserControl != null)
- {
- // unhook events
- viewEvents.DisconnectFromView( );
- HRESULT hr = explorerBrowserControl.Unadvise(eventsCookie);
- ExplorerBrowserNativeMethods.IUnknown_SetSite(explorerBrowserControl, null);
-
- // destroy the explorer browser control
- explorerBrowserControl.Destroy();
-
- // release com reference to it
- Marshal.ReleaseComObject(explorerBrowserControl);
- explorerBrowserControl = null;
- }
-
- base.OnHandleDestroyed(e);
- }
- #endregion
-
- #region object interfaces
-
- #region IServiceProvider
- HRESULT Microsoft.WindowsAPICodePack.Controls.IServiceProvider.QueryService(
- ref Guid guidService, ref Guid riid, out IntPtr ppvObject)
- {
- HRESULT hr = HRESULT.S_OK;
-
- if (guidService.CompareTo(new Guid(ExplorerBrowserIIDGuid.IExplorerPaneVisibility)) == 0)
- {
- // Responding to this SID allows us to control the visibility of the
- // explorer browser panes
- ppvObject =
- Marshal.GetComInterfaceForObject(this, typeof(IExplorerPaneVisibility));
- hr = HRESULT.S_OK;
- }
- else if (guidService.CompareTo(new Guid(ExplorerBrowserIIDGuid.ICommDlgBrowser)) == 0)
- {
- // Responding to this SID allows us to hook up our ICommDlgBrowser
- // implementation so we get selection change events from the view.
- if (riid.CompareTo(new Guid(ExplorerBrowserIIDGuid.ICommDlgBrowser)) == 0)
- {
- ppvObject = Marshal.GetComInterfaceForObject(this, typeof(ICommDlgBrowser));
- hr = HRESULT.S_OK;
- }
- else
- {
- ppvObject = IntPtr.Zero;
- hr = HRESULT.E_NOINTERFACE;
- }
- }
- else
- {
- IntPtr nullObj = IntPtr.Zero;
- ppvObject = nullObj;
- hr = HRESULT.E_NOINTERFACE;
- }
-
- return hr;
- }
- #endregion
-
- #region IExplorerPaneVisibility
- ///
- /// Controls the visibility of the explorer borwser panes
- ///
- /// a guid identifying the pane
- /// the pane state desired
- ///
- HRESULT IExplorerPaneVisibility.GetPaneState(ref Guid explorerPane, out EXPLORERPANESTATE peps)
- {
- switch (explorerPane.ToString())
- {
- case ExplorerBrowserViewPanes.AdvancedQuery:
- peps = VisibilityToPaneState(NavigationOptions.PaneVisibility.AdvancedQuery);
- break;
- case ExplorerBrowserViewPanes.Commands:
- peps = VisibilityToPaneState(NavigationOptions.PaneVisibility.Commands);
- break;
- case ExplorerBrowserViewPanes.CommandsOrganize:
- peps = VisibilityToPaneState(NavigationOptions.PaneVisibility.CommandsOrganize);
- break;
- case ExplorerBrowserViewPanes.CommandsView:
- peps = VisibilityToPaneState(NavigationOptions.PaneVisibility.CommandsView);
- break;
- case ExplorerBrowserViewPanes.Details:
- peps = VisibilityToPaneState(NavigationOptions.PaneVisibility.Details);
- break;
- case ExplorerBrowserViewPanes.Navigation:
- peps = VisibilityToPaneState(NavigationOptions.PaneVisibility.Navigation);
- break;
- case ExplorerBrowserViewPanes.Preview:
- peps = VisibilityToPaneState(NavigationOptions.PaneVisibility.Preview);
- break;
- case ExplorerBrowserViewPanes.Query:
- peps = VisibilityToPaneState(NavigationOptions.PaneVisibility.Query);
- break;
- default:
-#if LOG_UNKNOWN_PANES
- System.Diagnostics.Debugger.Log( 4, "ExplorerBrowser", "unknown pane view state. id=" + explorerPane.ToString( ) );
-#endif
- peps = VisibilityToPaneState(PaneVisibilityState.Show);
- break;
- }
-
- return HRESULT.S_OK;
- }
-
- private EXPLORERPANESTATE VisibilityToPaneState(PaneVisibilityState visibility)
- {
- switch (visibility)
- {
- case PaneVisibilityState.DontCare:
- return EXPLORERPANESTATE.EPS_DONTCARE;
-
- case PaneVisibilityState.Hide:
- return EXPLORERPANESTATE.EPS_DEFAULT_OFF | EXPLORERPANESTATE.EPS_FORCE;
-
- case PaneVisibilityState.Show:
- return EXPLORERPANESTATE.EPS_DEFAULT_ON | EXPLORERPANESTATE.EPS_FORCE;
-
- default:
- throw new ArgumentException("unexpected PaneVisibilityState");
- }
- }
-
- #endregion
-
- #region IExplorerBrowserEvents
- HRESULT IExplorerBrowserEvents.OnNavigationPending(IntPtr pidlFolder)
- {
- bool canceled = false;
-
- if (NavigationPending != null)
- {
- NavigationPendingEventArgs args = new NavigationPendingEventArgs();
-
- // For some special items (like network machines), ShellObject.FromIDList
- // might return null
- args.PendingLocation = ShellObjectFactory.Create(pidlFolder);
-
- if (args.PendingLocation != null)
- {
- foreach (Delegate del in NavigationPending.GetInvocationList())
- {
- del.DynamicInvoke(new object[] { this, args });
- if (args.Cancel)
- {
- canceled = true;
- }
- }
- }
- }
-
- return canceled ? HRESULT.E_FAIL : HRESULT.S_OK;
- }
-
- HRESULT IExplorerBrowserEvents.OnViewCreated( object psv )
- {
- viewEvents.ConnectToView( (IShellView)psv );
-
- return HRESULT.S_OK;
- }
-
- HRESULT IExplorerBrowserEvents.OnNavigationComplete(IntPtr pidlFolder)
- {
- // view mode may change
- ContentOptions.folderSettings.ViewMode = GetCurrentViewMode();
-
- if (NavigationComplete != null)
- {
- NavigationCompleteEventArgs args = new NavigationCompleteEventArgs();
- args.NewLocation = ShellObjectFactory.Create(pidlFolder);
- NavigationComplete(this, args);
- }
- return HRESULT.S_OK;
- }
-
- HRESULT IExplorerBrowserEvents.OnNavigationFailed(IntPtr pidlFolder)
- {
- if (NavigationFailed != null)
- {
- NavigationFailedEventArgs args = new NavigationFailedEventArgs();
- args.FailedLocation = ShellObjectFactory.Create(pidlFolder);
- NavigationFailed(this, args);
- }
- return HRESULT.S_OK;
- }
- #endregion
-
- #region ICommDlgBrowser
- HRESULT ICommDlgBrowser.OnDefaultCommand(IntPtr ppshv)
- {
- return HRESULT.S_FALSE;
- }
-
- HRESULT ICommDlgBrowser.OnStateChange(IntPtr ppshv, CommDlgBrowserStateChange uChange)
- {
- if( uChange == CommDlgBrowserStateChange.CDBOSC_SELCHANGE )
- FireSelectionChanged( );
-
- return HRESULT.S_OK;
- }
-
- HRESULT ICommDlgBrowser.IncludeObject(IntPtr ppshv, IntPtr pidl)
- {
- // items in the view have changed, so the collections need updating
- FireContentChanged( );
-
- return HRESULT.S_OK;
- }
-
- #endregion
-
- #region IMessageFilter Members
-
- bool IMessageFilter.PreFilterMessage(ref Message m)
- {
- HRESULT hr = HRESULT.S_FALSE;
- if (explorerBrowserControl != null)
- {
- // translate keyboard input
- hr = ((IInputObject)explorerBrowserControl).TranslateAcceleratorIO(ref m);
- }
- return (hr == HRESULT.S_OK);
- }
-
- #endregion
-
- #endregion
-
- #region utilities
-
- ///
- /// Returns the current view mode of the browser
- ///
- ///
- internal FOLDERVIEWMODE GetCurrentViewMode()
- {
- IFolderView2 ifv2 = GetFolderView2();
- uint viewMode = 0;
- if (ifv2 != null)
- {
- try
- {
- HRESULT hr = ifv2.GetCurrentViewMode(out viewMode);
- if (hr != HRESULT.S_OK)
- throw Marshal.GetExceptionForHR((int)hr);
- }
- finally
- {
- Marshal.ReleaseComObject(ifv2);
- ifv2 = null;
- }
- }
- return (FOLDERVIEWMODE)viewMode;
- }
-
- ///
- /// Gets the IFolderView2 interface from the explorer browser.
- ///
- ///
- internal IFolderView2 GetFolderView2()
- {
- Guid iid = new Guid(ExplorerBrowserIIDGuid.IFolderView2);
- IntPtr view = IntPtr.Zero;
- if (this.explorerBrowserControl != null)
- {
- HRESULT hr = this.explorerBrowserControl.GetCurrentView(ref iid, out view);
- switch (hr)
- {
- case HRESULT.S_OK:
- break;
-
- case HRESULT.E_NOINTERFACE:
- case HRESULT.E_FAIL:
-#if LOG_KNOWN_COM_ERRORS
- Debugger.Log( 2, "ExplorerBrowser", "Unable to obtain view. Error=" + e.ToString( ) );
-#endif
- return null;
-
- default:
- throw new COMException("ExplorerBrowser failed to get current view.", (int)hr);
- }
-
- return (IFolderView2)Marshal.GetObjectForIUnknown(view);
- }
- else
- {
- return null;
- }
- }
-
- ///
- /// Gets the selected items in the explorer browser as an IShellItemArray
- ///
- ///
- internal IShellItemArray GetSelectedItemsArray()
- {
- IShellItemArray iArray = null;
- IFolderView2 iFV2 = GetFolderView2();
- if (iFV2 != null)
- {
- try
- {
- Guid iidShellItemArray = new Guid(ShellIIDGuid.IShellItemArray);
- object oArray = null;
- HRESULT hr = iFV2.Items((uint)SVGIO.SVGIO_SELECTION, ref iidShellItemArray, out oArray);
- iArray = oArray as IShellItemArray;
- if (hr != HRESULT.S_OK &&
- hr != HRESULT.E_ELEMENTNOTFOUND &&
- hr != HRESULT.E_FAIL)
- {
- throw new COMException("unexpected error retrieving selection", (int)hr);
- }
- }
- finally
- {
- Marshal.ReleaseComObject(iFV2);
- iFV2 = null;
- }
- }
-
- return iArray;
- }
-
- internal int GetItemsCount()
- {
- int itemsCount = 0;
-
- IFolderView2 iFV2 = GetFolderView2();
- if (iFV2 != null)
- {
- try
- {
- HRESULT hr = iFV2.ItemCount((uint)SVGIO.SVGIO_ALLVIEW, out itemsCount);
-
- if (hr != HRESULT.S_OK &&
- hr != HRESULT.E_ELEMENTNOTFOUND &&
- hr != HRESULT.E_FAIL)
- {
- throw new COMException("unexpected error retrieving item count", (int)hr);
- }
- }
- finally
- {
- Marshal.ReleaseComObject(iFV2);
- iFV2 = null;
- }
- }
-
- return itemsCount;
- }
-
- internal int GetSelectedItemsCount()
- {
- int itemsCount = 0;
-
- IFolderView2 iFV2 = GetFolderView2();
- if (iFV2 != null)
- {
- try
- {
- HRESULT hr = iFV2.ItemCount((uint)SVGIO.SVGIO_SELECTION, out itemsCount);
-
- if( hr != HRESULT.S_OK &&
- hr != HRESULT.E_ELEMENTNOTFOUND &&
- hr != HRESULT.E_FAIL )
- {
- throw new COMException( "unexpected error retrieving selected item count", (int)hr );
- }
- }
- finally
- {
- Marshal.ReleaseComObject(iFV2);
- iFV2 = null;
- }
- }
-
- return itemsCount;
- }
-
- ///
- /// Gets the items in the ExplorerBrowser as an IShellItemArray
- ///
- ///
- internal IShellItemArray GetItemsArray()
- {
- IShellItemArray iArray = null;
- IFolderView2 iFV2 = GetFolderView2();
- if (iFV2 != null)
- {
- try
- {
- Guid iidShellItemArray = new Guid(ShellIIDGuid.IShellItemArray);
- object oArray = null;
- HRESULT hr = iFV2.Items((uint)SVGIO.SVGIO_ALLVIEW, ref iidShellItemArray, out oArray);
- if (hr != HRESULT.S_OK &&
- hr != HRESULT.E_FAIL &&
- hr != HRESULT.E_ELEMENTNOTFOUND &&
- hr != HRESULT.E_INVALIDARG)
- {
- throw new COMException("unexpected error retrieving view items", (int)hr);
- }
-
- iArray = oArray as IShellItemArray;
- }
- finally
- {
- Marshal.ReleaseComObject(iFV2);
- iFV2 = null;
- }
- }
- return iArray;
- }
-
- #endregion
-
- #region view event forwarding
- internal void FireSelectionChanged( )
- {
- if( SelectionChanged != null )
- SelectionChanged.Invoke( this, EventArgs.Empty );
- }
-
- internal void FireContentChanged( )
- {
- if( ItemsChanged != null )
- ItemsChanged.Invoke( this, EventArgs.Empty );
- }
-
- internal void FireContentEnumerationComplete( )
- {
- if( ViewEnumerationComplete != null )
- ViewEnumerationComplete.Invoke( this, EventArgs.Empty );
- }
-
- internal void FireSelectedItemChanged( )
- {
- if( ViewSelectedItemChanged != null )
- ViewSelectedItemChanged.Invoke( this, EventArgs.Empty );
- }
- #endregion
-
- #endregion
- }
-
-}
diff --git a/src/External/WindowsAPICodePack/Shell/ExplorerBrowser/ExplorerBrowserContentOptions.cs b/src/External/WindowsAPICodePack/Shell/ExplorerBrowser/ExplorerBrowserContentOptions.cs
deleted file mode 100644
index ec9199f..0000000
--- a/src/External/WindowsAPICodePack/Shell/ExplorerBrowser/ExplorerBrowserContentOptions.cs
+++ /dev/null
@@ -1,325 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Runtime.InteropServices;
-using System.Diagnostics;
-using MS.WindowsAPICodePack.Internal;
-using Microsoft.WindowsAPICodePack.Controls.WindowsForms;
-
-namespace Microsoft.WindowsAPICodePack.Controls
-{
- ///
- /// These options control how the content of the Explorer Browser
- /// is rendered.
- ///
- public class ExplorerBrowserContentOptions
- {
- #region construction
- ExplorerBrowser eb;
- internal ExplorerBrowserContentOptions( ExplorerBrowser eb )
- {
- this.eb = eb;
- }
- #endregion
-
- #region ViewMode property
- // This is a one-way property of the explorer browser.
- // Keeping it around for the get implementations.
- internal FOLDERSETTINGS folderSettings = new FOLDERSETTINGS( );
-
- ///
- /// The viewing mode of the Explorer Browser
- ///
- public ExplorerBrowserViewMode ViewMode
- {
- get
- {
- return (ExplorerBrowserViewMode)folderSettings.ViewMode;
- }
- set
- {
- folderSettings.ViewMode = (FOLDERVIEWMODE)value;
- HRESULT hr = HRESULT.S_OK;
- if( eb.explorerBrowserControl != null )
- hr = eb.explorerBrowserControl.SetFolderSettings( folderSettings );
- }
- }
- #endregion
-
- #region Flags property
- ///
- /// The binary representation of the ExplorerBrowser content flags
- ///
- public ExplorerBrowserContentFlags Flags
- {
- get
- {
- return (ExplorerBrowserContentFlags)folderSettings.fFlags;
- }
- set
- {
- folderSettings.fFlags = (FOLDERFLAGS)value | FOLDERFLAGS.FWF_USESEARCHFOLDER | FOLDERFLAGS.FWF_NOWEBVIEW;
- if( eb.explorerBrowserControl != null )
- eb.explorerBrowserControl.SetFolderSettings( folderSettings );
- }
- }
- #endregion
-
- #region content flags to properties mapping
- ///
- /// The view should be left-aligned.
- ///
- public bool AlignLeft
- {
- get
- {
- return IsFlagSet( ExplorerBrowserContentFlags.AlignLeft );
- }
- set
- {
- SetFlag( ExplorerBrowserContentFlags.AlignLeft, value );
- }
- }
- ///
- /// Automatically arrange the elements in the view.
- ///
- public bool AutoArrange
- {
- get
- {
- return IsFlagSet( ExplorerBrowserContentFlags.AutoArrange );
- }
- set
- {
- SetFlag( ExplorerBrowserContentFlags.AutoArrange, value );
- }
- }
- ///
- /// Turns on check mode for the view
- ///
- public bool CheckSelect
- {
- get
- {
- return IsFlagSet( ExplorerBrowserContentFlags.CheckSelect );
- }
- set
- {
- SetFlag( ExplorerBrowserContentFlags.CheckSelect, value );
- }
- }
- ///
- /// When the view is in "tile view mode" the layout of a single item should be extended to the width of the view.
- ///
- public bool ExtendedTiles
- {
- get
- {
- return IsFlagSet( ExplorerBrowserContentFlags.ExtendedTiles );
- }
- set
- {
- SetFlag( ExplorerBrowserContentFlags.ExtendedTiles, value );
- }
- }
- ///
- /// When an item is selected, the item and all its sub-items are highlighted.
- ///
- public bool FullRowSelect
- {
- get
- {
- return IsFlagSet( ExplorerBrowserContentFlags.FullRowSelect );
- }
- set
- {
- SetFlag( ExplorerBrowserContentFlags.FullRowSelect, value );
- }
- }
- ///
- /// The view should not display file names
- ///
- public bool HideFileNames
- {
- get
- {
- return IsFlagSet( ExplorerBrowserContentFlags.HideFileNames );
- }
- set
- {
- SetFlag( ExplorerBrowserContentFlags.HideFileNames, value );
- }
- }
- ///
- /// The view should not save view state in the browser.
- ///
- public bool NoBrowserViewState
- {
- get
- {
- return IsFlagSet( ExplorerBrowserContentFlags.NoBrowserViewState );
- }
- set
- {
- SetFlag( ExplorerBrowserContentFlags.NoBrowserViewState, value );
- }
- }
- ///
- /// Do not display a column header in the view in any view mode.
- ///
- public bool NoColumnHeader
- {
- get
- {
- return IsFlagSet( ExplorerBrowserContentFlags.NoColumnHeader );
- }
- set
- {
- SetFlag( ExplorerBrowserContentFlags.NoColumnHeader, value );
- }
- }
- ///
- /// Only show the column header in details view mode.
- ///
- public bool NoHeaderInAllViews
- {
- get
- {
- return IsFlagSet( ExplorerBrowserContentFlags.NoHeaderInAllViews );
- }
- set
- {
- SetFlag( ExplorerBrowserContentFlags.NoHeaderInAllViews, value );
- }
- }
- ///
- /// The view should not display icons.
- ///
- public bool NoIcons
- {
- get
- {
- return IsFlagSet( ExplorerBrowserContentFlags.NoIcons );
- }
- set
- {
- SetFlag( ExplorerBrowserContentFlags.NoIcons, value );
- }
- }
- ///
- /// Do not show subfolders.
- ///
- public bool NoSubfolders
- {
- get
- {
- return IsFlagSet( ExplorerBrowserContentFlags.NoSubfolders );
- }
- set
- {
- SetFlag( ExplorerBrowserContentFlags.NoSubfolders, value );
- }
- }
- ///
- /// Navigate with a single click
- ///
- public bool SingleClickActivate
- {
- get
- {
- return IsFlagSet( ExplorerBrowserContentFlags.SingleClickActivate );
- }
- set
- {
- SetFlag( ExplorerBrowserContentFlags.SingleClickActivate, value );
- }
- }
- ///
- /// Do not allow more than a single item to be selected.
- ///
- public bool SingleSelection
- {
- get
- {
- return IsFlagSet( ExplorerBrowserContentFlags.SingleSelection );
- }
- set
- {
- SetFlag( ExplorerBrowserContentFlags.SingleSelection, value );
- }
- }
-
- private bool IsFlagSet( ExplorerBrowserContentFlags flag )
- {
- return ( folderSettings.fFlags & (FOLDERFLAGS)flag ) != 0;
- }
-
- private void SetFlag( ExplorerBrowserContentFlags flag, bool value )
- {
- if( value )
- folderSettings.fFlags |= (FOLDERFLAGS)flag;
- else
- folderSettings.fFlags = folderSettings.fFlags & ~(FOLDERFLAGS)flag;
-
- if( eb.explorerBrowserControl != null )
- eb.explorerBrowserControl.SetFolderSettings( folderSettings );
- }
-
- #endregion
-
- #region thumbnail size
- ///
- /// The size of the thumbnails in pixels
- ///
- public int ThumbnailSize
- {
- get
- {
- int iconSize = 0;
- IFolderView2 iFV2 = eb.GetFolderView2( );
- if( iFV2 != null )
- {
- try
- {
- int fvm = 0;
- HRESULT hr = iFV2.GetViewModeAndIconSize( out fvm, out iconSize );
- if( hr != HRESULT.S_OK )
- throw new COMException("unable to get icon size", (int)hr );
- }
- finally
- {
- Marshal.ReleaseComObject( iFV2 );
- iFV2 = null;
- }
- }
-
- return iconSize;
- }
- set
- {
- IFolderView2 iFV2 = eb.GetFolderView2( );
- if( iFV2 != null )
- {
- try
- {
- int fvm = 0;
- int iconSize = 0;
- HRESULT hr = iFV2.GetViewModeAndIconSize( out fvm, out iconSize );
- if( hr != HRESULT.S_OK )
- throw new COMException( "unable to get icon size", (int)hr );
- hr = iFV2.SetViewModeAndIconSize( fvm, value );
- if( hr != HRESULT.S_OK )
- throw new COMException( "unable to set icon size", (int)hr );
- }
- finally
- {
- Marshal.ReleaseComObject( iFV2 );
- iFV2 = null;
- }
- }
- }
- }
- #endregion
- }
-
-}
diff --git a/src/External/WindowsAPICodePack/Shell/ExplorerBrowser/ExplorerBrowserDiagram.cd b/src/External/WindowsAPICodePack/Shell/ExplorerBrowser/ExplorerBrowserDiagram.cd
deleted file mode 100644
index 5188dd1..0000000
--- a/src/External/WindowsAPICodePack/Shell/ExplorerBrowser/ExplorerBrowserDiagram.cd
+++ /dev/null
@@ -1,94 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- AADgIAAAIAgBOAEAAABAQAAAAEAACAAGAAAQcACAAAA=
- ExplorerBrowser\ExplorerBrowser.cs
-
-
-
-
-
-
-
-
-
-
- AAAABAAAAAoIAgEAAggAEAAgEQAAAAACABJAAAUAAAA=
- ExplorerBrowser\ExplorerBrowserContentOptions.cs
-
-
-
-
-
-
-
-
- AABAggAAAAgJAAAAAACAABAAAAAAAAwFAAQAQAAAQBA=
- ExplorerBrowser\ExplorerBrowserPaneVisibility.cs
-
-
-
-
-
-
-
-
- AAAAAAAAAAAAABAAAAIgAAEAAAAAAABAAAAQAAAAAAQ=
- ExplorerBrowser\ExplorerBrowserNavigationLog.cs
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- AAAABAAIAAAIAAAAEAACAAAgAAAAAAAAACAAAAAAAAA=
- ExplorerBrowser\ExplorerBrowserNavigationOptions.cs
-
-
-
-
-
- AAAAAAAAQAAAAAAAAAAAAAAAAAAAABAAAAAAAAAgAAA=
- ExplorerBrowser\ExplorerBrowserEvents.cs
-
-
-
-
-
- AAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
- ExplorerBrowser\ExplorerBrowserEvents.cs
-
-
-
-
-
- AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAA=
- ExplorerBrowser\ExplorerBrowserEvents.cs
-
-
-
-
\ No newline at end of file
diff --git a/src/External/WindowsAPICodePack/Shell/ExplorerBrowser/ExplorerBrowserEnums.cs b/src/External/WindowsAPICodePack/Shell/ExplorerBrowser/ExplorerBrowserEnums.cs
deleted file mode 100644
index 2479401..0000000
--- a/src/External/WindowsAPICodePack/Shell/ExplorerBrowser/ExplorerBrowserEnums.cs
+++ /dev/null
@@ -1,159 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-
-namespace Microsoft.WindowsAPICodePack.Controls
-{
- ///
- /// Indicates the viewing mode of the explorer browser
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1008:EnumsShouldHaveZeroValue", Justification = "This is following the native API")]
- public enum ExplorerBrowserViewMode
- {
- ///
- /// Choose the best view mode for the folder
- ///
- Auto = -1,
-
- ///
- /// (New for Windows7)
- ///
- Content = 8,
-
- ///
- /// Object names and other selected information, such as the size or date last updated, are shown.
- ///
- Details = 4,
-
- ///
- /// The view should display medium-size icons.
- ///
- Icon = 1,
-
- ///
- /// Object names are displayed in a list view.
- ///
- List = 3,
-
- ///
- /// The view should display small icons.
- ///
- SmallIcon = 2,
-
- ///
- /// The view should display thumbnail icons.
- ///
- Thumbnail = 5,
-
- ///
- /// The view should display icons in a filmstrip format.
- ///
- ThumbStrip = 7,
-
- ///
- /// The view should display large icons.
- ///
- Tile = 6
- }
-
- ///
- /// Specifies the options that control subsequent navigation.
- /// Typically use one, or a bitwise combination of these
- /// flags to specify how the explorer browser navigates.
- ///
- [Flags]
- public enum ExplorerBrowserNavigationFlags
- {
- ///
- /// Always navigate, even if you are attempting to navigate to the current folder.
- ///
- AlwaysNavigate = 0x00000004,
-
- ///
- /// Do not navigate further than the initial navigation.
- ///
- NavigateOnce = 0x00000001,
- }
-
- ///
- /// Indicates the content options of the explorer browser.
- /// Typically use one, or a bitwise combination of these
- /// flags to specify how conent should appear in the
- /// explorer browser control
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2217:DoNotMarkEnumsWithFlags", Justification = "This is following the native API"), Flags]
- public enum ExplorerBrowserContentFlags : uint
- {
- ///
- /// The view should be left-aligned.
- ///
- AlignLeft = 0x00000800,
- ///
- /// Automatically arrange the elements in the view.
- ///
- AutoArrange = 0x00000001,
- ///
- /// Turns on check mode for the view
- ///
- CheckSelect = 0x08040000,
- ///
- /// When the view is set to "Tile" the layout of a single item should be extended to the width of the view.
- ///
- ExtendedTiles = 0x02000000,
- ///
- /// When an item is selected, the item and all its sub-items are highlighted.
- ///
- FullRowSelect = 0x00200000,
- ///
- /// The view should not display file names
- ///
- HideFileNames = 0x00020000,
- ///
- /// The view should not save view state in the browser.
- ///
- NoBrowserViewState = 0x10000000,
- ///
- /// Do not display a column header in the view in any view mode.
- ///
- NoColumnHeader = 0x00800000,
- ///
- /// Only show the column header in details view mode.
- ///
- NoHeaderInAllViews = 0x01000000,
- ///
- /// The view should not display icons.
- ///
- NoIcons = 0x00001000,
- ///
- /// Do not show subfolders.
- ///
- NoSubfolders = 0x00000080,
- ///
- /// Navigate with a single click
- ///
- SingleClickActivate = 0x00008000,
- ///
- /// Do not allow more than a single item to be selected.
- ///
- SingleSelection = 0x00000040,
- }
-
- ///
- /// Indicates the visibility state of an ExplorerBrowser pane
- ///
- public enum PaneVisibilityState
- {
- ///
- /// Allow the explorer browser to determine if this pane is displayed.
- ///
- DontCare,
- ///
- /// Hide the pane
- ///
- Hide,
- ///
- /// Show the pane
- ///
- Show
- }
-}
\ No newline at end of file
diff --git a/src/External/WindowsAPICodePack/Shell/ExplorerBrowser/ExplorerBrowserEvents.cs b/src/External/WindowsAPICodePack/Shell/ExplorerBrowser/ExplorerBrowserEvents.cs
deleted file mode 100644
index 7a926a2..0000000
--- a/src/External/WindowsAPICodePack/Shell/ExplorerBrowser/ExplorerBrowserEvents.cs
+++ /dev/null
@@ -1,118 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using Microsoft.WindowsAPICodePack.Shell;
-
-namespace Microsoft.WindowsAPICodePack.Controls
-{
- ///
- /// Fires when the SelectedItems collection changes.
- ///
- ///
- ///
- public delegate void ExplorerBrowserSelectionChangedEventHandler( object sender, EventArgs e );
-
- ///
- /// Fires when the Items colection changes.
- ///
- ///
- ///
- public delegate void ExplorerBrowserItemsChangedEventHandler( object sender, EventArgs e ) ;
-
- ///
- /// Fires when a navigation has been initiated, but is not yet complete.
- ///
- ///
- ///
- public delegate void ExplorerBrowserNavigationPendingEventHandler( object sender, NavigationPendingEventArgs e );
-
- ///
- /// Fires when a navigation has been 'completed': no NavigationPending listener
- /// has cancelled, and the ExplorerBorwser has created a new view. The view
- /// will be populated with new items asynchronously, and ItemsChanged will be
- /// fired to reflect this some time later.
- ///
- ///
- ///
- public delegate void ExplorerBrowserNavigationCompleteEventHandler( object sender, NavigationCompleteEventArgs e );
-
- ///
- /// Fires when either a NavigationPending listener cancels the navigation, or
- /// if the operating system determines that navigation is not possible.
- ///
- ///
- ///
- public delegate void ExplorerBrowserNavigationFailedEventHandler( object sender, NavigationFailedEventArgs e );
-
- ///
- /// Fires when the ExplorerBorwser view has finished enumerating files.
- ///
- /// the explorer borwser
- /// empty
- public delegate void ExplorerBrowserViewEnumerationCompleteHandler( object sender, EventArgs e );
-
- ///
- /// Fires when the item selected in the view has changed (i.e., a rename ).
- /// This is not the same as SelectionChanged.
- ///
- /// the explorer borwser
- /// empty
- public delegate void ExplorerBrowserViewSelectedItemChangedHandler( object sender, EventArgs e );
-
-
-
- ///
- /// Event argument for The NavigationPending event
- ///
- public class NavigationPendingEventArgs : EventArgs
- {
- ///
- /// The location being navigated to
- ///
- public ShellObject PendingLocation
- {
- get;
- set;
- }
-
- ///
- /// Set to 'True' to cancel the navigation.
- ///
- public bool Cancel
- {
- get;
- set;
- }
-
- }
-
- ///
- /// Event argument for The NavigationComplete event
- ///
- public class NavigationCompleteEventArgs : EventArgs
- {
- ///
- /// The new location of the explorer browser
- ///
- public ShellObject NewLocation
- {
- get;
- set;
- }
- }
-
- ///
- /// Event argument for the NavigatinoFailed event
- ///
- public class NavigationFailedEventArgs : EventArgs
- {
- ///
- /// The location the the browser would have navigated to.
- ///
- public ShellObject FailedLocation
- {
- get;
- set;
- }
- }
-}
\ No newline at end of file
diff --git a/src/External/WindowsAPICodePack/Shell/ExplorerBrowser/ExplorerBrowserPaneVisibility.cs b/src/External/WindowsAPICodePack/Shell/ExplorerBrowser/ExplorerBrowserPaneVisibility.cs
deleted file mode 100644
index 195c258..0000000
--- a/src/External/WindowsAPICodePack/Shell/ExplorerBrowser/ExplorerBrowserPaneVisibility.cs
+++ /dev/null
@@ -1,146 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-
-namespace Microsoft.WindowsAPICodePack.Controls
-{
- ///
- /// Controls the visibility of the various ExplorerBrowser panes on subsequent navigation
- ///
- public class ExplorerBrowserPaneVisibility
- {
- ///
- /// The pane on the left side of the Windows Explorer window that hosts the folders tree and Favorites.
- ///
- public PaneVisibilityState Navigation
- {
- get
- {
- return _Navigation;
- }
- set
- {
- _Navigation = value;
- }
- }
- private PaneVisibilityState _Navigation = PaneVisibilityState.DontCare;
-
- ///
- /// Commands module along the top of the Windows Explorer window.
- ///
- public PaneVisibilityState Commands
- {
- get
- {
- return _Commands;
- }
- set
- {
- _Commands = value;
- }
- }
- private PaneVisibilityState _Commands = PaneVisibilityState.DontCare;
-
- ///
- /// Organize menu within the commands module.
- ///
- public PaneVisibilityState CommandsOrganize
- {
- get
- {
- return _CommandsOrganize;
- }
- set
- {
- _CommandsOrganize = value;
- }
- }
- private PaneVisibilityState _CommandsOrganize = PaneVisibilityState.DontCare;
-
-
- ///
- /// View menu within the commands module.
- ///
- public PaneVisibilityState CommandsView
- {
- get
- {
- return _CommandsView;
- }
- set
- {
- _CommandsView = value;
- }
- }
- private PaneVisibilityState _CommandsView = PaneVisibilityState.DontCare;
-
-
- ///
- /// Pane showing metadata along the bottom of the Windows Explorer window.
- ///
- public PaneVisibilityState Details
- {
- get
- {
- return _Details;
- }
- set
- {
- _Details = value;
- }
- }
- private PaneVisibilityState _Details = PaneVisibilityState.DontCare;
-
-
- ///
- /// Pane on the right of the Windows Explorer window that shows a large reading preview of the file.
- ///
- public PaneVisibilityState Preview
- {
- get
- {
- return _Preview;
- }
- set
- {
- _Preview = value;
- }
- }
- private PaneVisibilityState _Preview = PaneVisibilityState.DontCare;
-
-
- ///
- /// Quick filter buttons to aid in a search.
- ///
- public PaneVisibilityState Query
- {
- get
- {
- return _Query;
- }
- set
- {
- _Query = value;
- }
- }
- private PaneVisibilityState _Query = PaneVisibilityState.DontCare;
-
-
- ///
- /// Additional fields and options to aid in a search.
- ///
- public PaneVisibilityState AdvancedQuery
- {
- get
- {
- return _AdvancedQuery;
- }
- set
- {
- _AdvancedQuery = value;
- }
- }
- private PaneVisibilityState _AdvancedQuery = PaneVisibilityState.DontCare;
-
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/ExplorerBrowser/ExplorerBrowserViewEvents.cs b/src/External/WindowsAPICodePack/Shell/ExplorerBrowser/ExplorerBrowserViewEvents.cs
deleted file mode 100644
index 2f519a4..0000000
--- a/src/External/WindowsAPICodePack/Shell/ExplorerBrowser/ExplorerBrowserViewEvents.cs
+++ /dev/null
@@ -1,121 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Runtime.InteropServices;
-using Microsoft.WindowsAPICodePack.Controls.WindowsForms;
-using Microsoft.WindowsAPICodePack.Controls;
-
-namespace MS.WindowsAPICodePack.Internal
-{
- ///
- /// This provides a connection point container compatible dispatch interface for
- /// hooking into the ExplorerBrowser view.
- ///
- [ComVisible( true )]
- [ClassInterface( ClassInterfaceType.AutoDual )]
- public class ExplorerBrowserViewEvents
- {
- #region implementation
- private uint viewConnectionPointCookie = 0;
- private object viewDispatch = null;
- private IntPtr nullPtr = IntPtr.Zero;
-
- private Guid IID_DShellFolderViewEvents = new Guid( ExplorerBrowserIIDGuid.DShellFolderViewEvents );
- private Guid IID_IDispatch = new Guid( ExplorerBrowserIIDGuid.IDispatch );
- private ExplorerBrowser parent = null;
- #endregion
-
- #region contstruction
- internal ExplorerBrowserViewEvents( ExplorerBrowser parent )
- {
- this.parent = parent;
- }
- #endregion
-
- #region operations
- internal void ConnectToView( IShellView psv )
- {
- DisconnectFromView( );
-
- HRESULT hr = psv.GetItemObject(
- SVGIO.SVGIO_BACKGROUND,
- ref IID_IDispatch,
- out viewDispatch );
-
- if( hr == HRESULT.S_OK )
- {
- hr = ExplorerBrowserNativeMethods.ConnectToConnectionPoint(
- this,
- ref IID_DShellFolderViewEvents,
- true,
- viewDispatch,
- ref viewConnectionPointCookie,
- ref nullPtr );
-
- if( hr != HRESULT.S_OK )
- {
- Marshal.ReleaseComObject( viewDispatch );
- }
- }
- }
-
- internal void DisconnectFromView( )
- {
- if( viewDispatch != null )
- {
- ExplorerBrowserNativeMethods.ConnectToConnectionPoint(
- IntPtr.Zero,
- ref IID_DShellFolderViewEvents,
- false,
- viewDispatch,
- ref viewConnectionPointCookie,
- ref nullPtr );
-
- Marshal.ReleaseComObject( viewDispatch );
- viewDispatch = null;
- viewConnectionPointCookie = 0;
- }
- }
- #endregion
-
- #region IDispatch events
- // These need to be public to be accessible via AutoDual reflection
-
- ///
- /// The view selection has changed
- ///
- [DispId( ExplorerBrowserViewDispatchIds.SelectionChanged )]
- public void ViewSelectionChanged( )
- {
- parent.FireSelectionChanged( );
- }
-
- ///
- /// The contents of the view have changed
- ///
- [DispId( ExplorerBrowserViewDispatchIds.ContentsChanged )]
- public void ViewContentsChanged( )
- {
- parent.FireContentChanged( );
- }
-
- ///
- /// The enumeration of files in the view is complete
- ///
- [DispId( ExplorerBrowserViewDispatchIds.FileListEnumDone )]
- public void ViewFileListEnumDone( )
- {
- parent.FireContentEnumerationComplete( );
- }
-
- ///
- /// The selected item in the view has changed (not the same as the selection has changed)
- ///
- [DispId( ExplorerBrowserViewDispatchIds.SelectedItemChanged )]
- public void ViewSelectedItemChanged( )
- {
- parent.FireSelectedItemChanged( );
- }
- #endregion
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/ExplorerBrowser/NavigationLog.cs b/src/External/WindowsAPICodePack/Shell/ExplorerBrowser/NavigationLog.cs
deleted file mode 100644
index 3ff26fe..0000000
--- a/src/External/WindowsAPICodePack/Shell/ExplorerBrowser/NavigationLog.cs
+++ /dev/null
@@ -1,259 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Collections.Generic;
-using Microsoft.WindowsAPICodePack.Controls.WindowsForms;
-using Microsoft.WindowsAPICodePack.Shell;
-
-namespace Microsoft.WindowsAPICodePack.Controls
-{
-
- ///
- /// The navigation log is a history of the locations visited by the explorer browser.
- ///
- public class ExplorerBrowserNavigationLog
- {
- #region operations
- ///
- /// Clears the contents of the navigation log.
- ///
- public void ClearLog( )
- {
- // nothing to do
- if( Locations.Count == 0 )
- return;
-
- bool oldCanNavigateBackward = CanNavigateBackward;
- bool oldCanNavigateForward = CanNavigateForward;
-
- Locations.Clear( );
- this.currentLocationIndex = -1;
-
- NavigationLogEventArgs args = new NavigationLogEventArgs( );
- args.LocationsChanged = true;
- args.CanNavigateBackwardChanged = ( oldCanNavigateBackward != CanNavigateBackward );
- args.CanNavigateForwardChanged = ( oldCanNavigateForward != CanNavigateForward );
- if( NavigationLogChanged != null )
- NavigationLogChanged( this, args );
- }
- #endregion
-
- #region properties
- ///
- /// Indicates the presence of locations in the log that can be
- /// reached by calling Navigate(Forward)
- ///
- public bool CanNavigateForward
- {
- get
- {
- return (CurrentLocationIndex < (Locations.Count - 1));
- }
- }
-
- ///
- /// Indicates the presence of locations in the log that can be
- /// reached by calling Navigate(Backward)
- ///
- public bool CanNavigateBackward
- {
- get
- {
- return ( CurrentLocationIndex >= 1 );
- }
- }
-
- ///
- /// The navigation log
- ///
- public List Locations
- {
- get;
- private set;
- }
-
- ///
- /// An index into the Locations collection. The ShellObject pointed to
- /// by this index is the current location of the ExplorerBrowser.
- ///
- public int CurrentLocationIndex
- {
- get
- {
- return currentLocationIndex;
- }
- }
-
-
- ///
- /// Gets the shell object in the Locations collection pointed to
- /// by CurrentLocationIndex.
- ///
- public ShellObject CurrentLocation
- {
- get
- {
- if( currentLocationIndex < 0 )
- return null;
-
- return Locations[currentLocationIndex];
- }
- }
- #endregion
-
- #region events
- ///
- /// Fires when the navigation log changes or
- /// the current navigation position changes
- ///
- public event NavigationLogChangedEventHandler NavigationLogChanged;
- #endregion
-
- #region implementation
-
- private ExplorerBrowser parent = null;
-
- ///
- /// The pending navigation log action. null if the user is not navigating
- /// via the navigation log.
- ///
- private PendingNavigation pendingNavigation = null;
-
- ///
- /// The index into the Locations collection. -1 if the Locations colleciton
- /// is empty.
- ///
- private int currentLocationIndex = -1;
-
- internal ExplorerBrowserNavigationLog( ExplorerBrowser parent )
- {
- if( parent == null )
- throw new ArgumentException( "parent can not be null!" );
-
- //
- Locations = new List();
-
- // Hook navigation events from the parent to distinguish between
- // navigation log induced navigation, and other navigations.
- this.parent = parent;
- this.parent.NavigationComplete += new ExplorerBrowserNavigationCompleteEventHandler( OnNavigationComplete );
- this.parent.NavigationFailed += new ExplorerBrowserNavigationFailedEventHandler( OnNavigationFailed );
- }
-
- private void OnNavigationFailed( object sender, NavigationFailedEventArgs args )
- {
- pendingNavigation = null;
- }
-
- private void OnNavigationComplete( object sender, NavigationCompleteEventArgs args )
- {
- NavigationLogEventArgs eventArgs = new NavigationLogEventArgs( );
- bool oldCanNavigateBackward = CanNavigateBackward;
- bool oldCanNavigateForward = CanNavigateForward;
-
- if( ( pendingNavigation != null ) )
- {
- // navigation log traversal in progress
-
- // determine if new location is the same as the traversal request
- int result = 0;
- pendingNavigation.location.NativeShellItem.Compare(
- args.NewLocation.NativeShellItem, SICHINTF.SICHINT_ALLFIELDS, out result );
- bool shellItemsEqual = ( result == 0 );
- if( shellItemsEqual == false )
- {
- // new location is different than traversal request,
- // behave is if it never happened!
- // remove history following currentLocationIndex, append new item
- if( currentLocationIndex < ( Locations.Count - 1 ) )
- Locations.RemoveRange( (int)currentLocationIndex + 1, (int)( Locations.Count - ( currentLocationIndex + 1 ) ) );
- Locations.Add( args.NewLocation );
- currentLocationIndex = (Locations.Count - 1);
- eventArgs.LocationsChanged = true;
- }
- else
- {
- // log traversal successful, update index
- currentLocationIndex = (int)pendingNavigation.index;
- eventArgs.LocationsChanged = false;
- }
- pendingNavigation = null;
- }
- else
- {
- // remove history following currentLocationIndex, append new item
- if( currentLocationIndex < (Locations.Count - 1) )
- Locations.RemoveRange( (int)currentLocationIndex + 1, (int)( Locations.Count - (currentLocationIndex + 1)) );
- Locations.Add( args.NewLocation );
- currentLocationIndex = (Locations.Count - 1);
- eventArgs.LocationsChanged = true;
- }
-
- // update event args
- eventArgs.CanNavigateBackwardChanged = ( oldCanNavigateBackward != CanNavigateBackward );
- eventArgs.CanNavigateForwardChanged = ( oldCanNavigateForward != CanNavigateForward );
-
- if( NavigationLogChanged != null )
- NavigationLogChanged( this, eventArgs );
- }
-
- internal bool NavigateLog( NavigationLogDirection direction )
- {
- // determine proper index to navigate to
- int locationIndex = 0;
- if( (direction == NavigationLogDirection.Backward) && CanNavigateBackward )
- {
- locationIndex = (currentLocationIndex - 1);
- }
- else if( (direction == NavigationLogDirection.Forward) && CanNavigateForward )
- {
- locationIndex = (currentLocationIndex + 1);
- }
- else
- {
- return false;
- }
-
- // initiate traversal request
- ShellObject location = Locations[ (int)locationIndex ];
- pendingNavigation = new PendingNavigation( location, locationIndex );
- parent.Navigate( location );
- return true;
- }
-
- internal bool NavigateLog( int index )
- {
- // can't go anywhere
- if( index >= Locations.Count ||
- index < 0 )
- return false;
-
- // no need to re navigate to the same location
- if( index == currentLocationIndex )
- return false;
-
- // initiate traversal request
- ShellObject location = Locations[ (int)index ];
- pendingNavigation = new PendingNavigation( location, index );
- parent.Navigate( location );
- return true;
- }
-
- #endregion
- }
-
- ///
- /// A navigation traversal request
- ///
- internal class PendingNavigation
- {
- internal PendingNavigation( ShellObject location, int index )
- {
- this.location = location;
- this.index = index;
- }
-
- internal ShellObject location;
- internal int index;
- }
-}
\ No newline at end of file
diff --git a/src/External/WindowsAPICodePack/Shell/ExplorerBrowser/NavigationLogEnums.cs b/src/External/WindowsAPICodePack/Shell/ExplorerBrowser/NavigationLogEnums.cs
deleted file mode 100644
index 293e478..0000000
--- a/src/External/WindowsAPICodePack/Shell/ExplorerBrowser/NavigationLogEnums.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-
-namespace Microsoft.WindowsAPICodePack.Controls
-{
- ///
- /// The direction argument for Navigate
- ///
- public enum NavigationLogDirection
- {
- ///
- /// Navigates forward through the navigation log
- ///
- Forward,
-
- ///
- /// Navigates backward through the travel log
- ///
- Backward
- }
-}
\ No newline at end of file
diff --git a/src/External/WindowsAPICodePack/Shell/ExplorerBrowser/NavigationLogEvents.cs b/src/External/WindowsAPICodePack/Shell/ExplorerBrowser/NavigationLogEvents.cs
deleted file mode 100644
index 5738cca..0000000
--- a/src/External/WindowsAPICodePack/Shell/ExplorerBrowser/NavigationLogEvents.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-
-namespace Microsoft.WindowsAPICodePack.Controls
-{
- ///
- /// The event argument for NavigationLogChangedEvent
- ///
- public class NavigationLogEventArgs : EventArgs
- {
- ///
- /// Indicates CanNavigateForward has changed
- ///
- public bool CanNavigateForwardChanged
- {
- get;
- set;
- }
-
- ///
- /// Indicates CanNavigateBackward has changed
- ///
- public bool CanNavigateBackwardChanged
- {
- get;
- set;
- }
-
- ///
- /// Indicates the Locations collection has changed
- ///
- public bool LocationsChanged
- {
- get;
- set;
- }
-
- }
-
- ///
- /// This is fired when the navigation log changes
- ///
- /// The ExplorerBrowser that this navigation log is attached to.
- /// The changes made to the navigation log
- public delegate void NavigationLogChangedEventHandler( object sender, NavigationLogEventArgs e );
-}
\ No newline at end of file
diff --git a/src/External/WindowsAPICodePack/Shell/ExplorerBrowser/NavigationOptions.cs b/src/External/WindowsAPICodePack/Shell/ExplorerBrowser/NavigationOptions.cs
deleted file mode 100644
index bc86f2c..0000000
--- a/src/External/WindowsAPICodePack/Shell/ExplorerBrowser/NavigationOptions.cs
+++ /dev/null
@@ -1,106 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-using System;
-using Microsoft.WindowsAPICodePack.Controls.WindowsForms;
-
-namespace Microsoft.WindowsAPICodePack.Controls
-{
-
- ///
- /// These options control the results subsequent navigations of the ExplorerBrowser
- ///
- public class ExplorerBrowserNavigationOptions
- {
- #region construction
- ExplorerBrowser eb;
- internal ExplorerBrowserNavigationOptions( ExplorerBrowser eb )
- {
- this.eb = eb;
- PaneVisibility = new ExplorerBrowserPaneVisibility( );
- }
- #endregion
-
- #region Flags property
- ///
- /// The binary flags that are passed to the explorer browser control's GetOptions/SetOptions methods
- ///
- public ExplorerBrowserNavigationFlags Flags
- {
- get
- {
- EXPLORER_BROWSER_OPTIONS ebo = new EXPLORER_BROWSER_OPTIONS( );
- if( eb.explorerBrowserControl != null )
- {
- eb.explorerBrowserControl.GetOptions( out ebo );
- return (ExplorerBrowserNavigationFlags)ebo;
- }
- return (ExplorerBrowserNavigationFlags)ebo;
- }
- set
- {
- EXPLORER_BROWSER_OPTIONS ebo = (EXPLORER_BROWSER_OPTIONS)value;
- if( eb.explorerBrowserControl != null )
- {
- // Always forcing SHOWFRAMES because we handle IExplorerPaneVisibility
- eb.explorerBrowserControl.SetOptions( ebo | EXPLORER_BROWSER_OPTIONS.EBO_SHOWFRAMES );
- }
- }
- }
- #endregion
-
- #region control flags to properties mapping
- ///
- /// Do not navigate further than the initial navigation.
- ///
- public bool NavigateOnce
- {
- get
- {
- return IsFlagSet( ExplorerBrowserNavigationFlags.NavigateOnce );
- }
- set
- {
- SetFlag( ExplorerBrowserNavigationFlags.NavigateOnce, value );
- }
- }
- ///
- /// Always navigate, even if you are attempting to navigate to the current folder.
- ///
- public bool AlwaysNavigate
- {
- get
- {
- return IsFlagSet( ExplorerBrowserNavigationFlags.AlwaysNavigate );
- }
- set
- {
- SetFlag( ExplorerBrowserNavigationFlags.AlwaysNavigate, value );
- }
- }
-
- private bool IsFlagSet( ExplorerBrowserNavigationFlags flag )
- {
- return ( Flags & flag ) != 0;
- }
-
- private void SetFlag( ExplorerBrowserNavigationFlags flag, bool value )
- {
- if( value )
- Flags |= flag;
- else
- Flags = Flags & ~flag;
- }
- #endregion
-
- #region ExplorerBrowser pane visibility
- ///
- /// Controls the visibility of the various ExplorerBrowser panes on subsequent navigation
- ///
- public ExplorerBrowserPaneVisibility PaneVisibility
- {
- get;
- private set;
- }
-
- #endregion
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/Interop/Common/ShellCOMClasses.cs b/src/External/WindowsAPICodePack/Shell/Interop/Common/ShellCOMClasses.cs
deleted file mode 100644
index 43394b3..0000000
--- a/src/External/WindowsAPICodePack/Shell/Interop/Common/ShellCOMClasses.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Runtime.InteropServices;
-
-namespace Microsoft.WindowsAPICodePack.Shell
-{
- [ComImport,
- Guid(ShellIIDGuid.IShellLibrary),
- CoClass(typeof(ShellLibraryCoClass))]
- internal interface INativeShellLibrary : IShellLibrary
- {
- }
-
- [ComImport,
- ClassInterface(ClassInterfaceType.None),
- TypeLibType(TypeLibTypeFlags.FCanCreate),
- Guid(ShellCLSIDGuid.ShellLibrary)]
- internal class ShellLibraryCoClass
- {
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/Interop/Common/ShellCOMGuids.cs b/src/External/WindowsAPICodePack/Shell/Interop/Common/ShellCOMGuids.cs
deleted file mode 100644
index 245a8a3..0000000
--- a/src/External/WindowsAPICodePack/Shell/Interop/Common/ShellCOMGuids.cs
+++ /dev/null
@@ -1,100 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-namespace Microsoft.WindowsAPICodePack.Shell
-{
- internal static class ShellIIDGuid
- {
- static ShellIIDGuid()
- {
- // Hide default constructor
- }
-
- // IID GUID strings for relevant Shell COM interfaces.
- internal const string IModalWindow = "B4DB1657-70D7-485E-8E3E-6FCB5A5C1802";
- internal const string IFileDialog = "42F85136-DB7E-439C-85F1-E4075D135FC8";
- internal const string IFileOpenDialog = "D57C7288-D4AD-4768-BE02-9D969532D960";
- internal const string IFileSaveDialog = "84BCCD23-5FDE-4CDB-AEA4-AF64B83D78AB";
- internal const string IFileDialogEvents = "973510DB-7D7F-452B-8975-74A85828D354";
- internal const string IFileDialogControlEvents = "36116642-D713-4B97-9B83-7484A9D00433";
- internal const string IFileDialogCustomize = "E6FDD21A-163F-4975-9C8C-A69F1BA37034";
-
- internal const string IShellItem = "43826D1E-E718-42EE-BC55-A1E261C37BFE";
- internal const string IShellItem2 = "7E9FB0D3-919F-4307-AB2E-9B1860310C93";
- internal const string IShellItemArray = "B63EA76D-1F85-456F-A19C-48159EFA858B";
- internal const string IShellLibrary = "11A66EFA-382E-451A-9234-1E0E12EF3085";
- internal const string IThumbnailCache = "F676C15D-596A-4ce2-8234-33996F445DB1";
- internal const string ISharedBitmap = "091162a4-bc96-411f-aae8-c5122cd03363";
- internal const string IShellFolder = "000214E6-0000-0000-C000-000000000046";
- internal const string IShellFolder2 = "93F2F68C-1D1B-11D3-A30E-00C04F79ABD1";
- internal const string IEnumIDList = "000214F2-0000-0000-C000-000000000046";
- internal const string IShellLinkW = "000214F9-0000-0000-C000-000000000046";
- internal const string CShellLink = "00021401-0000-0000-C000-000000000046";
-
- internal const string IPropertyStore = "886D8EEB-8CF2-4446-8D02-CDBA1DBDCF99";
- internal const string IPropertyDescription = "6F79D558-3E96-4549-A1D1-7D75D2288814";
- internal const string IPropertyDescription2 = "57D2EDED-5062-400E-B107-5DAE79FE57A6";
- internal const string IPropertyDescriptionList = "1F9FC1D0-C39B-4B26-817F-011967D3440E";
- internal const string IPropertyEnumType = "11E1FBF9-2D56-4A6B-8DB3-7CD193A471F2";
- internal const string IPropertyEnumType2 = "9B6E051C-5DDD-4321-9070-FE2ACB55E794";
- internal const string IPropertyEnumTypeList = "A99400F4-3D84-4557-94BA-1242FB2CC9A6";
-
- internal const string ICondition = "0FC988D4-C935-4b97-A973-46282EA175C8";
- internal const string ISearchFolderItemFactory = "a0ffbc28-5482-4366-be27-3e81e78e06c2";
- internal const string IConditionFactory = "A5EFE073-B16F-474f-9F3E-9F8B497A3E08";
- internal const string IRichChunk = "4FDEF69C-DBC9-454e-9910-B34F3C64B510";
- internal const string IPersistStream = "00000109-0000-0000-C000-000000000046";
- internal const string IPersist = "0000010c-0000-0000-C000-000000000046";
- internal const string IEnumUnknown = "00000100-0000-0000-C000-000000000046";
- internal const string IQuerySolution = "D6EBC66B-8921-4193-AFDD-A1789FB7FF57";
- internal const string IQueryParser = "2EBDEE67-3505-43f8-9946-EA44ABC8E5B0";
- internal const string IQueryParserManager = "A879E3C4-AF77-44fb-8F37-EBD1487CF920";
- }
-
- internal static class ShellCLSIDGuid
- {
- static ShellCLSIDGuid()
- {
- // Hide default constructor
- }
-
- // CLSID GUID strings for relevant coclasses.
- internal const string FileOpenDialog = "DC1C5A9C-E88A-4DDE-A5A1-60F82A20AEF7";
- internal const string FileSaveDialog = "C0B4E2F3-BA21-4773-8DBA-335EC946EB8B";
- internal const string KnownFolderManager = "4DF0C730-DF9D-4AE3-9153-AA6B82E9795A";
- internal const string ShellLibrary = "D9B3211D-E57F-4426-AAEF-30A806ADD397";
- internal const string SearchFolderItemFactory = "14010e02-bbbd-41f0-88e3-eda371216584";
- internal const string ConditionFactory = "E03E85B0-7BE3-4000-BA98-6C13DE9FA486";
- internal const string QueryParserManager = "5088B39A-29B4-4d9d-8245-4EE289222F66";
- }
-
- internal static class ShellKFIDGuid
- {
- static ShellKFIDGuid()
- {
- // Hide default constructor
- }
-
- internal const string ComputerFolder = "0AC0837C-BBF8-452A-850D-79D08E667CA7";
- internal const string Favorites = "1777F761-68AD-4D8A-87BD-30B759FA33DD";
- internal const string Documents = "FDD39AD0-238F-46AF-ADB4-6C85480369C7";
- internal const string Profile = "5E6C858F-0E22-4760-9AFE-EA3317B67173";
-
- internal const string GenericLibrary = "5c4f28b5-f869-4e84-8e60-f11db97c5cc7";
- internal const string DocumentsLibrary = "7d49d726-3c21-4f05-99aa-fdc2c9474656";
- internal const string MusicLibrary = "94d6ddcc-4a68-4175-a374-bd584a510b78";
- internal const string PicturesLibrary = "b3690e58-e961-423b-b687-386ebfd83239";
- internal const string VideosLibrary = "5fa96407-7e77-483c-ac93-691d05850de8";
-
- internal const string Libraries = "1B3EA5DC-B587-4786-B4EF-BD1DC332AEAE";
- }
-
- internal static class ShellBHIDGuid
- {
- static ShellBHIDGuid()
- {
- // Hide default constructor
- }
-
- internal const string ShellFolderObject = "3981e224-f559-11d3-8e3a-00c04f6837d5";
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/Interop/Common/ShellCOMInterfaces.cs b/src/External/WindowsAPICodePack/Shell/Interop/Common/ShellCOMInterfaces.cs
deleted file mode 100644
index ad9d11d..0000000
--- a/src/External/WindowsAPICodePack/Shell/Interop/Common/ShellCOMInterfaces.cs
+++ /dev/null
@@ -1,929 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-using System.Runtime.InteropServices.ComTypes;
-using System.Text;
-using Microsoft.WindowsAPICodePack.Shell.PropertySystem;
-using MS.WindowsAPICodePack.Internal;
-
-namespace Microsoft.WindowsAPICodePack.Shell
-{
- internal enum SICHINTF : uint
- {
- SICHINT_DISPLAY = 0x00000000,
- SICHINT_CANONICAL = 0x10000000,
- SICHINT_TEST_FILESYSPATH_IF_NOT_EQUAL = 0x20000000,
- SICHINT_ALLFIELDS = 0x80000000
- }
-
- // Disable warning if a method declaration hides another inherited from a parent COM interface
- // To successfully import a COM interface, all inherited methods need to be declared again with
- // the exception of those already declared in "IUnknown"
-#pragma warning disable 108
-
- #region COM Interfaces
-
- [ComImport(),
- Guid(ShellIIDGuid.IModalWindow),
- InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
- internal interface IModalWindow
- {
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime),
- PreserveSig]
- int Show([In] IntPtr parent);
- }
-
- [ComImport,
- Guid(ShellIIDGuid.IShellItem),
- InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
- internal interface IShellItem
- {
- // Not supported: IBindCtx.
- [PreserveSig]
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- HRESULT BindToHandler(
- [In] IntPtr pbc,
- [In] ref Guid bhid,
- [In] ref Guid riid,
- [Out, MarshalAs(UnmanagedType.Interface)] out IShellFolder ppv);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetParent([MarshalAs(UnmanagedType.Interface)] out IShellItem ppsi);
-
- [PreserveSig]
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- HRESULT GetDisplayName(
- [In] ShellNativeMethods.SIGDN sigdnName,
- out IntPtr ppszName);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetAttributes([In] ShellNativeMethods.SFGAO sfgaoMask, out ShellNativeMethods.SFGAO psfgaoAttribs);
-
- [PreserveSig]
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- HRESULT Compare(
- [In, MarshalAs(UnmanagedType.Interface)] IShellItem psi,
- [In] SICHINTF hint,
- out int piOrder);
- }
-
- [ComImport,
- Guid(ShellIIDGuid.IShellItem2),
- InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
- internal interface IShellItem2 : IShellItem
- {
- // Not supported: IBindCtx.
- [PreserveSig]
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- HRESULT BindToHandler(
- [In] IntPtr pbc,
- [In] ref Guid bhid,
- [In] ref Guid riid,
- [Out, MarshalAs(UnmanagedType.Interface)] out IShellFolder ppv);
-
- [PreserveSig]
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- HRESULT GetParent([MarshalAs(UnmanagedType.Interface)] out IShellItem ppsi);
-
- [PreserveSig]
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- HRESULT GetDisplayName(
- [In] ShellNativeMethods.SIGDN sigdnName,
- [MarshalAs(UnmanagedType.LPWStr)] out string ppszName);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetAttributes([In] ShellNativeMethods.SFGAO sfgaoMask, out ShellNativeMethods.SFGAO psfgaoAttribs);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void Compare(
- [In, MarshalAs(UnmanagedType.Interface)] IShellItem psi,
- [In] uint hint,
- out int piOrder);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), PreserveSig]
- int GetPropertyStore(
- [In] ShellNativeMethods.GETPROPERTYSTOREFLAGS Flags,
- [In] ref Guid riid,
- [Out, MarshalAs(UnmanagedType.Interface)] out IPropertyStore ppv);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetPropertyStoreWithCreateObject([In] ShellNativeMethods.GETPROPERTYSTOREFLAGS Flags, [In, MarshalAs(UnmanagedType.IUnknown)] object punkCreateObject, [In] ref Guid riid, out IntPtr ppv);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetPropertyStoreForKeys([In] ref PropertyKey rgKeys, [In] uint cKeys, [In] ShellNativeMethods.GETPROPERTYSTOREFLAGS Flags, [In] ref Guid riid, [Out, MarshalAs(UnmanagedType.IUnknown)] out IPropertyStore ppv);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetPropertyDescriptionList([In] ref PropertyKey keyType, [In] ref Guid riid, out IntPtr ppv);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void Update([In, MarshalAs(UnmanagedType.Interface)] IBindCtx pbc);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetProperty([In] ref PropertyKey key, out PropVariant ppropvar);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetCLSID([In] ref PropertyKey key, out Guid pclsid);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetFileTime([In] ref PropertyKey key, out System.Runtime.InteropServices.ComTypes.FILETIME pft);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetInt32([In] ref PropertyKey key, out int pi);
-
- [PreserveSig]
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- HRESULT GetString([In] ref PropertyKey key, [MarshalAs(UnmanagedType.LPWStr)] out string ppsz);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetUInt32([In] ref PropertyKey key, out uint pui);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetUInt64([In] ref PropertyKey key, out ulong pull);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetBool([In] ref PropertyKey key, out int pf);
- }
-
- [ComImport,
- Guid(ShellIIDGuid.IShellItemArray),
- InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
- internal interface IShellItemArray
- {
- // Not supported: IBindCtx.
- [PreserveSig]
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- HRESULT BindToHandler(
- [In, MarshalAs(UnmanagedType.Interface)] IntPtr pbc,
- [In] ref Guid rbhid,
- [In] ref Guid riid,
- out IntPtr ppvOut);
-
- [PreserveSig]
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- HRESULT GetPropertyStore(
- [In] int Flags,
- [In] ref Guid riid,
- out IntPtr ppv);
-
- [PreserveSig]
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- HRESULT GetPropertyDescriptionList(
- [In] ref PropertyKey keyType,
- [In] ref Guid riid,
- out IntPtr ppv);
-
- [PreserveSig]
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- HRESULT GetAttributes(
- [In] ShellNativeMethods.SIATTRIBFLAGS dwAttribFlags,
- [In] ShellNativeMethods.SFGAO sfgaoMask,
- out ShellNativeMethods.SFGAO psfgaoAttribs);
-
- [PreserveSig]
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- HRESULT GetCount(out uint pdwNumItems);
-
- [PreserveSig]
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- HRESULT GetItemAt(
- [In] uint dwIndex,
- [MarshalAs(UnmanagedType.Interface)] out IShellItem ppsi);
-
- // Not supported: IEnumShellItems (will use GetCount and GetItemAt instead).
- [PreserveSig]
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- HRESULT EnumItems([MarshalAs(UnmanagedType.Interface)] out IntPtr ppenumShellItems);
- }
-
- [ComImport,
- Guid(ShellIIDGuid.IShellLibrary),
- InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
- internal interface IShellLibrary
- {
- [PreserveSig]
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- HRESULT LoadLibraryFromItem(
- [In, MarshalAs(UnmanagedType.Interface)] IShellItem library,
- [In] ShellNativeMethods.STGM grfMode);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void LoadLibraryFromKnownFolder(
- [In] ref Guid knownfidLibrary,
- [In] ShellNativeMethods.STGM grfMode);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void AddFolder([In, MarshalAs(UnmanagedType.Interface)] IShellItem location);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void RemoveFolder([In, MarshalAs(UnmanagedType.Interface)] IShellItem location);
-
- [PreserveSig]
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- HRESULT GetFolders(
- [In] ShellNativeMethods.LIBRARYFOLDERFILTER lff,
- [In] ref Guid riid,
- [MarshalAs(UnmanagedType.Interface)] out IShellItemArray ppv);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void ResolveFolder(
- [In, MarshalAs(UnmanagedType.Interface)] IShellItem folderToResolve,
- [In] uint timeout,
- [In] ref Guid riid,
- [MarshalAs(UnmanagedType.Interface)] out IShellItem ppv);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetDefaultSaveFolder(
- [In] ShellNativeMethods.DEFAULTSAVEFOLDERTYPE dsft,
- [In] ref Guid riid,
- [MarshalAs(UnmanagedType.Interface)] out IShellItem ppv);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void SetDefaultSaveFolder(
- [In] ShellNativeMethods.DEFAULTSAVEFOLDERTYPE dsft,
- [In, MarshalAs(UnmanagedType.Interface)] IShellItem si);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetOptions(
- out ShellNativeMethods.LIBRARYOPTIONFLAGS lofOptions);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void SetOptions(
- [In] ShellNativeMethods.LIBRARYOPTIONFLAGS lofMask,
- [In] ShellNativeMethods.LIBRARYOPTIONFLAGS lofOptions);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetFolderType(out Guid ftid);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void SetFolderType([In] ref Guid ftid);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetIcon([MarshalAs(UnmanagedType.LPWStr)] out string icon);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void SetIcon([In, MarshalAs(UnmanagedType.LPWStr)] string icon);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void Commit();
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void Save(
- [In, MarshalAs(UnmanagedType.Interface)] IShellItem folderToSaveIn,
- [In, MarshalAs(UnmanagedType.LPWStr)] string libraryName,
- [In] ShellNativeMethods.LIBRARYSAVEFLAGS lsf,
- [MarshalAs(UnmanagedType.Interface)] out IShellItem2 savedTo);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void SaveInKnownFolder(
- [In] ref Guid kfidToSaveIn,
- [In, MarshalAs(UnmanagedType.LPWStr)] string libraryName,
- [In] ShellNativeMethods.LIBRARYSAVEFLAGS lsf,
- [MarshalAs(UnmanagedType.Interface)] out IShellItem2 savedTo);
- };
-
- [ComImportAttribute()]
- [GuidAttribute("bcc18b79-ba16-442f-80c4-8a59c30c463b")]
- [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
- interface IShellItemImageFactory
- {
- [PreserveSig]
- HRESULT GetImage(
- [In, MarshalAs(UnmanagedType.Struct)] CoreNativeMethods.SIZE size,
- [In] ShellNativeMethods.SIIGBF flags,
- [Out] out IntPtr phbm);
- }
-
- [ComImport,
- Guid(ShellIIDGuid.IThumbnailCache),
- InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
- interface IThumbnailCache
- {
- void GetThumbnail([In] IShellItem pShellItem,
- [In] uint cxyRequestedThumbSize,
- [In] Microsoft.WindowsAPICodePack.Shell.ShellNativeMethods.WTS_FLAGS flags,
- [Out] out ISharedBitmap ppvThumb,
- [Out] out Microsoft.WindowsAPICodePack.Shell.ShellNativeMethods.WTS_CACHEFLAGS pOutFlags,
- [Out] Microsoft.WindowsAPICodePack.Shell.ShellNativeMethods.WTS_THUMBNAILID pThumbnailID);
-
- void GetThumbnailByID([In] Microsoft.WindowsAPICodePack.Shell.ShellNativeMethods.WTS_THUMBNAILID thumbnailID,
- [In] uint cxyRequestedThumbSize,
- [Out] out ISharedBitmap ppvThumb,
- [Out] out Microsoft.WindowsAPICodePack.Shell.ShellNativeMethods.WTS_CACHEFLAGS pOutFlags);
- }
-
- [ComImport,
- Guid(ShellIIDGuid.ISharedBitmap),
- InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
- interface ISharedBitmap
- {
- void GetSharedBitmap([Out] out IntPtr phbm);
- void GetSize([Out] out CoreNativeMethods.SIZE pSize);
- void GetFormat([Out] out ShellNativeMethods.WTS_ALPHATYPE pat);
- void InitializeBitmap([In] IntPtr hbm, [In] ShellNativeMethods.WTS_ALPHATYPE wtsAT);
- void Detach([Out] out IntPtr phbm);
- }
- [ComImport,
- Guid(ShellIIDGuid.IShellFolder),
- InterfaceType(ComInterfaceType.InterfaceIsIUnknown),
- ComConversionLoss]
- internal interface IShellFolder
- {
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void ParseDisplayName(IntPtr hwnd, [In, MarshalAs(UnmanagedType.Interface)] IBindCtx pbc, [In, MarshalAs(UnmanagedType.LPWStr)] string pszDisplayName, [In, Out] ref uint pchEaten, [Out] IntPtr ppidl, [In, Out] ref uint pdwAttributes);
- [PreserveSig]
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- HRESULT EnumObjects([In] IntPtr hwnd, [In] ShellNativeMethods.SHCONT grfFlags, [MarshalAs(UnmanagedType.Interface)] out IEnumIDList ppenumIDList);
-
- [PreserveSig]
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- HRESULT BindToObject([In] IntPtr pidl, /*[In, MarshalAs(UnmanagedType.Interface)] IBindCtx*/ IntPtr pbc, [In] ref Guid riid, [Out, MarshalAs(UnmanagedType.Interface)] out IShellFolder ppv);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void BindToStorage([In] ref IntPtr pidl, [In, MarshalAs(UnmanagedType.Interface)] IBindCtx pbc, [In] ref Guid riid, out IntPtr ppv);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void CompareIDs([In] IntPtr lParam, [In] ref IntPtr pidl1, [In] ref IntPtr pidl2);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void CreateViewObject([In] IntPtr hwndOwner, [In] ref Guid riid, out IntPtr ppv);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetAttributesOf([In] uint cidl, [In] IntPtr apidl, [In, Out] ref uint rgfInOut);
-
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetUIObjectOf([In] IntPtr hwndOwner, [In] uint cidl, [In] IntPtr apidl, [In] ref Guid riid, [In, Out] ref uint rgfReserved, out IntPtr ppv);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetDisplayNameOf([In] ref IntPtr pidl, [In] uint uFlags, out IntPtr pName);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void SetNameOf([In] IntPtr hwnd, [In] ref IntPtr pidl, [In, MarshalAs(UnmanagedType.LPWStr)] string pszName, [In] uint uFlags, [Out] IntPtr ppidlOut);
- }
-
- [ComImport,
- Guid(ShellIIDGuid.IShellFolder2),
- InterfaceType(ComInterfaceType.InterfaceIsIUnknown),
- ComConversionLoss]
- internal interface IShellFolder2 : IShellFolder
- {
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void ParseDisplayName([In] IntPtr hwnd, [In, MarshalAs(UnmanagedType.Interface)] IBindCtx pbc, [In, MarshalAs(UnmanagedType.LPWStr)] string pszDisplayName, [In, Out] ref uint pchEaten, [Out] IntPtr ppidl, [In, Out] ref uint pdwAttributes);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void EnumObjects([In] IntPtr hwnd, [In] ShellNativeMethods.SHCONT grfFlags, [MarshalAs(UnmanagedType.Interface)] out IEnumIDList ppenumIDList);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void BindToObject([In] IntPtr pidl, /*[In, MarshalAs(UnmanagedType.Interface)] IBindCtx*/ IntPtr pbc, [In] ref Guid riid, [Out, MarshalAs(UnmanagedType.Interface)] out IShellFolder ppv);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void BindToStorage([In] ref IntPtr pidl, [In, MarshalAs(UnmanagedType.Interface)] IBindCtx pbc, [In] ref Guid riid, out IntPtr ppv);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void CompareIDs([In] IntPtr lParam, [In] ref IntPtr pidl1, [In] ref IntPtr pidl2);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void CreateViewObject([In] IntPtr hwndOwner, [In] ref Guid riid, out IntPtr ppv);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetAttributesOf([In] uint cidl, [In] IntPtr apidl, [In, Out] ref uint rgfInOut);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetUIObjectOf([In] IntPtr hwndOwner, [In] uint cidl, [In] IntPtr apidl, [In] ref Guid riid, [In, Out] ref uint rgfReserved, out IntPtr ppv);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetDisplayNameOf([In] ref IntPtr pidl, [In] uint uFlags, out IntPtr pName);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void SetNameOf([In] IntPtr hwnd, [In] ref IntPtr pidl, [In, MarshalAs(UnmanagedType.LPWStr)] string pszName, [In] uint uFlags, [Out] IntPtr ppidlOut);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetDefaultSearchGUID(out Guid pguid);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void EnumSearches([Out] out IntPtr ppenum);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetDefaultColumn([In] uint dwRes, out uint pSort, out uint pDisplay);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetDefaultColumnState([In] uint iColumn, out uint pcsFlags);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetDetailsEx([In] ref IntPtr pidl, [In] ref PropertyKey pscid, [MarshalAs(UnmanagedType.Struct)] out object pv);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetDetailsOf([In] ref IntPtr pidl, [In] uint iColumn, out IntPtr psd);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void MapColumnToSCID([In] uint iColumn, out PropertyKey pscid);
- }
-
- [ComImport,
- Guid(ShellIIDGuid.IEnumIDList),
- InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
- internal interface IEnumIDList
- {
- [PreserveSig]
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- HRESULT Next(uint celt, out IntPtr rgelt, out uint pceltFetched);
-
- [PreserveSig]
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- HRESULT Skip([In] uint celt);
-
- [PreserveSig]
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- HRESULT Reset();
-
- [PreserveSig]
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- HRESULT Clone([MarshalAs(UnmanagedType.Interface)] out IEnumIDList ppenum);
- }
-
- [ComImport,
- Guid(ShellIIDGuid.IShellLinkW),
- InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
- internal interface IShellLinkW
- {
- void GetPath(
- [Out(), MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszFile,
- int cchMaxPath,
- //ref _WIN32_FIND_DATAW pfd,
- IntPtr pfd,
- uint fFlags);
- void GetIDList(out IntPtr ppidl);
- void SetIDList(IntPtr pidl);
- void GetDescription(
- [Out(), MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszFile,
- int cchMaxName);
- void SetDescription(
- [MarshalAs(UnmanagedType.LPWStr)] string pszName);
- void GetWorkingDirectory(
- [Out(), MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszDir,
- int cchMaxPath
- );
- void SetWorkingDirectory(
- [MarshalAs(UnmanagedType.LPWStr)] string pszDir);
- void GetArguments(
- [Out(), MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszArgs,
- int cchMaxPath);
- void SetArguments(
- [MarshalAs(UnmanagedType.LPWStr)] string pszArgs);
- void GetHotKey(out short wHotKey);
- void SetHotKey(short wHotKey);
- void GetShowCmd(out uint iShowCmd);
- void SetShowCmd(uint iShowCmd);
- void GetIconLocation(
- [Out(), MarshalAs(UnmanagedType.LPWStr)] out StringBuilder pszIconPath,
- int cchIconPath,
- out int iIcon);
- void SetIconLocation(
- [MarshalAs(UnmanagedType.LPWStr)] string pszIconPath,
- int iIcon);
- void SetRelativePath(
- [MarshalAs(UnmanagedType.LPWStr)] string pszPathRel,
- uint dwReserved);
- void Resolve(IntPtr hwnd, uint fFlags);
- void SetPath(
- [MarshalAs(UnmanagedType.LPWStr)] string pszFile);
- }
-
- [ComImport,
- Guid(ShellIIDGuid.CShellLink),
- ClassInterface(ClassInterfaceType.None)]
- internal class CShellLink { }
-
- // Summary:
- // Provides the managed definition of the IPersistStream interface, with functionality
- // from IPersist.
- [ComImport]
- [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
- [Guid("00000109-0000-0000-C000-000000000046")]
- internal interface IPersistStream
- {
- // Summary:
- // Retrieves the class identifier (CLSID) of an object.
- //
- // Parameters:
- // pClassID:
- // When this method returns, contains a reference to the CLSID. This parameter
- // is passed uninitialized.
- [PreserveSig]
- void GetClassID(out Guid pClassID);
- //
- // Summary:
- // Checks an object for changes since it was last saved to its current file.
- //
- // Returns:
- // S_OK if the file has changed since it was last saved; S_FALSE if the file
- // has not changed since it was last saved.
- [PreserveSig]
- HRESULT IsDirty();
-
- [PreserveSig]
- HRESULT Load([In, MarshalAs(UnmanagedType.Interface)] IStream stm);
-
- [PreserveSig]
- HRESULT Save([In, MarshalAs(UnmanagedType.Interface)] IStream stm, bool fRemember);
-
- [PreserveSig]
- HRESULT GetSizeMax(out ulong cbSize);
- }
-
- [ComImport(),
- Guid(ShellIIDGuid.ICondition),
- InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
- internal interface ICondition : IPersistStream
- {
- // Summary:
- // Retrieves the class identifier (CLSID) of an object.
- //
- // Parameters:
- // pClassID:
- // When this method returns, contains a reference to the CLSID. This parameter
- // is passed uninitialized.
- [PreserveSig]
- void GetClassID(out Guid pClassID);
- //
- // Summary:
- // Checks an object for changes since it was last saved to its current file.
- //
- // Returns:
- // S_OK if the file has changed since it was last saved; S_FALSE if the file
- // has not changed since it was last saved.
- [PreserveSig]
- HRESULT IsDirty();
-
- [PreserveSig]
- HRESULT Load([In, MarshalAs(UnmanagedType.Interface)] IStream stm);
-
- [PreserveSig]
- HRESULT Save([In, MarshalAs(UnmanagedType.Interface)] IStream stm, bool fRemember);
-
- [PreserveSig]
- HRESULT GetSizeMax(out ulong cbSize);
-
- // For any node, return what kind of node it is.
- [PreserveSig]
- HRESULT GetConditionType([Out()] out SearchConditionType pNodeType);
-
- // riid must be IID_IEnumUnknown, IID_IEnumVARIANT or IID_IObjectArray, or in the case of a negation node IID_ICondition.
- // If this is a leaf node, E_FAIL will be returned.
- // If this is a negation node, then if riid is IID_ICondition, *ppv will be set to a single ICondition, otherwise an enumeration of one.
- // If this is a conjunction or a disjunction, *ppv will be set to an enumeration of the subconditions.
- [PreserveSig]
- HRESULT GetSubConditions([In] ref Guid riid, [Out, MarshalAs(UnmanagedType.Interface)] out object ppv);
-
- // If this is not a leaf node, E_FAIL will be returned.
- // Retrieve the property name, operation and value from the leaf node.
- // Any one of ppszPropertyName, pcop and ppropvar may be NULL.
- [PreserveSig]
- HRESULT GetComparisonInfo([Out(), MarshalAs(UnmanagedType.LPWStr)] out string ppszPropertyName,
- [Out()] out SearchConditionOperation pcop,
- [Out()] out PropVariant ppropvar);
-
- // If this is not a leaf node, E_FAIL will be returned.
- // *ppszValueTypeName will be set to the semantic type of the value, or to NULL if this is not meaningful.
- [PreserveSig]
- HRESULT GetValueType([Out, MarshalAs(UnmanagedType.LPWStr)] out string ppszValueTypeName);
-
- // If this is not a leaf node, E_FAIL will be returned.
- // If the value of the leaf node is VT_EMPTY, *ppszNormalization will be set to an empty string.
- // If the value is a string (VT_LPWSTR, VT_BSTR or VT_LPSTR), then *ppszNormalization will be set to a
- // character-normalized form of the value.
- // Otherwise, *ppszNormalization will be set to some (character-normalized) string representation of the value.
- [PreserveSig]
- HRESULT GetValueNormalization([Out, MarshalAs(UnmanagedType.LPWStr)] out string ppszNormalization);
-
- // Return information about what parts of the input produced the property, the operation and the value.
- // Any one of ppPropertyTerm, ppOperationTerm and ppValueTerm may be NULL.
- // For a leaf node returned by the parser, the position information of each IRichChunk identifies the tokens that
- // contributed the property/operation/value, the string value is the corresponding part of the input string, and
- // the PROPVARIANT is VT_EMPTY.
- [PreserveSig]
- HRESULT GetInputTerms([Out] out IRichChunk ppPropertyTerm, [Out] out IRichChunk ppOperationTerm, [Out] out IRichChunk ppValueTerm);
-
- // Make a deep copy of this ICondition.
- [PreserveSig]
- HRESULT Clone([Out()] out ICondition ppc);
- };
-
- [ComImport,
- Guid(ShellIIDGuid.IRichChunk),
- InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
- internal interface IRichChunk
- {
- // The position *pFirstPos is zero-based.
- // Any one of pFirstPos, pLength, ppsz and pValue may be NULL.
- [PreserveSig]
- HRESULT GetData(/*[out, annotation("__out_opt")] ULONG* pFirstPos, [out, annotation("__out_opt")] ULONG* pLength, [out, annotation("__deref_opt_out_opt")] LPWSTR* ppsz, [out, annotation("__out_opt")] PROPVARIANT* pValue*/);
- }
-
- [ComImport]
- [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
- [Guid(ShellIIDGuid.IEnumUnknown)]
- internal interface IEnumUnknown
- {
- [PreserveSig]
- HRESULT Next(UInt32 requestedNumber, ref IntPtr buffer, ref UInt32 fetchedNumber);
- [PreserveSig]
- HRESULT Skip(UInt32 number);
- [PreserveSig]
- HRESULT Reset();
- [PreserveSig]
- HRESULT Clone(out IEnumUnknown result);
- }
-
-
- [ComImport,
- Guid(ShellIIDGuid.IConditionFactory),
- InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
- internal interface IConditionFactory
- {
- [PreserveSig]
- HRESULT MakeNot([In] ICondition pcSub, [In] bool fSimplify, [Out] out ICondition ppcResult);
-
- [PreserveSig]
- HRESULT MakeAndOr([In] SearchConditionType ct, [In] IEnumUnknown peuSubs, [In] bool fSimplify, [Out] out ICondition ppcResult);
-
- [PreserveSig]
- HRESULT MakeLeaf(
- [In, MarshalAs(UnmanagedType.LPWStr)] string pszPropertyName,
- [In] SearchConditionOperation cop,
- [In, MarshalAs(UnmanagedType.LPWStr)] string pszValueType,
- [In] ref PropVariant ppropvar,
- IRichChunk richChunk1,
- IRichChunk richChunk2,
- IRichChunk richChunk3,
- [In] bool fExpand,
- [Out] out ICondition ppcResult);
-
- [PreserveSig]
- HRESULT Resolve(/*[In] ICondition pc, [In] STRUCTURED_QUERY_RESOLVE_OPTION sqro, [In] ref SYSTEMTIME pstReferenceTime, [Out] out ICondition ppcResolved*/);
-
- };
-
- [ComImport,
- Guid(ShellIIDGuid.IConditionFactory),
- CoClass(typeof(ConditionFactoryCoClass))]
- internal interface INativeConditionFactory : IConditionFactory
- {
- }
-
- [ComImport,
- ClassInterface(ClassInterfaceType.None),
- TypeLibType(TypeLibTypeFlags.FCanCreate),
- Guid(ShellCLSIDGuid.ConditionFactory)]
- internal class ConditionFactoryCoClass
- {
- }
-
-
-
- [ComImport,
- Guid(ShellIIDGuid.ISearchFolderItemFactory),
- InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
- internal interface ISearchFolderItemFactory
- {
- [PreserveSig]
- HRESULT SetDisplayName([In, MarshalAs(UnmanagedType.LPWStr)] string pszDisplayName);
-
- [PreserveSig]
- HRESULT SetFolderTypeID([In] Guid ftid);
-
- [PreserveSig]
- HRESULT SetFolderLogicalViewMode([In] FolderLogicalViewMode flvm);
-
- [PreserveSig]
- HRESULT SetIconSize([In] int iIconSize);
-
- [PreserveSig]
- HRESULT SetVisibleColumns([In] uint cVisibleColumns, [In, MarshalAs(UnmanagedType.LPArray)] PropertyKey[] rgKey);
-
- [PreserveSig]
- HRESULT SetSortColumns([In] uint cSortColumns, [In, MarshalAs(UnmanagedType.LPArray)] SortColumn[] rgSortColumns);
-
- [PreserveSig]
- HRESULT SetGroupColumn([In] ref PropertyKey keyGroup);
-
- [PreserveSig]
- HRESULT SetStacks([In] uint cStackKeys, [In, MarshalAs(UnmanagedType.LPArray)] PropertyKey[] rgStackKeys);
-
- [PreserveSig]
- HRESULT SetScope([In, MarshalAs(UnmanagedType.Interface)] IShellItemArray ppv);
-
- [PreserveSig]
- HRESULT SetCondition([In] ICondition pCondition);
-
- [PreserveSig]
- int GetShellItem(ref Guid riid, [Out, MarshalAs(UnmanagedType.Interface)] out IShellItem ppv);
-
- [PreserveSig]
- HRESULT GetIDList([Out] IntPtr ppidl);
- };
-
- [ComImport,
- Guid(ShellIIDGuid.ISearchFolderItemFactory),
- CoClass(typeof(SearchFolderItemFactoryCoClass))]
- internal interface INativeSearchFolderItemFactory : ISearchFolderItemFactory
- {
- }
-
- [ComImport,
- ClassInterface(ClassInterfaceType.None),
- TypeLibType(TypeLibTypeFlags.FCanCreate),
- Guid(ShellCLSIDGuid.SearchFolderItemFactory)]
- internal class SearchFolderItemFactoryCoClass
- {
- }
-
- [ComImport,
- Guid(ShellIIDGuid.IQuerySolution),
- InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
- interface IQuerySolution : IConditionFactory
- {
- [PreserveSig]
- HRESULT MakeNot([In] ICondition pcSub, [In] bool fSimplify, [Out] out ICondition ppcResult);
-
- [PreserveSig]
- HRESULT MakeAndOr([In] SearchConditionType ct, [In] IEnumUnknown peuSubs, [In] bool fSimplify, [Out] out ICondition ppcResult);
-
- [PreserveSig]
- HRESULT MakeLeaf(
- [In, MarshalAs(UnmanagedType.LPWStr)] string pszPropertyName,
- [In] SearchConditionOperation cop,
- [In, MarshalAs(UnmanagedType.LPWStr)] string pszValueType,
- [In] ref PropVariant ppropvar,
- IRichChunk richChunk1,
- IRichChunk richChunk2,
- IRichChunk richChunk3,
- [In] bool fExpand,
- [Out] out ICondition ppcResult);
-
- [PreserveSig]
- HRESULT Resolve([In] ICondition pc, [In] int sqro, [In] ref SYSTEMTIME pstReferenceTime, [Out] out ICondition ppcResolved);
-
- // Retrieve the condition tree and the "main type" of the solution.
- // ppQueryNode and ppMainType may be NULL.
- [PreserveSig]
- HRESULT GetQuery([Out, MarshalAs(UnmanagedType.Interface)] out ICondition ppQueryNode, [Out, MarshalAs(UnmanagedType.Interface)] out IEntity ppMainType);
-
- // Identify parts of the input string not accounted for.
- // Each parse error is represented by an IRichChunk where the position information
- // reflect token counts, the string is NULL and the value is a VT_I4
- // where lVal is from the ParseErrorType enumeration. The valid
- // values for riid are IID_IEnumUnknown and IID_IEnumVARIANT.
- [PreserveSig]
- HRESULT GetErrors([In] ref Guid riid, [Out] out /* void** */ IntPtr ppParseErrors);
-
- // Report the query string, how it was tokenized and what LCID and word breaker were used (for recognizing keywords).
- // ppszInputString, ppTokens, pLocale and ppWordBreaker may be NULL.
- [PreserveSig]
- HRESULT GetLexicalData([MarshalAs(UnmanagedType.LPWStr)] out string ppszInputString, [Out] /* ITokenCollection** */ out IntPtr ppTokens, [Out] out uint plcid, [Out] /* IUnknown** */ out IntPtr ppWordBreaker);
- }
-
- [ComImport,
- Guid(ShellIIDGuid.IQueryParser),
- InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
- internal interface IQueryParser
- {
- // Parse parses an input string, producing a query solution.
- // pCustomProperties should be an enumeration of IRichChunk objects, one for each custom property
- // the application has recognized. pCustomProperties may be NULL, equivalent to an empty enumeration.
- // For each IRichChunk, the position information identifies the character span of the custom property,
- // the string value should be the name of an actual property, and the PROPVARIANT is completely ignored.
- [PreserveSig]
- HRESULT Parse([In, MarshalAs(UnmanagedType.LPWStr)] string pszInputString, [In] IEnumUnknown pCustomProperties, [Out] out IQuerySolution ppSolution);
-
- // Set a single option. See STRUCTURED_QUERY_SINGLE_OPTION above.
- [PreserveSig]
- HRESULT SetOption([In] StructuredQuerySingleOption option, [In] ref PropVariant pOptionValue);
-
- [PreserveSig]
- HRESULT GetOption([In] StructuredQuerySingleOption option, [Out] out PropVariant pOptionValue);
-
- // Set a multi option. See STRUCTURED_QUERY_MULTIOPTION above.
- [PreserveSig]
- HRESULT SetMultiOption([In] StructuredQueryMultipleOption option, [In, MarshalAs(UnmanagedType.LPWStr)] string pszOptionKey, [In] PropVariant pOptionValue);
-
- // Get a schema provider for browsing the currently loaded schema.
- [PreserveSig]
- HRESULT GetSchemaProvider([Out] out /*ISchemaProvider*/ IntPtr ppSchemaProvider);
-
- // Restate a condition as a query string according to the currently selected syntax.
- // The parameter fUseEnglish is reserved for future use; must be FALSE.
- [PreserveSig]
- HRESULT RestateToString([In] ICondition pCondition, [In] bool fUseEnglish, [Out, MarshalAs(UnmanagedType.LPWStr)] out string ppszQueryString);
-
- // Parse a condition for a given property. It can be anything that would go after 'PROPERTY:' in an AQS expession.
- [PreserveSig]
- HRESULT ParsePropertyValue([In, MarshalAs(UnmanagedType.LPWStr)] string pszPropertyName, [In, MarshalAs(UnmanagedType.LPWStr)] string pszInputString, [Out] out IQuerySolution ppSolution);
-
- // Restate a condition for a given property. If the condition contains a leaf with any other property name, or no property name at all,
- // E_INVALIDARG will be returned.
- [PreserveSig]
- HRESULT RestatePropertyValueToString([In] ICondition pCondition, [In] bool fUseEnglish, [Out, MarshalAs(UnmanagedType.LPWStr)] out string ppszPropertyName, [Out, MarshalAs(UnmanagedType.LPWStr)] out string ppszQueryString);
- }
-
- [ComImport,
- Guid(ShellIIDGuid.IQueryParserManager),
- InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
- internal interface IQueryParserManager
- {
- // Create a query parser loaded with the schema for a certain catalog localize to a certain language, and initialized with
- // standard defaults. One valid value for riid is IID_IQueryParser.
- [PreserveSig]
- HRESULT CreateLoadedParser([In, MarshalAs(UnmanagedType.LPWStr)] string pszCatalog, [In] ushort langidForKeywords, [In] ref Guid riid, [Out] out IQueryParser ppQueryParser);
-
- // In addition to setting AQS/NQS and automatic wildcard for the given query parser, this sets up standard named entity handlers and
- // sets the keyboard locale as locale for word breaking.
- [PreserveSig]
- HRESULT InitializeOptions([In] bool fUnderstandNQS, [In] bool fAutoWildCard, [In] IQueryParser pQueryParser);
-
- // Change one of the settings for the query parser manager, such as the name of the schema binary, or the location of the localized and unlocalized
- // schema binaries. By default, the settings point to the schema binaries used by Windows Shell.
- [PreserveSig]
- HRESULT SetOption([In] QueryParserManagerOption option, [In] PropVariant pOptionValue);
-
- };
-
- [ComImport,
- Guid(ShellIIDGuid.IQueryParserManager),
- CoClass(typeof(QueryParserManagerCoClass))]
- internal interface INativeQueryParserManager : IQueryParserManager
- {
- }
-
- [ComImport,
- ClassInterface(ClassInterfaceType.None),
- TypeLibType(TypeLibTypeFlags.FCanCreate),
- Guid(ShellCLSIDGuid.QueryParserManager)]
- internal class QueryParserManagerCoClass
- {
- }
-
- [ComImport,
- Guid("24264891-E80B-4fd3-B7CE-4FF2FAE8931F"),
- InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
- internal interface IEntity
- {
- // TODO
- }
-
- ///
- /// SYSTEMTIME structure with some useful methods
- ///
- internal struct SYSTEMTIME
- {
- internal ushort wYear;
- internal ushort wMonth;
- internal ushort wDayOfWeek;
- internal ushort wDay;
- internal ushort wHour;
- internal ushort wMinute;
- internal ushort wSecond;
- internal ushort wMilliseconds;
-
- ///
- /// Convert form System.DateTime
- ///
- ///
- internal void FromDateTime(DateTime time)
- {
- wYear = (ushort)time.Year;
- wMonth = (ushort)time.Month;
- wDayOfWeek = (ushort)time.DayOfWeek;
- wDay = (ushort)time.Day;
- wHour = (ushort)time.Hour;
- wMinute = (ushort)time.Minute;
- wSecond = (ushort)time.Second;
- wMilliseconds = (ushort)time.Millisecond;
- }
-
- ///
- /// Convert to System.DateTime
- ///
- ///
- internal DateTime ToDateTime()
- {
- return new DateTime(wYear, wMonth, wDay, wHour, wMinute, wSecond, wMilliseconds);
- }
-
- ///
- /// Convert to System.DateTime
- ///
- ///
- ///
- internal static DateTime ToDateTime(SYSTEMTIME time)
- {
- return time.ToDateTime();
- }
- }
-
- #endregion
-
-#pragma warning restore 108
-}
diff --git a/src/External/WindowsAPICodePack/Shell/Interop/Common/ShellNativeMethods.cs b/src/External/WindowsAPICodePack/Shell/Interop/Common/ShellNativeMethods.cs
deleted file mode 100644
index a98a05f..0000000
--- a/src/External/WindowsAPICodePack/Shell/Interop/Common/ShellNativeMethods.cs
+++ /dev/null
@@ -1,799 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Runtime.InteropServices;
-using System.Runtime.InteropServices.ComTypes;
-
-namespace Microsoft.WindowsAPICodePack.Shell
-{
- internal static class ShellNativeMethods
- {
- static ShellNativeMethods()
- {
- // Hide default constructor
- }
-
- #region TaskDialog Definitions
-
- // Identify button *return values* - note that, unfortunately, these are different
- // from the inbound button values.
- internal enum TASKDIALOG_COMMON_BUTTON_RETURN_ID
- {
- IDOK = 1,
- IDCANCEL = 2,
- IDABORT = 3,
- IDRETRY = 4,
- IDIGNORE = 5,
- IDYES = 6,
- IDNO = 7,
- IDCLOSE = 8
- }
-
- #endregion
-
- #region Shell Enums
-
- [Flags]
- internal enum FOS : uint
- {
- FOS_OVERWRITEPROMPT = 0x00000002,
- FOS_STRICTFILETYPES = 0x00000004,
- FOS_NOCHANGEDIR = 0x00000008,
- FOS_PICKFOLDERS = 0x00000020,
- // Ensure that items returned are filesystem items.
- FOS_FORCEFILESYSTEM = 0x00000040,
- // Allow choosing items that have no storage.
- FOS_ALLNONSTORAGEITEMS = 0x00000080,
- FOS_NOVALIDATE = 0x00000100,
- FOS_ALLOWMULTISELECT = 0x00000200,
- FOS_PATHMUSTEXIST = 0x00000800,
- FOS_FILEMUSTEXIST = 0x00001000,
- FOS_CREATEPROMPT = 0x00002000,
- FOS_SHAREAWARE = 0x00004000,
- FOS_NOREADONLYRETURN = 0x00008000,
- FOS_NOTESTFILECREATE = 0x00010000,
- FOS_HIDEMRUPLACES = 0x00020000,
- FOS_HIDEPINNEDPLACES = 0x00040000,
- FOS_NODEREFERENCELINKS = 0x00100000,
- FOS_DONTADDTORECENT = 0x02000000,
- FOS_FORCESHOWHIDDEN = 0x10000000,
- FOS_DEFAULTNOMINIMODE = 0x20000000
- }
- internal enum CDCONTROLSTATE : uint
- {
- CDCS_INACTIVE = 0x00000000,
- CDCS_ENABLED = 0x00000001,
- CDCS_VISIBLE = 0x00000002
- }
- internal enum SIGDN : uint
- {
- SIGDN_NORMALDISPLAY = 0x00000000, // SHGDN_NORMAL
- SIGDN_PARENTRELATIVEPARSING = 0x80018001, // SHGDN_INFOLDER | SHGDN_FORPARSING
- SIGDN_DESKTOPABSOLUTEPARSING = 0x80028000, // SHGDN_FORPARSING
- SIGDN_PARENTRELATIVEEDITING = 0x80031001, // SHGDN_INFOLDER | SHGDN_FOREDITING
- SIGDN_DESKTOPABSOLUTEEDITING = 0x8004c000, // SHGDN_FORPARSING | SHGDN_FORADDRESSBAR
- SIGDN_FILESYSPATH = 0x80058000, // SHGDN_FORPARSING
- SIGDN_URL = 0x80068000, // SHGDN_FORPARSING
- SIGDN_PARENTRELATIVEFORADDRESSBAR = 0x8007c001, // SHGDN_INFOLDER | SHGDN_FORPARSING | SHGDN_FORADDRESSBAR
- SIGDN_PARENTRELATIVE = 0x80080001 // SHGDN_INFOLDER
- }
-
- ///
- /// Indicate flags that modify the property store object retrieved by methods
- /// that create a property store, such as IShellItem2::GetPropertyStore or
- /// IPropertyStoreFactory::GetPropertyStore.
- ///
- [Flags]
- internal enum GETPROPERTYSTOREFLAGS : uint
- {
- ///
- /// Meaning to a calling process: Return a read-only property store that contains all
- /// properties. Slow items (offline files) are not opened.
- /// Combination with other flags: Can be overridden by other flags.
- ///
- GPS_DEFAULT = 0,
-
- ///
- /// Meaning to a calling process: Include only properties directly from the property
- /// handler, which opens the file on the disk, network, or device. Meaning to a file
- /// folder: Only include properties directly from the handler.
- ///
- /// Meaning to other folders: When delegating to a file folder, pass this flag on
- /// to the file folder; do not do any multiplexing (MUX). When not delegating to a
- /// file folder, ignore this flag instead of returning a failure code.
- ///
- /// Combination with other flags: Cannot be combined with GPS_TEMPORARY,
- /// GPS_FASTPROPERTIESONLY, or GPS_BESTEFFORT.
- ///
- GPS_HANDLERPROPERTIESONLY = 0x1,
-
- ///
- /// Meaning to a calling process: Can write properties to the item.
- /// Note: The store may contain fewer properties than a read-only store.
- ///
- /// Meaning to a file folder: ReadWrite.
- ///
- /// Meaning to other folders: ReadWrite. Note: When using default MUX,
- /// return a single unmultiplexed store because the default MUX does not support ReadWrite.
- ///
- /// Combination with other flags: Cannot be combined with GPS_TEMPORARY, GPS_FASTPROPERTIESONLY,
- /// GPS_BESTEFFORT, or GPS_DELAYCREATION. Implies GPS_HANDLERPROPERTIESONLY.
- ///
- GPS_READWRITE = 0x2,
-
- ///
- /// Meaning to a calling process: Provides a writable store, with no initial properties,
- /// that exists for the lifetime of the Shell item instance; basically, a property bag
- /// attached to the item instance.
- ///
- /// Meaning to a file folder: Not applicable. Handled by the Shell item.
- ///
- /// Meaning to other folders: Not applicable. Handled by the Shell item.
- ///
- /// Combination with other flags: Cannot be combined with any other flag. Implies GPS_READWRITE
- ///
- GPS_TEMPORARY = 0x4,
-
- ///
- /// Meaning to a calling process: Provides a store that does not involve reading from the
- /// disk or network. Note: Some values may be different, or missing, compared to a store
- /// without this flag.
- ///
- /// Meaning to a file folder: Include the "innate" and "fallback" stores only. Do not load the handler.
- ///
- /// Meaning to other folders: Include only properties that are available in memory or can
- /// be computed very quickly (no properties from disk, network, or peripheral IO devices).
- /// This is normally only data sources from the IDLIST. When delegating to other folders, pass this flag on to them.
- ///
- /// Combination with other flags: Cannot be combined with GPS_TEMPORARY, GPS_READWRITE,
- /// GPS_HANDLERPROPERTIESONLY, or GPS_DELAYCREATION.
- ///
- GPS_FASTPROPERTIESONLY = 0x8,
-
- ///
- /// Meaning to a calling process: Open a slow item (offline file) if necessary.
- /// Meaning to a file folder: Retrieve a file from offline storage, if necessary.
- /// Note: Without this flag, the handler is not created for offline files.
- ///
- /// Meaning to other folders: Do not return any properties that are very slow.
- ///
- /// Combination with other flags: Cannot be combined with GPS_TEMPORARY or GPS_FASTPROPERTIESONLY.
- ///
- GPS_OPENSLOWITEM = 0x10,
-
- ///
- /// Meaning to a calling process: Delay memory-intensive operations, such as file access, until
- /// a property is requested that requires such access.
- ///
- /// Meaning to a file folder: Do not create the handler until needed; for example, either
- /// GetCount/GetAt or GetValue, where the innate store does not satisfy the request.
- /// Note: GetValue might fail due to file access problems.
- ///
- /// Meaning to other folders: If the folder has memory-intensive properties, such as
- /// delegating to a file folder or network access, it can optimize performance by
- /// supporting IDelayedPropertyStoreFactory and splitting up its properties into a
- /// fast and a slow store. It can then use delayed MUX to recombine them.
- ///
- /// Combination with other flags: Cannot be combined with GPS_TEMPORARY or
- /// GPS_READWRITE
- ///
- GPS_DELAYCREATION = 0x20,
-
- ///
- /// Meaning to a calling process: Succeed at getting the store, even if some
- /// properties are not returned. Note: Some values may be different, or missing,
- /// compared to a store without this flag.
- ///
- /// Meaning to a file folder: Succeed and return a store, even if the handler or
- /// innate store has an error during creation. Only fail if substores fail.
- ///
- /// Meaning to other folders: Succeed on getting the store, even if some properties
- /// are not returned.
- ///
- /// Combination with other flags: Cannot be combined with GPS_TEMPORARY,
- /// GPS_READWRITE, or GPS_HANDLERPROPERTIESONLY.
- ///
- GPS_BESTEFFORT = 0x40,
-
- ///
- /// Mask for valid GETPROPERTYSTOREFLAGS values.
- ///
- GPS_MASK_VALID = 0xff,
- }
-
- internal enum SIATTRIBFLAGS
- {
- // if multiple items and the attirbutes together.
- SIATTRIBFLAGS_AND = 0x00000001,
- // if multiple items or the attributes together.
- SIATTRIBFLAGS_OR = 0x00000002,
- // Call GetAttributes directly on the
- // ShellFolder for multiple attributes.
- SIATTRIBFLAGS_APPCOMPAT = 0x00000003,
- }
- internal enum FDE_SHAREVIOLATION_RESPONSE
- {
- FDESVR_DEFAULT = 0x00000000,
- FDESVR_ACCEPT = 0x00000001,
- FDESVR_REFUSE = 0x00000002
- }
- internal enum FDE_OVERWRITE_RESPONSE
- {
- FDEOR_DEFAULT = 0x00000000,
- FDEOR_ACCEPT = 0x00000001,
- FDEOR_REFUSE = 0x00000002
- }
- internal enum FDAP
- {
- FDAP_BOTTOM = 0x00000000,
- FDAP_TOP = 0x00000001,
- }
-
- [Flags]
- internal enum SIIGBF
- {
- SIIGBF_RESIZETOFIT = 0x00,
- SIIGBF_BIGGERSIZEOK = 0x01,
- SIIGBF_MEMORYONLY = 0x02,
- SIIGBF_ICONONLY = 0x04,
- SIIGBF_THUMBNAILONLY = 0x08,
- SIIGBF_INCACHEONLY = 0x10,
- }
-
- [Flags]
- internal enum WTS_FLAGS
- {
- WTS_EXTRACT = 0x00000000,
- WTS_INCACHEONLY = 0x00000001,
- WTS_FASTEXTRACT = 0x00000002,
- WTS_FORCEEXTRACTION = 0x00000004,
- WTS_SLOWRECLAIM = 0x00000008,
- WTS_EXTRACTDONOTCACHE = 0x00000020
- }
-
- [Flags]
- internal enum WTS_CACHEFLAGS
- {
- WTS_DEFAULT = 0x00000000,
- WTS_LOWQUALITY = 0x00000001,
- WTS_CACHED = 0x00000002,
- }
-
- internal enum WTS_ALPHATYPE
- {
- WTSAT_UNKNOWN = 0,
- WTSAT_RGB = 1,
- WTSAT_ARGB = 2,
- }
-
- [Flags]
- internal enum SFGAO : uint
- {
- ///
- /// The specified items can be copied.
- ///
- SFGAO_CANCOPY = 0x00000001,
-
- ///
- /// The specified items can be moved.
- ///
- SFGAO_CANMOVE = 0x00000002,
-
- ///
- /// Shortcuts can be created for the specified items. This flag has the same value as DROPEFFECT.
- /// The normal use of this flag is to add a Create Shortcut item to the shortcut menu that is displayed
- /// during drag-and-drop operations. However, SFGAO_CANLINK also adds a Create Shortcut item to the Microsoft
- /// Windows Explorer's File menu and to normal shortcut menus.
- /// If this item is selected, your application's IContextMenu::InvokeCommand is invoked with the lpVerb
- /// member of the CMINVOKECOMMANDINFO structure set to "link." Your application is responsible for creating the link.
- ///
- SFGAO_CANLINK = 0x00000004,
-
- ///
- /// The specified items can be bound to an IStorage interface through IShellFolder::BindToObject.
- ///
- SFGAO_STORAGE = 0x00000008,
-
- ///
- /// The specified items can be renamed.
- ///
- SFGAO_CANRENAME = 0x00000010,
-
- ///
- /// The specified items can be deleted.
- ///
- SFGAO_CANDELETE = 0x00000020,
-
- ///
- /// The specified items have property sheets.
- ///
- SFGAO_HASPROPSHEET = 0x00000040,
-
- ///
- /// The specified items are drop targets.
- ///
- SFGAO_DROPTARGET = 0x00000100,
-
- ///
- /// This flag is a mask for the capability flags.
- ///
- SFGAO_CAPABILITYMASK = 0x00000177,
-
- ///
- /// Windows 7 and later. The specified items are system items.
- ///
- SFGAO_SYSTEM = 0x00001000,
-
- ///
- /// The specified items are encrypted.
- ///
- SFGAO_ENCRYPTED = 0x00002000,
-
- ///
- /// Indicates that accessing the object = through IStream or other storage interfaces,
- /// is a slow operation.
- /// Applications should avoid accessing items flagged with SFGAO_ISSLOW.
- ///
- SFGAO_ISSLOW = 0x00004000,
-
- ///
- /// The specified items are ghosted icons.
- ///
- SFGAO_GHOSTED = 0x00008000,
-
- ///
- /// The specified items are shortcuts.
- ///
- SFGAO_LINK = 0x00010000,
-
- ///
- /// The specified folder objects are shared.
- ///
- SFGAO_SHARE = 0x00020000,
-
- ///
- /// The specified items are read-only. In the case of folders, this means
- /// that new items cannot be created in those folders.
- ///
- SFGAO_READONLY = 0x00040000,
-
- ///
- /// The item is hidden and should not be displayed unless the
- /// Show hidden files and folders option is enabled in Folder Settings.
- ///
- SFGAO_HIDDEN = 0x00080000,
-
- ///
- /// This flag is a mask for the display attributes.
- ///
- SFGAO_DISPLAYATTRMASK = 0x000FC000,
-
- ///
- /// The specified folders contain one or more file system folders.
- ///
- SFGAO_FILESYSANCESTOR = 0x10000000,
-
- ///
- /// The specified items are folders.
- ///
- SFGAO_FOLDER = 0x20000000,
-
- ///
- /// The specified folders or file objects are part of the file system
- /// that is, they are files, directories, or root directories).
- ///
- SFGAO_FILESYSTEM = 0x40000000,
-
- ///
- /// The specified folders have subfolders = and are, therefore,
- /// expandable in the left pane of Windows Explorer).
- ///
- SFGAO_HASSUBFOLDER = 0x80000000,
-
- ///
- /// This flag is a mask for the contents attributes.
- ///
- SFGAO_CONTENTSMASK = 0x80000000,
-
- ///
- /// When specified as input, SFGAO_VALIDATE instructs the folder to validate that the items
- /// pointed to by the contents of apidl exist. If one or more of those items do not exist,
- /// IShellFolder::GetAttributesOf returns a failure code.
- /// When used with the file system folder, SFGAO_VALIDATE instructs the folder to discard cached
- /// properties retrieved by clients of IShellFolder2::GetDetailsEx that may
- /// have accumulated for the specified items.
- ///
- SFGAO_VALIDATE = 0x01000000,
-
- ///
- /// The specified items are on removable media or are themselves removable devices.
- ///
- SFGAO_REMOVABLE = 0x02000000,
-
- ///
- /// The specified items are compressed.
- ///
- SFGAO_COMPRESSED = 0x04000000,
-
- ///
- /// The specified items can be browsed in place.
- ///
- SFGAO_BROWSABLE = 0x08000000,
-
- ///
- /// The items are nonenumerated items.
- ///
- SFGAO_NONENUMERATED = 0x00100000,
-
- ///
- /// The objects contain new content.
- ///
- SFGAO_NEWCONTENT = 0x00200000,
-
- ///
- /// It is possible to create monikers for the specified file objects or folders.
- ///
- SFGAO_CANMONIKER = 0x00400000,
-
- ///
- /// Not supported.
- ///
- SFGAO_HASSTORAGE = 0x00400000,
-
- ///
- /// Indicates that the item has a stream associated with it that can be accessed
- /// by a call to IShellFolder::BindToObject with IID_IStream in the riid parameter.
- ///
- SFGAO_STREAM = 0x00400000,
-
- ///
- /// Children of this item are accessible through IStream or IStorage.
- /// Those children are flagged with SFGAO_STORAGE or SFGAO_STREAM.
- ///
- SFGAO_STORAGEANCESTOR = 0x00800000,
-
- ///
- /// This flag is a mask for the storage capability attributes.
- ///
- SFGAO_STORAGECAPMASK = 0x70C50008,
-
- ///
- /// Mask used by PKEY_SFGAOFlags to remove certain values that are considered
- /// to cause slow calculations or lack context.
- /// Equal to SFGAO_VALIDATE | SFGAO_ISSLOW | SFGAO_HASSUBFOLDER.
- ///
- SFGAO_PKEYSFGAOMASK = 0x81044000,
- }
-
- [Flags]
- internal enum SHCONT : ushort
- {
- SHCONTF_CHECKING_FOR_CHILDREN = 0x0010,
- SHCONTF_FOLDERS = 0x0020,
- SHCONTF_NONFOLDERS = 0x0040,
- SHCONTF_INCLUDEHIDDEN = 0x0080,
- SHCONTF_INIT_ON_FIRST_NEXT = 0x0100,
- SHCONTF_NETPRINTERSRCH = 0x0200,
- SHCONTF_SHAREABLE = 0x0400,
- SHCONTF_STORAGE = 0x0800,
- SHCONTF_NAVIGATION_ENUM = 0x1000,
- SHCONTF_FASTITEMS = 0x2000,
- SHCONTF_FLATLIST = 0x4000,
- SHCONTF_ENABLE_ASYNC = 0x8000
- }
-
- #endregion
-
- #region Shell Structs
-
- [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
- internal struct COMDLG_FILTERSPEC
- {
- [MarshalAs(UnmanagedType.LPWStr)]
- internal string pszName;
- [MarshalAs(UnmanagedType.LPWStr)]
- internal string pszSpec;
-
- internal COMDLG_FILTERSPEC(string name, string spec)
- {
- pszName = name;
- pszSpec = spec;
- }
- }
-
- [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
- internal struct WTS_THUMBNAILID
- {
- [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 16)]
- byte rgbKey;
- }
-
-
- #endregion
-
- #region Shell Helper Methods
-
- [DllImport("shell32.dll", CharSet = CharSet.Unicode, SetLastError = true )]
- internal static extern int SHCreateShellItemArrayFromDataObject(
- System.Runtime.InteropServices.ComTypes.IDataObject pdo,
- ref Guid riid,
- [MarshalAs( UnmanagedType.Interface )] out IShellItemArray iShellItemArray );
-
- [DllImport( "shell32.dll", CharSet = CharSet.Unicode,
- SetLastError = true)]
- internal static extern int SHCreateItemFromParsingName(
- [MarshalAs(UnmanagedType.LPWStr)] string path,
- // The following parameter is not used - binding context.
- IntPtr pbc,
- ref Guid riid,
- [MarshalAs(UnmanagedType.Interface)] out IShellItem2 shellItem);
-
- [DllImport("shell32.dll", CharSet = CharSet.Unicode,
- SetLastError = true)]
- internal static extern int SHCreateItemFromParsingName(
- [MarshalAs(UnmanagedType.LPWStr)] string path,
- [MarshalAs(UnmanagedType.Interface)] IBindCtx pbc,
- ref Guid riid,
- [MarshalAs(UnmanagedType.Interface)] out IShellItem2 shellItem);
-
- [DllImport("shell32.dll", CharSet = CharSet.Unicode,
- SetLastError = true)]
- internal static extern int SHCreateItemFromParsingName(
- [MarshalAs(UnmanagedType.LPWStr)] string path,
- [MarshalAs(UnmanagedType.Interface)] IBindCtx pbc,
- ref Guid riid,
- [MarshalAs(UnmanagedType.Interface)] out IShellItem shellItem);
-
- [DllImport("shell32.dll", CharSet = CharSet.Unicode,
- SetLastError = true)]
- internal static extern int SHCreateItemFromParsingName(
- [MarshalAs(UnmanagedType.LPWStr)] string path,
- // The following parameter is not used - binding context.
- IntPtr pbc,
- ref Guid riid,
- [MarshalAs(UnmanagedType.Interface)] out IShellItem shellItem);
-
- [DllImport("shell32.dll", CharSet = CharSet.Unicode,
- SetLastError = true)]
- internal static extern int SHCreateShellItemArrayFromShellItem(IShellItem psi,
- ref Guid riid,
- [MarshalAs(UnmanagedType.Interface)] out IShellItemArray ppenum);
-
- [DllImport("shlwapi.dll", CharSet = CharSet.Unicode,
- SetLastError = true)]
- internal static extern int PathParseIconLocation(
- [MarshalAs(UnmanagedType.LPWStr)] ref string pszIconFile);
-
-
- [DllImport("shell32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
- internal static extern int SHCreateItemFromIDList(
- /*PCIDLIST_ABSOLUTE*/ IntPtr pidl,
- ref Guid riid,
- [MarshalAs(UnmanagedType.Interface)] out IShellItem2 ppv);
-
- [DllImport("shell32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
- internal static extern int SHParseDisplayName(
- [MarshalAs(UnmanagedType.LPWStr)] string pszName,
- IntPtr pbc,
- out IntPtr ppidl,
- SFGAO sfgaoIn,
- out SFGAO psfgaoOut
- );
-
- [DllImport("shell32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
- internal static extern int SHGetIDListFromObject(IntPtr iUnknown,
- out IntPtr ppidl
- );
-
- [DllImport("shell32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
- internal static extern int SHGetDesktopFolder(
- [MarshalAs(UnmanagedType.Interface)] out IShellFolder ppshf
- );
-
- [DllImport("shell32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
- internal static extern int SHCreateShellItem(
- IntPtr pidlParent,
- [In, MarshalAs(UnmanagedType.Interface)] IShellFolder psfParent,
- IntPtr pidl,
- [MarshalAs(UnmanagedType.Interface)] out IShellItem ppsi
- );
-
- [DllImport( "shell32.dll", CharSet = CharSet.Unicode, SetLastError = true )]
- internal static extern uint ILGetSize( IntPtr pidl );
-
- [DllImport( "shell32.dll", CharSet = CharSet.None )]
- public static extern void ILFree( IntPtr pidl );
-
- [DllImport("gdi32.dll")]
- internal static extern bool DeleteObject(IntPtr hObject);
-
- [DllImport("ole32.dll")]
- public static extern int CreateBindCtx(int reserved, out IBindCtx ppbc);
-
- #endregion
-
- #region Shell Library Enums
-
- internal enum LIBRARYFOLDERFILTER
- {
- LFF_FORCEFILESYSTEM = 1,
- LFF_STORAGEITEMS = 2,
- LFF_ALLITEMS = 3
- };
-
- [Flags]
- internal enum LIBRARYOPTIONFLAGS : uint
- {
- LOF_DEFAULT = 0,
- LOF_PINNEDTONAVPANE = 0x1,
- LOF_MASK_ALL = 0x1
- };
-
- internal enum DEFAULTSAVEFOLDERTYPE
- {
- DSFT_DETECT = 1,
- DSFT_PRIVATE = (DSFT_DETECT + 1),
- DSFT_PUBLIC = (DSFT_PRIVATE + 1)
- };
-
- internal enum LIBRARYSAVEFLAGS
- {
- LSF_FAILIFTHERE = 0,
- LSF_OVERRIDEEXISTING = 0x1,
- LSF_MAKEUNIQUENAME = 0x2
- };
-
- internal enum LIBRARYMANAGEDIALOGOPTIONS
- {
- LMD_DEFAULT = 0,
- LMD_NOUNINDEXABLELOCATIONWARNING = 0x1
- };
-
- ///
- /// The STGM constants are flags that indicate
- /// conditions for creating and deleting the object and access modes
- /// for the object.
- ///
- /// You can combine these flags, but you can only choose one flag
- /// from each group of related flags. Typically one flag from each
- /// of the access and sharing groups must be specified for all
- /// functions and methods which use these constants.
- ///
- [Flags]
- internal enum STGM : uint
- {
- ///
- /// Indicates that, in direct mode, each change to a storage
- /// or stream element is written as it occurs.
- ///
- Direct = 0x00000000,
-
- ///
- /// Indicates that, in transacted mode, changes are buffered
- /// and written only if an explicit commit operation is called.
- ///
- Transacted = 0x00010000,
-
- ///
- /// Provides a faster implementation of a compound file
- /// in a limited, but frequently used, case.
- ///
- Simple = 0x08000000,
-
-
-
- ///
- /// Indicates that the object is read-only,
- /// meaning that modifications cannot be made.
- ///
- Read = 0x00000000,
-
- ///
- /// Enables you to save changes to the object,
- /// but does not permit access to its data.
- ///
- Write = 0x00000001,
-
- ///
- /// Enables access and modification of object data.
- ///
- ReadWrite = 0x00000002,
-
- ///
- /// Specifies that subsequent openings of the object are
- /// not denied read or write access.
- ///
- ShareDenyNone = 0x00000040,
-
- ///
- /// Prevents others from subsequently opening the object in Read mode.
- ///
- ShareDenyRead = 0x00000030,
-
- ///
- /// Prevents others from subsequently opening the object
- /// for Write or ReadWrite access.
- ///
- ShareDenyWrite = 0x00000020,
-
- ///
- /// Prevents others from subsequently opening the object in any mode.
- ///
- ShareExclusive = 0x00000010,
-
- ///
- /// Opens the storage object with exclusive access to the most
- /// recently committed version.
- ///
- Priority = 0x00040000,
-
- ///
- /// Indicates that the underlying file is to be automatically destroyed when the root
- /// storage object is released. This feature is most useful for creating temporary files.
- ///
- DeleteOnRelease = 0x04000000,
-
- ///
- /// Indicates that, in transacted mode, a temporary scratch file is usually used
- /// to save modifications until the Commit method is called.
- /// Specifying NoScratch permits the unused portion of the original file
- /// to be used as work space instead of creating a new file for that purpose.
- ///
- NoScratch = 0x00100000,
-
- ///
- /// Indicates that an existing storage object
- /// or stream should be removed before the new object replaces it.
- ///
- Create = 0x00001000,
-
- ///
- /// Creates the new object while preserving existing data in a stream named "Contents".
- ///
- Convert = 0x00020000,
-
- ///
- /// Causes the create operation to fail if an existing object with the specified name exists.
- ///
- FailIfThere = 0x00000000,
-
- ///
- /// This flag is used when opening a storage object with Transacted
- /// and without ShareExclusive or ShareDenyWrite.
- /// In this case, specifying NoSnapshot prevents the system-provided
- /// implementation from creating a snapshot copy of the file.
- /// Instead, changes to the file are written to the end of the file.
- ///
- NoSnapshot = 0x00200000,
-
- ///
- /// Supports direct mode for single-writer, multireader file operations.
- ///
- DirectSwmr = 0x00400000
- };
- #endregion
-
- #region Shell Library Helper Methods
-
- [DllImport("Shell32", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Winapi, SetLastError = true)]
- internal static extern int SHShowManageLibraryUI(
- [In, MarshalAs(UnmanagedType.Interface)] IShellItem library,
- [In] IntPtr hwndOwner,
- [In] string title,
- [In] string instruction,
- [In] LIBRARYMANAGEDIALOGOPTIONS lmdOptions);
-
- #endregion
-
- #region Command Link Definitions
-
- internal const int BS_COMMANDLINK = 0x0000000E;
- internal const uint BCM_SETNOTE = 0x00001609;
- internal const uint BCM_GETNOTE = 0x0000160A;
- internal const uint BCM_GETNOTELENGTH = 0x0000160B;
- internal const uint BCM_SETSHIELD = 0x0000160C;
-
- #endregion
-
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/Interop/Common/WindowUtilities.cs b/src/External/WindowsAPICodePack/Shell/Interop/Common/WindowUtilities.cs
deleted file mode 100644
index c6469b3..0000000
--- a/src/External/WindowsAPICodePack/Shell/Interop/Common/WindowUtilities.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using Microsoft.WindowsAPICodePack.Taskbar;
-using MS.WindowsAPICodePack.Internal;
-
-namespace Microsoft.WindowsAPICodePack.Shell
-{
-
- internal static class WindowUtilities
- {
- internal static System.Drawing.Point GetParentOffsetOfChild(IntPtr hwnd, IntPtr hwndParent)
- {
- var childScreenCoord = new CoreNativeMethods.POINT(0, 0);
-
- TabbedThumbnailNativeMethods.ClientToScreen(
- hwnd, ref childScreenCoord);
-
- var parentScreenCoord = new CoreNativeMethods.POINT(0, 0);
-
- TabbedThumbnailNativeMethods.ClientToScreen(
- hwndParent, ref parentScreenCoord);
-
- System.Drawing.Point offset = new System.Drawing.Point(
- childScreenCoord.X - parentScreenCoord.X,
- childScreenCoord.Y - parentScreenCoord.Y);
-
- return offset;
- }
-
- internal static System.Drawing.Size GetNonClientArea(IntPtr hwnd)
- {
- var c = new CoreNativeMethods.POINT(0, 0);
-
- TabbedThumbnailNativeMethods.ClientToScreen(hwnd, ref c);
-
- var r = new CoreNativeMethods.RECT();
-
- TabbedThumbnailNativeMethods.GetWindowRect(hwnd, ref r);
-
- return new System.Drawing.Size(c.X - r.left, c.Y - r.top);
- }
- }
-
-}
diff --git a/src/External/WindowsAPICodePack/Shell/Interop/Dialogs/DialogsCOMClasses.cs b/src/External/WindowsAPICodePack/Shell/Interop/Dialogs/DialogsCOMClasses.cs
deleted file mode 100644
index cc35d91..0000000
--- a/src/External/WindowsAPICodePack/Shell/Interop/Dialogs/DialogsCOMClasses.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Runtime.InteropServices;
-using Microsoft.WindowsAPICodePack.Shell;
-
-namespace Microsoft.WindowsAPICodePack.Dialogs
-{
-
- // Dummy base interface for CommonFileDialog coclasses.
- internal interface NativeCommonFileDialog
- {
- }
-
- // Coclass interfaces - designed to "look like" the object
- // in the API, so that the 'new' operator can be used in a
- // straightforward way. Behind the scenes, the C# compiler
- // morphs all 'new CoClass()' calls to 'new CoClassWrapper()'.
-
- [ComImport,
- Guid(ShellIIDGuid.IFileOpenDialog),
- CoClass(typeof(FileOpenDialogRCW))]
- internal interface NativeFileOpenDialog : IFileOpenDialog
- {
- }
-
- [ComImport,
- Guid(ShellIIDGuid.IFileSaveDialog),
- CoClass(typeof(FileSaveDialogRCW))]
- internal interface NativeFileSaveDialog : IFileSaveDialog
- {
- }
-
- // .NET classes representing runtime callable wrappers.
- [ComImport,
- ClassInterface(ClassInterfaceType.None),
- TypeLibType(TypeLibTypeFlags.FCanCreate),
- Guid(ShellCLSIDGuid.FileOpenDialog)]
- internal class FileOpenDialogRCW
- {
- }
-
- [ComImport,
- ClassInterface(ClassInterfaceType.None),
- TypeLibType(TypeLibTypeFlags.FCanCreate),
- Guid(ShellCLSIDGuid.FileSaveDialog)]
- internal class FileSaveDialogRCW
- {
- }
-
-}
diff --git a/src/External/WindowsAPICodePack/Shell/Interop/Dialogs/DialogsCOMInterfaces.cs b/src/External/WindowsAPICodePack/Shell/Interop/Dialogs/DialogsCOMInterfaces.cs
deleted file mode 100644
index bac9b83..0000000
--- a/src/External/WindowsAPICodePack/Shell/Interop/Dialogs/DialogsCOMInterfaces.cs
+++ /dev/null
@@ -1,507 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-using Microsoft.WindowsAPICodePack.Shell;
-using Microsoft.WindowsAPICodePack.Shell.PropertySystem;
-using MS.WindowsAPICodePack.Internal;
-
-namespace Microsoft.WindowsAPICodePack.Dialogs
-{
-// Disable warning if a method declaration hides another inherited from a parent COM interface
-// To successfully import a COM interface, all inherited methods need to be declared again with
-// the exception of those already declared in "IUnknown"
-#pragma warning disable 0108
-
- [ComImport(),
- Guid(ShellIIDGuid.IFileDialog),
- InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
- internal interface IFileDialog : IModalWindow
- {
- // Defined on IModalWindow - repeated here due to requirements of COM interop layer.
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime),
- PreserveSig]
- int Show([In] IntPtr parent);
-
- // IFileDialog-Specific interface members.
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void SetFileTypes(
- [In] uint cFileTypes,
- [In, MarshalAs(UnmanagedType.LPArray)] ShellNativeMethods.COMDLG_FILTERSPEC[] rgFilterSpec);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void SetFileTypeIndex([In] uint iFileType);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetFileTypeIndex(out uint piFileType);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void Advise(
- [In, MarshalAs(UnmanagedType.Interface)] IFileDialogEvents pfde,
- out uint pdwCookie);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void Unadvise([In] uint dwCookie);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void SetOptions([In] ShellNativeMethods.FOS fos);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetOptions(out ShellNativeMethods.FOS pfos);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void SetDefaultFolder([In, MarshalAs(UnmanagedType.Interface)] IShellItem psi);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void SetFolder([In, MarshalAs(UnmanagedType.Interface)] IShellItem psi);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetFolder([MarshalAs(UnmanagedType.Interface)] out IShellItem ppsi);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetCurrentSelection([MarshalAs(UnmanagedType.Interface)] out IShellItem ppsi);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void SetFileName([In, MarshalAs(UnmanagedType.LPWStr)] string pszName);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetFileName([MarshalAs(UnmanagedType.LPWStr)] out string pszName);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void SetTitle([In, MarshalAs(UnmanagedType.LPWStr)] string pszTitle);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void SetOkButtonLabel([In, MarshalAs(UnmanagedType.LPWStr)] string pszText);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void SetFileNameLabel([In, MarshalAs(UnmanagedType.LPWStr)] string pszLabel);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetResult([MarshalAs(UnmanagedType.Interface)] out IShellItem ppsi);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void AddPlace([In, MarshalAs(UnmanagedType.Interface)] IShellItem psi, ShellNativeMethods.FDAP fdap);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void SetDefaultExtension([In, MarshalAs(UnmanagedType.LPWStr)] string pszDefaultExtension);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void Close([MarshalAs(UnmanagedType.Error)] int hr);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void SetClientGuid([In] ref Guid guid);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void ClearClientData();
-
- // Not supported: IShellItemFilter is not defined, converting to IntPtr.
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void SetFilter([MarshalAs(UnmanagedType.Interface)] IntPtr pFilter);
- }
-
- [ComImport(),
- Guid(ShellIIDGuid.IFileOpenDialog),
- InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
- internal interface IFileOpenDialog : IFileDialog
- {
- // Defined on IModalWindow - repeated here due to requirements of COM interop layer.
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime),
- PreserveSig]
- int Show([In] IntPtr parent);
-
- // Defined on IFileDialog - repeated here due to requirements of COM interop layer.
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void SetFileTypes([In] uint cFileTypes, [In] ref ShellNativeMethods.COMDLG_FILTERSPEC rgFilterSpec);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void SetFileTypeIndex([In] uint iFileType);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetFileTypeIndex(out uint piFileType);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void Advise(
- [In, MarshalAs(UnmanagedType.Interface)] IFileDialogEvents pfde,
- out uint pdwCookie);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void Unadvise([In] uint dwCookie);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void SetOptions([In] ShellNativeMethods.FOS fos);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetOptions(out ShellNativeMethods.FOS pfos);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void SetDefaultFolder([In, MarshalAs(UnmanagedType.Interface)] IShellItem psi);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void SetFolder([In, MarshalAs(UnmanagedType.Interface)] IShellItem psi);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetFolder([MarshalAs(UnmanagedType.Interface)] out IShellItem ppsi);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetCurrentSelection([MarshalAs(UnmanagedType.Interface)] out IShellItem ppsi);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void SetFileName([In, MarshalAs(UnmanagedType.LPWStr)] string pszName);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetFileName([MarshalAs(UnmanagedType.LPWStr)] out string pszName);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void SetTitle([In, MarshalAs(UnmanagedType.LPWStr)] string pszTitle);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void SetOkButtonLabel([In, MarshalAs(UnmanagedType.LPWStr)] string pszText);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void SetFileNameLabel([In, MarshalAs(UnmanagedType.LPWStr)] string pszLabel);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetResult([MarshalAs(UnmanagedType.Interface)] out IShellItem ppsi);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void AddPlace([In, MarshalAs(UnmanagedType.Interface)] IShellItem psi, ShellNativeMethods.FDAP fdap);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void SetDefaultExtension([In, MarshalAs(UnmanagedType.LPWStr)] string pszDefaultExtension);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void Close([MarshalAs(UnmanagedType.Error)] int hr);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void SetClientGuid([In] ref Guid guid);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void ClearClientData();
-
- // Not supported: IShellItemFilter is not defined, converting to IntPtr.
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void SetFilter([MarshalAs(UnmanagedType.Interface)] IntPtr pFilter);
-
- // Defined by IFileOpenDialog.
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetResults([MarshalAs(UnmanagedType.Interface)] out IShellItemArray ppenum);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetSelectedItems([MarshalAs(UnmanagedType.Interface)] out IShellItemArray ppsai);
- }
-
- [ComImport(),
- Guid(ShellIIDGuid.IFileSaveDialog),
- InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
- internal interface IFileSaveDialog : IFileDialog
- {
- // Defined on IModalWindow - repeated here due to requirements of COM interop layer.
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime),
- PreserveSig]
- int Show([In] IntPtr parent);
-
- // Defined on IFileDialog - repeated here due to requirements of COM interop layer.
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void SetFileTypes(
- [In] uint cFileTypes,
- [In] ref ShellNativeMethods.COMDLG_FILTERSPEC rgFilterSpec);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void SetFileTypeIndex([In] uint iFileType);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetFileTypeIndex(out uint piFileType);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void Advise(
- [In, MarshalAs(UnmanagedType.Interface)] IFileDialogEvents pfde,
- out uint pdwCookie);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void Unadvise([In] uint dwCookie);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void SetOptions([In] ShellNativeMethods.FOS fos);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetOptions(out ShellNativeMethods.FOS pfos);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void SetDefaultFolder([In, MarshalAs(UnmanagedType.Interface)] IShellItem psi);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void SetFolder([In, MarshalAs(UnmanagedType.Interface)] IShellItem psi);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetFolder([MarshalAs(UnmanagedType.Interface)] out IShellItem ppsi);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetCurrentSelection([MarshalAs(UnmanagedType.Interface)] out IShellItem ppsi);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void SetFileName([In, MarshalAs(UnmanagedType.LPWStr)] string pszName);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetFileName([MarshalAs(UnmanagedType.LPWStr)] out string pszName);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void SetTitle([In, MarshalAs(UnmanagedType.LPWStr)] string pszTitle);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void SetOkButtonLabel([In, MarshalAs(UnmanagedType.LPWStr)] string pszText);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void SetFileNameLabel([In, MarshalAs(UnmanagedType.LPWStr)] string pszLabel);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetResult([MarshalAs(UnmanagedType.Interface)] out IShellItem ppsi);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void AddPlace(
- [In, MarshalAs(UnmanagedType.Interface)] IShellItem psi,
- ShellNativeMethods.FDAP fdap);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void SetDefaultExtension([In, MarshalAs(UnmanagedType.LPWStr)] string pszDefaultExtension);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void Close([MarshalAs(UnmanagedType.Error)] int hr);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void SetClientGuid([In] ref Guid guid);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void ClearClientData();
-
- // Not supported: IShellItemFilter is not defined, converting to IntPtr.
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void SetFilter([MarshalAs(UnmanagedType.Interface)] IntPtr pFilter);
-
- // Defined by IFileSaveDialog interface.
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void SetSaveAsItem([In, MarshalAs(UnmanagedType.Interface)] IShellItem psi);
-
- // Not currently supported: IPropertyStore.
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void SetProperties([In, MarshalAs(UnmanagedType.Interface)] IntPtr pStore);
-
- [PreserveSig]
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- int SetCollectedProperties(
- [In] IPropertyDescriptionList pList,
- [In] bool fAppendDefault);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- [PreserveSig]
- HRESULT GetProperties(out IPropertyStore ppStore);
-
- // Not currently supported: IPropertyStore, IFileOperationProgressSink.
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void ApplyProperties(
- [In, MarshalAs(UnmanagedType.Interface)] IShellItem psi,
- [In, MarshalAs(UnmanagedType.Interface)] IntPtr pStore,
- [In, ComAliasName("ShellObjects.wireHWND")] ref IntPtr hwnd,
- [In, MarshalAs(UnmanagedType.Interface)] IntPtr pSink);
- }
-
- [ComImport,
- Guid(ShellIIDGuid.IFileDialogEvents),
- InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
- internal interface IFileDialogEvents
- {
- // NOTE: some of these callbacks are cancelable - returning S_FALSE means that
- // the dialog should not proceed (e.g. with closing, changing folder); to
- // support this, we need to use the PreserveSig attribute to enable us to return
- // the proper HRESULT.
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime),
- PreserveSig]
- HRESULT OnFileOk([In, MarshalAs(UnmanagedType.Interface)] IFileDialog pfd);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime),
- PreserveSig]
- HRESULT OnFolderChanging(
- [In, MarshalAs(UnmanagedType.Interface)] IFileDialog pfd,
- [In, MarshalAs(UnmanagedType.Interface)] IShellItem psiFolder);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void OnFolderChange([In, MarshalAs(UnmanagedType.Interface)] IFileDialog pfd);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void OnSelectionChange([In, MarshalAs(UnmanagedType.Interface)] IFileDialog pfd);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void OnShareViolation(
- [In, MarshalAs(UnmanagedType.Interface)] IFileDialog pfd,
- [In, MarshalAs(UnmanagedType.Interface)] IShellItem psi,
- out ShellNativeMethods.FDE_SHAREVIOLATION_RESPONSE pResponse);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void OnTypeChange([In, MarshalAs(UnmanagedType.Interface)] IFileDialog pfd);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void OnOverwrite([In, MarshalAs(UnmanagedType.Interface)] IFileDialog pfd,
- [In, MarshalAs(UnmanagedType.Interface)] IShellItem psi,
- out ShellNativeMethods.FDE_OVERWRITE_RESPONSE pResponse);
- }
-
- [ComImport,
- Guid(ShellIIDGuid.IFileDialogCustomize),
- InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
- internal interface IFileDialogCustomize
- {
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void EnableOpenDropDown([In] int dwIDCtl);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void AddMenu(
- [In] int dwIDCtl,
- [In, MarshalAs(UnmanagedType.LPWStr)] string pszLabel);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void AddPushButton(
- [In] int dwIDCtl,
- [In, MarshalAs(UnmanagedType.LPWStr)] string pszLabel);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void AddComboBox([In] int dwIDCtl);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void AddRadioButtonList([In] int dwIDCtl);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void AddCheckButton(
- [In] int dwIDCtl,
- [In, MarshalAs(UnmanagedType.LPWStr)] string pszLabel,
- [In] bool bChecked);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void AddEditBox(
- [In] int dwIDCtl,
- [In, MarshalAs(UnmanagedType.LPWStr)] string pszText);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void AddSeparator([In] int dwIDCtl);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void AddText(
- [In] int dwIDCtl,
- [In, MarshalAs(UnmanagedType.LPWStr)] string pszText);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void SetControlLabel(
- [In] int dwIDCtl,
- [In, MarshalAs(UnmanagedType.LPWStr)] string pszLabel);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetControlState(
- [In] int dwIDCtl,
- [Out] out ShellNativeMethods.CDCONTROLSTATE pdwState);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void SetControlState(
- [In] int dwIDCtl,
- [In] ShellNativeMethods.CDCONTROLSTATE dwState);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetEditBoxText(
- [In] int dwIDCtl,
- [MarshalAs(UnmanagedType.LPWStr)] out string ppszText);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void SetEditBoxText(
- [In] int dwIDCtl,
- [In, MarshalAs(UnmanagedType.LPWStr)] string pszText);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetCheckButtonState(
- [In] int dwIDCtl,
- [Out] out bool pbChecked);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void SetCheckButtonState(
- [In] int dwIDCtl,
- [In] bool bChecked);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void AddControlItem(
- [In] int dwIDCtl,
- [In] int dwIDItem,
- [In, MarshalAs(UnmanagedType.LPWStr)] string pszLabel);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void RemoveControlItem(
- [In] int dwIDCtl,
- [In] int dwIDItem);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void RemoveAllControlItems([In] int dwIDCtl);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetControlItemState(
- [In] int dwIDCtl,
- [In] int dwIDItem,
- [Out] out ShellNativeMethods.CDCONTROLSTATE pdwState);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void SetControlItemState(
- [In] int dwIDCtl,
- [In] int dwIDItem,
- [In] ShellNativeMethods.CDCONTROLSTATE dwState);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetSelectedControlItem(
- [In] int dwIDCtl,
- [Out] out int pdwIDItem);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void SetSelectedControlItem(
- [In] int dwIDCtl,
- [In] int dwIDItem); // Not valid for OpenDropDown.
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void StartVisualGroup(
- [In] int dwIDCtl,
- [In, MarshalAs(UnmanagedType.LPWStr)] string pszLabel);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void EndVisualGroup();
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void MakeProminent([In] int dwIDCtl);
- }
-
- [ComImport,
- Guid(ShellIIDGuid.IFileDialogControlEvents),
- InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
- internal interface IFileDialogControlEvents
- {
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void OnItemSelected(
- [In, MarshalAs(UnmanagedType.Interface)] IFileDialogCustomize pfdc,
- [In] int dwIDCtl,
- [In] int dwIDItem);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void OnButtonClicked(
- [In, MarshalAs(UnmanagedType.Interface)] IFileDialogCustomize pfdc,
- [In] int dwIDCtl);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void OnCheckButtonToggled(
- [In, MarshalAs(UnmanagedType.Interface)] IFileDialogCustomize pfdc,
- [In] int dwIDCtl,
- [In] bool bChecked);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void OnControlActivating(
- [In, MarshalAs(UnmanagedType.Interface)] IFileDialogCustomize pfdc,
- [In] int dwIDCtl);
- }
-// Restore the warning
-#pragma warning restore 0108
-
-}
diff --git a/src/External/WindowsAPICodePack/Shell/Interop/ExplorerBrowser/ExplorerBrowserCOMGuids.cs b/src/External/WindowsAPICodePack/Shell/Interop/ExplorerBrowser/ExplorerBrowserCOMGuids.cs
deleted file mode 100644
index 0c237f8..0000000
--- a/src/External/WindowsAPICodePack/Shell/Interop/ExplorerBrowser/ExplorerBrowserCOMGuids.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-namespace Microsoft.WindowsAPICodePack.Controls
-{
- internal static class ExplorerBrowserIIDGuid
- {
- static ExplorerBrowserIIDGuid()
- {
- // Private constructor to prevent the compiler from generating the default one.
- }
-
- // IID GUID strings for relevant Shell COM interfaces.
- internal const string IExplorerBrowser = "DFD3B6B5-C10C-4BE9-85F6-A66969F402F6";
- internal const string IKnownFolderManager = "8BE2D872-86AA-4d47-B776-32CCA40C7018";
- internal const string IFolderView = "cde725b0-ccc9-4519-917e-325d72fab4ce";
- internal const string IFolderView2 = "1af3a467-214f-4298-908e-06b03e0b39f9";
- internal const string ICommDlgBrowser = "000214F1-0000-0000-C000-000000000046";
- internal const string IServiceProvider = "6d5140c1-7436-11ce-8034-00aa006009fa";
- internal const string IExplorerPaneVisibility = "e07010ec-bc17-44c0-97b0-46c7c95b9edc";
- internal const string IExplorerBrowserEvents = "361bbdc7-e6ee-4e13-be58-58e2240c810f";
- internal const string IInputObject = "68284fAA-6A48-11D0-8c78-00C04fd918b4";
- internal const string IShellView = "000214E3-0000-0000-C000-000000000046";
- internal const string IDispatch = "00020400-0000-0000-C000-000000000046";
- internal const string DShellFolderViewEvents = "62112AA2-EBE4-11cf-A5FB-0020AFE7292D";
- }
-
- internal static class ExplorerBrowserViewPanes
- {
- static ExplorerBrowserViewPanes()
- {
- // Private constructor to prevent the compiler from generating the default one.
- }
-
- internal const string Navigation = "cb316b22-25f7-42b8-8a09-540d23a43c2f";
- internal const string Commands = "d9745868-ca5f-4a76-91cd-f5a129fbb076";
- internal const string CommandsOrganize = "72e81700-e3ec-4660-bf24-3c3b7b648806";
- internal const string CommandsView = "21f7c32d-eeaa-439b-bb51-37b96fd6a943";
- internal const string Details = "43abf98b-89b8-472d-b9ce-e69b8229f019";
- internal const string Preview = "893c63d1-45c8-4d17-be19-223be71be365";
- internal const string Query = "65bcde4f-4f07-4f27-83a7-1afca4df7ddd";
- internal const string AdvancedQuery = "b4e9db8b-34ba-4c39-b5cc-16a1bd2c411c";
- }
-
- internal static class ExplorerBrowserCLSIDGuid
- {
- static ExplorerBrowserCLSIDGuid()
- {
- // Private constructor to prevent the compiler from generating the default one.
- }
-
- // CLSID GUID strings for relevant coclasses.
- internal const string ExplorerBrowser = "71F96385-DDD6-48D3-A0C1-AE06E8B055FB";
- }
-
- internal static class ExplorerBrowserViewDispatchIds
- {
- internal const int SelectionChanged = 200;
- internal const int ContentsChanged = 207;
- internal const int FileListEnumDone = 201;
- internal const int SelectedItemChanged = 220;
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/Interop/ExplorerBrowser/ExplorerBrowserCOMInterfaces.cs b/src/External/WindowsAPICodePack/Shell/Interop/ExplorerBrowser/ExplorerBrowserCOMInterfaces.cs
deleted file mode 100644
index 30315bd..0000000
--- a/src/External/WindowsAPICodePack/Shell/Interop/ExplorerBrowser/ExplorerBrowserCOMInterfaces.cs
+++ /dev/null
@@ -1,678 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-using Microsoft.WindowsAPICodePack.Shell;
-using MS.WindowsAPICodePack.Internal;
-
-namespace Microsoft.WindowsAPICodePack.Controls
-{
- internal enum SVGIO : uint
- {
- SVGIO_BACKGROUND = 0x00000000,
- SVGIO_SELECTION = 0x00000001,
- SVGIO_ALLVIEW = 0x00000002,
- SVGIO_CHECKED = 0x00000003,
- SVGIO_TYPE_MASK = 0x0000000F,
- SVGIO_FLAG_VIEWORDER = 0x80000000
- }
-
- internal enum FOLDERFLAGS : uint
- {
- FWF_AUTOARRANGE = 0x00000001,
- FWF_ABBREVIATEDNAMES = 0x00000002,
- FWF_SNAPTOGRID = 0x00000004,
- FWF_OWNERDATA = 0x00000008,
- FWF_BESTFITWINDOW = 0x00000010,
- FWF_DESKTOP = 0x00000020,
- FWF_SINGLESEL = 0x00000040,
- FWF_NOSUBFOLDERS = 0x00000080,
- FWF_TRANSPARENT = 0x00000100,
- FWF_NOCLIENTEDGE = 0x00000200,
- FWF_NOSCROLL = 0x00000400,
- FWF_ALIGNLEFT = 0x00000800,
- FWF_NOICONS = 0x00001000,
- FWF_SHOWSELALWAYS = 0x00002000,
- FWF_NOVISIBLE = 0x00004000,
- FWF_SINGLECLICKACTIVATE = 0x00008000,
- FWF_NOWEBVIEW = 0x00010000,
- FWF_HIDEFILENAMES = 0x00020000,
- FWF_CHECKSELECT = 0x00040000,
- FWF_NOENUMREFRESH = 0x00080000,
- FWF_NOGROUPING = 0x00100000,
- FWF_FULLROWSELECT = 0x00200000,
- FWF_NOFILTERS = 0x00400000,
- FWF_NOCOLUMNHEADER = 0x00800000,
- FWF_NOHEADERINALLVIEWS = 0x01000000,
- FWF_EXTENDEDTILES = 0x02000000,
- FWF_TRICHECKSELECT = 0x04000000,
- FWF_AUTOCHECKSELECT = 0x08000000,
- FWF_NOBROWSERVIEWSTATE = 0x10000000,
- FWF_SUBSETGROUPS = 0x20000000,
- FWF_USESEARCHFOLDER = 0x40000000,
- FWF_ALLOWRTLREADING = 0x80000000
- }
-
- internal enum FOLDERVIEWMODE
- {
- FVM_AUTO = -1,
- FVM_FIRST = 1,
- FVM_ICON = 1,
- FVM_SMALLICON = 2,
- FVM_LIST = 3,
- FVM_DETAILS = 4,
- FVM_THUMBNAIL = 5,
- FVM_TILE = 6,
- FVM_THUMBSTRIP = 7,
- FVM_CONTENT = 8,
- FVM_LAST = 8
- }
-
- internal enum EXPLORERPANESTATE
- {
- EPS_DONTCARE = 0x00000000,
- EPS_DEFAULT_ON = 0x00000001,
- EPS_DEFAULT_OFF = 0x00000002,
- EPS_STATEMASK = 0x0000ffff,
- EPS_INITIALSTATE = 0x00010000,
- EPS_FORCE = 0x00020000
- }
-
- [StructLayout( LayoutKind.Sequential, Pack = 4 )]
- internal class FOLDERSETTINGS
- {
- public FOLDERVIEWMODE ViewMode;
- public FOLDERFLAGS fFlags;
- }
-
- internal enum EXPLORER_BROWSER_FILL_FLAGS
- {
- EBF_NODROPTARGET = 0x200,
- EBF_NONE = 0,
- EBF_SELECTFROMDATAOBJECT = 0x100
- }
-
- internal enum EXPLORER_BROWSER_OPTIONS
- {
- EBO_NAVIGATEONCE = 0x00000001,
- EBO_SHOWFRAMES = 0x00000002,
- EBO_ALWAYSNAVIGATE = 0x00000004,
- EBO_NOTRAVELLOG = 0x00000008,
- EBO_NOWRAPPERWINDOW = 0x00000010,
- EBO_HTMLSHAREPOINTVIEW = 0x00000020
- }
-
- internal enum CommDlgBrowserStateChange : uint
- {
- CDBOSC_SETFOCUS = 0x00000000,
- CDBOSC_KILLFOCUS = 0x00000001,
- CDBOSC_SELCHANGE = 0x00000002,
- CDBOSC_RENAME = 0x00000003,
- CDBOSC_STATECHANGE = 0x00000004
- }
-
- internal enum CommDlgBrowserNotifyType : uint
- {
- CDB2N_CONTEXTMENU_DONE = 0x00000001,
- CDB2N_CONTEXTMENU_START = 0x00000002
- }
-
- internal enum CommDlgBrowser2ViewFlags : uint
- {
- CDB2GVF_SHOWALLFILES = 0x00000001,
- CDB2GVF_ISFILESAVE = 0x00000002,
- CDB2GVF_ALLOWPREVIEWPANE = 0x00000004,
- CDB2GVF_NOSELECTVERB = 0x00000008,
- CDB2GVF_NOINCLUDEITEM = 0x00000010,
- CDB2GVF_ISFOLDERPICKER = 0x00000020
- }
-
- // Disable warning if a method declaration hides another inherited from a parent COM interface
- // To successfully import a COM interface, all inherited methods need to be declared again with
- // the exception of those already declared in "IUnknown"
-#pragma warning disable 108
-
-
- [ComImport,
- TypeLibType( TypeLibTypeFlags.FCanCreate ),
- ClassInterface( ClassInterfaceType.None ),
- Guid( ExplorerBrowserCLSIDGuid.ExplorerBrowser )]
- internal class ExplorerBrowserClass : IExplorerBrowser
- {
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- public virtual extern void Initialize( IntPtr hwndParent, [In]ref CoreNativeMethods.RECT prc, [In] FOLDERSETTINGS pfs );
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- public virtual extern void Destroy( );
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- public virtual extern void SetRect( [In, Out] ref IntPtr phdwp, CoreNativeMethods.RECT rcBrowser );
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- public virtual extern void SetPropertyBag( [MarshalAs( UnmanagedType.LPWStr )] string pszPropertyBag );
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- public virtual extern void SetEmptyText( [MarshalAs( UnmanagedType.LPWStr )] string pszEmptyText );
- [PreserveSig]
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- public virtual extern HRESULT SetFolderSettings( FOLDERSETTINGS pfs );
- [PreserveSig]
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- public virtual extern HRESULT Advise( IntPtr psbe, out uint pdwCookie );
- [PreserveSig]
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- public virtual extern HRESULT Unadvise( uint dwCookie );
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- public virtual extern void SetOptions( [In]EXPLORER_BROWSER_OPTIONS dwFlag );
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- public virtual extern void GetOptions( out EXPLORER_BROWSER_OPTIONS pdwFlag );
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- public virtual extern void BrowseToIDList( IntPtr pidl, uint uFlags );
- [PreserveSig]
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- public virtual extern HRESULT BrowseToObject( [MarshalAs( UnmanagedType.IUnknown )] object punk, uint uFlags );
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- public virtual extern void FillFromObject( [MarshalAs( UnmanagedType.IUnknown )] object punk, int dwFlags );
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- public virtual extern void RemoveAll( );
- [PreserveSig]
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- public virtual extern HRESULT GetCurrentView( ref Guid riid, out IntPtr ppv );
- }
-
-
- [ComImport,
- InterfaceType( ComInterfaceType.InterfaceIsIUnknown ),
- Guid( ExplorerBrowserIIDGuid.IExplorerBrowser )]
- internal interface IExplorerBrowser
- {
- ///
- /// Prepares the browser to be navigated.
- ///
- /// A handle to the owner window or control.
- /// A pointer to a RECT containing the coordinates of the bounding rectangle
- /// the browser will occupy. The coordinates are relative to hwndParent. If this parameter is NULL,
- /// then method IExplorerBrowser::SetRect should subsequently be called.
- /// A pointer to a FOLDERSETTINGS structure that determines how the folder will be
- /// displayed in the view. If this parameter is NULL, then method IExplorerBrowser::SetFolderSettings
- /// should be called, otherwise, the default view settings for the folder are used.
- ///
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void Initialize( IntPtr hwndParent, [In] ref CoreNativeMethods.RECT prc, [In] FOLDERSETTINGS pfs );
-
- ///
- /// Destroys the browser.
- ///
- ///
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void Destroy( );
-
- ///
- /// Sets the size and position of the view windows created by the browser.
- ///
- /// A pointer to a DeferWindowPos handle. This paramater can be NULL.
- /// The coordinates that the browser will occupy.
- ///
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void SetRect( [In, Out] ref IntPtr phdwp, CoreNativeMethods.RECT rcBrowser );
-
- ///
- /// Sets the name of the property bag.
- ///
- /// A pointer to a constant, null-terminated, Unicode string that contains
- /// the name of the property bag. View state information that is specific to the application of the
- /// client is stored (persisted) using this name.
- ///
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void SetPropertyBag( [MarshalAs( UnmanagedType.LPWStr )] string pszPropertyBag );
-
- ///
- /// Sets the default empty text.
- ///
- /// A pointer to a constant, null-terminated, Unicode string that contains
- /// the empty text.
- ///
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void SetEmptyText( [MarshalAs( UnmanagedType.LPWStr )] string pszEmptyText );
-
- ///
- /// Sets the folder settings for the current view.
- ///
- /// A pointer to a FOLDERSETTINGS structure that contains the folder settings
- /// to be applied.
- ///
- [PreserveSig]
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- HRESULT SetFolderSettings( FOLDERSETTINGS pfs );
-
- ///
- /// Initiates a connection with IExplorerBrowser for event callbacks.
- ///
- /// A pointer to the IExplorerBrowserEvents interface of the object to be
- /// advised of IExplorerBrowser events
- /// When this method returns, contains a token that uniquely identifies
- /// the event listener. This allows several event listeners to be subscribed at a time.
- ///
- [PreserveSig]
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- HRESULT Advise( IntPtr psbe, out uint pdwCookie );
-
- ///
- /// Terminates an advisory connection.
- ///
- /// A connection token previously returned from IExplorerBrowser::Advise.
- /// Identifies the connection to be terminated.
- ///
- [PreserveSig]
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- HRESULT Unadvise( [In] uint dwCookie );
-
- ///
- /// Sets the current browser options.
- ///
- /// One or more EXPLORER_BROWSER_OPTIONS flags to be set.
- ///
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void SetOptions( [In]EXPLORER_BROWSER_OPTIONS dwFlag );
-
- ///
- /// Gets the current browser options.
- ///
- /// When this method returns, contains the current EXPLORER_BROWSER_OPTIONS
- /// for the browser.
- ///
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void GetOptions( out EXPLORER_BROWSER_OPTIONS pdwFlag );
-
- ///
- /// Browses to a pointer to an item identifier list (PIDL)
- ///
- /// A pointer to a const ITEMIDLIST (item identifier list) that specifies an object's
- /// location as the destination to navigate to. This parameter can be NULL.
- /// A flag that specifies the category of the pidl. This affects how
- /// navigation is accomplished
- ///
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void BrowseToIDList( IntPtr pidl, uint uFlags );
-
- ///
- /// Browse to an object
- ///
- /// A pointer to an object to browse to. If the object cannot be browsed,
- /// an error value is returned.
- /// A flag that specifies the category of the pidl. This affects how
- /// navigation is accomplished.
- ///
- [PreserveSig]
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- HRESULT BrowseToObject( [MarshalAs( UnmanagedType.IUnknown )] object punk, uint uFlags );
-
- ///
- /// Creates a results folder and fills it with items.
- ///
- /// An interface pointer on the source object that will fill the IResultsFolder
- /// One of the EXPLORER_BROWSER_FILL_FLAGS
- ///
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void FillFromObject( [MarshalAs( UnmanagedType.IUnknown )] object punk, int dwFlags );
-
- ///
- /// Removes all items from the results folder.
- ///
- ///
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void RemoveAll( );
-
- ///
- /// Gets an interface for the current view of the browser.
- ///
- /// A reference to the desired interface ID.
- /// When this method returns, contains the interface pointer requested in riid.
- /// This will typically be IShellView or IShellView2.
- ///
- [PreserveSig]
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- HRESULT GetCurrentView( ref Guid riid, out IntPtr ppv );
- }
-
- [ComImport,
- Guid( ExplorerBrowserIIDGuid.IServiceProvider ),
- InterfaceType( ComInterfaceType.InterfaceIsIUnknown )]
- internal interface IServiceProvider
- {
- [PreserveSig]
- [MethodImpl( MethodImplOptions.InternalCall )]
- HRESULT QueryService( ref Guid guidService, ref Guid riid, out IntPtr ppvObject );
- };
-
- [ComImport,
- Guid( ExplorerBrowserIIDGuid.IFolderView ),
- InterfaceType( ComInterfaceType.InterfaceIsIUnknown )]
- internal interface IFolderView
- {
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void GetCurrentViewMode( [Out] out uint pViewMode );
-
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void SetCurrentViewMode( uint ViewMode );
-
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void GetFolder( ref Guid riid, [MarshalAs( UnmanagedType.IUnknown )] out object ppv );
-
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void Item( int iItemIndex, out IntPtr ppidl );
-
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void ItemCount( uint uFlags, out int pcItems );
-
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void Items( uint uFlags, ref Guid riid, [Out, MarshalAs( UnmanagedType.IUnknown )] out object ppv );
-
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void GetSelectionMarkedItem( out int piItem );
-
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void GetFocusedItem( out int piItem );
-
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void GetItemPosition( IntPtr pidl, out CoreNativeMethods.POINT ppt );
-
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void GetSpacing( [Out] out CoreNativeMethods.POINT ppt );
-
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void GetDefaultSpacing( out CoreNativeMethods.POINT ppt );
-
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void GetAutoArrange( );
-
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void SelectItem( int iItem, uint dwFlags );
-
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void SelectAndPositionItems( uint cidl, IntPtr apidl, ref CoreNativeMethods.POINT apt, uint dwFlags );
- }
-
- [ComImport,
- Guid( ExplorerBrowserIIDGuid.IFolderView2 ),
- InterfaceType( ComInterfaceType.InterfaceIsIUnknown )]
- internal interface IFolderView2 : IFolderView
- {
- // IFolderView
- [PreserveSig]
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- HRESULT GetCurrentViewMode( out uint pViewMode );
-
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void SetCurrentViewMode( uint ViewMode );
-
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void GetFolder( ref Guid riid, [MarshalAs( UnmanagedType.IUnknown )] out object ppv );
-
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void Item( int iItemIndex, out IntPtr ppidl );
-
- [PreserveSig]
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- HRESULT ItemCount( uint uFlags, out int pcItems );
-
- [PreserveSig]
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- HRESULT Items( uint uFlags, ref Guid riid, [Out, MarshalAs( UnmanagedType.IUnknown )] out object ppv );
-
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void GetSelectionMarkedItem( out int piItem );
-
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void GetFocusedItem( out int piItem );
-
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void GetItemPosition( IntPtr pidl, out CoreNativeMethods.POINT ppt );
-
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void GetSpacing( [Out] out CoreNativeMethods.POINT ppt );
-
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void GetDefaultSpacing( out CoreNativeMethods.POINT ppt );
-
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void GetAutoArrange( );
-
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void SelectItem( int iItem, uint dwFlags );
-
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void SelectAndPositionItems( uint cidl, IntPtr apidl, ref CoreNativeMethods.POINT apt, uint dwFlags );
-
- // IFolderView2
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void SetGroupBy( IntPtr key, bool fAscending );
-
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void GetGroupBy( ref IntPtr pkey, ref bool pfAscending );
-
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void SetViewProperty( IntPtr pidl, IntPtr propkey, object propvar );
-
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void GetViewProperty( IntPtr pidl, IntPtr propkey, out object ppropvar );
-
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void SetTileViewProperties( IntPtr pidl, [MarshalAs( UnmanagedType.LPWStr )] string pszPropList );
-
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void SetExtendedTileViewProperties( IntPtr pidl, [MarshalAs( UnmanagedType.LPWStr )] string pszPropList );
-
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void SetText( int iType, [MarshalAs( UnmanagedType.LPWStr )] string pwszText );
-
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void SetCurrentFolderFlags( uint dwMask, uint dwFlags );
-
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void GetCurrentFolderFlags( out uint pdwFlags );
-
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void GetSortColumnCount( out int pcColumns );
-
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void SetSortColumns( IntPtr rgSortColumns, int cColumns );
-
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void GetSortColumns( out IntPtr rgSortColumns, int cColumns );
-
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void GetItem( int iItem, ref Guid riid, [MarshalAs( UnmanagedType.IUnknown )] out object ppv );
-
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void GetVisibleItem( int iStart, bool fPrevious, out int piItem );
-
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void GetSelectedItem( int iStart, out int piItem );
-
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void GetSelection( bool fNoneImpliesFolder, out IShellItemArray ppsia );
-
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void GetSelectionState( IntPtr pidl, out uint pdwFlags );
-
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void InvokeVerbOnSelection( [In, MarshalAs( UnmanagedType.LPWStr )] string pszVerb );
-
- [PreserveSig]
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- HRESULT SetViewModeAndIconSize( int uViewMode, int iImageSize );
-
- [PreserveSig]
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- HRESULT GetViewModeAndIconSize( out int puViewMode, out int piImageSize );
-
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void SetGroupSubsetCount( uint cVisibleRows );
-
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void GetGroupSubsetCount( out uint pcVisibleRows );
-
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void SetRedraw( bool fRedrawOn );
-
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void IsMoveInSameFolder( );
-
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- void DoRename( );
- }
-
- [ComImport,
- Guid( ExplorerBrowserIIDGuid.IExplorerPaneVisibility ),
- InterfaceType( ComInterfaceType.InterfaceIsIUnknown )]
- internal interface IExplorerPaneVisibility
- {
- [PreserveSig]
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- HRESULT GetPaneState( ref Guid explorerPane, out EXPLORERPANESTATE peps);
- };
-
- [ComImport,
- Guid( ExplorerBrowserIIDGuid.IExplorerBrowserEvents ),
- InterfaceType( ComInterfaceType.InterfaceIsIUnknown )]
- internal interface IExplorerBrowserEvents
- {
- [PreserveSig]
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- HRESULT OnNavigationPending( IntPtr pidlFolder );
-
- [PreserveSig]
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- HRESULT OnViewCreated( [MarshalAs(UnmanagedType.IUnknown)] object psv );
-
- [PreserveSig]
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- HRESULT OnNavigationComplete( IntPtr pidlFolder);
-
- [PreserveSig]
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- HRESULT OnNavigationFailed( IntPtr pidlFolder);
- }
-
- [ComImport,
- Guid( ExplorerBrowserIIDGuid.ICommDlgBrowser ),
- InterfaceType( ComInterfaceType.InterfaceIsIUnknown )]
- internal interface ICommDlgBrowser
- {
- [PreserveSig]
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- HRESULT OnDefaultCommand( IntPtr ppshv );
-
- [PreserveSig]
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- HRESULT OnStateChange(
- IntPtr ppshv,
- CommDlgBrowserStateChange uChange );
-
- [PreserveSig]
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- HRESULT IncludeObject(
- IntPtr ppshv,
- IntPtr pidl );
- }
-
-
- [ComImport,
- Guid( ExplorerBrowserIIDGuid.IInputObject ),
- InterfaceType( ComInterfaceType.InterfaceIsIUnknown )]
- internal interface IInputObject
- {
- [PreserveSig]
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- HRESULT UIActivateIO( bool fActivate, ref System.Windows.Forms.Message pMsg );
-
- [PreserveSig]
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- HRESULT HasFocusIO( );
-
- [PreserveSig]
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- HRESULT TranslateAcceleratorIO( ref System.Windows.Forms.Message pMsg );
-
- };
-
- [ComImport,
- Guid( ExplorerBrowserIIDGuid.IShellView ),
- InterfaceType( ComInterfaceType.InterfaceIsIUnknown )]
- internal interface IShellView
- {
- // IOleWindow
- [PreserveSig]
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- HRESULT GetWindow(
- out IntPtr phwnd);
-
- [PreserveSig]
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- HRESULT ContextSensitiveHelp(
- bool fEnterMode);
-
- // IShellView
- [PreserveSig]
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- HRESULT TranslateAccelerator(
- IntPtr pmsg);
-
- [PreserveSig]
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- HRESULT EnableModeless(
- bool fEnable);
-
- [PreserveSig]
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- HRESULT UIActivate(
- uint uState);
-
- [PreserveSig]
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- HRESULT Refresh( );
-
- [PreserveSig]
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- HRESULT CreateViewWindow(
- [MarshalAs( UnmanagedType.IUnknown )] object psvPrevious,
- IntPtr pfs,
- [MarshalAs( UnmanagedType.IUnknown )] object psb,
- IntPtr prcView,
- out IntPtr phWnd);
-
- [PreserveSig]
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- HRESULT DestroyViewWindow( );
-
- [PreserveSig]
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- HRESULT GetCurrentInfo(
- out IntPtr pfs);
-
- [PreserveSig]
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- HRESULT AddPropertySheetPages(
- uint dwReserved,
- IntPtr pfn,
- uint lparam);
-
- [PreserveSig]
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- HRESULT SaveViewState( );
-
- [PreserveSig]
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- HRESULT SelectItem(
- IntPtr pidlItem,
- uint uFlags);
-
- [PreserveSig]
- [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime )]
- HRESULT GetItemObject(
- SVGIO uItem,
- ref Guid riid,
- [MarshalAs(UnmanagedType.IUnknown)] out object ppv );
- }
-
-#pragma warning restore 108
-
-}
diff --git a/src/External/WindowsAPICodePack/Shell/Interop/ExplorerBrowser/ExplorerBrowserNativeMethods.cs b/src/External/WindowsAPICodePack/Shell/Interop/ExplorerBrowser/ExplorerBrowserNativeMethods.cs
deleted file mode 100644
index eeed1b5..0000000
--- a/src/External/WindowsAPICodePack/Shell/Interop/ExplorerBrowser/ExplorerBrowserNativeMethods.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Runtime.InteropServices;
-using System.Security;
-using MS.WindowsAPICodePack.Internal;
-
-namespace Microsoft.WindowsAPICodePack.Controls
-{
- ///
- /// Internal class that contains interop declarations for
- /// functions that are not benign and are performance critical.
- ///
- [SuppressUnmanagedCodeSecurity]
- internal static class ExplorerBrowserNativeMethods
- {
- [DllImport( "SHLWAPI.DLL", CharSet = CharSet.Unicode, SetLastError = true )]
- internal static extern HRESULT IUnknown_SetSite(
- [In, MarshalAs( UnmanagedType.IUnknown )] object punk,
- [In, MarshalAs( UnmanagedType.IUnknown )] object punkSite );
-
-
- [DllImport( "SHLWAPI.DLL", CharSet = CharSet.Unicode, SetLastError = true )]
- internal static extern HRESULT ConnectToConnectionPoint(
- [In, MarshalAs( UnmanagedType.IUnknown )] object punk,
- ref Guid riidEvent,
- bool fConnect,
- [In, MarshalAs( UnmanagedType.IUnknown )] object punkTarget,
- ref uint pdwCookie,
- ref IntPtr ppcpOut );
-
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/Interop/KnownFolders/KnownFoldersCOMGuids.cs b/src/External/WindowsAPICodePack/Shell/Interop/KnownFolders/KnownFoldersCOMGuids.cs
deleted file mode 100644
index 09bc4dc..0000000
--- a/src/External/WindowsAPICodePack/Shell/Interop/KnownFolders/KnownFoldersCOMGuids.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-namespace Microsoft.WindowsAPICodePack.Shell
-{
- internal static class KnownFoldersIIDGuid
- {
- static KnownFoldersIIDGuid()
- {
- // Hide default constructor
- }
-
- // IID GUID strings for relevant Shell COM interfaces.
- internal const string IKnownFolder = "3AA7AF7E-9B36-420c-A8E3-F77D4674A488";
- internal const string IKnownFolderManager = "8BE2D872-86AA-4d47-B776-32CCA40C7018";
- }
-
- internal static class KnownFoldersCLSIDGuid
- {
- static KnownFoldersCLSIDGuid()
- {
- // Hide default constructor
- }
-
- // CLSID GUID strings for relevant coclasses.
- internal const string KnownFolderManager = "4df0c730-df9d-4ae3-9153-aa6b82e9795a";
- }
-
- internal static class KnownFoldersKFIDGuid
- {
- static KnownFoldersKFIDGuid()
- {
- // Hide default constructor
- }
-
- internal const string ComputerFolder = "0AC0837C-BBF8-452A-850D-79D08E667CA7";
- internal const string Favorites = "1777F761-68AD-4D8A-87BD-30B759FA33DD";
- internal const string Documents = "FDD39AD0-238F-46AF-ADB4-6C85480369C7";
- internal const string Profile = "5E6C858F-0E22-4760-9AFE-EA3317B67173";
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/Interop/KnownFolders/KnownFoldersCOMInterfaces.cs b/src/External/WindowsAPICodePack/Shell/Interop/KnownFolders/KnownFoldersCOMInterfaces.cs
deleted file mode 100644
index 1fb168b..0000000
--- a/src/External/WindowsAPICodePack/Shell/Interop/KnownFolders/KnownFoldersCOMInterfaces.cs
+++ /dev/null
@@ -1,184 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-using MS.WindowsAPICodePack.Internal;
-
-namespace Microsoft.WindowsAPICodePack.Shell
-{
- // Disable warning if a method declaration hides another inherited from a parent COM interface
- // To successfully import a COM interface, all inherited methods need to be declared again with
- // the exception of those already declared in "IUnknown"
- #pragma warning disable 0108
-
- [ComImport,
- Guid(KnownFoldersIIDGuid.IKnownFolder),
- InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
- internal interface IKnownFolderNative
- {
- [MethodImpl(MethodImplOptions.InternalCall,
- MethodCodeType = MethodCodeType.Runtime)]
- Guid GetId();
-
- [MethodImpl(MethodImplOptions.InternalCall,
- MethodCodeType = MethodCodeType.Runtime)]
- FolderCategory GetCategory();
-
- [MethodImpl(MethodImplOptions.InternalCall,
- MethodCodeType = MethodCodeType.Runtime)]
- [PreserveSig]
- HRESULT GetShellItem([In] int i,
- ref Guid interfaceGuid,
- [Out, MarshalAs(UnmanagedType.Interface)] out IShellItem2 shellItem);
-
- [return: MarshalAs(UnmanagedType.LPWStr)]
- [MethodImpl(MethodImplOptions.InternalCall,
- MethodCodeType = MethodCodeType.Runtime)]
- string GetPath([In] int option);
-
- [MethodImpl(MethodImplOptions.InternalCall,
- MethodCodeType = MethodCodeType.Runtime)]
- void SetPath([In] int i, [In] string path);
-
- [MethodImpl(MethodImplOptions.InternalCall,
- MethodCodeType = MethodCodeType.Runtime)]
- void GetIDList([In] int i,
- [Out] out IntPtr itemIdentifierListPointer);
-
- [MethodImpl(MethodImplOptions.InternalCall,
- MethodCodeType = MethodCodeType.Runtime)]
- Guid GetFolderType();
-
- [MethodImpl(MethodImplOptions.InternalCall,
- MethodCodeType = MethodCodeType.Runtime)]
- RedirectionCapabilities GetRedirectionCapabilities();
-
- [MethodImpl(MethodImplOptions.InternalCall,
- MethodCodeType = MethodCodeType.Runtime)]
- void GetFolderDefinition(
- [Out, MarshalAs(UnmanagedType.Struct)] out KnownFoldersSafeNativeMethods.NativeFolderDefinition definition);
-
- }
-
- [ComImport,
- Guid(KnownFoldersIIDGuid.IKnownFolderManager),
- InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
- internal interface IKnownFolderManager
- {
- [MethodImpl(MethodImplOptions.InternalCall,
- MethodCodeType = MethodCodeType.Runtime)]
- void FolderIdFromCsidl(int csidl,
- [Out] out Guid knownFolderID);
-
- [MethodImpl(MethodImplOptions.InternalCall,
- MethodCodeType = MethodCodeType.Runtime)]
- void FolderIdToCsidl([In, MarshalAs(UnmanagedType.LPStruct)] Guid id,
- [Out] out int csidl);
-
- [MethodImpl(MethodImplOptions.InternalCall,
- MethodCodeType = MethodCodeType.Runtime)]
- void GetFolderIds([Out] out IntPtr folders,
- [Out] out UInt32 count);
-
- [PreserveSig]
- [MethodImpl(MethodImplOptions.InternalCall,
- MethodCodeType = MethodCodeType.Runtime)]
- HRESULT GetFolder([In, MarshalAs(UnmanagedType.LPStruct)] Guid id,
- [Out, MarshalAs(UnmanagedType.Interface)] out IKnownFolderNative knownFolder);
-
- [MethodImpl(MethodImplOptions.InternalCall,
- MethodCodeType = MethodCodeType.Runtime)]
- void GetFolderByName(string canonicalName,
- [Out, MarshalAs(UnmanagedType.Interface)] out IKnownFolderNative knownFolder);
-
- [MethodImpl(MethodImplOptions.InternalCall,
- MethodCodeType = MethodCodeType.Runtime)]
- void RegisterFolder(
- [In, MarshalAs(UnmanagedType.LPStruct)] Guid knownFolderGuid,
- [In] ref KnownFoldersSafeNativeMethods.NativeFolderDefinition knownFolderDefinition);
-
- [MethodImpl(MethodImplOptions.InternalCall,
- MethodCodeType = MethodCodeType.Runtime)]
- void UnregisterFolder(
- [In, MarshalAs(UnmanagedType.LPStruct)] Guid knownFolderGuid);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void FindFolderFromPath(
- [In, MarshalAs(UnmanagedType.LPWStr)] string path,
- [In] int mode,
- [Out, MarshalAs(UnmanagedType.Interface)] out IKnownFolderNative knownFolder);
-
- [PreserveSig]
- [MethodImpl(MethodImplOptions.InternalCall,
- MethodCodeType = MethodCodeType.Runtime)]
- HRESULT FindFolderFromIDList(IntPtr pidl, [Out, MarshalAs(UnmanagedType.Interface)] out IKnownFolderNative knownFolder);
-
- [MethodImpl(MethodImplOptions.InternalCall,
- MethodCodeType = MethodCodeType.Runtime)]
- void Redirect();
- }
-
- [ComImport]
- [Guid("4df0c730-df9d-4ae3-9153-aa6b82e9795a")]
- internal class KnownFolderManagerClass : IKnownFolderManager
- {
- [MethodImpl(MethodImplOptions.InternalCall,
- MethodCodeType = MethodCodeType.Runtime)]
- public virtual extern void FolderIdFromCsidl(int csidl,
- [Out] out Guid knownFolderID);
-
- [MethodImpl(MethodImplOptions.InternalCall,
- MethodCodeType = MethodCodeType.Runtime)]
- public virtual extern void FolderIdToCsidl(
- [In, MarshalAs(UnmanagedType.LPStruct)] Guid id,
- [Out] out int csidl);
-
- [MethodImpl(MethodImplOptions.InternalCall,
- MethodCodeType = MethodCodeType.Runtime)]
- public virtual extern void GetFolderIds(
- [Out] out IntPtr folders,
- [Out] out UInt32 count);
-
- [PreserveSig]
- [MethodImpl(MethodImplOptions.InternalCall,
- MethodCodeType = MethodCodeType.Runtime)]
- public virtual extern HRESULT GetFolder(
- [In, MarshalAs(UnmanagedType.LPStruct)] Guid id,
- [Out, MarshalAs(UnmanagedType.Interface)]
- out IKnownFolderNative knownFolder);
-
- [MethodImpl(MethodImplOptions.InternalCall,
- MethodCodeType = MethodCodeType.Runtime)]
- public virtual extern void GetFolderByName(
- string canonicalName,
- [Out, MarshalAs(UnmanagedType.Interface)] out IKnownFolderNative knownFolder);
-
- [MethodImpl(MethodImplOptions.InternalCall,
- MethodCodeType = MethodCodeType.Runtime)]
- public virtual extern void RegisterFolder(
- [In, MarshalAs(UnmanagedType.LPStruct)] Guid knownFolderGuid,
- [In] ref KnownFoldersSafeNativeMethods.NativeFolderDefinition knownFolderDefinition);
-
- [MethodImpl(MethodImplOptions.InternalCall,
- MethodCodeType = MethodCodeType.Runtime)]
- public virtual extern void UnregisterFolder(
- [In, MarshalAs(UnmanagedType.LPStruct)] Guid knownFolderGuid);
-
- [MethodImpl(MethodImplOptions.InternalCall,
- MethodCodeType = MethodCodeType.Runtime)]
- public virtual extern void FindFolderFromPath(
- [In, MarshalAs(UnmanagedType.LPWStr)] string path,
- [In] int mode,
- [Out, MarshalAs(UnmanagedType.Interface)] out IKnownFolderNative knownFolder);
-
- [PreserveSig]
- [MethodImpl(MethodImplOptions.InternalCall,
- MethodCodeType = MethodCodeType.Runtime)]
- public virtual extern HRESULT FindFolderFromIDList(IntPtr pidl, [Out, MarshalAs(UnmanagedType.Interface)] out IKnownFolderNative knownFolder);
-
- [MethodImpl(MethodImplOptions.InternalCall,
- MethodCodeType = MethodCodeType.Runtime)]
- public virtual extern void Redirect();
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/Interop/KnownFolders/KnownFoldersNativeMethods.cs b/src/External/WindowsAPICodePack/Shell/Interop/KnownFolders/KnownFoldersNativeMethods.cs
deleted file mode 100644
index a63a557..0000000
--- a/src/External/WindowsAPICodePack/Shell/Interop/KnownFolders/KnownFoldersNativeMethods.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Runtime.InteropServices;
-using System.Security;
-
-namespace Microsoft.WindowsAPICodePack.Shell
-{
- ///
- /// Internal class that contains interop declarations for
- /// functions that are considered benign but that
- /// are performance critical.
- ///
- ///
- /// Functions that are benign but not performance critical
- /// should be located in the NativeMethods class.
- ///
- [SuppressUnmanagedCodeSecurity]
- internal static class KnownFoldersSafeNativeMethods
- {
- #region KnownFolders
-
- [StructLayout(LayoutKind.Sequential)]
- internal struct NativeFolderDefinition
- {
- internal FolderCategory category;
- internal IntPtr name;
- internal IntPtr description;
- internal Guid parentId;
- internal IntPtr relativePath;
- internal IntPtr parsingName;
- internal IntPtr tooltip;
- internal IntPtr localizedName;
- internal IntPtr icon;
- internal IntPtr security;
- internal UInt32 attributes;
- internal DefinitionOptions definitionOptions;
- internal Guid folderTypeId;
- }
-
- #endregion
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/Interop/PropertySystem/PropertySystemCOMInterfaces.cs b/src/External/WindowsAPICodePack/Shell/Interop/PropertySystem/PropertySystemCOMInterfaces.cs
deleted file mode 100644
index 2d21ea1..0000000
--- a/src/External/WindowsAPICodePack/Shell/Interop/PropertySystem/PropertySystemCOMInterfaces.cs
+++ /dev/null
@@ -1,258 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-using MS.WindowsAPICodePack.Internal;
-
-namespace Microsoft.WindowsAPICodePack.Shell.PropertySystem
-{
-// Disable warning if a method declaration hides another inherited from a parent COM interface
-// To successfully import a COM interface, all inherited methods need to be declared again with
-// the exception of those already declared in "IUnknown"
-#pragma warning disable 108
-
- #region Property System COM Interfaces
- [ComImport,
- Guid(ShellIIDGuid.IPropertyStore),
- InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
- internal interface IPropertyStore
- {
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetCount([Out] out uint cProps);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetAt([In] uint iProp, out PropertyKey pkey);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetValue([In] ref PropertyKey key, out PropVariant pv);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), PreserveSig]
- [return: MarshalAs(UnmanagedType.I4)]
- int SetValue([In] ref PropertyKey key, [In] ref PropVariant pv);
-
- [PreserveSig]
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- HRESULT Commit();
- }
-
- [ComImport,
- Guid(ShellIIDGuid.IPropertyDescriptionList),
- InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
- internal interface IPropertyDescriptionList
- {
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetCount(out uint pcElem);
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetAt([In] uint iElem, [In] ref Guid riid, [MarshalAs(UnmanagedType.Interface)] out IPropertyDescription ppv);
- }
-
- [ComImport,
- Guid(ShellIIDGuid.IPropertyDescription),
- InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
- internal interface IPropertyDescription
- {
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetPropertyKey(out PropertyKey pkey);
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetCanonicalName([MarshalAs(UnmanagedType.LPWStr)] out string ppszName);
- [PreserveSig]
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- HRESULT GetPropertyType(out VarEnum pvartype);
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime),
- PreserveSig]
- HRESULT GetDisplayName(out IntPtr ppszName);
- [PreserveSig]
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- HRESULT GetEditInvitation( out IntPtr ppszInvite);
- [PreserveSig]
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- HRESULT GetTypeFlags([In] PropertyTypeFlags mask, out PropertyTypeFlags ppdtFlags);
- [PreserveSig]
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- HRESULT GetViewFlags(out PropertyViewFlags ppdvFlags);
- [PreserveSig]
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- HRESULT GetDefaultColumnWidth(out uint pcxChars);
- [PreserveSig]
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- HRESULT GetDisplayType(out PropertyDisplayType pdisplaytype);
- [PreserveSig]
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- HRESULT GetColumnState(out PropertyColumnState pcsFlags);
- [PreserveSig]
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- HRESULT GetGroupingRange(out PropertyGroupingRange pgr);
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetRelativeDescriptionType(out PropertySystemNativeMethods.PROPDESC_RELATIVEDESCRIPTION_TYPE prdt);
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetRelativeDescription([In] ref PropVariant propvar1, [In] ref PropVariant propvar2, [MarshalAs(UnmanagedType.LPWStr)] out string ppszDesc1, [MarshalAs(UnmanagedType.LPWStr)] out string ppszDesc2);
- [PreserveSig]
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- HRESULT GetSortDescription(out PropertySortDescription psd);
- [PreserveSig]
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- HRESULT GetSortDescriptionLabel([In] bool fDescending, out IntPtr ppszDescription);
- [PreserveSig]
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- HRESULT GetAggregationType(out PropertyAggregationType paggtype);
- [PreserveSig]
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- HRESULT GetConditionType(out PropertyConditionType pcontype, out PropertyConditionOperation popDefault);
- [PreserveSig]
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- HRESULT GetEnumTypeList([In] ref Guid riid, [Out, MarshalAs(UnmanagedType.Interface)] out IPropertyEnumTypeList ppv);
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void CoerceToCanonicalValue([In] ref PropVariant propvar, out PropVariant ppropvar);
- [PreserveSig]
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- HRESULT FormatForDisplay([In] ref PropVariant propvar, [In] ref PropertyDescriptionFormat pdfFlags, [MarshalAs(UnmanagedType.LPWStr)] out string ppszDisplay);
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void IsValueCanonical([In] ref PropVariant propvar);
- }
-
- [ComImport,
- Guid(ShellIIDGuid.IPropertyDescription2),
- InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
- internal interface IPropertyDescription2 : IPropertyDescription
- {
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetPropertyKey(out PropertyKey pkey);
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetCanonicalName([MarshalAs(UnmanagedType.LPWStr)] out string ppszName);
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetPropertyType(out VarEnum pvartype);
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetDisplayName([MarshalAs(UnmanagedType.LPWStr)] out string ppszName);
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetEditInvitation([MarshalAs(UnmanagedType.LPWStr)] out string ppszInvite);
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetTypeFlags([In] PropertyTypeFlags mask, out PropertyTypeFlags ppdtFlags);
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetViewFlags(out PropertyViewFlags ppdvFlags);
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetDefaultColumnWidth(out uint pcxChars);
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetDisplayType(out PropertyDisplayType pdisplaytype);
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetColumnState(out uint pcsFlags);
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetGroupingRange(out PropertyGroupingRange pgr);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetRelativeDescriptionType(out PropertySystemNativeMethods.PROPDESC_RELATIVEDESCRIPTION_TYPE prdt);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetRelativeDescription([In] ref PropVariant propvar1, [In] ref PropVariant propvar2,
- [MarshalAs(UnmanagedType.LPWStr)] out string ppszDesc1,
- [MarshalAs(UnmanagedType.LPWStr)] out string ppszDesc2);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetSortDescription(out PropertySortDescription psd);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetSortDescriptionLabel([In] int fDescending, [MarshalAs(UnmanagedType.LPWStr)] out string ppszDescription);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetAggregationType(out PropertyAggregationType paggtype);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetConditionType(
- out PropertyConditionType pcontype,
- out PropertyConditionOperation popDefault);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetEnumTypeList([In] ref Guid riid, out IntPtr ppv);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void CoerceToCanonicalValue([In] ref PropVariant propvar, out PropVariant ppropvar);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void FormatForDisplay([In] ref PropVariant propvar, [In] ref PropertyDescriptionFormat pdfFlags, [MarshalAs(UnmanagedType.LPWStr)] out string ppszDisplay);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void IsValueCanonical([In] ref PropVariant propvar);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetImageReferenceForValue(
- ref PropVariant propvar,
- [Out, MarshalAs(UnmanagedType.LPWStr)] out string ppszImageRes);
- }
-
- [ComImport,
- Guid(ShellIIDGuid.IPropertyEnumType),
- InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
- internal interface IPropertyEnumType
- {
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetEnumType([Out] out PropEnumType penumtype);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetValue([Out] out PropVariant ppropvar);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetRangeMinValue([Out] out PropVariant ppropvar);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetRangeSetValue([Out] out PropVariant ppropvar);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetDisplayText([Out, MarshalAs(UnmanagedType.LPWStr)] out string ppszDisplay);
- }
-
- [ComImport,
- Guid(ShellIIDGuid.IPropertyEnumType2),
- InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
- internal interface IPropertyEnumType2 : IPropertyEnumType
- {
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetEnumType([Out] out PropEnumType penumtype);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetValue([Out] out PropVariant ppropvar);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetRangeMinValue([Out] out PropVariant ppropvar);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetRangeSetValue([Out] out PropVariant ppropvar);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetDisplayText([Out, MarshalAs(UnmanagedType.LPWStr)] out string ppszDisplay);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetImageReference([Out, MarshalAs(UnmanagedType.LPWStr)] out string ppszImageRes);
- }
-
-
- [ComImport,
- Guid(ShellIIDGuid.IPropertyEnumTypeList),
- InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
- internal interface IPropertyEnumTypeList
- {
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetCount([Out] out uint pctypes);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetAt(
- [In] uint itype,
- [In] ref Guid riid, // riid may be IID_IPropertyEnumType
- [Out, MarshalAs(UnmanagedType.Interface)] out IPropertyEnumType ppv);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void GetConditionAt(
- [In] uint index,
- [In] ref Guid riid,
- out IntPtr ppv);
-
- [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
- void FindMatchingIndex(
- [In] ref PropVariant propvarCmp,
- [Out] out uint pnIndex);
- }
-
- #endregion
-
-#pragma warning restore 108
-
-}
diff --git a/src/External/WindowsAPICodePack/Shell/Interop/PropertySystem/PropertySystemNativeMethods.cs b/src/External/WindowsAPICodePack/Shell/Interop/PropertySystem/PropertySystemNativeMethods.cs
deleted file mode 100644
index 349b98b..0000000
--- a/src/External/WindowsAPICodePack/Shell/Interop/PropertySystem/PropertySystemNativeMethods.cs
+++ /dev/null
@@ -1,67 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Runtime.InteropServices;
-using MS.WindowsAPICodePack.Internal;
-
-namespace Microsoft.WindowsAPICodePack.Shell.PropertySystem
-{
- internal static class PropertySystemNativeMethods
- {
- static PropertySystemNativeMethods()
- {
- // Hide default constructor
- }
-
- #region Property Definitions
-
- internal enum PROPDESC_RELATIVEDESCRIPTION_TYPE
- {
- PDRDT_GENERAL,
- PDRDT_DATE,
- PDRDT_SIZE,
- PDRDT_COUNT,
- PDRDT_REVISION,
- PDRDT_LENGTH,
- PDRDT_DURATION,
- PDRDT_SPEED,
- PDRDT_RATE,
- PDRDT_RATING,
- PDRDT_PRIORITY
- }
-
- #endregion
-
- #region Property System Helpers
-
- [DllImport("propsys.dll", CharSet = CharSet.Unicode, SetLastError = true)]
- internal static extern int PSGetNameFromPropertyKey(
- ref PropertyKey propkey,
- [Out, MarshalAs(UnmanagedType.LPWStr)] out string ppszCanonicalName
- );
-
- [DllImport("propsys.dll", CharSet = CharSet.Unicode, SetLastError = true)]
- internal static extern HRESULT PSGetPropertyDescription(
- ref PropertyKey propkey,
- ref Guid riid,
- [Out, MarshalAs(UnmanagedType.Interface)] out IPropertyDescription ppv
- );
-
- [DllImport("propsys.dll", CharSet = CharSet.Unicode, SetLastError = true)]
- internal static extern int PSGetPropertyKeyFromName(
- [In, MarshalAs(UnmanagedType.LPWStr)] string pszCanonicalName,
- out PropertyKey propkey
- );
-
- [DllImport("propsys.dll", CharSet = CharSet.Unicode, SetLastError = true)]
- internal static extern int PSGetPropertyDescriptionListFromString(
- [In, MarshalAs(UnmanagedType.LPWStr)] string pszPropList,
- [In] ref Guid riid,
- out IPropertyDescriptionList ppv
- );
-
-
-
- #endregion
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/Interop/StockIcons/StockIconsNativeMethods.cs b/src/External/WindowsAPICodePack/Shell/Interop/StockIcons/StockIconsNativeMethods.cs
deleted file mode 100644
index af414dd..0000000
--- a/src/External/WindowsAPICodePack/Shell/Interop/StockIcons/StockIconsNativeMethods.cs
+++ /dev/null
@@ -1,84 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Runtime.InteropServices;
-using MS.WindowsAPICodePack.Internal;
-
-namespace Microsoft.WindowsAPICodePack.Shell
-{
- internal class StockIconsNativeMethods
- {
- #region StockIcon declarations
-
- ///
- /// Specifies options for the appearance of the
- /// stock icon.
- ///
- [Flags]
- internal enum StockIconOptions //: uint
- {
-
- ///
- /// Retrieve the small version of the icon, as specified by
- /// SM_CXICON and SM_CYICON system metrics.
- ///
- Large = 0x000000000,
-
- ///
- /// Retrieve the small version of the icon, as specified by
- /// SM_CXSMICON and SM_CYSMICON system metrics.
- ///
- Small = 0x000000001,
-
- ///
- /// Retrieve the shell-sized icons (instead of the
- /// size specified by the system metrics).
- ///
- ShellSize = 0x000000004,
-
- ///
- /// Specified that the hIcon member of the SHSTOCKICONINFO
- /// structure receives a handle to the specified icon.
- ///
- Handle = 0x000000100,
-
- ///
- /// Specifies that the iSysImageImage member of the SHSTOCKICONINFO
- /// structure receives the index of the specified
- /// icon in the system imagelist.
- ///
- SystemIndex = 0x000004000,
-
- ///
- /// Adds the link overlay to the icon.
- ///
- LinkOverlay = 0x000008000,
-
- ///
- /// Adds the system highlight color to the icon.
- ///
- Selected = 0x000010000
- }
-
- [StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
- internal struct StockIconInfo
- {
- internal UInt32 StuctureSize;
- internal IntPtr Handle;
- internal Int32 ImageIndex;
- internal Int32 Identifier;
- [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]
- internal string Path;
- }
-
- [PreserveSig]
- [DllImport("Shell32.dll", CharSet = CharSet.Unicode,
- ExactSpelling = true, SetLastError = false)]
- internal static extern HRESULT SHGetStockIconInfo(
- StockIconIdentifier identifier,
- StockIconOptions flags,
- ref StockIconInfo info);
-
- #endregion
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/Interop/Taskbar/TabbedThumbnailNativeMethods.cs b/src/External/WindowsAPICodePack/Shell/Interop/Taskbar/TabbedThumbnailNativeMethods.cs
deleted file mode 100644
index 9ff61e5..0000000
--- a/src/External/WindowsAPICodePack/Shell/Interop/Taskbar/TabbedThumbnailNativeMethods.cs
+++ /dev/null
@@ -1,242 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Text;
-using System.Runtime.InteropServices;
-using System.Drawing;
-using MS.WindowsAPICodePack.Internal;
-
-namespace Microsoft.WindowsAPICodePack.Taskbar
-{
- internal class TabbedThumbnailNativeMethods
- {
- internal const int DWM_SIT_DISPLAYFRAME = 0x00000001;
-
- internal const int DWMWA_FORCE_ICONIC_REPRESENTATION = 7;
- internal const int DWMWA_HAS_ICONIC_BITMAP = 10;
-
- internal const uint WM_ACTIVATEAPP = 0x001C;
- internal const uint WM_CREATE = 0x1;
- internal const uint WM_DESTROY = 0x2;
- internal const uint WM_NCDESTROY = 0x0082;
- internal const uint WM_ACTIVATE = 0x0006;
- internal const uint WM_CLOSE = 0x0010;
- internal const uint WM_SYSCOMMAND = 0x112;
- internal const uint WM_DWMSENDICONICTHUMBNAIL = 0x0323;
- internal const uint WM_DWMSENDICONICLIVEPREVIEWBITMAP = 0x0326;
-
- internal const uint WA_ACTIVE = 1;
- internal const uint WA_CLICKACTIVE = 2;
-
- internal const int SC_CLOSE = 0xF060;
- internal const int SC_MAXIMIZE = 0xF030;
- internal const int SC_MINIMIZE = 0xF020;
-
- internal const uint MSGFLT_ADD = 1;
- internal const uint MSGFLT_REMOVE = 2;
-
-
-
- private TabbedThumbnailNativeMethods()
- {
- // Hide the default constructor as this is a static class and we don't want to instantiate it.
- }
-
- [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
- internal static extern IntPtr SendMessage(
- IntPtr hWnd,
- uint msg,
- IntPtr wParam,
- IntPtr lParam
- );
-
- [DllImport("dwmapi.dll")]
- internal static extern int DwmSetIconicThumbnail(
- IntPtr hwnd, IntPtr hbitmap, uint flags);
-
- [DllImport("user32.dll")]
- internal static extern int GetWindowText(
- IntPtr hwnd, StringBuilder str, int maxCount);
-
- [DllImport("dwmapi.dll")]
- internal static extern int DwmInvalidateIconicBitmaps(IntPtr hwnd);
-
- [DllImport("dwmapi.dll")]
- internal static extern int DwmSetIconicLivePreviewBitmap(
- IntPtr hwnd,
- IntPtr hbitmap,
- ref CoreNativeMethods.POINT ptClient,
- uint flags);
-
- [DllImport("dwmapi.dll")]
- internal static extern int DwmSetIconicLivePreviewBitmap(
- IntPtr hwnd, IntPtr hbitmap, IntPtr ptClient, uint flags);
-
- [DllImport("dwmapi.dll", PreserveSig = true)]
- static extern bool DwmIsCompositionEnabled();
-
- [DllImport("dwmapi.dll", PreserveSig = true)]
- internal static extern int DwmSetWindowAttribute(
- IntPtr hwnd,
- //DWMWA_* values.
- uint dwAttributeToSet,
- IntPtr pvAttributeValue,
- uint cbAttribute);
-
- [DllImport("user32.dll")]
- [return: MarshalAs(UnmanagedType.Bool)]
- internal static extern bool GetWindowRect(IntPtr hwnd, ref CoreNativeMethods.RECT rect);
-
- [DllImport("User32.dll", SetLastError = true)]
- internal static extern bool PrintWindow(IntPtr hwnd, IntPtr hDC, uint nFlags);
-
- [DllImport("gdi32.dll")]
- internal static extern IntPtr CreateRectRgn(int nLeftRect, int nTopRect, int nRightRect,
- int nBottomRect);
-
- [DllImport("user32.dll")]
- internal static extern int GetWindowRgn(IntPtr hWnd, IntPtr hRgn);
-
- [DllImport("user32.dll")]
- [return: MarshalAs(UnmanagedType.Bool)]
- internal static extern bool GetClientRect(IntPtr hwnd, ref CoreNativeMethods.RECT rect);
-
- internal static bool GetClientSize(IntPtr hwnd, out System.Drawing.Size size)
- {
- CoreNativeMethods.RECT rect = new CoreNativeMethods.RECT();
- if (!GetClientRect(hwnd, ref rect))
- {
- size = new System.Drawing.Size(-1, -1);
- return false;
- }
- size = new System.Drawing.Size(rect.right, rect.bottom);
- return true;
- }
-
- [DllImport("user32.dll")]
- [return: MarshalAs(UnmanagedType.Bool)]
- internal static extern bool ClientToScreen(
- IntPtr hwnd,
- ref CoreNativeMethods.POINT point);
-
-
- [DllImport("gdi32.dll")]
- [return: MarshalAs(UnmanagedType.Bool)]
- internal static extern bool StretchBlt(
- IntPtr hDestDC, int destX, int destY, int destWidth, int destHeight,
- IntPtr hSrcDC, int srcX, int srcY, int srcWidth, int srcHeight,
- uint operation);
-
- [DllImport("user32.dll")]
- internal static extern IntPtr GetWindowDC(IntPtr hwnd);
-
- [DllImport("user32.dll")]
- internal static extern int ReleaseDC(IntPtr hwnd, IntPtr hdc);
-
- [DllImport("user32.dll", SetLastError = true)]
- internal static extern IntPtr ChangeWindowMessageFilter(uint message, uint dwFlag);
-
- ///
- /// Sets the specified iconic thumbnail for the specified window.
- /// This is typically done in response to a DWM message.
- ///
- /// The window handle.
- /// The thumbnail bitmap.
- internal static void SetIconicThumbnail(IntPtr hwnd, IntPtr hBitmap)
- {
- int rc = DwmSetIconicThumbnail(
- hwnd,
- hBitmap,
- DWM_SIT_DISPLAYFRAME);
- if (rc != 0)
- throw Marshal.GetExceptionForHR(rc);
- }
-
- ///
- /// Sets the specified peek (live preview) bitmap for the specified
- /// window. This is typically done in response to a DWM message.
- ///
- /// The window handle.
- /// The thumbnail bitmap.
- /// Whether to display a standard window
- /// frame around the bitmap.
- internal static void SetPeekBitmap(IntPtr hwnd, IntPtr bitmap, bool displayFrame)
- {
- int rc = DwmSetIconicLivePreviewBitmap(
- hwnd,
- bitmap,
- IntPtr.Zero,
- displayFrame ? DWM_SIT_DISPLAYFRAME : (uint)0);
- if (rc != 0)
- throw Marshal.GetExceptionForHR(rc);
- }
-
- ///
- /// Sets the specified peek (live preview) bitmap for the specified
- /// window. This is typically done in response to a DWM message.
- ///
- /// The window handle.
- /// The thumbnail bitmap.
- /// The client area offset at which to display
- /// the specified bitmap. The rest of the parent window will be
- /// displayed as "remembered" by the DWM.
- /// Whether to display a standard window
- /// frame around the bitmap.
- internal static void SetPeekBitmap(IntPtr hwnd, IntPtr bitmap, Point offset, bool displayFrame)
- {
- var nativePoint = new CoreNativeMethods.POINT(offset.X, offset.Y);
- int rc = DwmSetIconicLivePreviewBitmap(
- hwnd,
- bitmap,
- ref nativePoint,
- displayFrame ? DWM_SIT_DISPLAYFRAME : (uint)0);
-
- if (rc != 0)
- {
- Exception e = Marshal.GetExceptionForHR(rc);
-
- if (e is ArgumentException)
- {
- // Ignore argument exception as it's not really recommended to be throwing
- // exception when rendering the peek bitmap. If it's some other kind of exception,
- // then throw it.
- }
- else
- throw e;
- }
- }
-
- ///
- /// Call this method to either enable custom previews on the taskbar (second argument as true)
- /// or to disable (second argument as false). If called with True, the method will call DwmSetWindowAttribute
- /// for the specific window handle and let DWM know that we will be providing a custom bitmap for the thumbnail
- /// as well as Aero peek.
- ///
- ///
- ///
- internal static void EnableCustomWindowPreview(IntPtr hwnd, bool enable)
- {
- IntPtr t = Marshal.AllocHGlobal(4);
- Marshal.WriteInt32(t, enable ? 1 : 0);
-
- try
- {
- int rc;
- rc = DwmSetWindowAttribute(
- hwnd, DWMWA_HAS_ICONIC_BITMAP, t, 4);
- if (rc != 0)
- throw Marshal.GetExceptionForHR(rc);
-
- rc = DwmSetWindowAttribute(
- hwnd, DWMWA_FORCE_ICONIC_REPRESENTATION, t, 4);
- if (rc != 0)
- throw Marshal.GetExceptionForHR(rc);
- }
- finally
- {
- Marshal.FreeHGlobal(t);
- }
- }
-
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/Interop/Taskbar/TaskbarCOMInterfaces.cs b/src/External/WindowsAPICodePack/Shell/Interop/Taskbar/TaskbarCOMInterfaces.cs
deleted file mode 100644
index fa256ce..0000000
--- a/src/External/WindowsAPICodePack/Shell/Interop/Taskbar/TaskbarCOMInterfaces.cs
+++ /dev/null
@@ -1,155 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Runtime.InteropServices;
-using System.Text;
-using MS.WindowsAPICodePack.Internal;
-
-namespace Microsoft.WindowsAPICodePack.Taskbar
-{
- [ComImportAttribute()]
- [GuidAttribute("6332DEBF-87B5-4670-90C0-5E57B408A49E")]
- [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
- internal interface ICustomDestinationList
- {
- void SetAppID(
- [MarshalAs(UnmanagedType.LPWStr)] string pszAppID);
- [PreserveSig]
- HRESULT BeginList(
- out uint cMaxSlots,
- ref Guid riid,
- [Out(), MarshalAs(UnmanagedType.Interface)] out object ppvObject);
- [PreserveSig]
- HRESULT AppendCategory(
- [MarshalAs(UnmanagedType.LPWStr)] string pszCategory,
- [MarshalAs(UnmanagedType.Interface)] IObjectArray poa);
- void AppendKnownCategory(
- [MarshalAs(UnmanagedType.I4)] KNOWNDESTCATEGORY category);
- [PreserveSig]
- HRESULT AddUserTasks(
- [MarshalAs(UnmanagedType.Interface)] IObjectArray poa);
- void CommitList();
- void GetRemovedDestinations(
- ref Guid riid,
- [Out(), MarshalAs(UnmanagedType.Interface)] out object ppvObject);
- void DeleteList(
- [MarshalAs(UnmanagedType.LPWStr)] string pszAppID);
- void AbortList();
- }
-
- [GuidAttribute("77F10CF0-3DB5-4966-B520-B7C54FD35ED6")]
- [ClassInterfaceAttribute(ClassInterfaceType.None)]
- [ComImportAttribute()]
- internal class CDestinationList { }
-
- [ComImportAttribute()]
- [GuidAttribute("92CA9DCD-5622-4BBA-A805-5E9F541BD8C9")]
- [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
- internal interface IObjectArray
- {
- void GetCount(out uint cObjects);
- void GetAt(
- uint iIndex,
- ref Guid riid,
- [Out(), MarshalAs(UnmanagedType.Interface)] out object ppvObject);
- }
-
- [ComImportAttribute()]
- [GuidAttribute("5632B1A4-E38A-400A-928A-D4CD63230295")]
- [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
- internal interface IObjectCollection
- {
- // IObjectArray
- [PreserveSig]
- void GetCount(out uint cObjects);
- [PreserveSig]
- void GetAt(
- uint iIndex,
- ref Guid riid,
- [Out(), MarshalAs(UnmanagedType.Interface)] out object ppvObject);
-
- // IObjectCollection
- void AddObject(
- [MarshalAs(UnmanagedType.Interface)] object pvObject);
- void AddFromArray(
- [MarshalAs(UnmanagedType.Interface)] IObjectArray poaSource);
- void RemoveObject(uint uiIndex);
- void Clear();
- }
-
- [GuidAttribute("2D3468C1-36A7-43B6-AC24-D3F02FD9607A")]
- [ClassInterfaceAttribute(ClassInterfaceType.None)]
- [ComImportAttribute()]
- internal class CEnumerableObjectCollection { }
-
- [ComImportAttribute()]
- [GuidAttribute("c43dc798-95d1-4bea-9030-bb99e2983a1a")]
- [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
- internal interface ITaskbarList4
- {
- // ITaskbarList
- [PreserveSig]
- void HrInit();
- [PreserveSig]
- void AddTab(IntPtr hwnd);
- [PreserveSig]
- void DeleteTab(IntPtr hwnd);
- [PreserveSig]
- void ActivateTab(IntPtr hwnd);
- [PreserveSig]
- void SetActiveAlt(IntPtr hwnd);
-
- // ITaskbarList2
- [PreserveSig]
- void MarkFullscreenWindow(
- IntPtr hwnd,
- [MarshalAs(UnmanagedType.Bool)] bool fFullscreen);
-
- // ITaskbarList3
- [PreserveSig]
- void SetProgressValue(IntPtr hwnd, UInt64 ullCompleted, UInt64 ullTotal);
- [PreserveSig]
- void SetProgressState(IntPtr hwnd, TBPFLAG tbpFlags);
- [PreserveSig]
- void RegisterTab(IntPtr hwndTab, IntPtr hwndMDI);
- [PreserveSig]
- void UnregisterTab(IntPtr hwndTab);
- [PreserveSig]
- void SetTabOrder(IntPtr hwndTab, IntPtr hwndInsertBefore);
- [PreserveSig]
- void SetTabActive(IntPtr hwndTab, IntPtr hwndInsertBefore, uint dwReserved);
- [PreserveSig]
- HRESULT ThumbBarAddButtons(
- IntPtr hwnd,
- uint cButtons,
- [MarshalAs(UnmanagedType.LPArray)] THUMBBUTTON[] pButtons);
- [PreserveSig]
- HRESULT ThumbBarUpdateButtons(
- IntPtr hwnd,
- uint cButtons,
- [MarshalAs(UnmanagedType.LPArray)] THUMBBUTTON[] pButtons);
- [PreserveSig]
- void ThumbBarSetImageList(IntPtr hwnd, IntPtr himl);
- [PreserveSig]
- void SetOverlayIcon(
- IntPtr hwnd,
- IntPtr hIcon,
- [MarshalAs(UnmanagedType.LPWStr)] string pszDescription);
- [PreserveSig]
- void SetThumbnailTooltip(
- IntPtr hwnd,
- [MarshalAs(UnmanagedType.LPWStr)] string pszTip);
- [PreserveSig]
- void SetThumbnailClip(
- IntPtr hwnd,
- IntPtr prcClip);
-
- // ITaskbarList4
- void SetTabProperties(IntPtr hwndTab, STPFLAG stpFlags);
- }
-
- [GuidAttribute("56FDF344-FD6D-11d0-958A-006097C9A090")]
- [ClassInterfaceAttribute(ClassInterfaceType.None)]
- [ComImportAttribute()]
- internal class CTaskbarList { }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/Interop/Taskbar/TaskbarNativeMethods.cs b/src/External/WindowsAPICodePack/Shell/Interop/Taskbar/TaskbarNativeMethods.cs
deleted file mode 100644
index d0f0847..0000000
--- a/src/External/WindowsAPICodePack/Shell/Interop/Taskbar/TaskbarNativeMethods.cs
+++ /dev/null
@@ -1,212 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Text;
-using System.Runtime.InteropServices;
-using System.Drawing;
-using MS.WindowsAPICodePack.Internal;
-using Microsoft.WindowsAPICodePack.Shell;
-using Microsoft.WindowsAPICodePack.Shell.PropertySystem;
-
-namespace Microsoft.WindowsAPICodePack.Taskbar
-{
- #region Enums
- internal enum KNOWNDESTCATEGORY
- {
- KDC_FREQUENT = 1,
- KDC_RECENT
- }
-
- internal enum SHARD
- {
- SHARD_PIDL = 0x1,
- SHARD_PATHA = 0x2,
- SHARD_PATHW = 0x3,
- SHARD_APPIDINFO = 0x4, // indicates the data type is a pointer to a SHARDAPPIDINFO structure
- SHARD_APPIDINFOIDLIST = 0x5, // indicates the data type is a pointer to a SHARDAPPIDINFOIDLIST structure
- SHARD_LINK = 0x6, // indicates the data type is a pointer to an IShellLink instance
- SHARD_APPIDINFOLINK = 0x7, // indicates the data type is a pointer to a SHARDAPPIDINFOLINK structure
- }
-
- internal enum TBPFLAG
- {
- TBPF_NOPROGRESS = 0,
- TBPF_INDETERMINATE = 0x1,
- TBPF_NORMAL = 0x2,
- TBPF_ERROR = 0x4,
- TBPF_PAUSED = 0x8
- }
-
- internal enum TBATFLAG
- {
- TBATF_USEMDITHUMBNAIL = 0x1,
- TBATF_USEMDILIVEPREVIEW = 0x2
- }
-
- internal enum THBMASK
- {
- THB_BITMAP = 0x1,
- THB_ICON = 0x2,
- THB_TOOLTIP = 0x4,
- THB_FLAGS = 0x8
- }
-
- [Flags]
- internal enum THBFLAGS
- {
- THBF_ENABLED = 0x00000000,
- THBF_DISABLED = 0x00000001,
- THBF_DISMISSONCLICK = 0x00000002,
- THBF_NOBACKGROUND = 0x00000004,
- THBF_HIDDEN = 0x00000008,
- THBF_NONINTERACTIVE = 0x00000010
- }
-
- internal enum STPFLAG
- {
- STPF_NONE = 0x0,
- STPF_USEAPPTHUMBNAILALWAYS = 0x1,
- STPF_USEAPPTHUMBNAILWHENACTIVE = 0x2,
- STPF_USEAPPPEEKALWAYS = 0x4,
- STPF_USEAPPPEEKWHENACTIVE = 0x8
- }
-
- #endregion
-
- #region Structs
-
- [StructLayout(LayoutKind.Explicit)]
- internal struct CALPWSTR
- {
- [FieldOffset(0)]
- internal uint cElems;
- [FieldOffset(4)]
- internal IntPtr pElems;
- }
-
- [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
- internal struct THUMBBUTTON
- {
- ///
- /// WPARAM value for a THUMBBUTTON being clicked.
- ///
- internal const int THBN_CLICKED = 0x1800;
-
- [MarshalAs(UnmanagedType.U4)]
- internal THBMASK dwMask;
- internal uint iId;
- internal uint iBitmap;
- internal IntPtr hIcon;
- [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]
- internal string szTip;
- [MarshalAs(UnmanagedType.U4)]
- internal THBFLAGS dwFlags;
- }
- #endregion;
-
- internal class TaskbarNativeMethods
- {
- internal static readonly uint DWM_SIT_DISPLAYFRAME = 0x00000001;
-
- internal static Guid IID_IObjectArray = new Guid("92CA9DCD-5622-4BBA-A805-5E9F541BD8C9");
- internal static Guid IID_IUnknown = new Guid("00000000-0000-0000-C000-000000000046");
-
- internal const int WM_COMMAND = 0x0111;
-
- // Register Window Message used by Shell to notify that the corresponding taskbar button has been added to the taskbar.
- internal static readonly uint WM_TASKBARBUTTONCREATED = RegisterWindowMessage("TaskbarButtonCreated");
-
- internal static readonly uint WM_DWMSENDICONICTHUMBNAIL = 0x0323;
- internal static readonly uint WM_DWMSENDICONICLIVEPREVIEWBITMAP = 0x0326;
-
- private TaskbarNativeMethods()
- {
- // Hide the default constructor as this is a static class and we don't want to instantiate it.
- }
-
-
- #region Methods
-
- [DllImport(CommonDllNames.Shell32,
- CharSet = CharSet.Auto,
- SetLastError = true)]
- internal static extern uint SHCreateItemFromParsingName(
- [MarshalAs(UnmanagedType.LPWStr)] string path,
- // The following parameter is not used - binding context.
- IntPtr pbc,
- ref Guid riid,
- [MarshalAs(UnmanagedType.Interface)] out IShellItem shellItem);
-
- [DllImport(CommonDllNames.Shell32)]
- internal static extern void SetCurrentProcessExplicitAppUserModelID(
- [MarshalAs(UnmanagedType.LPWStr)] string AppID);
-
- [DllImport(CommonDllNames.Shell32)]
- internal static extern void GetCurrentProcessExplicitAppUserModelID(
- [Out(), MarshalAs(UnmanagedType.LPWStr)] out string AppID);
-
- [DllImport(CommonDllNames.Shell32)]
- internal static extern void SHAddToRecentDocs(
- SHARD flags,
- [MarshalAs(UnmanagedType.LPWStr)] string path);
-
- internal static void SHAddToRecentDocs(string path)
- {
- SHAddToRecentDocs(SHARD.SHARD_PATHW, path);
- }
-
- [DllImport(CommonDllNames.User32)]
- internal static extern int GetWindowText(
- IntPtr hwnd, StringBuilder str, int maxCount);
-
- [DllImport(CommonDllNames.User32, EntryPoint = "RegisterWindowMessage", SetLastError = true, CharSet = CharSet.Unicode)]
- internal static extern uint RegisterWindowMessage([MarshalAs(UnmanagedType.LPWStr)] string lpString);
-
-
- [DllImport(CommonDllNames.Shell32)]
- public static extern int SHGetPropertyStoreForWindow(
- IntPtr hwnd,
- ref Guid iid /*IID_IPropertyStore*/,
- [Out(), MarshalAs(UnmanagedType.Interface)]
- out IPropertyStore propertyStore);
-
- ///
- /// Sets the window's application id by its window handle.
- ///
- /// The window handle.
- /// The application id.
- internal static void SetWindowAppId(IntPtr hwnd, string appId)
- {
- SetWindowProperty(hwnd, SystemProperties.System.AppUserModel.ID, appId);
- }
-
- internal static void SetWindowProperty(IntPtr hwnd, PropertyKey propkey, string value)
- {
- // Get the IPropertyStore for the given window handle
- IPropertyStore propStore = GetWindowPropertyStore(hwnd);
-
- // Set the value
- PropVariant pv = new PropVariant();
- propStore.SetValue(ref propkey, ref pv);
-
- // Dispose the IPropertyStore and PropVariant
- Marshal.ReleaseComObject(propStore);
- pv.Clear();
- }
-
- internal static IPropertyStore GetWindowPropertyStore(IntPtr hwnd)
- {
- IPropertyStore propStore;
- Guid guid = new Guid(ShellIIDGuid.IPropertyStore);
- int rc = SHGetPropertyStoreForWindow(
- hwnd,
- ref guid,
- out propStore);
- if (rc != 0)
- throw Marshal.GetExceptionForHR(rc);
- return propStore;
- }
-
- #endregion
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/KnownFolders/DefinitionOptions.cs b/src/External/WindowsAPICodePack/Shell/KnownFolders/DefinitionOptions.cs
deleted file mode 100644
index feebd01..0000000
--- a/src/External/WindowsAPICodePack/Shell/KnownFolders/DefinitionOptions.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-namespace Microsoft.WindowsAPICodePack.Shell
-{
- ///
- /// Specifies behaviors for known folders.
- ///
- [System.Flags]
- public enum DefinitionOptions
- {
- ///
- /// No behaviors are defined.
- ///
- None = 0x0,
- ///
- /// Prevents a per-user known folder from being
- /// redirected to a network location.
- ///
- LocalRedirectOnly = 0x2,
-
- ///
- /// The known folder can be roamed through PC-to-PC synchronization.
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Roamable", Justification = "This is following the native API")]
- Roamable = 0x4,
-
- ///
- /// Creates the known folder when the user first logs on.
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Precreate", Justification="This is following the native API")]
- Precreate = 0x8
- }
-}
\ No newline at end of file
diff --git a/src/External/WindowsAPICodePack/Shell/KnownFolders/FileSystemKnownFolder.cs b/src/External/WindowsAPICodePack/Shell/KnownFolders/FileSystemKnownFolder.cs
deleted file mode 100644
index 5fc21a5..0000000
--- a/src/External/WindowsAPICodePack/Shell/KnownFolders/FileSystemKnownFolder.cs
+++ /dev/null
@@ -1,280 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Diagnostics;
-using System.Runtime.InteropServices;
-
-namespace Microsoft.WindowsAPICodePack.Shell
-{
- ///
- /// Represents a registered file system Known Folder
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "This will complicate the class hierarchy and naming convention used in the Shell area")]
- public class FileSystemKnownFolder : ShellFileSystemFolder, IKnownFolder, IDisposable
- {
- #region Private Fields
-
- private IKnownFolderNative knownFolderNative;
- private KnownFolderSettings knownFolderSettings = null;
-
- #endregion
-
- #region Internal Constructors
-
- internal FileSystemKnownFolder(IShellItem2 shellItem)
- : base(shellItem)
- {
- }
-
- internal FileSystemKnownFolder(IKnownFolderNative kf)
- {
- Debug.Assert(kf != null);
- knownFolderNative = kf;
-
- // Set the native shell item
- // and set it on the base class (ShellObject)
- Guid guid = new Guid(ShellIIDGuid.IShellItem2);
- knownFolderNative.GetShellItem(0, ref guid, out nativeShellItem);
- }
-
- #endregion
-
- #region Private Members
-
- private KnownFolderSettings KnownFolderSettings
- {
- get
- {
- if (knownFolderNative == null)
- {
- // We need to get the PIDL either from the NativeShellItem,
- // or from base class's property (if someone already set it on us).
- // Need to use the PIDL to get the native IKnownFolder interface.
-
- // Get teh PIDL for the ShellItem
- if (nativeShellItem != null && base.PIDL == IntPtr.Zero)
- base.PIDL = ShellHelper.PidlFromShellItem(nativeShellItem);
-
- // If we have a valid PIDL, get the native IKnownFolder
- if (base.PIDL != IntPtr.Zero)
- knownFolderNative = KnownFolderHelper.FromPIDL(base.PIDL);
-
- Debug.Assert(knownFolderNative != null);
- }
-
- // If this is the first time this property is being called,
- // get the native Folder Defination (KnownFolder properties)
- if (knownFolderSettings == null)
- knownFolderSettings = new KnownFolderSettings(knownFolderNative);
-
- return knownFolderSettings;
- }
- }
-
- #endregion
-
- #region IKnownFolder Members
-
- ///
- /// Gets the path for this known folder.
- ///
- /// A object.
- public override string Path
- {
- get { return KnownFolderSettings.Path; }
- }
-
- ///
- /// Gets the category designation for this known folder.
- ///
- /// A value.
- public FolderCategory Category
- {
- get { return KnownFolderSettings.Category; }
- }
-
- ///
- /// Gets this known folder's canonical name.
- ///
- /// A object.
- public string CanonicalName
- {
- get { return KnownFolderSettings.CanonicalName; }
- }
-
- ///
- /// Gets this known folder's description.
- ///
- /// A object.
- public string Description
- {
- get { return KnownFolderSettings.Description; }
- }
-
- ///
- /// Gets the unique identifier for this known folder's parent folder.
- ///
- /// A value.
- public Guid ParentId
- {
- get { return KnownFolderSettings.ParentId; }
- }
-
- ///
- /// Gets this known folder's relative path.
- ///
- /// A object.
- public string RelativePath
- {
- get { return KnownFolderSettings.RelativePath; }
- }
-
- ///
- /// Gets this known folder's parsing name.
- ///
- /// A object.
- public override string ParsingName
- {
- get { return base.ParsingName; }
- }
-
- ///
- /// Gets this known folder's tool tip text.
- ///
- /// A object.
- public string Tooltip
- {
- get { return KnownFolderSettings.Tooltip; }
- }
- ///
- /// Gets the resource identifier for this
- /// known folder's tool tip text.
- ///
- /// A object.
- public string TooltipResourceId
- {
- get { return KnownFolderSettings.TooltipResourceId; }
- }
-
- ///
- /// Gets this known folder's localized name.
- ///
- /// A object.
- public string LocalizedName
- {
- get { return KnownFolderSettings.LocalizedName; }
- }
- ///
- /// Gets the resource identifier for this
- /// known folder's localized name.
- ///
- /// A object.
- public string LocalizedNameResourceId
- {
- get { return KnownFolderSettings.LocalizedNameResourceId; }
- }
-
- ///
- /// Gets this known folder's security attributes.
- ///
- /// A object.
- public string Security
- {
- get { return KnownFolderSettings.Security; }
- }
-
- ///
- /// Gets this known folder's file attributes,
- /// such as "read-only".
- ///
- /// A value.
- public System.IO.FileAttributes FileAttributes
- {
- get { return KnownFolderSettings.FileAttributes; }
- }
-
- ///
- /// Gets an value that describes this known folder's behaviors.
- ///
- /// A value.
- public DefinitionOptions DefinitionOptions
- {
- get { return KnownFolderSettings.DefinitionOptions; }
- }
-
- ///
- /// Gets the unique identifier for this known folder's type.
- ///
- /// A value.
- public Guid FolderTypeId
- {
- get { return KnownFolderSettings.FolderTypeId; }
- }
-
- ///
- /// Gets a string representation of this known folder's type.
- ///
- /// A object.
- public string FolderType
- {
- get { return KnownFolderSettings.FolderType; }
- }
- ///
- /// Gets the unique identifier for this known folder.
- ///
- /// A value.
- public Guid FolderId
- {
- get { return KnownFolderSettings.FolderId; }
- }
-
- ///
- /// Gets a value that indicates whether this known folder's path exists on the computer.
- ///
- /// A bool value.
- /// If this property value is false,
- /// the folder might be a virtual folder ( property will
- /// be for virtual folders)
- public bool PathExists
- {
- get { return KnownFolderSettings.PathExists; }
- }
-
- ///
- /// Gets a value that states whether this known folder
- /// can have its path set to a new value,
- /// including any restrictions on the redirection.
- ///
- /// A value.
- public RedirectionCapabilities Redirection
- {
- get { return KnownFolderSettings.Redirection; }
- }
-
- #endregion
-
- #region IDisposable Members
-
- ///
- /// Release resources
- ///
- /// Indicates that this mothod is being called from Dispose() rather than the finalizer.
- protected override void Dispose(bool disposing)
- {
- if (disposing)
- {
- knownFolderSettings = null;
- }
-
- if (knownFolderNative != null)
- {
- Marshal.ReleaseComObject(knownFolderNative);
- knownFolderNative = null;
- }
-
- base.Dispose(disposing);
- }
-
- #endregion
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/KnownFolders/FolderCategory.cs b/src/External/WindowsAPICodePack/Shell/KnownFolders/FolderCategory.cs
deleted file mode 100644
index 762cffa..0000000
--- a/src/External/WindowsAPICodePack/Shell/KnownFolders/FolderCategory.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-namespace Microsoft.WindowsAPICodePack.Shell
-{
- ///
- /// Specifies the categories for known folders.
- ///
- public enum FolderCategory
- {
- ///
- /// The folder category is not specified.
- ///
- None = 0x00,
- ///
- /// The folder is a virtual folder. Virtual folders are not part
- /// of the file system. For example, Control Panel and
- /// Printers are virtual folders. A number of properties
- /// such as folder path and redirection do not apply to this category.
- ///
- Virtual = 0x1,
- ///
- /// The folder is fixed. Fixed file system folders are not
- /// managed by the Shell and are usually given a permanent
- /// path when the system is installed. For example, the
- /// Windows and Program Files folders are fixed folders.
- /// A number of properties such as redirection do not apply
- /// to this category.
- ///
- Fixed = 0x2,
- ///
- /// The folder is a common folder. Common folders are
- /// used for sharing data and settings
- /// accessible by all users of a system. For example,
- /// all users share a common Documents folder as well
- /// as their per-user Documents folder.
- ///
- Common = 0x3,
- ///
- /// Each user has their own copy of the folder. Per-user folders
- /// are those stored under each user's profile and
- /// accessible only by that user.
- ///
- PerUser = 0x4
- }
-}
\ No newline at end of file
diff --git a/src/External/WindowsAPICodePack/Shell/KnownFolders/FolderProperties.cs b/src/External/WindowsAPICodePack/Shell/KnownFolders/FolderProperties.cs
deleted file mode 100644
index 500d88d..0000000
--- a/src/External/WindowsAPICodePack/Shell/KnownFolders/FolderProperties.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Runtime.InteropServices;
-using System.Windows.Media.Imaging;
-
-namespace Microsoft.WindowsAPICodePack.Shell
-{
- ///
- /// Structure used internally to store property values for
- /// a known folder. This structure holds the information
- /// returned in the FOLDER_DEFINITION structure, and
- /// resources referenced by fields in NativeFolderDefinition,
- /// such as icon and tool tip.
- ///
- [StructLayout(LayoutKind.Sequential)]
- internal struct FolderProperties
- {
- internal string name;
- internal FolderCategory category;
- internal string canonicalName;
- internal string description;
- internal Guid parentId;
- internal string parent;
- internal string relativePath;
- internal string parsingName;
- internal string tooltipResourceId;
- internal string tooltip;
- internal string localizedName;
- internal string localizedNameResourceId;
- internal string iconResourceId;
- internal BitmapSource icon;
- internal DefinitionOptions definitionOptions;
- internal System.IO.FileAttributes fileAttributes;
- internal Guid folderTypeId;
- internal string folderType;
- internal Guid folderId;
- internal string path;
- internal bool pathExists;
- internal RedirectionCapabilities redirection;
- internal string security;
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/KnownFolders/FolderTypes.cs b/src/External/WindowsAPICodePack/Shell/KnownFolders/FolderTypes.cs
deleted file mode 100644
index 1eb2c73..0000000
--- a/src/External/WindowsAPICodePack/Shell/KnownFolders/FolderTypes.cs
+++ /dev/null
@@ -1,226 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Collections.Generic;
-
-namespace Microsoft.WindowsAPICodePack.Shell
-{
- ///
- /// The FolderTypes values represent a view template applied to a folder,
- /// usually based on its intended use and contents.
- ///
- internal static class FolderTypes
- {
- ///
- /// No particular content type has been detected or specified. This value is not supported in Windows 7 and later systems.
- ///
- internal static Guid NotSpecified = new Guid(
- 0x5c4f28b5, 0xf869, 0x4e84, 0x8e, 0x60, 0xf1, 0x1d, 0xb9, 0x7c, 0x5c, 0xc7);
-
- ///
- /// The folder is invalid. There are several things that can cause this judgement: hard disk errors, file system errors, and compression errors among them.
- ///
- internal static Guid Invalid = new Guid(
- 0x57807898, 0x8c4f, 0x4462, 0xbb, 0x63, 0x71, 0x04, 0x23, 0x80, 0xb1, 0x09);
-
- ///
- /// The folder contains document files. These can be of mixed format.doc, .txt, and others.
- ///
- internal static Guid Documents = new Guid(
- 0x7d49d726, 0x3c21, 0x4f05, 0x99, 0xaa, 0xfd, 0xc2, 0xc9, 0x47, 0x46, 0x56);
-
- ///
- /// Image files, such as .jpg, .tif, or .png files.
- ///
- internal static Guid Pictures = new Guid(
- 0xb3690e58, 0xe961, 0x423b, 0xb6, 0x87, 0x38, 0x6e, 0xbf, 0xd8, 0x32, 0x39);
-
- ///
- /// Windows 7 and later. The folder contains audio files, such as .mp3 and .wma files.
- ///
- internal static Guid Music = new Guid(
- 0xaf9c03d6, 0x7db9, 0x4a15, 0x94, 0x64, 0x13, 0xbf, 0x9f, 0xb6, 0x9a, 0x2a);
-
- ///
- /// A list of music files displayed in Icons view. This value is not supported in Windows 7 and later systems.
- ///
- internal static Guid MusicIcons = new Guid(
- 0x0b7467fb, 0x84ba, 0x4aae, 0xa0, 0x9b, 0x15, 0xb7, 0x10, 0x97, 0xaf, 0x9e);
-
- ///
- /// The folder is the Games folder found in the Start menu.
- ///
- internal static Guid Games = new Guid(
- 0xb689b0d0, 0x76d3, 0x4cbb, 0x87, 0xf7, 0x58, 0x5d, 0x0e, 0x0c, 0xe0, 0x70);
-
- ///
- /// The Control Panel in category view. This is a virtual folder.
- ///
- internal static Guid ControlPanelCategory = new Guid(
- 0xde4f0660, 0xfa10, 0x4b8f, 0xa4, 0x94, 0x06, 0x8b, 0x20, 0xb2, 0x23, 0x07);
-
- ///
- /// The Control Panel in classic view. This is a virtual folder.
- ///
- internal static Guid ControlPanelClassic = new Guid(
- 0x0c3794f3, 0xb545, 0x43aa, 0xa3, 0x29, 0xc3, 0x74, 0x30, 0xc5, 0x8d, 0x2a);
-
- ///
- /// Printers that have been added to the system. This is a virtual folder.
- ///
- internal static Guid Printers = new Guid(
- 0x2c7bbec6, 0xc844, 0x4a0a, 0x91, 0xfa, 0xce, 0xf6, 0xf5, 0x9c, 0xfd, 0xa1);
-
- ///
- /// The Recycle Bin. This is a virtual folder.
- ///
- internal static Guid RecycleBin = new Guid(
- 0xd6d9e004, 0xcd87, 0x442b, 0x9d, 0x57, 0x5e, 0x0a, 0xeb, 0x4f, 0x6f, 0x72);
-
- ///
- /// The software explorer window used by the Add or Remove Programs control panel icon.
- ///
- internal static Guid SoftwareExplorer = new Guid(
- 0xd674391b, 0x52d9, 0x4e07, 0x83, 0x4e, 0x67, 0xc9, 0x86, 0x10, 0xf3, 0x9d);
-
- ///
- /// The folder is a compressed archive, such as a compressed file with a .zip file name extension.
- ///
- internal static Guid CompressedFolder = new Guid(
- 0x80213e82, 0xbcfd, 0x4c4f, 0x88, 0x17, 0xbb, 0x27, 0x60, 0x12, 0x67, 0xa9);
-
- ///
- /// An e-mail-related folder that contains contact information.
- ///
- internal static Guid Contacts = new Guid(
- 0xde2b70ec, 0x9bf7, 0x4a93, 0xbd, 0x3d, 0x24, 0x3f, 0x78, 0x81, 0xd4, 0x92);
-
- ///
- /// A default library view without a more specific template. This value is not supported in Windows 7 and later systems.
- ///
- internal static Guid Library = new Guid(
- 0x4badfc68, 0xc4ac, 0x4716, 0xa0, 0xa0, 0x4d, 0x5d, 0xaa, 0x6b, 0x0f, 0x3e);
-
- ///
- /// The Network Explorer folder.
- ///
- internal static Guid NetworkExplorer = new Guid(
- 0x25cc242b, 0x9a7c, 0x4f51, 0x80, 0xe0, 0x7a, 0x29, 0x28, 0xfe, 0xbe, 0x42);
-
- ///
- /// The folder is the FOLDERID_UsersFiles folder.
- ///
- internal static Guid UserFiles = new Guid(
- 0xcd0fc69b, 0x71e2, 0x46e5, 0x96, 0x90, 0x5b, 0xcd, 0x9f, 0x57, 0xaa, 0xb3);
-
- ///
- /// Windows 7 and later. The folder contains search results, but they are of mixed or no specific type.
- ///
- internal static Guid GenericSearchResults = new Guid(
- 0x7fde1a1e, 0x8b31, 0x49a5, 0x93, 0xb8, 0x6b, 0xe1, 0x4c, 0xfa, 0x49, 0x43);
-
- ///
- /// Windows 7 and later. The folder is a library, but of no specified type.
- ///
- internal static Guid GenericLibrary = new Guid(
- 0x5f4eab9a, 0x6833, 0x4f61, 0x89, 0x9d, 0x31, 0xcf, 0x46, 0x97, 0x9d, 0x49);
-
- ///
- /// Windows 7 and later. The folder contains video files. These can be of mixed format.wmv, .mov, and others.
- ///
- internal static Guid Videos = new Guid(
- 0x5fa96407, 0x7e77, 0x483c, 0xac, 0x93, 0x69, 0x1d, 0x05, 0x85, 0x0d, 0xe8);
-
- ///
- /// Windows 7 and later. The view shown when the user clicks the Windows Explorer button on the taskbar.
- ///
- internal static Guid UsersLibraries = new Guid(
- 0xc4d98f09, 0x6124, 0x4fe0, 0x99, 0x42, 0x82, 0x64, 0x16, 0x8, 0x2d, 0xa9);
-
- ///
- /// Windows 7 and later. The homegroup view.
- ///
- internal static Guid OtherUsers = new Guid(
- 0xb337fd00, 0x9dd5, 0x4635, 0xa6, 0xd4, 0xda, 0x33, 0xfd, 0x10, 0x2b, 0x7a);
-
- ///
- /// Windows 7 and later. A folder that contains communication-related files such as e-mails, calendar information, and contact information.
- ///
- internal static Guid Communications = new Guid(
- 0x91475fe5, 0x586b, 0x4eba, 0x8d, 0x75, 0xd1, 0x74, 0x34, 0xb8, 0xcd, 0xf6);
-
- ///
- /// Windows 7 and later. The folder contains recorded television broadcasts.
- ///
- internal static Guid RecordedTV = new Guid(
- 0x5557a28f, 0x5da6, 0x4f83, 0x88, 0x09, 0xc2, 0xc9, 0x8a, 0x11, 0xa6, 0xfa);
-
- ///
- /// Windows 7 and later. The folder contains saved game states.
- ///
- internal static Guid SavedGames = new Guid(
- 0xd0363307, 0x28cb, 0x4106, 0x9f, 0x23, 0x29, 0x56, 0xe3, 0xe5, 0xe0, 0xe7);
-
- ///
- /// Windows 7 and later. The folder contains federated search OpenSearch results.
- ///
- internal static Guid OpenSearch = new Guid(
- 0x8faf9629, 0x1980, 0x46ff, 0x80, 0x23, 0x9d, 0xce, 0xab, 0x9c, 0x3e, 0xe3);
-
- ///
- /// Windows 7 and later. Before you search.
- ///
- internal static Guid SearchConnector = new Guid(
- 0x982725ee, 0x6f47, 0x479e, 0xb4, 0x47, 0x81, 0x2b, 0xfa, 0x7d, 0x2e, 0x8f);
-
- ///
- /// Windows 7 and later. A user's Searches folder, normally found at C:\Users\username\Searches.
- ///
- internal static Guid Searches = new Guid(
- 0x0b0ba2e3, 0x405f, 0x415e, 0xa6, 0xee, 0xca, 0xd6, 0x25, 0x20, 0x78, 0x53);
-
-
- static Dictionary types;
-
- static FolderTypes()
- {
- types = new Dictionary();
- types.Add(NotSpecified, "Not Specified");
- types.Add(Invalid, "Invalid");
- types.Add(Communications, "Communications");
- types.Add(CompressedFolder, "Compressed Folder");
- types.Add(Contacts, "Contacts");
- types.Add(ControlPanelCategory, "ControlPanel Category");
- types.Add(ControlPanelClassic, "ControlPanel Classic");
- types.Add(Documents, "Documents");
- types.Add(Games, "Games");
- types.Add(GenericSearchResults, "Generic Search Results");
- types.Add(GenericLibrary, "Generic Library");
- types.Add(Library, "Library");
- types.Add(Music, "Music");
- types.Add(MusicIcons, "Music Icons");
- types.Add(NetworkExplorer, "Network Explorer");
- types.Add(OtherUsers, "Other Users");
- types.Add(OpenSearch, "Open Search");
- types.Add(Pictures, "Pictures");
- types.Add(Printers, "Printers");
- types.Add(RecycleBin, "RecycleBin");
- types.Add(RecordedTV, "Recorded TV");
- types.Add(SoftwareExplorer, "Software Explorer");
- types.Add(SavedGames, "Saved Games");
- types.Add(SearchConnector, "Search Connector");
- types.Add(Searches, "Searches");
- types.Add(UsersLibraries, "Users Libraries");
- types.Add(UserFiles, "User Files");
- types.Add(Videos, "Videos");
- }
-
- internal static string GetFolderType(Guid typeId)
- {
- if (typeId == Guid.Empty || !types.ContainsKey(typeId))
- return String.Empty;
-
- return types[typeId];
- }
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/KnownFolders/FoldersIdentifiers.cs b/src/External/WindowsAPICodePack/Shell/KnownFolders/FoldersIdentifiers.cs
deleted file mode 100644
index 58ea90e..0000000
--- a/src/External/WindowsAPICodePack/Shell/KnownFolders/FoldersIdentifiers.cs
+++ /dev/null
@@ -1,587 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Collections.Generic;
-using System.Reflection;
-
-namespace Microsoft.WindowsAPICodePack.Shell
-{
- ///
- /// Contains the GUID identifiers for well-known folders.
- ///
- internal static class FolderIdentifiers
- {
- internal static Dictionary folders;
-
- static FolderIdentifiers()
- {
- folders = new Dictionary();
- Type folderIDs = typeof(FolderIdentifiers);
-
- FieldInfo[] fields = folderIDs.GetFields(
- BindingFlags.NonPublic | BindingFlags.Static);
-
- foreach (FieldInfo f in fields)
- {
- // Ignore dictionary field.
- if (f.FieldType == typeof(Guid))
- {
- Guid id = (Guid)f.GetValue(null);
- string name = f.Name;
- folders.Add(id, name);
- }
- }
- }
- ///
- /// Returns the friendly name for a specified folder.
- ///
- /// The Guid identifier for a known folder.
- /// A value.
- internal static string NameForGuid(Guid folderId)
- {
- if (!folders.ContainsKey(folderId))
- throw new ArgumentException(
- "Guid does not identify a known folder.",
- "folderId");
- return folders[folderId];
- }
- ///
- /// Returns a sorted list of name, guid pairs for
- /// all known folders.
- ///
- ///
- internal static SortedList GetAllFolders()
- {
- // Make a copy of the dictionary
- // because the Keys and Values collections
- // are mutable.
- ICollection keys = folders.Keys;
-
- SortedList slist = new SortedList();
- foreach (Guid g in keys)
- {
- slist.Add(folders[g], g);
- }
- return slist;
- }
- ///
- /// Computer
- ///
- internal static Guid Computer = new Guid(0x0AC0837C, 0xBBF8, 0x452A, 0x85, 0x0D, 0x79, 0xD0, 0x8E, 0x66, 0x7C, 0xA7);
-
- ///
- /// Conflicts
- ///
- internal static Guid Conflict = new Guid(0x4bfefb45, 0x347d, 0x4006, 0xa5, 0xbe, 0xac, 0x0c, 0xb0, 0x56, 0x71, 0x92);
-
- ///
- /// Control Panel
- ///
- internal static Guid ControlPanel = new Guid(0x82A74AEB, 0xAEB4, 0x465C, 0xA0, 0x14, 0xD0, 0x97, 0xEE, 0x34, 0x6D, 0x63);
-
- ///
- /// Desktop
- ///
- internal static Guid Desktop = new Guid(0xB4BFCC3A, 0xDB2C, 0x424C, 0xB0, 0x29, 0x7F, 0xE9, 0x9A, 0x87, 0xC6, 0x41);
-
- ///
- /// Internet Explorer
- ///
- internal static Guid Internet = new Guid(0x4D9F7874, 0x4E0C, 0x4904, 0x96, 0x7B, 0x40, 0xB0, 0xD2, 0x0C, 0x3E, 0x4B);
-
- ///
- /// Network
- ///
- internal static Guid Network = new Guid(0xD20BEEC4, 0x5CA8, 0x4905, 0xAE, 0x3B, 0xBF, 0x25, 0x1E, 0xA0, 0x9B, 0x53);
-
- ///
- /// Printers
- ///
- internal static Guid Printers = new Guid(0x76FC4E2D, 0xD6AD, 0x4519, 0xA6, 0x63, 0x37, 0xBD, 0x56, 0x06, 0x81, 0x85);
-
- ///
- /// Sync Center
- ///
- internal static Guid SyncManager = new Guid(0x43668BF8, 0xC14E, 0x49B2, 0x97, 0xC9, 0x74, 0x77, 0x84, 0xD7, 0x84, 0xB7);
-
- ///
- /// Network Connections
- ///
- internal static Guid Connections = new Guid(0x6F0CD92B, 0x2E97, 0x45D1, 0x88, 0xFF, 0xB0, 0xD1, 0x86, 0xB8, 0xDE, 0xDD);
-
- ///
- /// Sync Setup
- ///
- internal static Guid SyncSetup = new Guid(0xf214138, 0xb1d3, 0x4a90, 0xbb, 0xa9, 0x27, 0xcb, 0xc0, 0xc5, 0x38, 0x9a);
-
- ///
- /// Sync Results
- ///
- internal static Guid SyncResults = new Guid(0x289a9a43, 0xbe44, 0x4057, 0xa4, 0x1b, 0x58, 0x7a, 0x76, 0xd7, 0xe7, 0xf9);
-
- ///
- /// Recycle Bin
- ///
- internal static Guid RecycleBin = new Guid(0xB7534046, 0x3ECB, 0x4C18, 0xBE, 0x4E, 0x64, 0xCD, 0x4C, 0xB7, 0xD6, 0xAC);
-
- ///
- /// Fonts
- ///
- internal static Guid Fonts = new Guid(0xFD228CB7, 0xAE11, 0x4AE3, 0x86, 0x4C, 0x16, 0xF3, 0x91, 0x0A, 0xB8, 0xFE);
-
- ///
- /// Startup
- ///
- internal static Guid Startup = new Guid(0xB97D20BB, 0xF46A, 0x4C97, 0xBA, 0x10, 0x5E, 0x36, 0x08, 0x43, 0x08, 0x54);
-
- ///
- /// Programs
- ///
- internal static Guid Programs = new Guid(0xA77F5D77, 0x2E2B, 0x44C3, 0xA6, 0xA2, 0xAB, 0xA6, 0x01, 0x05, 0x4A, 0x51);
-
- ///
- /// Start Menu
- ///
- internal static Guid StartMenu = new Guid(0x625B53C3, 0xAB48, 0x4EC1, 0xBA, 0x1F, 0xA1, 0xEF, 0x41, 0x46, 0xFC, 0x19);
-
- ///
- /// Recent Items
- ///
- internal static Guid Recent = new Guid(0xAE50C081, 0xEBD2, 0x438A, 0x86, 0x55, 0x8A, 0x09, 0x2E, 0x34, 0x98, 0x7A);
-
- ///
- /// SendTo
- ///
- internal static Guid SendTo = new Guid(0x8983036C, 0x27C0, 0x404B, 0x8F, 0x08, 0x10, 0x2D, 0x10, 0xDC, 0xFD, 0x74);
-
- ///
- /// Documents
- ///
- internal static Guid Documents = new Guid(0xFDD39AD0, 0x238F, 0x46AF, 0xAD, 0xB4, 0x6C, 0x85, 0x48, 0x03, 0x69, 0xC7);
-
- ///
- /// Favorites
- ///
- internal static Guid Favorites = new Guid(0x1777F761, 0x68AD, 0x4D8A, 0x87, 0xBD, 0x30, 0xB7, 0x59, 0xFA, 0x33, 0xDD);
-
- ///
- /// Network Shortcuts
- ///
- internal static Guid NetHood = new Guid(0xC5ABBF53, 0xE17F, 0x4121, 0x89, 0x00, 0x86, 0x62, 0x6F, 0xC2, 0xC9, 0x73);
-
- ///
- /// Printer Shortcuts
- ///
- internal static Guid PrintHood = new Guid(0x9274BD8D, 0xCFD1, 0x41C3, 0xB3, 0x5E, 0xB1, 0x3F, 0x55, 0xA7, 0x58, 0xF4);
-
- ///
- /// Templates
- ///
- internal static Guid Templates = new Guid(0xA63293E8, 0x664E, 0x48DB, 0xA0, 0x79, 0xDF, 0x75, 0x9E, 0x05, 0x09, 0xF7);
-
- ///
- /// Startup
- ///
- internal static Guid CommonStartup = new Guid(0x82A5EA35, 0xD9CD, 0x47C5, 0x96, 0x29, 0xE1, 0x5D, 0x2F, 0x71, 0x4E, 0x6E);
-
- ///
- /// Programs
- ///
- internal static Guid CommonPrograms = new Guid(0x0139D44E, 0x6AFE, 0x49F2, 0x86, 0x90, 0x3D, 0xAF, 0xCA, 0xE6, 0xFF, 0xB8);
-
- ///
- /// Start Menu
- ///
- internal static Guid CommonStartMenu = new Guid(0xA4115719, 0xD62E, 0x491D, 0xAA, 0x7C, 0xE7, 0x4B, 0x8B, 0xE3, 0xB0, 0x67);
-
- ///
- /// Public Desktop
- ///
- internal static Guid PublicDesktop = new Guid(0xC4AA340D, 0xF20F, 0x4863, 0xAF, 0xEF, 0xF8, 0x7E, 0xF2, 0xE6, 0xBA, 0x25);
-
- ///
- /// ProgramData
- ///
- internal static Guid ProgramData = new Guid(0x62AB5D82, 0xFDC1, 0x4DC3, 0xA9, 0xDD, 0x07, 0x0D, 0x1D, 0x49, 0x5D, 0x97);
-
- ///
- /// Templates
- ///
- internal static Guid CommonTemplates = new Guid(0xB94237E7, 0x57AC, 0x4347, 0x91, 0x51, 0xB0, 0x8C, 0x6C, 0x32, 0xD1, 0xF7);
-
- ///
- /// Public Documents
- ///
- internal static Guid PublicDocuments = new Guid(0xED4824AF, 0xDCE4, 0x45A8, 0x81, 0xE2, 0xFC, 0x79, 0x65, 0x08, 0x36, 0x34);
-
- ///
- /// Roaming
- ///
- internal static Guid RoamingAppData = new Guid(0x3EB685DB, 0x65F9, 0x4CF6, 0xA0, 0x3A, 0xE3, 0xEF, 0x65, 0x72, 0x9F, 0x3D);
-
- ///
- /// Local
- ///
- internal static Guid LocalAppData = new Guid(0xF1B32785, 0x6FBA, 0x4FCF, 0x9D, 0x55, 0x7B, 0x8E, 0x7F, 0x15, 0x70, 0x91);
-
- ///
- /// LocalLow
- ///
- internal static Guid LocalAppDataLow = new Guid(0xA520A1A4, 0x1780, 0x4FF6, 0xBD, 0x18, 0x16, 0x73, 0x43, 0xC5, 0xAF, 0x16);
-
- ///
- /// Temporary Internet Files
- ///
- internal static Guid InternetCache = new Guid(0x352481E8, 0x33BE, 0x4251, 0xBA, 0x85, 0x60, 0x07, 0xCA, 0xED, 0xCF, 0x9D);
-
- ///
- /// Cookies
- ///
- internal static Guid Cookies = new Guid(0x2B0F765D, 0xC0E9, 0x4171, 0x90, 0x8E, 0x08, 0xA6, 0x11, 0xB8, 0x4F, 0xF6);
-
- ///
- /// History
- ///
- internal static Guid History = new Guid(0xD9DC8A3B, 0xB784, 0x432E, 0xA7, 0x81, 0x5A, 0x11, 0x30, 0xA7, 0x59, 0x63);
-
- ///
- /// System32
- ///
- internal static Guid System = new Guid(0x1AC14E77, 0x02E7, 0x4E5D, 0xB7, 0x44, 0x2E, 0xB1, 0xAE, 0x51, 0x98, 0xB7);
-
- ///
- /// System32
- ///
- internal static Guid SystemX86 = new Guid(0xD65231B0, 0xB2F1, 0x4857, 0xA4, 0xCE, 0xA8, 0xE7, 0xC6, 0xEA, 0x7D, 0x27);
-
- ///
- /// Windows
- ///
- internal static Guid Windows = new Guid(0xF38BF404, 0x1D43, 0x42F2, 0x93, 0x05, 0x67, 0xDE, 0x0B, 0x28, 0xFC, 0x23);
-
- ///
- /// The user's username (%USERNAME%)
- ///
- internal static Guid Profile = new Guid(0x5E6C858F, 0x0E22, 0x4760, 0x9A, 0xFE, 0xEA, 0x33, 0x17, 0xB6, 0x71, 0x73);
-
- ///
- /// Pictures
- ///
- internal static Guid Pictures = new Guid(0x33E28130, 0x4E1E, 0x4676, 0x83, 0x5A, 0x98, 0x39, 0x5C, 0x3B, 0xC3, 0xBB);
-
- ///
- /// Program Files
- ///
- internal static Guid ProgramFilesX86 = new Guid(0x7C5A40EF, 0xA0FB, 0x4BFC, 0x87, 0x4A, 0xC0, 0xF2, 0xE0, 0xB9, 0xFA, 0x8E);
-
- ///
- /// Common Files
- ///
- internal static Guid ProgramFilesCommonX86 = new Guid(0xDE974D24, 0xD9C6, 0x4D3E, 0xBF, 0x91, 0xF4, 0x45, 0x51, 0x20, 0xB9, 0x17);
-
- ///
- /// Program Files
- ///
- internal static Guid ProgramFilesX64 = new Guid(0x6d809377, 0x6af0, 0x444b, 0x89, 0x57, 0xa3, 0x77, 0x3f, 0x02, 0x20, 0x0e);
-
- ///
- /// Common Files
- ///
- internal static Guid ProgramFilesCommonX64 = new Guid(0x6365d5a7, 0xf0d, 0x45e5, 0x87, 0xf6, 0xd, 0xa5, 0x6b, 0x6a, 0x4f, 0x7d);
-
- ///
- /// Program Files
- ///
- internal static Guid ProgramFiles = new Guid(0x905e63b6, 0xc1bf, 0x494e, 0xb2, 0x9c, 0x65, 0xb7, 0x32, 0xd3, 0xd2, 0x1a);
-
- ///
- /// Common Files
- ///
- internal static Guid ProgramFilesCommon = new Guid(0xF7F1ED05, 0x9F6D, 0x47A2, 0xAA, 0xAE, 0x29, 0xD3, 0x17, 0xC6, 0xF0, 0x66);
-
- ///
- /// Administrative Tools
- ///
- internal static Guid AdminTools = new Guid(0x724EF170, 0xA42D, 0x4FEF, 0x9F, 0x26, 0xB6, 0x0E, 0x84, 0x6F, 0xBA, 0x4F);
-
- ///
- /// Administrative Tools
- ///
- internal static Guid CommonAdminTools = new Guid(0xD0384E7D, 0xBAC3, 0x4797, 0x8F, 0x14, 0xCB, 0xA2, 0x29, 0xB3, 0x92, 0xB5);
-
- ///
- /// Music
- ///
- internal static Guid Music = new Guid(0x4BD8D571, 0x6D19, 0x48D3, 0xBE, 0x97, 0x42, 0x22, 0x20, 0x08, 0x0E, 0x43);
-
- ///
- /// Videos
- ///
- internal static Guid Videos = new Guid(0x18989B1D, 0x99B5, 0x455B, 0x84, 0x1C, 0xAB, 0x7C, 0x74, 0xE4, 0xDD, 0xFC);
-
- ///
- /// Public Pictures
- ///
- internal static Guid PublicPictures = new Guid(0xB6EBFB86, 0x6907, 0x413C, 0x9A, 0xF7, 0x4F, 0xC2, 0xAB, 0xF0, 0x7C, 0xC5);
-
- ///
- /// Public Music
- ///
- internal static Guid PublicMusic = new Guid(0x3214FAB5, 0x9757, 0x4298, 0xBB, 0x61, 0x92, 0xA9, 0xDE, 0xAA, 0x44, 0xFF);
-
- ///
- /// Public Videos
- ///
- internal static Guid PublicVideos = new Guid(0x2400183A, 0x6185, 0x49FB, 0xA2, 0xD8, 0x4A, 0x39, 0x2A, 0x60, 0x2B, 0xA3);
-
- ///
- /// Resources
- ///
- internal static Guid ResourceDir = new Guid(0x8AD10C31, 0x2ADB, 0x4296, 0xA8, 0xF7, 0xE4, 0x70, 0x12, 0x32, 0xC9, 0x72);
-
- ///
- /// None
- ///
- internal static Guid LocalizedResourcesDir = new Guid(0x2A00375E, 0x224C, 0x49DE, 0xB8, 0xD1, 0x44, 0x0D, 0xF7, 0xEF, 0x3D, 0xDC);
-
- ///
- /// OEM Links
- ///
- internal static Guid CommonOEMLinks = new Guid(0xC1BAE2D0, 0x10DF, 0x4334, 0xBE, 0xDD, 0x7A, 0xA2, 0x0B, 0x22, 0x7A, 0x9D);
-
- ///
- /// Temporary Burn Folder
- ///
- internal static Guid CDBurning = new Guid(0x9E52AB10, 0xF80D, 0x49DF, 0xAC, 0xB8, 0x43, 0x30, 0xF5, 0x68, 0x78, 0x55);
-
- ///
- /// Users
- ///
- internal static Guid UserProfiles = new Guid(0x0762D272, 0xC50A, 0x4BB0, 0xA3, 0x82, 0x69, 0x7D, 0xCD, 0x72, 0x9B, 0x80);
-
- ///
- /// Playlists
- ///
- internal static Guid Playlists = new Guid(0xDE92C1C7, 0x837F, 0x4F69, 0xA3, 0xBB, 0x86, 0xE6, 0x31, 0x20, 0x4A, 0x23);
-
- ///
- /// Sample Playlists
- ///
- internal static Guid SamplePlaylists = new Guid(0x15CA69B3, 0x30EE, 0x49C1, 0xAC, 0xE1, 0x6B, 0x5E, 0xC3, 0x72, 0xAF, 0xB5);
-
- ///
- /// Sample Music
- ///
- internal static Guid SampleMusic = new Guid(0xB250C668, 0xF57D, 0x4EE1, 0xA6, 0x3C, 0x29, 0x0E, 0xE7, 0xD1, 0xAA, 0x1F);
-
- ///
- /// Sample Pictures
- ///
- internal static Guid SamplePictures = new Guid(0xC4900540, 0x2379, 0x4C75, 0x84, 0x4B, 0x64, 0xE6, 0xFA, 0xF8, 0x71, 0x6B);
-
- ///
- /// Sample Videos
- ///
- internal static Guid SampleVideos = new Guid(0x859EAD94, 0x2E85, 0x48AD, 0xA7, 0x1A, 0x09, 0x69, 0xCB, 0x56, 0xA6, 0xCD);
-
- ///
- /// Slide Shows
- ///
- internal static Guid PhotoAlbums = new Guid(0x69D2CF90, 0xFC33, 0x4FB7, 0x9A, 0x0C, 0xEB, 0xB0, 0xF0, 0xFC, 0xB4, 0x3C);
-
- ///
- /// Public
- ///
- internal static Guid Public = new Guid(0xDFDF76A2, 0xC82A, 0x4D63, 0x90, 0x6A, 0x56, 0x44, 0xAC, 0x45, 0x73, 0x85);
-
- ///
- /// Programs and Features
- ///
- internal static Guid ChangeRemovePrograms = new Guid(0xdf7266ac, 0x9274, 0x4867, 0x8d, 0x55, 0x3b, 0xd6, 0x61, 0xde, 0x87, 0x2d);
-
- ///
- /// Installed Updates
- ///
- internal static Guid AppUpdates = new Guid(0xa305ce99, 0xf527, 0x492b, 0x8b, 0x1a, 0x7e, 0x76, 0xfa, 0x98, 0xd6, 0xe4);
-
- ///
- /// Get Programs
- ///
- internal static Guid AddNewPrograms = new Guid(0xde61d971, 0x5ebc, 0x4f02, 0xa3, 0xa9, 0x6c, 0x82, 0x89, 0x5e, 0x5c, 0x04);
-
- ///
- /// Downloads
- ///
- internal static Guid Downloads = new Guid(0x374de290, 0x123f, 0x4565, 0x91, 0x64, 0x39, 0xc4, 0x92, 0x5e, 0x46, 0x7b);
-
- ///
- /// Public Downloads
- ///
- internal static Guid PublicDownloads = new Guid(0x3d644c9b, 0x1fb8, 0x4f30, 0x9b, 0x45, 0xf6, 0x70, 0x23, 0x5f, 0x79, 0xc0);
-
- ///
- /// Searches
- ///
- internal static Guid SavedSearches = new Guid(0x7d1d3a04, 0xdebb, 0x4115, 0x95, 0xcf, 0x2f, 0x29, 0xda, 0x29, 0x20, 0xda);
-
- ///
- /// Quick Launch
- ///
- internal static Guid QuickLaunch = new Guid(0x52a4f021, 0x7b75, 0x48a9, 0x9f, 0x6b, 0x4b, 0x87, 0xa2, 0x10, 0xbc, 0x8f);
-
- ///
- /// Contacts
- ///
- internal static Guid Contacts = new Guid(0x56784854, 0xc6cb, 0x462b, 0x81, 0x69, 0x88, 0xe3, 0x50, 0xac, 0xb8, 0x82);
-
- ///
- /// Gadgets
- ///
- internal static Guid SidebarParts = new Guid(0xa75d362e, 0x50fc, 0x4fb7, 0xac, 0x2c, 0xa8, 0xbe, 0xaa, 0x31, 0x44, 0x93);
-
- ///
- /// Gadgets
- ///
- internal static Guid SidebarDefaultParts = new Guid(0x7b396e54, 0x9ec5, 0x4300, 0xbe, 0xa, 0x24, 0x82, 0xeb, 0xae, 0x1a, 0x26);
-
- ///
- /// Tree property value folder
- ///
- internal static Guid TreeProperties = new Guid(0x5b3749ad, 0xb49f, 0x49c1, 0x83, 0xeb, 0x15, 0x37, 0x0f, 0xbd, 0x48, 0x82);
-
- ///
- /// GameExplorer
- ///
- internal static Guid PublicGameTasks = new Guid(0xdebf2536, 0xe1a8, 0x4c59, 0xb6, 0xa2, 0x41, 0x45, 0x86, 0x47, 0x6a, 0xea);
-
- ///
- /// GameExplorer
- ///
- internal static Guid GameTasks = new Guid(0x54fae61, 0x4dd8, 0x4787, 0x80, 0xb6, 0x9, 0x2, 0x20, 0xc4, 0xb7, 0x0);
-
- ///
- /// Saved Games
- ///
- internal static Guid SavedGames = new Guid(0x4c5c32ff, 0xbb9d, 0x43b0, 0xb5, 0xb4, 0x2d, 0x72, 0xe5, 0x4e, 0xaa, 0xa4);
-
- ///
- /// Games
- ///
- internal static Guid Games = new Guid(0xcac52c1a, 0xb53d, 0x4edc, 0x92, 0xd7, 0x6b, 0x2e, 0x8a, 0xc1, 0x94, 0x34);
-
- ///
- /// Recorded TV
- ///
- internal static Guid RecordedTV = new Guid(0xbd85e001, 0x112e, 0x431e, 0x98, 0x3b, 0x7b, 0x15, 0xac, 0x09, 0xff, 0xf1);
-
- ///
- /// Microsoft Office Outlook
- ///
- internal static Guid SearchMapi = new Guid(0x98ec0e18, 0x2098, 0x4d44, 0x86, 0x44, 0x66, 0x97, 0x93, 0x15, 0xa2, 0x81);
-
- ///
- /// Offline Files
- ///
- internal static Guid SearchCsc = new Guid(0xee32e446, 0x31ca, 0x4aba, 0x81, 0x4f, 0xa5, 0xeb, 0xd2, 0xfd, 0x6d, 0x5e);
-
- ///
- /// Links
- ///
- internal static Guid Links = new Guid(0xbfb9d5e0, 0xc6a9, 0x404c, 0xb2, 0xb2, 0xae, 0x6d, 0xb6, 0xaf, 0x49, 0x68);
-
- ///
- /// The user's full name (for instance, Jean Philippe Bagel) entered when the user account was created.
- ///
- internal static Guid UsersFiles = new Guid(0xf3ce0f7c, 0x4901, 0x4acc, 0x86, 0x48, 0xd5, 0xd4, 0x4b, 0x04, 0xef, 0x8f);
-
- ///
- /// Search home
- ///
- internal static Guid SearchHome = new Guid(0x190337d1, 0xb8ca, 0x4121, 0xa6, 0x39, 0x6d, 0x47, 0x2d, 0x16, 0x97, 0x2a);
-
- ///
- /// Original Images
- ///
- internal static Guid OriginalImages = new Guid(0x2C36C0AA, 0x5812, 0x4b87, 0xbf, 0xd0, 0x4c, 0xd0, 0xdf, 0xb1, 0x9b, 0x39);
-
-
- #region Win7 KnownFolders Guids
-
- ///
- /// UserProgramFiles
- ///
- internal static Guid UserProgramFiles = new Guid(0x5cd7aee2, 0x2219, 0x4a67, 0xb8, 0x5d, 0x6c, 0x9c, 0xe1, 0x56, 0x60, 0xcb);
-
- ///
- /// UserProgramFilesCommon
- ///
- internal static Guid UserProgramFilesCommon = new Guid(0xbcbd3057, 0xca5c, 0x4622, 0xb4, 0x2d, 0xbc, 0x56, 0xdb, 0x0a, 0xe5, 0x16);
-
- ///
- /// Ringtones
- ///
- internal static Guid Ringtones = new Guid(0xC870044B, 0xF49E, 0x4126, 0xA9, 0xC3, 0xB5, 0x2A, 0x1F, 0xF4, 0x11, 0xE8);
-
- ///
- /// PublicRingtones
- ///
- internal static Guid PublicRingtones = new Guid(0xE555AB60, 0x153B, 0x4D17, 0x9F, 0x04, 0xA5, 0xFE, 0x99, 0xFC, 0x15, 0xEC);
-
- ///
- /// UsersLibraries
- ///
- internal static Guid UsersLibraries = new Guid(0xa302545d, 0xdeff, 0x464b, 0xab, 0xe8, 0x61, 0xc8, 0x64, 0x8d, 0x93, 0x9b);
-
- ///
- /// DocumentsLibrary
- ///
- internal static Guid DocumentsLibrary = new Guid(0x7b0db17d, 0x9cd2, 0x4a93, 0x97, 0x33, 0x46, 0xcc, 0x89, 0x02, 0x2e, 0x7c);
-
- ///
- /// MusicLibrary
- ///
- internal static Guid MusicLibrary = new Guid(0x2112ab0a, 0xc86a, 0x4ffe, 0xa3, 0x68, 0xd, 0xe9, 0x6e, 0x47, 0x1, 0x2e);
-
- ///
- /// PicturesLibrary
- ///
- internal static Guid PicturesLibrary = new Guid(0xa990ae9f, 0xa03b, 0x4e80, 0x94, 0xbc, 0x99, 0x12, 0xd7, 0x50, 0x41, 0x4);
-
- ///
- /// VideosLibrary
- ///
- internal static Guid VideosLibrary = new Guid(0x491e922f, 0x5643, 0x4af4, 0xa7, 0xeb, 0x4e, 0x7a, 0x13, 0x8d, 0x81, 0x74);
-
- ///
- /// RecordedTVLibrary
- ///
- internal static Guid RecordedTVLibrary = new Guid(0x1a6fdba2, 0xf42d, 0x4358, 0xa7, 0x98, 0xb7, 0x4d, 0x74, 0x59, 0x26, 0xc5);
-
- ///
- /// OtherUsers
- ///
- internal static Guid OtherUsers = new Guid(0x52528a6b, 0xb9e3, 0x4add, 0xb6, 0xd, 0x58, 0x8c, 0x2d, 0xba, 0x84, 0x2d);
-
- ///
- /// DeviceMetadataStore
- ///
- internal static Guid DeviceMetadataStore = new Guid(0x5ce4a5e9, 0xe4eb, 0x479d, 0xb8, 0x9f, 0x13, 0x0c, 0x02, 0x88, 0x61, 0x55);
-
- ///
- /// Libraries
- ///
- internal static Guid Libraries = new Guid(0x1b3ea5dc, 0xb587, 0x4786, 0xb4, 0xef, 0xbd, 0x1d, 0xc3, 0x32, 0xae, 0xae);
-
- ///
- /// UserPinned
- ///
- internal static Guid UserPinned = new Guid(0x9e3995ab, 0x1f9c, 0x4f13, 0xb8, 0x27, 0x48, 0xb2, 0x4b, 0x6c, 0x71, 0x74);
-
- ///
- /// ImplicitAppShortcuts
- ///
- internal static Guid ImplicitAppShortcuts = new Guid(0xbcb5256f, 0x79f6, 0x4cee, 0xb7, 0x25, 0xdc, 0x34, 0xe4, 0x2, 0xfd, 0x46);
-
- #endregion
- }
-}
\ No newline at end of file
diff --git a/src/External/WindowsAPICodePack/Shell/KnownFolders/IKnownFolder.cs b/src/External/WindowsAPICodePack/Shell/KnownFolders/IKnownFolder.cs
deleted file mode 100644
index cb1483d..0000000
--- a/src/External/WindowsAPICodePack/Shell/KnownFolders/IKnownFolder.cs
+++ /dev/null
@@ -1,175 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-
-namespace Microsoft.WindowsAPICodePack.Shell
-{
- ///
- /// Represents a registered or known folder in the system.
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification="This will complicate the class hierarchy and naming convention used in the Shell area")]
- public interface IKnownFolder : IDisposable, IEnumerable
- {
- ///
- /// Gets the path for this known folder.
- ///
- string Path
- {
- get;
- }
-
- ///
- /// Gets the category designation for this known folder.
- ///
- FolderCategory Category
- {
- get;
- }
-
- ///
- /// Gets this known folder's canonical name.
- ///
- string CanonicalName
- {
- get;
- }
-
- ///
- /// Gets this known folder's description.
- ///
- string Description
- {
- get;
- }
-
- ///
- /// Gets the unique identifier for this known folder's parent folder.
- ///
- Guid ParentId
- {
- get;
- }
-
- ///
- /// Gets this known folder's relative path.
- ///
- string RelativePath
- {
- get;
- }
-
- ///
- /// Gets this known folder's parsing name.
- ///
- string ParsingName
- {
- get;
- }
-
- ///
- /// Gets this known folder's tool tip text.
- ///
- string Tooltip
- {
- get;
- }
-
- ///
- /// Gets the resource identifier for this
- /// known folder's tool tip text.
- ///
- string TooltipResourceId
- {
- get;
- }
-
- ///
- /// Gets this known folder's localized name.
- ///
- string LocalizedName
- {
- get;
- }
-
- ///
- /// Gets the resource identifier for this
- /// known folder's localized name.
- ///
- string LocalizedNameResourceId
- {
- get;
- }
-
- ///
- /// Gets this known folder's security attributes.
- ///
- string Security
- {
- get;
- }
-
- ///
- /// Gets this known folder's file attributes,
- /// such as "read-only".
- ///
- FileAttributes FileAttributes
- {
- get;
- }
-
- ///
- /// Gets an value that describes this known folder's behaviors.
- ///
- DefinitionOptions DefinitionOptions
- {
- get;
- }
-
- ///
- /// Gets the unique identifier for this known folder's type.
- ///
- Guid FolderTypeId
- {
- get;
- }
-
- ///
- /// Gets a string representation of this known folder's type.
- ///
- string FolderType
- {
- get;
- }
-
- ///
- /// Gets the unique identifier for this known folder.
- ///
- Guid FolderId
- {
- get;
- }
-
- ///
- /// Gets a value that indicates whether this known folder's path exists on the computer.
- ///
- /// If this property value is false,
- /// the folder might be a virtual folder ( property will
- /// be for virtual folders)
- bool PathExists
- {
- get;
- }
-
- ///
- /// Gets a value that states whether this known folder
- /// can have its path set to a new value,
- /// including any restrictions on the redirection.
- ///
- RedirectionCapabilities Redirection
- {
- get;
- }
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/KnownFolders/KnownFolderHelper.cs b/src/External/WindowsAPICodePack/Shell/KnownFolders/KnownFolderHelper.cs
deleted file mode 100644
index 167a0d1..0000000
--- a/src/External/WindowsAPICodePack/Shell/KnownFolders/KnownFolderHelper.cs
+++ /dev/null
@@ -1,221 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Diagnostics;
-using System.Runtime.InteropServices;
-using MS.WindowsAPICodePack.Internal;
-
-namespace Microsoft.WindowsAPICodePack.Shell
-{
- ///
- /// Creates the helper class for known folders.
- ///
- public static class KnownFolderHelper
- {
- static KnownFolderHelper()
- {
- // Private constructor to prevent the compiler from generating the default one.
- }
-
- ///
- /// Returns the native known folder (IKnownFolderNative) given a PID list
- ///
- ///
- ///
- internal static IKnownFolderNative FromPIDL(IntPtr pidl)
- {
- IKnownFolderManager knownFolderManager = (IKnownFolderManager)new KnownFolderManagerClass();
- IKnownFolderNative knownFolder;
- HRESULT hr = knownFolderManager.FindFolderFromIDList(pidl, out knownFolder);
-
- if (hr != HRESULT.S_OK)
- return null;
- else
- return knownFolder;
- }
-
- ///
- /// Returns a known folder given a globally unique identifier.
- ///
- /// A GUID for the requested known folder.
- /// A known folder representing the specified name.
- /// Thrown if the given Known Folder ID is invalid.
- public static IKnownFolder FromKnownFolderId(Guid knownFolderId)
- {
- IKnownFolderNative knownFolderNative;
- IKnownFolderManager knownFolderManager = (IKnownFolderManager)new KnownFolderManagerClass();
-
- HRESULT hr = knownFolderManager.GetFolder(knownFolderId, out knownFolderNative);
-
- if (hr == HRESULT.S_OK)
- {
- IKnownFolder kf = GetKnownFolder(knownFolderNative);
-
- if (kf != null)
- return kf;
- else
- throw new ArgumentException("Given Known Folder ID is invalid.", "knownFolderId");
- }
- else
- throw Marshal.GetExceptionForHR((int)hr);
- }
-
- ///
- /// Returns a known folder given a globally unique identifier.
- ///
- /// A GUID for the requested known folder.
- /// A known folder representing the specified name. Returns null if Known Folder is not found or could not be created.
- internal static IKnownFolder FromKnownFolderIdInternal(Guid knownFolderId)
- {
- IKnownFolderNative knownFolderNative;
- IKnownFolderManager knownFolderManager = (IKnownFolderManager)new KnownFolderManagerClass();
-
- HRESULT hr = knownFolderManager.GetFolder(knownFolderId, out knownFolderNative);
-
- if (hr == HRESULT.S_OK)
- {
- return GetKnownFolder(knownFolderNative);
- }
- else
- return null;
- }
-
- ///
- /// Given a native KnownFolder (IKnownFolderNative), create the right type of
- /// IKnownFolder object (FileSystemKnownFolder or NonFileSystemKnownFolder)
- ///
- /// Native Known Folder
- ///
- private static IKnownFolder GetKnownFolder(IKnownFolderNative knownFolderNative)
- {
- Debug.Assert(knownFolderNative != null, "Native IKnownFolder should not be null.");
-
- // Get the native IShellItem2 from the native IKnownFolder
- IShellItem2 shellItem;
- Guid guid = new Guid(ShellIIDGuid.IShellItem2);
- HRESULT hr = knownFolderNative.GetShellItem(0, ref guid, out shellItem);
-
- if (!CoreErrorHelper.Succeeded((int)hr))
- return null;
-
- bool isFileSystem = false;
-
- // If we have a valid IShellItem, try to get the FileSystem attribute.
- if (shellItem != null)
- {
- ShellNativeMethods.SFGAO sfgao;
- shellItem.GetAttributes(ShellNativeMethods.SFGAO.SFGAO_FILESYSTEM, out sfgao);
-
- // Is this item a FileSystem item?
- isFileSystem = (sfgao & ShellNativeMethods.SFGAO.SFGAO_FILESYSTEM) != 0;
- }
-
- // If it's FileSystem, create a FileSystemKnownFolder, else NonFileSystemKnownFolder
- if (isFileSystem)
- {
- FileSystemKnownFolder kf = new FileSystemKnownFolder(knownFolderNative);
- return kf;
- }
- else
- {
- NonFileSystemKnownFolder kf = new NonFileSystemKnownFolder(knownFolderNative);
- return kf;
- }
-
- }
-
- ///
- /// Returns the known folder given its canonical name.
- ///
- /// A non-localized canonical name for the known folder, such as MyComputer.
- /// A known folder representing the specified name.
- /// Thrown if the given canonical name is invalid or if the KnownFolder could not be created.
- public static IKnownFolder FromCanonicalName(string canonicalName)
- {
- IKnownFolderNative knownFolderNative;
- IKnownFolderManager knownFolderManager = (IKnownFolderManager)new KnownFolderManagerClass();
-
- knownFolderManager.GetFolderByName(canonicalName, out knownFolderNative);
- IKnownFolder kf = KnownFolderHelper.GetKnownFolder(knownFolderNative);
-
- if (kf != null)
- return kf;
- else
- throw new ArgumentException("Canonical name is invalid.", "canonicalName");
- }
-
- ///
- /// Returns a known folder given its shell path, such as C:\users\public\documents or
- /// ::{645FF040-5081-101B-9F08-00AA002F954E} for the Recycle Bin.
- ///
- /// The path for the requested known folder; either a physical path or a virtual path.
- /// A known folder representing the specified name.
- public static IKnownFolder FromPath(string path)
- {
- return KnownFolderHelper.FromParsingName(path);
- }
-
- ///
- /// Returns a known folder given its shell namespace parsing name, such as
- /// ::{645FF040-5081-101B-9F08-00AA002F954E} for the Recycle Bin.
- ///
- /// The parsing name (or path) for the requested known folder.
- /// A known folder representing the specified name.
- /// Thrown if the given parsing name is invalid.
- public static IKnownFolder FromParsingName(string parsingName)
- {
- IntPtr pidl = IntPtr.Zero;
- IntPtr pidl2 = IntPtr.Zero;
-
- try
- {
- pidl = ShellHelper.PidlFromParsingName(parsingName);
-
- if (pidl == IntPtr.Zero)
- {
- throw new ArgumentException("Parsing name is invalid.", "parsingName");
- }
-
-
- // It's probably a special folder, try to get it
- IKnownFolderNative knownFolderNative = KnownFolderHelper.FromPIDL(pidl);
-
- if (knownFolderNative != null)
- {
- IKnownFolder kf = KnownFolderHelper.GetKnownFolder(knownFolderNative);
-
- if (kf != null)
- return kf;
- else
- throw new ArgumentException("Parsing name is invalid.", "parsingName");
- }
- else
- {
- // No physical storage was found for this known folder
- // We'll try again with a different name
-
- // try one more time with a trailing \0
- pidl2 = ShellHelper.PidlFromParsingName(parsingName.PadRight(1, '\0'));
-
- if (pidl2 == IntPtr.Zero)
- {
- throw new ArgumentException("Parsing name is invalid.", "parsingName");
- }
-
- IKnownFolder kf = KnownFolderHelper.GetKnownFolder(KnownFolderHelper.FromPIDL(pidl));
-
- if (kf != null)
- return kf;
- else
- throw new ArgumentException("Parsing name is invalid.", "parsingName");
- }
- }
- finally
- {
- ShellNativeMethods.ILFree(pidl);
- ShellNativeMethods.ILFree(pidl2);
- }
-
- }
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/KnownFolders/KnownFolderSettings.cs b/src/External/WindowsAPICodePack/Shell/KnownFolders/KnownFolderSettings.cs
deleted file mode 100644
index f5894b2..0000000
--- a/src/External/WindowsAPICodePack/Shell/KnownFolders/KnownFolderSettings.cs
+++ /dev/null
@@ -1,299 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Diagnostics;
-using System.Runtime.InteropServices;
-using MS.WindowsAPICodePack.Internal;
-
-namespace Microsoft.WindowsAPICodePack.Shell
-{
- ///
- /// Internal class to represent the KnownFolder settings/properties
- ///
- internal class KnownFolderSettings
- {
- private FolderProperties knownFolderProperties;
-
- internal KnownFolderSettings(IKnownFolderNative knownFolderNative)
- {
- GetFolderProperties(knownFolderNative);
- }
-
- #region Private Methods
-
- ///
- /// Populates a structure that contains
- /// this known folder's properties.
- ///
- private void GetFolderProperties(IKnownFolderNative knownFolderNative)
- {
- Debug.Assert(knownFolderNative != null);
-
- KnownFoldersSafeNativeMethods.NativeFolderDefinition nativeFolderDefinition;
- knownFolderNative.GetFolderDefinition(out nativeFolderDefinition);
-
- try
- {
- knownFolderProperties.category = nativeFolderDefinition.category;
- knownFolderProperties.canonicalName = Marshal.PtrToStringUni(nativeFolderDefinition.name);
- knownFolderProperties.description = Marshal.PtrToStringUni(nativeFolderDefinition.description);
- knownFolderProperties.parentId = nativeFolderDefinition.parentId;
- knownFolderProperties.relativePath = Marshal.PtrToStringUni(nativeFolderDefinition.relativePath);
- knownFolderProperties.parsingName = Marshal.PtrToStringUni(nativeFolderDefinition.parsingName);
- knownFolderProperties.tooltipResourceId = Marshal.PtrToStringUni(nativeFolderDefinition.tooltip);
- knownFolderProperties.localizedNameResourceId = Marshal.PtrToStringUni(nativeFolderDefinition.localizedName);
- knownFolderProperties.iconResourceId = Marshal.PtrToStringUni(nativeFolderDefinition.icon);
- knownFolderProperties.security = Marshal.PtrToStringUni(nativeFolderDefinition.security);
- knownFolderProperties.fileAttributes = (System.IO.FileAttributes)nativeFolderDefinition.attributes;
- knownFolderProperties.definitionOptions = nativeFolderDefinition.definitionOptions;
- knownFolderProperties.folderTypeId = nativeFolderDefinition.folderTypeId;
- knownFolderProperties.folderType = FolderTypes.GetFolderType(knownFolderProperties.folderTypeId);
-
- bool pathExists;
-
- knownFolderProperties.path = GetPath(out pathExists, knownFolderNative);
- knownFolderProperties.pathExists = pathExists;
-
- knownFolderProperties.redirection = knownFolderNative.GetRedirectionCapabilities();
-
- // Turn tooltip, localized name and icon resource IDs
- // into the actual resources.
- knownFolderProperties.tooltip = CoreHelpers.GetStringResource(knownFolderProperties.tooltipResourceId);
- knownFolderProperties.localizedName = CoreHelpers.GetStringResource(knownFolderProperties.localizedNameResourceId);
-
- knownFolderProperties.folderId = knownFolderNative.GetId();
-
- }
- finally
- {
- // Clean up memory.
- Marshal.FreeCoTaskMem(nativeFolderDefinition.name);
- Marshal.FreeCoTaskMem(nativeFolderDefinition.description);
- Marshal.FreeCoTaskMem(nativeFolderDefinition.relativePath);
- Marshal.FreeCoTaskMem(nativeFolderDefinition.parsingName);
- Marshal.FreeCoTaskMem(nativeFolderDefinition.tooltip);
- Marshal.FreeCoTaskMem(nativeFolderDefinition.localizedName);
- Marshal.FreeCoTaskMem(nativeFolderDefinition.icon);
- Marshal.FreeCoTaskMem(nativeFolderDefinition.security);
- }
- }
-
- ///
- /// Gets the path of this this known folder.
- ///
- ///
- /// Returns false if the folder is virtual, or a boolean
- /// value that indicates whether this known folder exists.
- ///
- /// Native IKnownFolder reference
- ///
- /// A containing the path, or if this known folder does not exist.
- ///
- private string GetPath(out bool fileExists, IKnownFolderNative knownFolderNative)
- {
- Debug.Assert(knownFolderNative != null);
-
- string kfPath = String.Empty;
- fileExists = true;
-
- // Virtual folders do not have path.
- if (knownFolderProperties.category == FolderCategory.Virtual)
- {
- fileExists = false;
- return kfPath;
- }
-
- try
- {
- kfPath = knownFolderNative.GetPath(0);
- }
- catch (System.IO.FileNotFoundException)
- {
- fileExists = false;
- }
- catch (System.IO.DirectoryNotFoundException)
- {
- fileExists = false;
- }
-
- return kfPath;
- }
-
- #endregion
-
- #region KnownFolder Properties
-
- ///
- /// Gets the path for this known folder.
- ///
- /// A object.
- public string Path
- {
- get
- {
- return knownFolderProperties.path;
- }
- }
-
-
- ///
- /// Gets the category designation for this known folder.
- ///
- /// A value.
- public FolderCategory Category
- {
- get { return knownFolderProperties.category; }
- }
-
- ///
- /// Gets this known folder's canonical name.
- ///
- /// A object.
- public string CanonicalName
- {
- get { return knownFolderProperties.canonicalName; }
- }
-
- ///
- /// Gets this known folder's description.
- ///
- /// A object.
- public string Description
- {
- get { return knownFolderProperties.description; }
- }
-
- ///
- /// Gets the unique identifier for this known folder's parent folder.
- ///
- /// A value.
- public Guid ParentId
- {
- get { return knownFolderProperties.parentId; }
- }
-
- ///
- /// Gets this known folder's relative path.
- ///
- /// A object.
- public string RelativePath
- {
- get { return knownFolderProperties.relativePath; }
- }
-
- ///
- /// Gets this known folder's tool tip text.
- ///
- /// A object.
- public string Tooltip
- {
- get { return knownFolderProperties.tooltip; }
- }
- ///
- /// Gets the resource identifier for this
- /// known folder's tool tip text.
- ///
- /// A object.
- public string TooltipResourceId
- {
- get { return knownFolderProperties.tooltipResourceId; }
- }
-
- ///
- /// Gets this known folder's localized name.
- ///
- /// A object.
- public string LocalizedName
- {
- get { return knownFolderProperties.localizedName; }
- }
- ///
- /// Gets the resource identifier for this
- /// known folder's localized name.
- ///
- /// A object.
- public string LocalizedNameResourceId
- {
- get { return knownFolderProperties.localizedNameResourceId; }
- }
-
- ///
- /// Gets this known folder's security attributes.
- ///
- /// A object.
- public string Security
- {
- get { return knownFolderProperties.security; }
- }
-
- ///
- /// Gets this known folder's file attributes,
- /// such as "read-only".
- ///
- /// A value.
- public System.IO.FileAttributes FileAttributes
- {
- get { return knownFolderProperties.fileAttributes; }
- }
-
- ///
- /// Gets an value that describes this known folder's behaviors.
- ///
- /// A value.
- public DefinitionOptions DefinitionOptions
- {
- get { return knownFolderProperties.definitionOptions; }
- }
-
- ///
- /// Gets the unique identifier for this known folder's type.
- ///
- /// A value.
- public Guid FolderTypeId
- {
- get { return knownFolderProperties.folderTypeId; }
- }
-
- ///
- /// Gets a string representation of this known folder's type.
- ///
- /// A object.
- public string FolderType
- {
- get { return knownFolderProperties.folderType; }
- }
- ///
- /// Gets the unique identifier for this known folder.
- ///
- /// A value.
- public Guid FolderId
- {
- get { return knownFolderProperties.folderId; }
- }
-
- ///
- /// Gets a value that indicates whether this known folder's path exists on the computer.
- ///
- /// A bool value.
- /// If this property value is false,
- /// the folder might be a virtual folder ( property will
- /// be for virtual folders)
- public bool PathExists
- {
- get { return knownFolderProperties.pathExists; }
- }
-
- ///
- /// Gets a value that states whether this known folder
- /// can have its path set to a new value,
- /// including any restrictions on the redirection.
- ///
- /// A value.
- public RedirectionCapabilities Redirection
- {
- get { return knownFolderProperties.redirection; }
- }
-
- #endregion
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/KnownFolders/KnownFolders.cs b/src/External/WindowsAPICodePack/Shell/KnownFolders/KnownFolders.cs
deleted file mode 100644
index ef96e47..0000000
--- a/src/External/WindowsAPICodePack/Shell/KnownFolders/KnownFolders.cs
+++ /dev/null
@@ -1,1335 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Runtime.InteropServices;
-using MS.WindowsAPICodePack.Internal;
-
-namespace Microsoft.WindowsAPICodePack.Shell
-{
- ///
- /// Defines properties for known folders that identify the path of standard known folders.
- ///
- public static class KnownFolders
- {
- ///
- /// Gets a strongly-typed read-only collection of all the registered known folders.
- ///
- public static ICollection All
- {
- get
- {
- return GetAllFolders();
- }
- }
-
- private static ReadOnlyCollection GetAllFolders()
- {
- // Should this method be thread-safe?? (It'll take a while
- // to get a list of all the known folders, create the managed wrapper
- // and return the read-only collection.
-
- IList foldersList = new List();
- uint count;
- IntPtr folders;
-
- IKnownFolderManager knownFolderManager = (IKnownFolderManager)new KnownFolderManagerClass();
- knownFolderManager.GetFolderIds(out folders, out count);
-
- if (count > 0 && folders != IntPtr.Zero)
- {
- // Loop through all the KnownFolderID elements
- for (int i = 0; i < count; i++)
- {
- // Read the current pointer
- IntPtr current = new IntPtr(folders.ToInt64() + (Marshal.SizeOf(typeof(Guid)) * i));
-
- // Convert to Guid
- Guid knownFolderID = (Guid)Marshal.PtrToStructure(current, typeof(Guid));
-
- IKnownFolder kf = null;
-
- // Get the known folder
- kf = KnownFolderHelper.FromKnownFolderIdInternal(knownFolderID);
-
- // Add to our collection if it's not null (some folders might not exist on the system
- // or we could have an exception that resulted in the null return from above method call
- if (kf != null)
- foldersList.Add(kf);
- }
- }
-
- Marshal.FreeCoTaskMem(folders);
-
- return new ReadOnlyCollection(foldersList);
- }
-
- private static IKnownFolder GetKnownFolder(Guid guid)
- {
- return KnownFolderHelper.FromKnownFolderId(guid);
- }
-
- #region Default Known Folders
-
- ///
- /// Gets the metadata for the Computer folder.
- ///
- /// An object.
- public static IKnownFolder Computer
- {
- get
- {
- return GetKnownFolder(
- FolderIdentifiers.Computer);
- }
- }
-
- ///
- /// Gets the metadata for the Conflict folder.
- ///
- /// An object.
- public static IKnownFolder Conflict
- {
- get
- {
- return GetKnownFolder(
- FolderIdentifiers.Conflict);
- }
- }
-
- ///
- /// Gets the metadata for the ControlPanel folder.
- ///
- /// An object.
- public static IKnownFolder ControlPanel
- {
- get
- {
- return GetKnownFolder(
- FolderIdentifiers.ControlPanel);
- }
- }
-
- ///
- /// Gets the metadata for the Desktop folder.
- ///
- /// An object.
- public static IKnownFolder Desktop
- {
- get
- {
- return GetKnownFolder(
- FolderIdentifiers.Desktop);
- }
- }
-
- ///
- /// Gets the metadata for the Internet folder.
- ///
- /// An object.
- public static IKnownFolder Internet
- {
- get
- {
- return GetKnownFolder(
- FolderIdentifiers.Internet);
- }
- }
-
- ///
- /// Gets the metadata for the Network folder.
- ///
- /// An object.
- public static IKnownFolder Network
- {
- get
- {
- return GetKnownFolder(
- FolderIdentifiers.Network);
- }
- }
-
- ///
- /// Gets the metadata for the Printers folder.
- ///
- /// An object.
- public static IKnownFolder Printers
- {
- get
- {
- return GetKnownFolder(
- FolderIdentifiers.Printers);
- }
- }
-
- ///
- /// Gets the metadata for the SyncManager folder.
- ///
- /// An object.
- public static IKnownFolder SyncManager
- {
- get
- {
- return GetKnownFolder(
- FolderIdentifiers.SyncManager);
- }
- }
-
- ///
- /// Gets the metadata for the Connections folder.
- ///
- /// An object.
- public static IKnownFolder Connections
- {
- get
- {
- return GetKnownFolder(
- FolderIdentifiers.Connections);
- }
- }
-
- ///
- /// Gets the metadata for the SyncSetup folder.
- ///
- /// An object.
- public static IKnownFolder SyncSetup
- {
- get
- {
- return GetKnownFolder(
- FolderIdentifiers.SyncSetup);
- }
- }
-
- ///
- /// Gets the metadata for the SyncResults folder.
- ///
- /// An object.
- public static IKnownFolder SyncResults
- {
- get
- {
- return GetKnownFolder(
- FolderIdentifiers.SyncResults);
- }
- }
-
- ///
- /// Gets the metadata for the RecycleBin folder.
- ///
- /// An object.
- public static IKnownFolder RecycleBin
- {
- get
- {
- return GetKnownFolder(
- FolderIdentifiers.RecycleBin);
- }
- }
-
- ///
- /// Gets the metadata for the Fonts folder.
- ///
- /// An object.
- public static IKnownFolder Fonts
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.Fonts);
- }
- }
-
- ///
- /// Gets the metadata for the Startup folder.
- ///
- /// An object.
- public static IKnownFolder Startup
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.Startup);
- }
- }
-
- ///
- /// Gets the metadata for the Programs folder.
- ///
- /// An object.
- public static IKnownFolder Programs
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.Programs);
- }
- }
-
- ///
- /// Gets the metadata for the per-user StartMenu folder.
- ///
- /// An object.
- public static IKnownFolder StartMenu
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.StartMenu);
- }
- }
-
- ///
- /// Gets the metadata for the per-user Recent folder.
- ///
- /// An object.
- public static IKnownFolder Recent
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.Recent);
- }
- }
-
- ///
- /// Gets the metadata for the per-user SendTo folder.
- ///
- /// An object.
- public static IKnownFolder SendTo
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.SendTo);
- }
- }
-
- ///
- /// Gets the metadata for the per-user Documents folder.
- ///
- /// An object.
- public static IKnownFolder Documents
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.Documents);
- }
- }
-
- ///
- /// Gets the metadata for the per-user Favorites folder.
- ///
- /// An object.
- public static IKnownFolder Favorites
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.Favorites);
- }
- }
-
- ///
- /// Gets the metadata for the NetHood folder.
- ///
- /// An object.
- public static IKnownFolder NetHood
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.NetHood);
- }
- }
-
- ///
- /// Gets the metadata for the PrintHood folder.
- ///
- /// An object.
- public static IKnownFolder PrintHood
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.PrintHood);
- }
- }
-
- ///
- /// Gets the metadata for the Templates folder.
- ///
- /// An object.
- public static IKnownFolder Templates
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.Templates);
- }
- }
-
- ///
- /// Gets the metadata for the CommonStartup folder.
- ///
- /// An object.
- public static IKnownFolder CommonStartup
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.CommonStartup);
- }
- }
-
- ///
- /// Gets the metadata for the CommonPrograms folder.
- ///
- /// An object.
- public static IKnownFolder CommonPrograms
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.CommonPrograms);
- }
- }
-
- ///
- /// Gets the metadata for the CommonStartMenu folder.
- ///
- /// An object.
- public static IKnownFolder CommonStartMenu
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.CommonStartMenu);
- }
- }
-
- ///
- /// Gets the metadata for the PublicDesktop folder.
- ///
- /// An object.
- public static IKnownFolder PublicDesktop
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.PublicDesktop);
- }
- }
-
- ///
- /// Gets the metadata for the ProgramData folder.
- ///
- /// An object.
- public static IKnownFolder ProgramData
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.ProgramData);
- }
- }
-
- ///
- /// Gets the metadata for the CommonTemplates folder.
- ///
- /// An object.
- public static IKnownFolder CommonTemplates
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.CommonTemplates);
- }
- }
-
- ///
- /// Gets the metadata for the PublicDocuments folder.
- ///
- /// An object.
- public static IKnownFolder PublicDocuments
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.PublicDocuments);
- }
- }
-
- ///
- /// Gets the metadata for the RoamingAppData folder.
- ///
- /// An object.
- public static IKnownFolder RoamingAppData
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.RoamingAppData);
- }
- }
-
- ///
- /// Gets the metadata for the per-user LocalAppData
- /// folder.
- ///
- /// An object.
- public static IKnownFolder LocalAppData
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.LocalAppData);
- }
- }
-
- ///
- /// Gets the metadata for the LocalAppDataLow folder.
- ///
- /// An object.
- public static IKnownFolder LocalAppDataLow
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.LocalAppDataLow);
- }
- }
-
- ///
- /// Gets the metadata for the InternetCache folder.
- ///
- /// An object.
- public static IKnownFolder InternetCache
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.InternetCache);
- }
- }
-
- ///
- /// Gets the metadata for the Cookies folder.
- ///
- /// An object.
- public static IKnownFolder Cookies
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.Cookies);
- }
- }
-
- ///
- /// Gets the metadata for the History folder.
- ///
- /// An object.
- public static IKnownFolder History
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.History);
- }
- }
-
- ///
- /// Gets the metadata for the System folder.
- ///
- /// An object.
- public static IKnownFolder System
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.System);
- }
- }
-
- ///
- /// Gets the metadata for the SystemX86
- /// folder.
- ///
- /// An object.
- public static IKnownFolder SystemX86
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.SystemX86);
- }
- }
-
- ///
- /// Gets the metadata for the Windows folder.
- ///
- /// An object.
- public static IKnownFolder Windows
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.Windows);
- }
- }
-
- ///
- /// Gets the metadata for the Profile folder.
- ///
- /// An object.
- public static IKnownFolder Profile
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.Profile);
- }
- }
-
- ///
- /// Gets the metadata for the per-user Pictures folder.
- ///
- /// An object.
- public static IKnownFolder Pictures
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.Pictures);
- }
- }
-
- ///
- /// Gets the metadata for the ProgramFilesX86 folder.
- ///
- /// An object.
- public static IKnownFolder ProgramFilesX86
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.ProgramFilesX86);
- }
- }
-
- ///
- /// Gets the metadata for the ProgramFilesCommonX86 folder.
- ///
- /// An object.
- public static IKnownFolder ProgramFilesCommonX86
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.ProgramFilesCommonX86);
- }
- }
-
- ///
- /// Gets the metadata for the ProgramsFilesX64 folder.
- ///
- /// An object.
- public static IKnownFolder ProgramFilesX64
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.ProgramFilesX64);
- }
- }
-
- ///
- /// Gets the metadata for the ProgramFilesCommonX64 folder.
- ///
- /// An object.
- public static IKnownFolder ProgramFilesCommonX64
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.ProgramFilesCommonX64);
- }
- }
-
- ///
- /// Gets the metadata for the ProgramFiles folder.
- ///
- /// An object.
- public static IKnownFolder ProgramFiles
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.ProgramFiles);
- }
- }
-
- ///
- /// Gets the metadata for the ProgramFilesCommon folder.
- ///
- /// An object.
- public static IKnownFolder ProgramFilesCommon
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.ProgramFilesCommon);
- }
- }
-
- ///
- /// Gets the metadata for the AdminTools folder.
- ///
- /// An object.
- public static IKnownFolder AdminTools
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.AdminTools);
- }
- }
-
- ///
- /// Gets the metadata for the CommonAdminTools folder.
- ///
- /// An object.
- public static IKnownFolder CommonAdminTools
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.CommonAdminTools);
- }
- }
-
- ///
- /// Gets the metadata for the per-user Music folder.
- ///
- /// An object.
- public static IKnownFolder Music
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.Music);
- }
- }
-
- ///
- /// Gets the metadata for the Videos folder.
- ///
- /// An object.
- public static IKnownFolder Videos
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.Videos);
- }
- }
-
- ///
- /// Gets the metadata for the PublicPictures folder.
- ///
- /// An object.
- public static IKnownFolder PublicPictures
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.PublicPictures);
- }
- }
-
- ///
- /// Gets the metadata for the PublicMusic folder.
- ///
- /// An object.
- public static IKnownFolder PublicMusic
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.PublicMusic);
- }
- }
-
- ///
- /// Gets the metadata for the PublicVideos folder.
- ///
- /// An object.
- public static IKnownFolder PublicVideos
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.PublicVideos);
- }
- }
-
- ///
- /// Gets the metadata for the ResourceDir folder.
- ///
- /// An object.
- public static IKnownFolder ResourceDir
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.ResourceDir);
- }
- }
-
- ///
- /// Gets the metadata for the LocalizedResourcesDir folder.
- ///
- /// An object.
- public static IKnownFolder LocalizedResourcesDir
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.LocalizedResourcesDir);
- }
- }
-
- ///
- /// Gets the metadata for the CommonOEMLinks folder.
- ///
- /// An object.
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "OEM", Justification = "This is following the native API")]
- public static IKnownFolder CommonOEMLinks
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.CommonOEMLinks);
- }
- }
-
- ///
- /// Gets the metadata for the CDBurning folder.
- ///
- /// An object.
- public static IKnownFolder CDBurning
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.CDBurning);
- }
- }
-
- ///
- /// Gets the metadata for the UserProfiles folder.
- ///
- /// An object.
- public static IKnownFolder UserProfiles
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.UserProfiles);
- }
- }
-
- ///
- /// Gets the metadata for the Playlists folder.
- ///
- /// An object.
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Playlists", Justification = "This is following the native API")]
- public static IKnownFolder Playlists
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.Playlists);
- }
- }
-
- ///
- /// Gets the metadata for the SamplePlaylists folder.
- ///
- /// An object.
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Playlists", Justification = "This is following the native API")]
- public static IKnownFolder SamplePlaylists
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.SamplePlaylists);
- }
- }
-
- ///
- /// Gets the metadata for the SampleMusic folder.
- ///
- /// An object.
- public static IKnownFolder SampleMusic
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.SampleMusic);
- }
- }
-
- ///
- /// Gets the metadata for the SamplePictures folder.
- ///
- /// An object.
- public static IKnownFolder SamplePictures
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.SamplePictures);
- }
- }
-
- ///
- /// Gets the metadata for the SampleVideos folder.
- ///
- /// An object.
- public static IKnownFolder SampleVideos
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.SampleVideos);
- }
- }
-
- ///
- /// Gets the metadata for the PhotoAlbums folder.
- ///
- /// An object.
- public static IKnownFolder PhotoAlbums
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.PhotoAlbums);
- }
- }
-
- ///
- /// Gets the metadata for the Public folder.
- ///
- /// An object.
- public static IKnownFolder Public
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.Public);
- }
- }
-
- ///
- /// Gets the metadata for the ChangeRemovePrograms folder.
- ///
- /// An object.
- public static IKnownFolder ChangeRemovePrograms
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.ChangeRemovePrograms);
- }
- }
-
- ///
- /// Gets the metadata for the AppUpdates folder.
- ///
- /// An object.
- public static IKnownFolder AppUpdates
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.AppUpdates);
- }
- }
-
- ///
- /// Gets the metadata for the AddNewPrograms folder.
- ///
- /// An object.
- public static IKnownFolder AddNewPrograms
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.AddNewPrograms);
- }
- }
-
- ///
- /// Gets the metadata for the per-user Downloads folder.
- ///
- /// An object.
- public static IKnownFolder Downloads
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.Downloads);
- }
- }
-
- ///
- /// Gets the metadata for the PublicDownloads folder.
- ///
- /// An object.
- public static IKnownFolder PublicDownloads
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.PublicDownloads);
- }
- }
-
- ///
- /// Gets the metadata for the per-user SavedSearches folder.
- ///
- /// An object.
- public static IKnownFolder SavedSearches
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.SavedSearches);
- }
- }
-
- ///
- /// Gets the metadata for the per-user QuickLaunch folder.
- ///
- /// An object.
- public static IKnownFolder QuickLaunch
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.QuickLaunch);
- }
- }
-
- ///
- /// Gets the metadata for the Contacts folder.
- ///
- /// An object.
- public static IKnownFolder Contacts
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.Contacts);
- }
- }
-
- ///
- /// Gets the metadata for the SidebarParts folder.
- ///
- /// An object.
- public static IKnownFolder SidebarParts
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.SidebarParts);
- }
- }
-
- ///
- /// Gets the metadata for the SidebarDefaultParts folder.
- ///
- /// An object.
- public static IKnownFolder SidebarDefaultParts
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.SidebarDefaultParts);
- }
- }
-
- ///
- /// Gets the metadata for the TreeProperties folder.
- ///
- /// An object.
- public static IKnownFolder TreeProperties
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.TreeProperties);
- }
- }
-
- ///
- /// Gets the metadata for the PublicGameTasks folder.
- ///
- /// An object.
- public static IKnownFolder PublicGameTasks
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.PublicGameTasks);
- }
- }
-
- ///
- /// Gets the metadata for the GameTasks folder.
- ///
- /// An object.
- public static IKnownFolder GameTasks
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.GameTasks);
- }
- }
-
- ///
- /// Gets the metadata for the per-user SavedGames folder.
- ///
- /// An object.
- public static IKnownFolder SavedGames
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.SavedGames);
- }
- }
-
- ///
- /// Gets the metadata for the Games folder.
- ///
- /// An object.
- public static IKnownFolder Games
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.Games);
- }
- }
-
- ///
- /// Gets the metadata for the RecordedTV folder.
- ///
- /// An object.
- /// This folder is not used.
- public static IKnownFolder RecordedTV
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.RecordedTV);
- }
- }
-
- ///
- /// Gets the metadata for the SearchMapi folder.
- ///
- /// An object.
- public static IKnownFolder SearchMapi
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.SearchMapi);
- }
- }
-
- ///
- /// Gets the metadata for the SearchCsc folder.
- ///
- /// An object.
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Csc", Justification = "This is following the native API")]
- public static IKnownFolder SearchCsc
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.SearchCsc);
- }
- }
-
- ///
- /// Gets the metadata for the per-user Links folder.
- ///
- /// An object.
- public static IKnownFolder Links
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.Links);
- }
- }
-
- ///
- /// Gets the metadata for the UsersFiles folder.
- ///
- /// An object.
- public static IKnownFolder UsersFiles
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.UsersFiles);
- }
- }
-
- ///
- /// Gets the metadata for the SearchHome folder.
- ///
- /// An object.
- public static IKnownFolder SearchHome
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.SearchHome);
- }
- }
-
- ///
- /// Gets the metadata for the OriginalImages folder.
- ///
- /// An object.
- public static IKnownFolder OriginalImages
- {
- get
- {
- return GetKnownFolder(FolderIdentifiers.OriginalImages);
- }
- }
-
- ///
- /// Gets the metadata for the UserProgramFiles folder.
- ///
- public static IKnownFolder UserProgramFiles
- {
- get
- {
- CoreHelpers.ThrowIfNotWin7();
- return GetKnownFolder(FolderIdentifiers.UserProgramFiles);
- }
- }
-
- ///
- /// Gets the metadata for the UserProgramFilesCommon folder.
- ///
- public static IKnownFolder UserProgramFilesCommon
- {
- get
- {
- CoreHelpers.ThrowIfNotWin7();
- return GetKnownFolder(FolderIdentifiers.UserProgramFilesCommon);
- }
- }
-
- ///
- /// Gets the metadata for the Ringtones folder.
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Ringtones", Justification = "This is following the native API")]
- public static IKnownFolder Ringtones
- {
- get
- {
- CoreHelpers.ThrowIfNotWin7();
- return GetKnownFolder(FolderIdentifiers.Ringtones);
- }
- }
-
- ///
- /// Gets the metadata for the PublicRingtones folder.
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Ringtones", Justification = "This is following the native API")]
- public static IKnownFolder PublicRingtones
- {
- get
- {
- CoreHelpers.ThrowIfNotWin7();
- return GetKnownFolder(FolderIdentifiers.PublicRingtones);
- }
- }
-
- ///
- /// Gets the metadata for the UsersLibraries folder.
- ///
- public static IKnownFolder UsersLibraries
- {
- get
- {
- CoreHelpers.ThrowIfNotWin7();
- return GetKnownFolder(FolderIdentifiers.UsersLibraries);
- }
- }
-
- ///
- /// Gets the metadata for the DocumentsLibrary folder.
- ///
- public static IKnownFolder DocumentsLibrary
- {
- get
- {
- CoreHelpers.ThrowIfNotWin7();
- return GetKnownFolder(FolderIdentifiers.DocumentsLibrary);
- }
- }
-
- ///
- /// Gets the metadata for the MusicLibrary folder.
- ///
- public static IKnownFolder MusicLibrary
- {
- get
- {
- CoreHelpers.ThrowIfNotWin7();
- return GetKnownFolder(FolderIdentifiers.MusicLibrary);
- }
- }
-
- ///
- /// Gets the metadata for the PicturesLibrary folder.
- ///
- public static IKnownFolder PicturesLibrary
- {
- get
- {
- CoreHelpers.ThrowIfNotWin7();
- return GetKnownFolder(FolderIdentifiers.PicturesLibrary);
- }
- }
-
- ///
- /// Gets the metadata for the VideosLibrary folder.
- ///
- public static IKnownFolder VideosLibrary
- {
- get
- {
- CoreHelpers.ThrowIfNotWin7();
- return GetKnownFolder(FolderIdentifiers.VideosLibrary);
- }
- }
-
- ///
- /// Gets the metadata for the RecordedTVLibrary folder.
- ///
- public static IKnownFolder RecordedTVLibrary
- {
- get
- {
- CoreHelpers.ThrowIfNotWin7();
- return GetKnownFolder(FolderIdentifiers.RecordedTVLibrary);
- }
- }
-
- ///
- /// Gets the metadata for the OtherUsers folder.
- ///
- public static IKnownFolder OtherUsers
- {
- get
- {
- CoreHelpers.ThrowIfNotWin7();
- return GetKnownFolder(FolderIdentifiers.OtherUsers);
- }
- }
-
- ///
- /// Gets the metadata for the DeviceMetadataStore folder.
- ///
- public static IKnownFolder DeviceMetadataStore
- {
- get
- {
- CoreHelpers.ThrowIfNotWin7();
- return GetKnownFolder(FolderIdentifiers.DeviceMetadataStore);
- }
- }
-
- ///
- /// Gets the metadata for the Libraries folder.
- ///
- public static IKnownFolder Libraries
- {
- get
- {
- CoreHelpers.ThrowIfNotWin7();
- return GetKnownFolder(FolderIdentifiers.Libraries);
- }
- }
-
- ///
- ///Gets the metadata for the UserPinned folder.
- ///
- public static IKnownFolder UserPinned
- {
- get
- {
- CoreHelpers.ThrowIfNotWin7();
- return GetKnownFolder(FolderIdentifiers.UserPinned);
- }
- }
-
- ///
- /// Gets the metadata for the ImplicitAppShortcuts folder.
- ///
- public static IKnownFolder ImplicitAppShortcuts
- {
- get
- {
- CoreHelpers.ThrowIfNotWin7();
- return GetKnownFolder(FolderIdentifiers.ImplicitAppShortcuts);
- }
- }
-
- #endregion
-
- }
-}
\ No newline at end of file
diff --git a/src/External/WindowsAPICodePack/Shell/KnownFolders/NonFileSystemKnownFolder.cs b/src/External/WindowsAPICodePack/Shell/KnownFolders/NonFileSystemKnownFolder.cs
deleted file mode 100644
index 99de303..0000000
--- a/src/External/WindowsAPICodePack/Shell/KnownFolders/NonFileSystemKnownFolder.cs
+++ /dev/null
@@ -1,280 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Diagnostics;
-using System.Runtime.InteropServices;
-
-namespace Microsoft.WindowsAPICodePack.Shell
-{
- ///
- /// Represents a registered non file system Known Folder
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "This will complicate the class hierarchy and naming convention used in the Shell area")]
- public class NonFileSystemKnownFolder : ShellNonFileSystemFolder, IKnownFolder, IDisposable
- {
- #region Private Fields
-
- private IKnownFolderNative knownFolderNative;
- private KnownFolderSettings knownFolderSettings = null;
-
- #endregion
-
- #region Internal Constructors
-
- internal NonFileSystemKnownFolder(IShellItem2 shellItem)
- : base(shellItem)
- {
- }
-
- internal NonFileSystemKnownFolder(IKnownFolderNative kf)
- {
- Debug.Assert(kf != null);
- knownFolderNative = kf;
-
- // Set the native shell item
- // and set it on the base class (ShellObject)
- Guid guid = new Guid(ShellIIDGuid.IShellItem2);
- knownFolderNative.GetShellItem(0, ref guid, out nativeShellItem);
- }
-
- #endregion
-
- #region Private Members
-
- private KnownFolderSettings KnownFolderSettings
- {
- get
- {
- if (knownFolderNative == null)
- {
- // We need to get the PIDL either from the NativeShellItem,
- // or from base class's property (if someone already set it on us).
- // Need to use the PIDL to get the native IKnownFolder interface.
-
- // Get teh PIDL for the ShellItem
- if (nativeShellItem != null && base.PIDL == IntPtr.Zero)
- base.PIDL = ShellHelper.PidlFromShellItem(nativeShellItem);
-
- // If we have a valid PIDL, get the native IKnownFolder
- if (base.PIDL != IntPtr.Zero)
- knownFolderNative = KnownFolderHelper.FromPIDL(base.PIDL);
-
- Debug.Assert(knownFolderNative != null);
- }
-
- // If this is the first time this property is being called,
- // get the native Folder Defination (KnownFolder properties)
- if (knownFolderSettings == null)
- knownFolderSettings = new KnownFolderSettings(knownFolderNative);
-
- return knownFolderSettings;
- }
- }
-
- #endregion
-
- #region IKnownFolder Members
-
- ///
- /// Gets the path for this known folder.
- ///
- /// A object.
- public string Path
- {
- get { return KnownFolderSettings.Path; }
- }
-
- ///
- /// Gets the category designation for this known folder.
- ///
- /// A value.
- public FolderCategory Category
- {
- get { return KnownFolderSettings.Category; }
- }
-
- ///
- /// Gets this known folder's canonical name.
- ///
- /// A object.
- public string CanonicalName
- {
- get { return KnownFolderSettings.CanonicalName; }
- }
-
- ///
- /// Gets this known folder's description.
- ///
- /// A object.
- public string Description
- {
- get { return KnownFolderSettings.Description; }
- }
-
- ///
- /// Gets the unique identifier for this known folder's parent folder.
- ///
- /// A value.
- public Guid ParentId
- {
- get { return KnownFolderSettings.ParentId; }
- }
-
- ///
- /// Gets this known folder's relative path.
- ///
- /// A object.
- public string RelativePath
- {
- get { return KnownFolderSettings.RelativePath; }
- }
-
- ///
- /// Gets this known folder's parsing name.
- ///
- /// A object.
- public override string ParsingName
- {
- get { return base.ParsingName; }
- }
-
- ///
- /// Gets this known folder's tool tip text.
- ///
- /// A object.
- public string Tooltip
- {
- get { return KnownFolderSettings.Tooltip; }
- }
- ///
- /// Gets the resource identifier for this
- /// known folder's tool tip text.
- ///
- /// A object.
- public string TooltipResourceId
- {
- get { return KnownFolderSettings.TooltipResourceId; }
- }
-
- ///
- /// Gets this known folder's localized name.
- ///
- /// A object.
- public string LocalizedName
- {
- get { return KnownFolderSettings.LocalizedName; }
- }
- ///
- /// Gets the resource identifier for this
- /// known folder's localized name.
- ///
- /// A object.
- public string LocalizedNameResourceId
- {
- get { return KnownFolderSettings.LocalizedNameResourceId; }
- }
-
- ///
- /// Gets this known folder's security attributes.
- ///
- /// A object.
- public string Security
- {
- get { return KnownFolderSettings.Security; }
- }
-
- ///
- /// Gets this known folder's file attributes,
- /// such as "read-only".
- ///
- /// A value.
- public System.IO.FileAttributes FileAttributes
- {
- get { return KnownFolderSettings.FileAttributes; }
- }
-
- ///
- /// Gets an value that describes this known folder's behaviors.
- ///
- /// A value.
- public DefinitionOptions DefinitionOptions
- {
- get { return KnownFolderSettings.DefinitionOptions; }
- }
-
- ///
- /// Gets the unique identifier for this known folder's type.
- ///
- /// A value.
- public Guid FolderTypeId
- {
- get { return KnownFolderSettings.FolderTypeId; }
- }
-
- ///
- /// Gets a string representation of this known folder's type.
- ///
- /// A object.
- public string FolderType
- {
- get { return KnownFolderSettings.FolderType; }
- }
- ///
- /// Gets the unique identifier for this known folder.
- ///
- /// A value.
- public Guid FolderId
- {
- get { return KnownFolderSettings.FolderId; }
- }
-
- ///
- /// Gets a value that indicates whether this known folder's path exists on the computer.
- ///
- /// A bool value.
- /// If this property value is false,
- /// the folder might be a virtual folder ( property will
- /// be for virtual folders)
- public bool PathExists
- {
- get { return KnownFolderSettings.PathExists; }
- }
-
- ///
- /// Gets a value that states whether this known folder
- /// can have its path set to a new value,
- /// including any restrictions on the redirection.
- ///
- /// A value.
- public RedirectionCapabilities Redirection
- {
- get { return KnownFolderSettings.Redirection; }
- }
-
- #endregion
-
- #region IDisposable Members
-
- ///
- /// Release resources
- ///
- /// Indicates that this mothod is being called from Dispose() rather than the finalizer.
- protected override void Dispose(bool disposing)
- {
- if (disposing)
- {
- knownFolderSettings = null;
- }
-
- if (knownFolderNative != null)
- {
- Marshal.ReleaseComObject(knownFolderNative);
- knownFolderNative = null;
- }
-
- base.Dispose(disposing);
- }
-
- #endregion
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/KnownFolders/RedirectionCapabilities.cs b/src/External/WindowsAPICodePack/Shell/KnownFolders/RedirectionCapabilities.cs
deleted file mode 100644
index 6d6e0e0..0000000
--- a/src/External/WindowsAPICodePack/Shell/KnownFolders/RedirectionCapabilities.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-namespace Microsoft.WindowsAPICodePack.Shell
-{
- ///
- /// Specifies the redirection capabilities for known folders.
- ///
- public enum RedirectionCapabilities
- {
- ///
- /// Redirection capability is unknown.
- ///
- None = 0x00,
- ///
- /// The known folder can be redirected.
- ///
- AllowAll = 0xff,
- ///
- /// The known folder can be redirected.
- /// Currently, redirection exists only for
- /// common and user folders; fixed and virtual folders
- /// cannot be redirected.
- ///
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Redirectable", Justification = "This is following the native API"
-)]
- Redirectable = 0x1,
- ///
- /// Redirection is not allowed.
- ///
- DenyAll = 0xfff00,
- ///
- /// The folder cannot be redirected because it is
- /// already redirected by group policy.
- ///
- DenyPolicyRedirected = 0x100,
- ///
- /// The folder cannot be redirected because the policy
- /// prohibits redirecting this folder.
- ///
- DenyPolicy = 0x200,
- ///
- /// The folder cannot be redirected because the calling
- /// application does not have sufficient permissions.
- ///
- DenyPermissions = 0x400
- }
-}
\ No newline at end of file
diff --git a/src/External/WindowsAPICodePack/Shell/KnownFolders/RetrievalOptions.cs b/src/External/WindowsAPICodePack/Shell/KnownFolders/RetrievalOptions.cs
deleted file mode 100644
index 4842a0d..0000000
--- a/src/External/WindowsAPICodePack/Shell/KnownFolders/RetrievalOptions.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-
-namespace Microsoft.WindowsAPICodePack.Shell
-{
- ///
- /// Contains special retrieval options for known folders.
- ///
- internal enum RetrievalOptions
- {
- None = 0,
- Create = 0x00008000,
- DontVerify = 0x00004000,
- DontUnexpand = 0x00002000,
- NoAlias = 0x00001000,
- Init = 0x00000800,
- DefaultPath = 0x00000400,
- NotParentRelative = 0x00000200
- }
-}
\ No newline at end of file
diff --git a/src/External/WindowsAPICodePack/Shell/Migrated rules for Shell.ruleset b/src/External/WindowsAPICodePack/Shell/Migrated rules for Shell.ruleset
deleted file mode 100644
index c66ae37..0000000
--- a/src/External/WindowsAPICodePack/Shell/Migrated rules for Shell.ruleset
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/External/WindowsAPICodePack/Shell/Properties/AssemblyInfo.cs b/src/External/WindowsAPICodePack/Shell/Properties/AssemblyInfo.cs
deleted file mode 100644
index 3bee8b9..0000000
--- a/src/External/WindowsAPICodePack/Shell/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("Microsoft.WindowsAPICodePack.Shell")]
-[assembly: AssemblyDescription("WindowsAPICodePack for Shell")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Microsoft")]
-[assembly: AssemblyProduct("Microsoft Windows API Code Pack for .NET Framework")]
-[assembly: AssemblyCopyright("Copyright © Microsoft 2009")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("48fe0672-7ff4-48fd-a3fd-83c8fa8c3506")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
-
diff --git a/src/External/WindowsAPICodePack/Shell/PropertySystem/IShellProperty.cs b/src/External/WindowsAPICodePack/Shell/PropertySystem/IShellProperty.cs
deleted file mode 100644
index 8b012d5..0000000
--- a/src/External/WindowsAPICodePack/Shell/PropertySystem/IShellProperty.cs
+++ /dev/null
@@ -1,79 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using Microsoft.WindowsAPICodePack.Shell;
-
-namespace Microsoft.WindowsAPICodePack.Shell.PropertySystem
-{
- ///
- /// Defines the properties used by a Shell Property.
- ///
- public interface IShellProperty
- {
- ///
- /// Gets the property key that identifies this property.
- ///
- PropertyKey PropertyKey
- {
- get;
- }
-
- ///
- /// Gets a formatted, Unicode string representation of a property value.
- ///
- /// One or more PropertyDescriptionFormat flags
- /// chosen to produce the desired display format.
- /// The formatted value as a string.
- string FormatForDisplay(PropertyDescriptionFormat format);
-
- ///
- /// Get the property description object.
- ///
- ShellPropertyDescription Description
- {
- get;
- }
-
- ///
- /// Gets the case-sensitive name of the property as it is known to the system,
- /// regardless of its localized name.
- ///
- string CanonicalName
- {
- get;
- }
-
- ///
- /// Gets the value for this property using the generic Object type.
- ///
- ///
- /// To obtain a specific type for this value, use the more strongly-typed
- /// Property<T> class.
- /// You can only set a value for this type using the Property<T>
- /// class.
- ///
- object ValueAsObject
- {
- get;
- }
-
- ///
- /// Gets the System.Type value for this property.
- ///
- Type ValueType
- {
- get;
- }
-
- ///
- /// Gets the image reference path and icon index associated with a property value.
- /// This API is only available in Windows 7.
- ///
- IconReference IconReference
- {
- get;
- }
- }
-}
diff --git a/src/External/WindowsAPICodePack/Shell/PropertySystem/ShellProperties.cs b/src/External/WindowsAPICodePack/Shell/PropertySystem/ShellProperties.cs
deleted file mode 100644
index 18e2165..0000000
--- a/src/External/WindowsAPICodePack/Shell/PropertySystem/ShellProperties.cs
+++ /dev/null
@@ -1,272 +0,0 @@
-//Copyright (c) Microsoft Corporation. All rights reserved.
-
-using System;
-using System.Runtime.InteropServices;
-using System.Runtime.InteropServices.ComTypes;
-using MS.WindowsAPICodePack.Internal;
-
-namespace Microsoft.WindowsAPICodePack.Shell.PropertySystem
-{
- ///
- /// Defines a partial class that implements helper methods for retrieving Shell properties
- /// using a canonical name, property key, or a strongly-typed property. Also provides
- /// access to all the strongly-typed system properties and default properties collections.
- ///
- public partial class ShellProperties
- {
- private ShellObject ParentShellObject { get; set; }
- private ShellPropertyCollection defaultPropertyCollection = null;
-
- internal ShellProperties(ShellObject parent)
- {
- ParentShellObject = parent;
- }
-
- ///
- /// Returns a property available in the default property collection using
- /// the given property key.
- ///
- /// The property key.
- /// An IShellProperty.
- public IShellProperty GetProperty(PropertyKey key)
- {
- return CreateTypedProperty(key);
- }
-
- ///
- /// Returns a property available in the default property collection using
- /// the given canonical name.
- ///
- /// The canonical name.
- /// An IShellProperty.
- public IShellProperty GetProperty(string canonicalName)
- {
- return CreateTypedProperty(canonicalName);
- }
-
- ///
- /// Returns a strongly typed property available in the default property collection using
- /// the given property key.
- ///
- /// The type of property to retrieve.
- /// The property key.
- /// A strongly-typed ShellProperty for the given property key.
- public ShellProperty GetProperty(PropertyKey key)
- {
- return CreateTypedProperty(key) as ShellProperty;
- }
-
- ///
- /// Returns a strongly typed property available in the default property collection using
- /// the given canonical name.
- ///
- /// The type of property to retrieve.
- /// The canonical name.
- /// A strongly-typed ShellProperty for the given canonical name.
- public ShellProperty GetProperty(string canonicalName)
- {
- return CreateTypedProperty(canonicalName) as ShellProperty;
- }
-
- private PropertySystem propertySystem = null;
- ///
- /// Gets all the properties for the system through an accessor.
- ///
- public PropertySystem System
- {
- get
- {
- if (propertySystem == null)
- propertySystem = new PropertySystem(ParentShellObject);
-
- return propertySystem;
- }
- }
-
- ///
- /// Gets the collection of all the default properties for this item.
- ///
- public ShellPropertyCollection DefaultPropertyCollection
- {
- get
- {
- if (defaultPropertyCollection == null)
- defaultPropertyCollection = new ShellPropertyCollection(ParentShellObject);
-
- return defaultPropertyCollection;
- }
- }
-
- ///
- /// Returns the shell property writer used when writing multiple properties.
- ///
- /// A ShellPropertyWriter.
- /// Use the Using pattern with the returned ShellPropertyWriter or
- /// manually call the Close method on the writer to commit the changes
- /// and dispose the writer
- public ShellPropertyWriter GetPropertyWriter()
- {
- return new ShellPropertyWriter(ParentShellObject);
-
- }
-
- internal IShellProperty CreateTypedProperty(PropertyKey propKey)
- {
- ShellPropertyDescription desc = ShellPropertyDescriptionsCache.Cache.GetPropertyDescription(propKey);
- return (new ShellProperty(propKey, desc, ParentShellObject));
- }
-
- internal IShellProperty CreateTypedProperty(PropertyKey propKey)
- {
- ShellPropertyDescription desc = ShellPropertyDescriptionsCache.Cache.GetPropertyDescription(propKey);
-
- switch (desc.VarEnumType)
- {
- case (VarEnum.VT_EMPTY):
- case (VarEnum.VT_NULL):
- {
- return (new ShellProperty