-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
35fa937
commit 6f53462
Showing
74 changed files
with
951 additions
and
614 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using Microsoft.Win32; | ||
using System; | ||
|
||
namespace ITHit.FileSystem.Samples.Common.Windows.ShellExtension | ||
{ | ||
public class ShellExtensionRegistrar | ||
{ | ||
private static readonly string ClsidKeyPathFormat = @"SOFTWARE\Classes\CLSID\{0:B}"; | ||
private static readonly string LocalServer32PathFormat = @$"{ClsidKeyPathFormat}\LocalServer32"; | ||
private static readonly string SyncRootPathFormat = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\SyncRootManager\{0}"; | ||
|
||
/// <summary> | ||
/// Register shell service provider COM class and register it for sync root. | ||
/// </summary> | ||
/// <param name="syncRootId">Sync root identifier</param> | ||
/// <param name="handlerName">Name of shell service provider</param> | ||
/// <param name="handlerGuid">CLSID of shell service provider</param> | ||
/// <param name="comServerPath">Absolute path to COM server executable</param> | ||
public static void Register(string syncRootId, string handlerName, Guid handlerGuid, string comServerPath) | ||
{ | ||
string handlerPath = handlerGuid.ToString("B").ToUpper(); | ||
string syncRootPath = string.Format(SyncRootPathFormat, syncRootId); | ||
|
||
using RegistryKey syncRootKey = Registry.LocalMachine.OpenSubKey(syncRootPath, true); | ||
syncRootKey.SetValue(handlerName, handlerPath); | ||
|
||
string localServer32Path = string.Format(LocalServer32PathFormat, handlerPath); | ||
using RegistryKey localServer32Key = Registry.CurrentUser.CreateSubKey(localServer32Path); | ||
localServer32Key.SetValue(null, comServerPath); | ||
} | ||
|
||
/// <summary> | ||
/// Unregister shell service provider COM class. | ||
/// </summary> | ||
/// <param name="handlerClsid"></param> | ||
public static void Unregister(Guid handlerClsid) | ||
{ | ||
string thumbnailProviderGuid = handlerClsid.ToString("B").ToUpper(); | ||
string clsidKeyPath = string.Format(ClsidKeyPathFormat, thumbnailProviderGuid); | ||
Registry.CurrentUser.DeleteSubKeyTree(clsidKeyPath, false); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
93 changes: 0 additions & 93 deletions
93
Windows/Common/VirtualDrive/FullSync/ClientToServerSync.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.