From 0425d421ee14e9fa4451d894b1bc11edcc3d5c60 Mon Sep 17 00:00:00 2001 From: IanStorm Date: Mon, 13 Jun 2016 21:11:40 +0200 Subject: [PATCH 01/69] * added interface project for XElement.DotNet.System.Environment.UserInformation --- Visual Studio/CloudSyncHelper.sln | 12 ++++ .../IUserInformation.cs | 7 +++ .../IUserInformationService.cs | 7 +++ .../Properties/AssemblyInfo.cs | 35 ++++++++++++ .../UserInformation.Interface.csproj | 56 +++++++++++++++++++ 5 files changed, 117 insertions(+) create mode 100644 XElement/DotNet/System/Environment/UserInformation.Interface/IUserInformation.cs create mode 100644 XElement/DotNet/System/Environment/UserInformation.Interface/IUserInformationService.cs create mode 100644 XElement/DotNet/System/Environment/UserInformation.Interface/Properties/AssemblyInfo.cs create mode 100644 XElement/DotNet/System/Environment/UserInformation.Interface/UserInformation.Interface.csproj diff --git a/Visual Studio/CloudSyncHelper.sln b/Visual Studio/CloudSyncHelper.sln index 90c1fb3..ea88d92 100644 --- a/Visual Studio/CloudSyncHelper.sln +++ b/Visual Studio/CloudSyncHelper.sln @@ -92,6 +92,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Logic.MefExtensions", "..\L EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test_Logic.Implementation", "..\Logic\Test_Logic.Implementation\Test_Logic.Implementation.csproj", "{062DAB41-F255-44B7-91A8-B987781FF17A}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Environment", "Environment", "{A58CEB5D-3ADA-4F02-8446-A2F6147E822B}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "UserInformation", "UserInformation", "{E8981F23-1883-4E05-BF46-0A5AF7C882E2}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UserInformation.Interface", "..\XElement\DotNet\System\Environment\UserInformation.Interface\UserInformation.Interface.csproj", "{59CB5B77-DD0D-4665-BEB9-22E999BC2E2B}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -212,6 +218,10 @@ Global {062DAB41-F255-44B7-91A8-B987781FF17A}.Debug|Any CPU.Build.0 = Debug|Any CPU {062DAB41-F255-44B7-91A8-B987781FF17A}.Release|Any CPU.ActiveCfg = Release|Any CPU {062DAB41-F255-44B7-91A8-B987781FF17A}.Release|Any CPU.Build.0 = Release|Any CPU + {59CB5B77-DD0D-4665-BEB9-22E999BC2E2B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {59CB5B77-DD0D-4665-BEB9-22E999BC2E2B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {59CB5B77-DD0D-4665-BEB9-22E999BC2E2B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {59CB5B77-DD0D-4665-BEB9-22E999BC2E2B}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -249,5 +259,7 @@ Global {411FC166-4D90-4915-AFFD-6C4C1ECF1396} = {79ED10F5-B256-47E0-8C11-2AF152A6CDCD} {0F5BA595-1293-4429-AD68-47A5E1413778} = {79ED10F5-B256-47E0-8C11-2AF152A6CDCD} {062DAB41-F255-44B7-91A8-B987781FF17A} = {79ED10F5-B256-47E0-8C11-2AF152A6CDCD} + {E8981F23-1883-4E05-BF46-0A5AF7C882E2} = {A58CEB5D-3ADA-4F02-8446-A2F6147E822B} + {59CB5B77-DD0D-4665-BEB9-22E999BC2E2B} = {E8981F23-1883-4E05-BF46-0A5AF7C882E2} EndGlobalSection EndGlobal diff --git a/XElement/DotNet/System/Environment/UserInformation.Interface/IUserInformation.cs b/XElement/DotNet/System/Environment/UserInformation.Interface/IUserInformation.cs new file mode 100644 index 0000000..6943e2b --- /dev/null +++ b/XElement/DotNet/System/Environment/UserInformation.Interface/IUserInformation.cs @@ -0,0 +1,7 @@ +namespace XElement.DotNet.System.Environment.UserInformation +{ + public interface IUserInformation + { + string FullName { get; } + } +} diff --git a/XElement/DotNet/System/Environment/UserInformation.Interface/IUserInformationService.cs b/XElement/DotNet/System/Environment/UserInformation.Interface/IUserInformationService.cs new file mode 100644 index 0000000..895d523 --- /dev/null +++ b/XElement/DotNet/System/Environment/UserInformation.Interface/IUserInformationService.cs @@ -0,0 +1,7 @@ +namespace XElement.DotNet.System.Environment.UserInformation +{ + public interface IUserInformationService + { + IUserInformation CurrentUser { get; } + } +} diff --git a/XElement/DotNet/System/Environment/UserInformation.Interface/Properties/AssemblyInfo.cs b/XElement/DotNet/System/Environment/UserInformation.Interface/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..045a861 --- /dev/null +++ b/XElement/DotNet/System/Environment/UserInformation.Interface/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +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( "XElement.DotNet.System.Environment.UserInformation.Interface" )] +[assembly: AssemblyDescription( "" )] +[assembly: AssemblyConfiguration( "" )] +[assembly: AssemblyCompany( "" )] +[assembly: AssemblyProduct( "Cloud Sync Helper" )] +[assembly: AssemblyCopyright( "Copyright © XElement Software 2016" )] +[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( "59cb5b77-dd0d-4665-beb9-22e999bc2e2b" )] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion( "0.0.0.0" )] +[assembly: AssemblyFileVersion( "0.0.0.0" )] diff --git a/XElement/DotNet/System/Environment/UserInformation.Interface/UserInformation.Interface.csproj b/XElement/DotNet/System/Environment/UserInformation.Interface/UserInformation.Interface.csproj new file mode 100644 index 0000000..e22719b --- /dev/null +++ b/XElement/DotNet/System/Environment/UserInformation.Interface/UserInformation.Interface.csproj @@ -0,0 +1,56 @@ + + + + + Debug + AnyCPU + {59CB5B77-DD0D-4665-BEB9-22E999BC2E2B} + Library + Properties + XElement.DotNet.System.Environment.UserInformation + XElement.DotNet.System.Environment.UserInformation.Interface + v4.5 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 955f87174b7988557ee3fccc43b24a02f8ffa8ac Mon Sep 17 00:00:00 2001 From: IanStorm Date: Mon, 13 Jun 2016 21:14:37 +0200 Subject: [PATCH 02/69] * added implementation for XElement.DotNet.System.Environment.UserInformation --- Visual Studio/CloudSyncHelper.sln | 7 ++ .../DirectoryEntryRetriever.cs | 35 ++++++++++ .../IUserInformationInt.cs | 10 +++ .../PrincipalContextRetriever.cs | 35 ++++++++++ .../Properties/AssemblyInfo.cs | 35 ++++++++++ .../SysEnvironmentRetriever.cs | 39 +++++++++++ .../UserInformation.Implementation.csproj | 67 +++++++++++++++++++ .../UserInformation.cs | 15 +++++ 8 files changed, 243 insertions(+) create mode 100644 XElement/DotNet/System/Environment/UserInformation.Implementation/DirectoryEntryRetriever.cs create mode 100644 XElement/DotNet/System/Environment/UserInformation.Implementation/IUserInformationInt.cs create mode 100644 XElement/DotNet/System/Environment/UserInformation.Implementation/PrincipalContextRetriever.cs create mode 100644 XElement/DotNet/System/Environment/UserInformation.Implementation/Properties/AssemblyInfo.cs create mode 100644 XElement/DotNet/System/Environment/UserInformation.Implementation/SysEnvironmentRetriever.cs create mode 100644 XElement/DotNet/System/Environment/UserInformation.Implementation/UserInformation.Implementation.csproj create mode 100644 XElement/DotNet/System/Environment/UserInformation.Implementation/UserInformation.cs diff --git a/Visual Studio/CloudSyncHelper.sln b/Visual Studio/CloudSyncHelper.sln index ea88d92..747bc24 100644 --- a/Visual Studio/CloudSyncHelper.sln +++ b/Visual Studio/CloudSyncHelper.sln @@ -98,6 +98,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "UserInformation", "UserInfo EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UserInformation.Interface", "..\XElement\DotNet\System\Environment\UserInformation.Interface\UserInformation.Interface.csproj", "{59CB5B77-DD0D-4665-BEB9-22E999BC2E2B}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UserInformation.Implementation", "..\XElement\DotNet\System\Environment\UserInformation.Implementation\UserInformation.Implementation.csproj", "{9E94C2D1-BE62-45E6-8A12-0B04D3A991DB}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -222,6 +224,10 @@ Global {59CB5B77-DD0D-4665-BEB9-22E999BC2E2B}.Debug|Any CPU.Build.0 = Debug|Any CPU {59CB5B77-DD0D-4665-BEB9-22E999BC2E2B}.Release|Any CPU.ActiveCfg = Release|Any CPU {59CB5B77-DD0D-4665-BEB9-22E999BC2E2B}.Release|Any CPU.Build.0 = Release|Any CPU + {9E94C2D1-BE62-45E6-8A12-0B04D3A991DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9E94C2D1-BE62-45E6-8A12-0B04D3A991DB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9E94C2D1-BE62-45E6-8A12-0B04D3A991DB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9E94C2D1-BE62-45E6-8A12-0B04D3A991DB}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -261,5 +267,6 @@ Global {062DAB41-F255-44B7-91A8-B987781FF17A} = {79ED10F5-B256-47E0-8C11-2AF152A6CDCD} {E8981F23-1883-4E05-BF46-0A5AF7C882E2} = {A58CEB5D-3ADA-4F02-8446-A2F6147E822B} {59CB5B77-DD0D-4665-BEB9-22E999BC2E2B} = {E8981F23-1883-4E05-BF46-0A5AF7C882E2} + {9E94C2D1-BE62-45E6-8A12-0B04D3A991DB} = {E8981F23-1883-4E05-BF46-0A5AF7C882E2} EndGlobalSection EndGlobal diff --git a/XElement/DotNet/System/Environment/UserInformation.Implementation/DirectoryEntryRetriever.cs b/XElement/DotNet/System/Environment/UserInformation.Implementation/DirectoryEntryRetriever.cs new file mode 100644 index 0000000..42adf64 --- /dev/null +++ b/XElement/DotNet/System/Environment/UserInformation.Implementation/DirectoryEntryRetriever.cs @@ -0,0 +1,35 @@ +using System; +using System.DirectoryServices; + +namespace XElement.DotNet.System.Environment.UserInformation +{ +#region not unit-tested + public class DirectoryEntryRetriever : IUserInformationService + { + public IUserInformation CurrentUser + { + get + { + var directoryEntry = this.GetFromDirectoryEntry(); + var fullName = (string)directoryEntry.Properties["fullname"].Value; + var userInfo = new UserInformation + { + FullName = fullName + }; + return userInfo; + } + } + + + private DirectoryEntry GetFromDirectoryEntry() + { + // --> http://www.developerzen.com/2007/06/07/getting-the-full-name-of-the-current-user/#respond + var path = String.Format( "WinNT://{0}/{1},User", + global::System.Environment.UserDomainName, + global::System.Environment.UserName ); + DirectoryEntry userEntry = new DirectoryEntry( path ); + return userEntry; + } + } +#endregion +} diff --git a/XElement/DotNet/System/Environment/UserInformation.Implementation/IUserInformationInt.cs b/XElement/DotNet/System/Environment/UserInformation.Implementation/IUserInformationInt.cs new file mode 100644 index 0000000..da45edf --- /dev/null +++ b/XElement/DotNet/System/Environment/UserInformation.Implementation/IUserInformationInt.cs @@ -0,0 +1,10 @@ +namespace XElement.DotNet.System.Environment.UserInformation +{ + internal interface IUserInformationInt : IUserInformation + { + string Domain { get; } + + + string TechnicalName { get; } + } +} diff --git a/XElement/DotNet/System/Environment/UserInformation.Implementation/PrincipalContextRetriever.cs b/XElement/DotNet/System/Environment/UserInformation.Implementation/PrincipalContextRetriever.cs new file mode 100644 index 0000000..7d63570 --- /dev/null +++ b/XElement/DotNet/System/Environment/UserInformation.Implementation/PrincipalContextRetriever.cs @@ -0,0 +1,35 @@ +using System; +using System.DirectoryServices.AccountManagement; + +namespace XElement.DotNet.System.Environment.UserInformation +{ +#region not unit-tested + public class PrincipalContextRetriever : IUserInformationService + { + public IUserInformation CurrentUser + { + get + { + throw new NotImplementedException(); + //var userPrincipal = this.GetFromPrincipalContext(); + //var userInfo = new UserInformation + //{ + //}; + //return userInfo; + } + } + + + private UserPrincipal GetFromPrincipalContext() + { + // --> http://www.dotnetspark.com/links/14003-systemdirectoryservicesaccountmanagement.aspx + var domainName = global::System.Environment.UserDomainName; + var userName = global::System.Environment.UserName; + var context = new PrincipalContext( ContextType.Domain, domainName, userName ); + UserPrincipal user = new UserPrincipal( context ); + user = UserPrincipal.FindByIdentity( context, userName ); + return user; + } + } +#endregion +} diff --git a/XElement/DotNet/System/Environment/UserInformation.Implementation/Properties/AssemblyInfo.cs b/XElement/DotNet/System/Environment/UserInformation.Implementation/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..7e3849e --- /dev/null +++ b/XElement/DotNet/System/Environment/UserInformation.Implementation/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +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( "XElement.DotNet.System.Environment.UserInformation.Implementation" )] +[assembly: AssemblyDescription( "" )] +[assembly: AssemblyConfiguration( "" )] +[assembly: AssemblyCompany( "" )] +[assembly: AssemblyProduct( "Cloud Sync Helper" )] +[assembly: AssemblyCopyright( "Copyright © XElement Software 2016" )] +[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( "9e94c2d1-be62-45e6-8a12-0b04d3a991db" )] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion( "0.0.0.0" )] +[assembly: AssemblyFileVersion( "0.0.0.0" )] diff --git a/XElement/DotNet/System/Environment/UserInformation.Implementation/SysEnvironmentRetriever.cs b/XElement/DotNet/System/Environment/UserInformation.Implementation/SysEnvironmentRetriever.cs new file mode 100644 index 0000000..184a40f --- /dev/null +++ b/XElement/DotNet/System/Environment/UserInformation.Implementation/SysEnvironmentRetriever.cs @@ -0,0 +1,39 @@ +namespace XElement.DotNet.System.Environment.UserInformation +{ +#region not unit-tested + public class SysEnvironmentRetriever : IUserInformationService + { + public IUserInformation CurrentUser + { + get + { + var userInfo = new UserInformation + { + Domain = global::System.Environment.UserDomainName, + TechnicalName = global::System.Environment.UserName + }; + return userInfo; + + //System.Security.Principal.WindowsIdentity.GetCurrent() + + //Environment. + + //// --> https://stackoverflow.com/questions/3471635/get-first-name-last-name-of-logedin-windows-user + //UserPrincipal userPrincipal = UserPrincipal.Current; + //var name = userPrincipal.DisplayName; + //var surname = userPrincipal.Surname; + + //// --> http://www.codeproject.com/Questions/354321/Get-User-Image-for-Windows-Login-user + //var imageFile = new FileInfo( Environment.GetFolderPath( Environment.SpecialFolder.CommonApplicationData ) + + // @"\Microsoft\User Account Pictures\" + Environment.UserDomainName + "+" + Environment.UserName + ".dat" ); + + //var bla = WindowsIdentity.GetCurrent( TokenAccessLevels.Read ); + //bla. + + //// --> https://stackoverflow.com/questions/12113706/filenotfoundexception-at-system-directoryservices-interop-unsafenativemethods-ia + //new PrincipalContext(ContextType.Machine, Environment.MachineName). + } + } + } +#endregion +} diff --git a/XElement/DotNet/System/Environment/UserInformation.Implementation/UserInformation.Implementation.csproj b/XElement/DotNet/System/Environment/UserInformation.Implementation/UserInformation.Implementation.csproj new file mode 100644 index 0000000..000756c --- /dev/null +++ b/XElement/DotNet/System/Environment/UserInformation.Implementation/UserInformation.Implementation.csproj @@ -0,0 +1,67 @@ + + + + + Debug + AnyCPU + {9E94C2D1-BE62-45E6-8A12-0B04D3A991DB} + Library + Properties + XElement.DotNet.System.Environment.UserInformation.Interface + XElement.DotNet.System.Environment.UserInformation.Implementation + v4.5 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + + {59cb5b77-dd0d-4665-beb9-22e999bc2e2b} + UserInformation.Interface + + + + + \ No newline at end of file diff --git a/XElement/DotNet/System/Environment/UserInformation.Implementation/UserInformation.cs b/XElement/DotNet/System/Environment/UserInformation.Implementation/UserInformation.cs new file mode 100644 index 0000000..fd2a819 --- /dev/null +++ b/XElement/DotNet/System/Environment/UserInformation.Implementation/UserInformation.cs @@ -0,0 +1,15 @@ +namespace XElement.DotNet.System.Environment.UserInformation +{ +#region not unit-tested + internal class UserInformation : IUserInformationInt + { + public string Domain { get; set; } + + + public string FullName { get; set; } + + + public string TechnicalName { get; set; } + } +#endregion +} From 8eaa4ca600a9787bdef948530e7c1d54003d53c9 Mon Sep 17 00:00:00 2001 From: IanStorm Date: Mon, 13 Jun 2016 21:17:46 +0200 Subject: [PATCH 03/69] * added MEF project for XElement.DotNet.System.Environment.UserInformation --- Visual Studio/CloudSyncHelper.sln | 7 ++ .../DirectoryEntryRetriever.cs | 10 +++ .../PrincipalContextRetriever.cs | 8 +++ .../Properties/AssemblyInfo.cs | 35 ++++++++++ .../SysEnvironmentRetriever.cs | 8 +++ .../UserInformation.MefExtensions.csproj | 67 +++++++++++++++++++ 6 files changed, 135 insertions(+) create mode 100644 XElement/DotNet/System/Environment/UserInformation.MefExtensions/DirectoryEntryRetriever.cs create mode 100644 XElement/DotNet/System/Environment/UserInformation.MefExtensions/PrincipalContextRetriever.cs create mode 100644 XElement/DotNet/System/Environment/UserInformation.MefExtensions/Properties/AssemblyInfo.cs create mode 100644 XElement/DotNet/System/Environment/UserInformation.MefExtensions/SysEnvironmentRetriever.cs create mode 100644 XElement/DotNet/System/Environment/UserInformation.MefExtensions/UserInformation.MefExtensions.csproj diff --git a/Visual Studio/CloudSyncHelper.sln b/Visual Studio/CloudSyncHelper.sln index 747bc24..2d631a5 100644 --- a/Visual Studio/CloudSyncHelper.sln +++ b/Visual Studio/CloudSyncHelper.sln @@ -100,6 +100,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UserInformation.Interface", EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UserInformation.Implementation", "..\XElement\DotNet\System\Environment\UserInformation.Implementation\UserInformation.Implementation.csproj", "{9E94C2D1-BE62-45E6-8A12-0B04D3A991DB}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UserInformation.MefExtensions", "..\XElement\DotNet\System\Environment\UserInformation.MefExtensions\UserInformation.MefExtensions.csproj", "{ACBFE0B5-E9C3-4DDC-B454-D12AE691802B}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -228,6 +230,10 @@ Global {9E94C2D1-BE62-45E6-8A12-0B04D3A991DB}.Debug|Any CPU.Build.0 = Debug|Any CPU {9E94C2D1-BE62-45E6-8A12-0B04D3A991DB}.Release|Any CPU.ActiveCfg = Release|Any CPU {9E94C2D1-BE62-45E6-8A12-0B04D3A991DB}.Release|Any CPU.Build.0 = Release|Any CPU + {ACBFE0B5-E9C3-4DDC-B454-D12AE691802B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {ACBFE0B5-E9C3-4DDC-B454-D12AE691802B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {ACBFE0B5-E9C3-4DDC-B454-D12AE691802B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {ACBFE0B5-E9C3-4DDC-B454-D12AE691802B}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -268,5 +274,6 @@ Global {E8981F23-1883-4E05-BF46-0A5AF7C882E2} = {A58CEB5D-3ADA-4F02-8446-A2F6147E822B} {59CB5B77-DD0D-4665-BEB9-22E999BC2E2B} = {E8981F23-1883-4E05-BF46-0A5AF7C882E2} {9E94C2D1-BE62-45E6-8A12-0B04D3A991DB} = {E8981F23-1883-4E05-BF46-0A5AF7C882E2} + {ACBFE0B5-E9C3-4DDC-B454-D12AE691802B} = {E8981F23-1883-4E05-BF46-0A5AF7C882E2} EndGlobalSection EndGlobal diff --git a/XElement/DotNet/System/Environment/UserInformation.MefExtensions/DirectoryEntryRetriever.cs b/XElement/DotNet/System/Environment/UserInformation.MefExtensions/DirectoryEntryRetriever.cs new file mode 100644 index 0000000..d904d15 --- /dev/null +++ b/XElement/DotNet/System/Environment/UserInformation.MefExtensions/DirectoryEntryRetriever.cs @@ -0,0 +1,10 @@ +using System.ComponentModel.Composition; + +namespace XElement.DotNet.System.Environment.UserInformation.MefExtensions +{ +#region not unit-tested + [Export( typeof( IUserInformationService ) )] + internal class DirectoryEntryRetriever : + global::XElement.DotNet.System.Environment.UserInformation.DirectoryEntryRetriever { } +#endregion +} diff --git a/XElement/DotNet/System/Environment/UserInformation.MefExtensions/PrincipalContextRetriever.cs b/XElement/DotNet/System/Environment/UserInformation.MefExtensions/PrincipalContextRetriever.cs new file mode 100644 index 0000000..a5c15d7 --- /dev/null +++ b/XElement/DotNet/System/Environment/UserInformation.MefExtensions/PrincipalContextRetriever.cs @@ -0,0 +1,8 @@ +namespace XElement.DotNet.System.Environment.UserInformation.MefExtensions +{ +#region not unit-tested + //[Export( typeof( IUserInformationService ) )] + internal class PrincipalContextRetriever : + global::XElement.DotNet.System.Environment.UserInformation.PrincipalContextRetriever { } +#endregion +} diff --git a/XElement/DotNet/System/Environment/UserInformation.MefExtensions/Properties/AssemblyInfo.cs b/XElement/DotNet/System/Environment/UserInformation.MefExtensions/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..0f2d685 --- /dev/null +++ b/XElement/DotNet/System/Environment/UserInformation.MefExtensions/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +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( "XElement.DotNet.System.Environment.UserInformation.MefExtensions" )] +[assembly: AssemblyDescription( "" )] +[assembly: AssemblyConfiguration( "" )] +[assembly: AssemblyCompany( "" )] +[assembly: AssemblyProduct( "Cloud Sync Helper" )] +[assembly: AssemblyCopyright( "Copyright © XElement Software 2016" )] +[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( "acbfe0b5-e9c3-4ddc-b454-d12ae691802b" )] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion( "0.0.0.0" )] +[assembly: AssemblyFileVersion( "0.0.0.0" )] diff --git a/XElement/DotNet/System/Environment/UserInformation.MefExtensions/SysEnvironmentRetriever.cs b/XElement/DotNet/System/Environment/UserInformation.MefExtensions/SysEnvironmentRetriever.cs new file mode 100644 index 0000000..b84eb9c --- /dev/null +++ b/XElement/DotNet/System/Environment/UserInformation.MefExtensions/SysEnvironmentRetriever.cs @@ -0,0 +1,8 @@ +namespace XElement.DotNet.System.Environment.UserInformation.MefExtensions +{ +#region not unit-tested + //[Export( typeof( IUserInformationService ) )] + internal class SysEnvironmentRetriever : + global::XElement.DotNet.System.Environment.UserInformation.SysEnvironmentRetriever { } +#endregion +} diff --git a/XElement/DotNet/System/Environment/UserInformation.MefExtensions/UserInformation.MefExtensions.csproj b/XElement/DotNet/System/Environment/UserInformation.MefExtensions/UserInformation.MefExtensions.csproj new file mode 100644 index 0000000..47b278b --- /dev/null +++ b/XElement/DotNet/System/Environment/UserInformation.MefExtensions/UserInformation.MefExtensions.csproj @@ -0,0 +1,67 @@ + + + + + Debug + AnyCPU + {ACBFE0B5-E9C3-4DDC-B454-D12AE691802B} + Library + Properties + XElement.DotNet.System.Environment.UserInformation.MefExtensions + XElement.DotNet.System.Environment.UserInformation.MefExtensions + v4.5 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + {9e94c2d1-be62-45e6-8a12-0b04d3a991db} + UserInformation.Implementation + + + {59CB5B77-DD0D-4665-BEB9-22E999BC2E2B} + UserInformation.Interface + + + + + \ No newline at end of file From 61a025881c0b0d4bfe6f58859897ed36c87b579a Mon Sep 17 00:00:00 2001 From: IanStorm Date: Mon, 13 Jun 2016 21:32:45 +0200 Subject: [PATCH 04/69] * moved OsRecognition project to Environment folder in VS solution --- Visual Studio/CloudSyncHelper.sln | 1 + 1 file changed, 1 insertion(+) diff --git a/Visual Studio/CloudSyncHelper.sln b/Visual Studio/CloudSyncHelper.sln index 2d631a5..119e2a7 100644 --- a/Visual Studio/CloudSyncHelper.sln +++ b/Visual Studio/CloudSyncHelper.sln @@ -246,6 +246,7 @@ Global {06D15881-BB89-464E-A43C-05F473AE66BA} = {D00A2DA5-B035-4EA9-845E-6B791CA13CE9} {18797D1C-3848-4906-9E29-4F433FF48D26} = {D00A2DA5-B035-4EA9-845E-6B791CA13CE9} {7CF544AE-B30D-46F0-8FE6-11EE842FF035} = {A7FAA180-B23C-4CE4-BCDC-C22F4736CF48} + {A7FAA180-B23C-4CE4-BCDC-C22F4736CF48} = {A58CEB5D-3ADA-4F02-8446-A2F6147E822B} {60EF22EB-496F-4399-A77D-5B3CF9B49DA1} = {06A61363-7B57-464E-8D8F-EAB947FD16E5} {869854C4-852D-4CBE-98D1-98FB6F804238} = {60EF22EB-496F-4399-A77D-5B3CF9B49DA1} {DAA6FA28-FA8B-461C-9948-4ADEB12B743C} = {869854C4-852D-4CBE-98D1-98FB6F804238} From 875b1d3ad8676fbbc121ce26a59538a32197dc11 Mon Sep 17 00:00:00 2001 From: IanStorm Date: Thu, 7 Jul 2016 16:27:49 +0200 Subject: [PATCH 05/69] * created project for sharing UI resources between modules and main executable --- .../CloudSyncHelper_win32.csproj | 4 + .../Dictionaries/Resources.xaml | 5 +- UI/Win32/Common/Common.csproj | 92 ++++++++++++++ UI/Win32/Common/Dictionaries/Resources.xaml | 8 ++ UI/Win32/Common/Properties/AssemblyInfo.cs | 53 ++++++++ .../Common/Properties/Resources.Designer.cs | 63 ++++++++++ UI/Win32/Common/Properties/Resources.resx | 117 ++++++++++++++++++ .../Common/Properties/Settings.Designer.cs | 26 ++++ UI/Win32/Common/Properties/Settings.settings | 7 ++ Visual Studio/CloudSyncHelper.sln | 7 ++ 10 files changed, 381 insertions(+), 1 deletion(-) create mode 100644 UI/Win32/Common/Common.csproj create mode 100644 UI/Win32/Common/Dictionaries/Resources.xaml create mode 100644 UI/Win32/Common/Properties/AssemblyInfo.cs create mode 100644 UI/Win32/Common/Properties/Resources.Designer.cs create mode 100644 UI/Win32/Common/Properties/Resources.resx create mode 100644 UI/Win32/Common/Properties/Settings.Designer.cs create mode 100644 UI/Win32/Common/Properties/Settings.settings diff --git a/UI/Win32/CloudSyncHelper_win32/CloudSyncHelper_win32.csproj b/UI/Win32/CloudSyncHelper_win32/CloudSyncHelper_win32.csproj index d5e7f49..081f382 100644 --- a/UI/Win32/CloudSyncHelper_win32/CloudSyncHelper_win32.csproj +++ b/UI/Win32/CloudSyncHelper_win32/CloudSyncHelper_win32.csproj @@ -432,6 +432,10 @@ {d80ca4dc-a78b-4d74-982b-037de065fe53} IconCrawler.MefExtensions + + {3a491eaf-a2e8-4c51-bed7-bf3fd890731f} + Common + {cc6ad910-f9f2-40b0-90ac-f347c73b5ef7} Localization diff --git a/UI/Win32/CloudSyncHelper_win32/Dictionaries/Resources.xaml b/UI/Win32/CloudSyncHelper_win32/Dictionaries/Resources.xaml index 6fd5635..b2a2f14 100644 --- a/UI/Win32/CloudSyncHelper_win32/Dictionaries/Resources.xaml +++ b/UI/Win32/CloudSyncHelper_win32/Dictionaries/Resources.xaml @@ -4,7 +4,10 @@ xmlns:uiCommon="clr-namespace:XElement.Common.UI.Converter;assembly=XElement.UiCommon" xmlns:localization="clr-namespace:XElement.CloudSyncHelper.UI.Win32.Localization;assembly=XElement.CloudSyncHelper.UI.Win32.Localization"> - + + + + diff --git a/UI/Win32/Common/Common.csproj b/UI/Win32/Common/Common.csproj new file mode 100644 index 0000000..61f72bd --- /dev/null +++ b/UI/Win32/Common/Common.csproj @@ -0,0 +1,92 @@ + + + + + Debug + AnyCPU + {3A491EAF-A2E8-4C51-BED7-BF3FD890731F} + library + Properties + XElement.CloudSyncHelper.UI.Win32.Common + XElement.CloudSyncHelper.UI.Win32.Common + v4.5 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + 4.0 + + + + + + ..\..\..\externals\XElement\XElement.UiCommon.dll + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + ResXFileCodeGenerator + Resources.Designer.cs + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + + Designer + MSBuild:Compile + + + + + \ No newline at end of file diff --git a/UI/Win32/Common/Dictionaries/Resources.xaml b/UI/Win32/Common/Dictionaries/Resources.xaml new file mode 100644 index 0000000..214ab25 --- /dev/null +++ b/UI/Win32/Common/Dictionaries/Resources.xaml @@ -0,0 +1,8 @@ + + + + + \ No newline at end of file diff --git a/UI/Win32/Common/Properties/AssemblyInfo.cs b/UI/Win32/Common/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..a1e54bc --- /dev/null +++ b/UI/Win32/Common/Properties/AssemblyInfo.cs @@ -0,0 +1,53 @@ +using System.Reflection; +using System.Runtime.InteropServices; +using System.Windows; + +// 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( "XElement.CloudSyncHelper.UI.Win32.Common" )] +[assembly: AssemblyDescription( "" )] +[assembly: AssemblyConfiguration( "" )] +[assembly: AssemblyCompany( "" )] +[assembly: AssemblyProduct( "Cloud Sync Helper" )] +[assembly: AssemblyCopyright( "Copyright © XElement Software 2016" )] +[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 )] + +//In order to begin building localizable applications, set +//CultureYouAreCodingWith in your .csproj file +//inside a . For example, if you are using US english +//in your source files, set the to en-US. Then uncomment +//the NeutralResourceLanguage attribute below. Update the "en-US" in +//the line below to match the UICulture setting in the project file. + +//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] + + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] + + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion( "0.0.0.0" )] +[assembly: AssemblyFileVersion( "0.0.0.0" )] diff --git a/UI/Win32/Common/Properties/Resources.Designer.cs b/UI/Win32/Common/Properties/Resources.Designer.cs new file mode 100644 index 0000000..99185f6 --- /dev/null +++ b/UI/Win32/Common/Properties/Resources.Designer.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace XElement.CloudSyncHelper.UI.Win32.Common.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("XElement.CloudSyncHelper.UI.Win32.Common.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/UI/Win32/Common/Properties/Resources.resx b/UI/Win32/Common/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/UI/Win32/Common/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/UI/Win32/Common/Properties/Settings.Designer.cs b/UI/Win32/Common/Properties/Settings.Designer.cs new file mode 100644 index 0000000..ec58f96 --- /dev/null +++ b/UI/Win32/Common/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace XElement.CloudSyncHelper.UI.Win32.Common.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + } +} diff --git a/UI/Win32/Common/Properties/Settings.settings b/UI/Win32/Common/Properties/Settings.settings new file mode 100644 index 0000000..033d7a5 --- /dev/null +++ b/UI/Win32/Common/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Visual Studio/CloudSyncHelper.sln b/Visual Studio/CloudSyncHelper.sln index 119e2a7..3ca29eb 100644 --- a/Visual Studio/CloudSyncHelper.sln +++ b/Visual Studio/CloudSyncHelper.sln @@ -102,6 +102,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UserInformation.Implementat EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UserInformation.MefExtensions", "..\XElement\DotNet\System\Environment\UserInformation.MefExtensions\UserInformation.MefExtensions.csproj", "{ACBFE0B5-E9C3-4DDC-B454-D12AE691802B}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common", "..\UI\Win32\Common\Common.csproj", "{3A491EAF-A2E8-4C51-BED7-BF3FD890731F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -234,6 +236,10 @@ Global {ACBFE0B5-E9C3-4DDC-B454-D12AE691802B}.Debug|Any CPU.Build.0 = Debug|Any CPU {ACBFE0B5-E9C3-4DDC-B454-D12AE691802B}.Release|Any CPU.ActiveCfg = Release|Any CPU {ACBFE0B5-E9C3-4DDC-B454-D12AE691802B}.Release|Any CPU.Build.0 = Release|Any CPU + {3A491EAF-A2E8-4C51-BED7-BF3FD890731F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3A491EAF-A2E8-4C51-BED7-BF3FD890731F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3A491EAF-A2E8-4C51-BED7-BF3FD890731F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3A491EAF-A2E8-4C51-BED7-BF3FD890731F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -276,5 +282,6 @@ Global {59CB5B77-DD0D-4665-BEB9-22E999BC2E2B} = {E8981F23-1883-4E05-BF46-0A5AF7C882E2} {9E94C2D1-BE62-45E6-8A12-0B04D3A991DB} = {E8981F23-1883-4E05-BF46-0A5AF7C882E2} {ACBFE0B5-E9C3-4DDC-B454-D12AE691802B} = {E8981F23-1883-4E05-BF46-0A5AF7C882E2} + {3A491EAF-A2E8-4C51-BED7-BF3FD890731F} = {98CCC88A-8E07-4471-9ED1-44FA11C0833D} EndGlobalSection EndGlobal From 52680896680d4c820f964fbefc65b07a6fda1fae Mon Sep 17 00:00:00 2001 From: IanStorm Date: Tue, 12 Jul 2016 10:58:13 +0200 Subject: [PATCH 06/69] * initial commit of proxy application (used for admin privileges) --- UI/Win32/LinkCreatorProxy/App.config | 6 ++ .../LinkCreatorProxy/LinkCreatorProxy.csproj | 65 +++++++++++++++++ UI/Win32/LinkCreatorProxy/Program.cs | 9 +++ .../Properties/AssemblyInfo.cs | 35 +++++++++ UI/Win32/LinkCreatorProxy/exe.manifest | 71 +++++++++++++++++++ Visual Studio/CloudSyncHelper.sln | 9 ++- 6 files changed, 194 insertions(+), 1 deletion(-) create mode 100644 UI/Win32/LinkCreatorProxy/App.config create mode 100644 UI/Win32/LinkCreatorProxy/LinkCreatorProxy.csproj create mode 100644 UI/Win32/LinkCreatorProxy/Program.cs create mode 100644 UI/Win32/LinkCreatorProxy/Properties/AssemblyInfo.cs create mode 100644 UI/Win32/LinkCreatorProxy/exe.manifest diff --git a/UI/Win32/LinkCreatorProxy/App.config b/UI/Win32/LinkCreatorProxy/App.config new file mode 100644 index 0000000..d1428ad --- /dev/null +++ b/UI/Win32/LinkCreatorProxy/App.config @@ -0,0 +1,6 @@ + + + + + + diff --git a/UI/Win32/LinkCreatorProxy/LinkCreatorProxy.csproj b/UI/Win32/LinkCreatorProxy/LinkCreatorProxy.csproj new file mode 100644 index 0000000..0e7195b --- /dev/null +++ b/UI/Win32/LinkCreatorProxy/LinkCreatorProxy.csproj @@ -0,0 +1,65 @@ + + + + + Debug + AnyCPU + {2DB5ABC1-4966-4616-BC51-FD088CF3B720} + Exe + Properties + XElement.CloudSyncHelper.UI.Win32 + LinkCreatorProxy + v4.5 + 512 + true + + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + exe.manifest + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/UI/Win32/LinkCreatorProxy/Program.cs b/UI/Win32/LinkCreatorProxy/Program.cs new file mode 100644 index 0000000..3f57d87 --- /dev/null +++ b/UI/Win32/LinkCreatorProxy/Program.cs @@ -0,0 +1,9 @@ +namespace XElement.CloudSyncHelper.UI.Win32 +{ + class Program + { + static void Main( string[] args ) + { + } + } +} diff --git a/UI/Win32/LinkCreatorProxy/Properties/AssemblyInfo.cs b/UI/Win32/LinkCreatorProxy/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..e3c9b46 --- /dev/null +++ b/UI/Win32/LinkCreatorProxy/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +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( "LinkCreatorProxy" )] +[assembly: AssemblyDescription( "A proxy for Cloud Sync Helper for doing operations that require elevated trust." )] +[assembly: AssemblyConfiguration( "" )] +[assembly: AssemblyCompany( "" )] +[assembly: AssemblyProduct( "Cloud Sync Helper" )] +[assembly: AssemblyCopyright( "Copyright © XElement Software 2016" )] +[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( "2db5abc1-4966-4616-bc51-fd088cf3b720" )] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion( "0.0.0.0" )] +[assembly: AssemblyFileVersion( "0.0.0.0" )] diff --git a/UI/Win32/LinkCreatorProxy/exe.manifest b/UI/Win32/LinkCreatorProxy/exe.manifest new file mode 100644 index 0000000..f518658 --- /dev/null +++ b/UI/Win32/LinkCreatorProxy/exe.manifest @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Visual Studio/CloudSyncHelper.sln b/Visual Studio/CloudSyncHelper.sln index 3ca29eb..bb07d40 100644 --- a/Visual Studio/CloudSyncHelper.sln +++ b/Visual Studio/CloudSyncHelper.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 -VisualStudioVersion = 14.0.25123.0 +VisualStudioVersion = 14.0.23107.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CloudSyncHelper_win32", "..\UI\Win32\CloudSyncHelper_win32\CloudSyncHelper_win32.csproj", "{8F9F2D42-0BD7-4760-A64A-630C14014FC9}" EndProject @@ -104,6 +104,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UserInformation.MefExtensio EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common", "..\UI\Win32\Common\Common.csproj", "{3A491EAF-A2E8-4C51-BED7-BF3FD890731F}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LinkCreatorProxy", "..\UI\Win32\LinkCreatorProxy\LinkCreatorProxy.csproj", "{2DB5ABC1-4966-4616-BC51-FD088CF3B720}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -240,6 +242,10 @@ Global {3A491EAF-A2E8-4C51-BED7-BF3FD890731F}.Debug|Any CPU.Build.0 = Debug|Any CPU {3A491EAF-A2E8-4C51-BED7-BF3FD890731F}.Release|Any CPU.ActiveCfg = Release|Any CPU {3A491EAF-A2E8-4C51-BED7-BF3FD890731F}.Release|Any CPU.Build.0 = Release|Any CPU + {2DB5ABC1-4966-4616-BC51-FD088CF3B720}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2DB5ABC1-4966-4616-BC51-FD088CF3B720}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2DB5ABC1-4966-4616-BC51-FD088CF3B720}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2DB5ABC1-4966-4616-BC51-FD088CF3B720}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -283,5 +289,6 @@ Global {9E94C2D1-BE62-45E6-8A12-0B04D3A991DB} = {E8981F23-1883-4E05-BF46-0A5AF7C882E2} {ACBFE0B5-E9C3-4DDC-B454-D12AE691802B} = {E8981F23-1883-4E05-BF46-0A5AF7C882E2} {3A491EAF-A2E8-4C51-BED7-BF3FD890731F} = {98CCC88A-8E07-4471-9ED1-44FA11C0833D} + {2DB5ABC1-4966-4616-BC51-FD088CF3B720} = {98CCC88A-8E07-4471-9ED1-44FA11C0833D} EndGlobalSection EndGlobal From 7238ac2e7979f42323dc6cc29d1e7889d69da124 Mon Sep 17 00:00:00 2001 From: IanStorm Date: Wed, 13 Jul 2016 09:13:29 +0200 Subject: [PATCH 07/69] * initial commit of UserProfileUC module --- UI/Win32/Modules/UserProfileUC/Colors.xaml | 12 +++ UI/Win32/Modules/UserProfileUC/Images.xaml | 9 ++ UI/Win32/Modules/UserProfileUC/Model.cs | 21 ++++ .../UserProfileUC/ModelParametersDTO.cs | 20 ++++ .../UserProfileUC/Properties/AssemblyInfo.cs | 53 ++++++++++ UI/Win32/Modules/UserProfileUC/Styles.xaml | 46 ++++++++ .../User-Profile_d48-p8_000000.png | Bin 0 -> 9344 bytes .../UserProfileUC/UserProfileUC.csproj | 98 ++++++++++++++++++ UI/Win32/Modules/UserProfileUC/View.xaml | 34 ++++++ UI/Win32/Modules/UserProfileUC/View.xaml.cs | 19 ++++ UI/Win32/Modules/UserProfileUC/ViewModel.cs | 25 +++++ 11 files changed, 337 insertions(+) create mode 100644 UI/Win32/Modules/UserProfileUC/Colors.xaml create mode 100644 UI/Win32/Modules/UserProfileUC/Images.xaml create mode 100644 UI/Win32/Modules/UserProfileUC/Model.cs create mode 100644 UI/Win32/Modules/UserProfileUC/ModelParametersDTO.cs create mode 100644 UI/Win32/Modules/UserProfileUC/Properties/AssemblyInfo.cs create mode 100644 UI/Win32/Modules/UserProfileUC/Styles.xaml create mode 100644 UI/Win32/Modules/UserProfileUC/User-Profile_d48-p8_000000.png create mode 100644 UI/Win32/Modules/UserProfileUC/UserProfileUC.csproj create mode 100644 UI/Win32/Modules/UserProfileUC/View.xaml create mode 100644 UI/Win32/Modules/UserProfileUC/View.xaml.cs create mode 100644 UI/Win32/Modules/UserProfileUC/ViewModel.cs diff --git a/UI/Win32/Modules/UserProfileUC/Colors.xaml b/UI/Win32/Modules/UserProfileUC/Colors.xaml new file mode 100644 index 0000000..f7cd111 --- /dev/null +++ b/UI/Win32/Modules/UserProfileUC/Colors.xaml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/UI/Win32/Modules/UserProfileUC/Images.xaml b/UI/Win32/Modules/UserProfileUC/Images.xaml new file mode 100644 index 0000000..bfb53e5 --- /dev/null +++ b/UI/Win32/Modules/UserProfileUC/Images.xaml @@ -0,0 +1,9 @@ + + + + + + \ No newline at end of file diff --git a/UI/Win32/Modules/UserProfileUC/Model.cs b/UI/Win32/Modules/UserProfileUC/Model.cs new file mode 100644 index 0000000..155cb83 --- /dev/null +++ b/UI/Win32/Modules/UserProfileUC/Model.cs @@ -0,0 +1,21 @@ +using System.Drawing; + +namespace XElement.CloudSyncHelper.UI.Win32.Modules.UserProfile +{ +#region not unit-tested + public class Model + { + public Model( ModelParametersDTO parameters ) + { + this.FullName = parameters.FullName; + this.ProfilePicture = parameters.ProfilePicture; + } + + + public string FullName { get; private set; } + + + public Image ProfilePicture { get; private set; } + } +#endregion +} diff --git a/UI/Win32/Modules/UserProfileUC/ModelParametersDTO.cs b/UI/Win32/Modules/UserProfileUC/ModelParametersDTO.cs new file mode 100644 index 0000000..6f8300b --- /dev/null +++ b/UI/Win32/Modules/UserProfileUC/ModelParametersDTO.cs @@ -0,0 +1,20 @@ +using System.Drawing; + +namespace XElement.CloudSyncHelper.UI.Win32.Modules.UserProfile +{ +#region not unit-tested + public class ModelParametersDTO + { + public string FullName { get; set; } + + + public string Prename { get; set; } + + + public Image ProfilePicture { get; set; } + + + public string Surname { get; set; } + } +#endregion +} diff --git a/UI/Win32/Modules/UserProfileUC/Properties/AssemblyInfo.cs b/UI/Win32/Modules/UserProfileUC/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..fee3fcc --- /dev/null +++ b/UI/Win32/Modules/UserProfileUC/Properties/AssemblyInfo.cs @@ -0,0 +1,53 @@ +using System.Reflection; +using System.Runtime.InteropServices; +using System.Windows; + +// 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( "XElement.CloudSyncHelper.UI.Win32.Modules.UserProfileUC" )] +[assembly: AssemblyDescription( "" )] +[assembly: AssemblyConfiguration( "" )] +[assembly: AssemblyCompany( "" )] +[assembly: AssemblyProduct( "Cloud Sync Helper" )] +[assembly: AssemblyCopyright( "Copyright © XElement Software 2016" )] +[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 )] + +//In order to begin building localizable applications, set +//CultureYouAreCodingWith in your .csproj file +//inside a . For example, if you are using US english +//in your source files, set the to en-US. Then uncomment +//the NeutralResourceLanguage attribute below. Update the "en-US" in +//the line below to match the UICulture setting in the project file. + +//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] + + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] + + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion( "0.0.0.0" )] +[assembly: AssemblyFileVersion( "0.0.0.0" )] diff --git a/UI/Win32/Modules/UserProfileUC/Styles.xaml b/UI/Win32/Modules/UserProfileUC/Styles.xaml new file mode 100644 index 0000000..ccf8521 --- /dev/null +++ b/UI/Win32/Modules/UserProfileUC/Styles.xaml @@ -0,0 +1,46 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/UI/Win32/Modules/UserProfileUC/User-Profile_d48-p8_000000.png b/UI/Win32/Modules/UserProfileUC/User-Profile_d48-p8_000000.png new file mode 100644 index 0000000000000000000000000000000000000000..15b6fee72b2782a186cfc92bdb6bc6e6b64d9f99 GIT binary patch literal 9344 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA1|-9oezr3(C@^@sIEG}fG8(9yzYP=}1*0J_ z8UmvsFd71*AwazlP*qh`;p5|LxIgS`PU|n&1z&rpf zI%g8&NPKF5X6zp@4*)B!DtwM3Mh;jKfnsrB0I)K$0@{qV)+JV4NJuDVU|bKhH8V4l z30R3;Cf2d&>VQS?TXS=Bz5(+9$YKcz2`^9^2ia6GajBqb%CfECkmTuBO;U#^OZ ziiRQU8I){b^I8iSBWXa~Ehs413ru1;3JMA)Nl8hABgue5&Bn%tM?^#<2-KXAmXp`-zvNphcVF7Hl z`T#v$29(1zP=FEd;rX7Sun%tMFW#zKh-<{41Lf<0$oBMW)HBC_-t!y z%R{jzfL&HSn4$EhK?MQD9snkvBzij>W*;ya0cVsb1j53?H82C|O#?kJpF-y|FaVna zWRLq$>S18LG3tTQ7@#B>Q6&jcoQXyaplb;9gu4S9)GXGZwE%Rrc+|4d5Eu=C;Sd7e VE@hQJ<~oD>5uUDoF6*2Ung9l`h|d53 literal 0 HcmV?d00001 diff --git a/UI/Win32/Modules/UserProfileUC/UserProfileUC.csproj b/UI/Win32/Modules/UserProfileUC/UserProfileUC.csproj new file mode 100644 index 0000000..1b15a1e --- /dev/null +++ b/UI/Win32/Modules/UserProfileUC/UserProfileUC.csproj @@ -0,0 +1,98 @@ + + + + + Debug + AnyCPU + {7DDBF51A-80F3-4870-8C04-5884761118E2} + library + Properties + XElement.CloudSyncHelper.UI.Win32.Modules.UserProfile + XElement.CloudSyncHelper.UI.Win32.Modules.UserProfileUC + v4.5 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + 4.0 + + + + + + + + + + Code + + + View.xaml + + + + + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + + + + + + {3a491eaf-a2e8-4c51-bed7-bf3fd890731f} + Common + + + + + \ No newline at end of file diff --git a/UI/Win32/Modules/UserProfileUC/View.xaml b/UI/Win32/Modules/UserProfileUC/View.xaml new file mode 100644 index 0000000..f3e78ed --- /dev/null +++ b/UI/Win32/Modules/UserProfileUC/View.xaml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/UI/Win32/Modules/UserProfileUC/View.xaml.cs b/UI/Win32/Modules/UserProfileUC/View.xaml.cs new file mode 100644 index 0000000..498f486 --- /dev/null +++ b/UI/Win32/Modules/UserProfileUC/View.xaml.cs @@ -0,0 +1,19 @@ +using System.Windows.Controls; +using System.Windows.Markup; + +#region not unit-tested +// --> https://social.msdn.microsoft.com/Forums/vstudio/en-US/6b1023c3-30d3-44db-9cac-b5a0b29f204f/multiple-assembies-under-one-namespace?forum=wpf +// Last visited: 2016-06-13 +[assembly: XmlnsDefinition( "https://github.com/XElementSoftware/CloudSyncHelper/tree/master/UI/Win32/Modules", + "XElement.CloudSyncHelper.UI.Win32.Modules" )] +namespace XElement.CloudSyncHelper.UI.Win32.Modules +{ + public partial class UserProfileUC : UserControl + { + public UserProfileUC() + { + InitializeComponent(); + } + } +} +#endregion diff --git a/UI/Win32/Modules/UserProfileUC/ViewModel.cs b/UI/Win32/Modules/UserProfileUC/ViewModel.cs new file mode 100644 index 0000000..1a0c947 --- /dev/null +++ b/UI/Win32/Modules/UserProfileUC/ViewModel.cs @@ -0,0 +1,25 @@ +namespace XElement.CloudSyncHelper.UI.Win32.Modules.UserProfile +{ +#region not unit-tested + public class ViewModel + { + public ViewModel( Model model ) + { + this.Model = model; + this.Initialize( model ); + } + + + private void Initialize( Model model ) + { + this.ShowDefaultProfilePicture = model.ProfilePicture == null; + } + + + public Model Model { get; private set; } + + + public bool ShowDefaultProfilePicture { get; private set; } + } +#endregion +} From 66b4a381e250cc12a146d61f36b17f1c73af128f Mon Sep 17 00:00:00 2001 From: IanStorm Date: Sat, 16 Jul 2016 13:17:07 +0200 Subject: [PATCH 08/69] * basic styling for UserProfileUC's toggle button --- .../Dictionaries/Colors.xaml | 25 +++++++++++--- UI/Win32/Common/Common.csproj | 4 +++ UI/Win32/Common/Dictionaries/Colors.xaml | 8 +++++ UI/Win32/Modules/UserProfileUC/Colors.xaml | 9 +++++ UI/Win32/Modules/UserProfileUC/Styles.xaml | 15 +++++---- UI/Win32/Modules/UserProfileUC/View.xaml | 11 ++++--- UI/Win32/Modules/UserProfileUC/View.xaml.cs | 33 ++++++++++++++++++- 7 files changed, 90 insertions(+), 15 deletions(-) create mode 100644 UI/Win32/Common/Dictionaries/Colors.xaml diff --git a/UI/Win32/CloudSyncHelper_win32/Dictionaries/Colors.xaml b/UI/Win32/CloudSyncHelper_win32/Dictionaries/Colors.xaml index e00c3d6..8650b03 100644 --- a/UI/Win32/CloudSyncHelper_win32/Dictionaries/Colors.xaml +++ b/UI/Win32/CloudSyncHelper_win32/Dictionaries/Colors.xaml @@ -1,9 +1,26 @@  - - - - + + + + + + + + + + + + \ No newline at end of file diff --git a/UI/Win32/Common/Common.csproj b/UI/Win32/Common/Common.csproj index 61f72bd..7a418cb 100644 --- a/UI/Win32/Common/Common.csproj +++ b/UI/Win32/Common/Common.csproj @@ -76,6 +76,10 @@ + + Designer + MSBuild:Compile + Designer MSBuild:Compile diff --git a/UI/Win32/Common/Dictionaries/Colors.xaml b/UI/Win32/Common/Dictionaries/Colors.xaml new file mode 100644 index 0000000..9096d11 --- /dev/null +++ b/UI/Win32/Common/Dictionaries/Colors.xaml @@ -0,0 +1,8 @@ + + + + + \ No newline at end of file diff --git a/UI/Win32/Modules/UserProfileUC/Colors.xaml b/UI/Win32/Modules/UserProfileUC/Colors.xaml index f7cd111..80ce93e 100644 --- a/UI/Win32/Modules/UserProfileUC/Colors.xaml +++ b/UI/Win32/Modules/UserProfileUC/Colors.xaml @@ -1,6 +1,10 @@  + + + + @@ -10,29 +9,32 @@ \ No newline at end of file diff --git a/UI/Win32/Modules/UserProfileUC/View.xaml b/UI/Win32/Modules/UserProfileUC/View.xaml index f3e78ed..b4d1692 100644 --- a/UI/Win32/Modules/UserProfileUC/View.xaml +++ b/UI/Win32/Modules/UserProfileUC/View.xaml @@ -16,10 +16,13 @@ - - - + + Date: Sat, 16 Jul 2016 13:17:46 +0200 Subject: [PATCH 09/69] * UserProfileUC project was missing in solution --- Visual Studio/CloudSyncHelper.sln | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Visual Studio/CloudSyncHelper.sln b/Visual Studio/CloudSyncHelper.sln index 3ca29eb..a19aea5 100644 --- a/Visual Studio/CloudSyncHelper.sln +++ b/Visual Studio/CloudSyncHelper.sln @@ -92,6 +92,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Logic.MefExtensions", "..\L EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test_Logic.Implementation", "..\Logic\Test_Logic.Implementation\Test_Logic.Implementation.csproj", "{062DAB41-F255-44B7-91A8-B987781FF17A}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Modules", "Modules", "{EC6ED90B-75A3-4E49-A6F9-37E52E34F809}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UserProfileUC", "..\UI\Win32\Modules\UserProfileUC\UserProfileUC.csproj", "{7DDBF51A-80F3-4870-8C04-5884761118E2}" +EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Environment", "Environment", "{A58CEB5D-3ADA-4F02-8446-A2F6147E822B}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "UserInformation", "UserInformation", "{E8981F23-1883-4E05-BF46-0A5AF7C882E2}" @@ -224,6 +228,10 @@ Global {062DAB41-F255-44B7-91A8-B987781FF17A}.Debug|Any CPU.Build.0 = Debug|Any CPU {062DAB41-F255-44B7-91A8-B987781FF17A}.Release|Any CPU.ActiveCfg = Release|Any CPU {062DAB41-F255-44B7-91A8-B987781FF17A}.Release|Any CPU.Build.0 = Release|Any CPU + {7DDBF51A-80F3-4870-8C04-5884761118E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7DDBF51A-80F3-4870-8C04-5884761118E2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7DDBF51A-80F3-4870-8C04-5884761118E2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7DDBF51A-80F3-4870-8C04-5884761118E2}.Release|Any CPU.Build.0 = Release|Any CPU {59CB5B77-DD0D-4665-BEB9-22E999BC2E2B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {59CB5B77-DD0D-4665-BEB9-22E999BC2E2B}.Debug|Any CPU.Build.0 = Debug|Any CPU {59CB5B77-DD0D-4665-BEB9-22E999BC2E2B}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -278,6 +286,8 @@ Global {411FC166-4D90-4915-AFFD-6C4C1ECF1396} = {79ED10F5-B256-47E0-8C11-2AF152A6CDCD} {0F5BA595-1293-4429-AD68-47A5E1413778} = {79ED10F5-B256-47E0-8C11-2AF152A6CDCD} {062DAB41-F255-44B7-91A8-B987781FF17A} = {79ED10F5-B256-47E0-8C11-2AF152A6CDCD} + {EC6ED90B-75A3-4E49-A6F9-37E52E34F809} = {98CCC88A-8E07-4471-9ED1-44FA11C0833D} + {7DDBF51A-80F3-4870-8C04-5884761118E2} = {EC6ED90B-75A3-4E49-A6F9-37E52E34F809} {E8981F23-1883-4E05-BF46-0A5AF7C882E2} = {A58CEB5D-3ADA-4F02-8446-A2F6147E822B} {59CB5B77-DD0D-4665-BEB9-22E999BC2E2B} = {E8981F23-1883-4E05-BF46-0A5AF7C882E2} {9E94C2D1-BE62-45E6-8A12-0B04D3A991DB} = {E8981F23-1883-4E05-BF46-0A5AF7C882E2} From 15115624146970e5a523ab9affaaeb091ca031e5 Mon Sep 17 00:00:00 2001 From: IanStorm Date: Sun, 17 Jul 2016 18:54:33 +0200 Subject: [PATCH 10/69] * fixed default namespace of UserInformation.Implementation project --- .../UserInformation.Implementation.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/XElement/DotNet/System/Environment/UserInformation.Implementation/UserInformation.Implementation.csproj b/XElement/DotNet/System/Environment/UserInformation.Implementation/UserInformation.Implementation.csproj index 000756c..9a89119 100644 --- a/XElement/DotNet/System/Environment/UserInformation.Implementation/UserInformation.Implementation.csproj +++ b/XElement/DotNet/System/Environment/UserInformation.Implementation/UserInformation.Implementation.csproj @@ -7,7 +7,7 @@ {9E94C2D1-BE62-45E6-8A12-0B04D3A991DB} Library Properties - XElement.DotNet.System.Environment.UserInformation.Interface + XElement.DotNet.System.Environment.UserInformation XElement.DotNet.System.Environment.UserInformation.Implementation v4.5 512 From 676d5d98fb57bc81aeba1801e4e094ad957c593b Mon Sep 17 00:00:00 2001 From: IanStorm Date: Mon, 18 Jul 2016 19:13:32 +0200 Subject: [PATCH 11/69] * implemented logic to determine the current user's role --- .../UserInformation.Implementation.csproj | 1 + .../UserInformation.cs | 5 ++- .../WindowsPrincipalRetriever.cs | 41 +++++++++++++++++++ .../IUserInformation.cs | 3 ++ .../UserInformation.Interface/RoleEnum.cs | 8 ++++ .../UserInformation.Interface.csproj | 1 + 6 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 XElement/DotNet/System/Environment/UserInformation.Implementation/WindowsPrincipalRetriever.cs create mode 100644 XElement/DotNet/System/Environment/UserInformation.Interface/RoleEnum.cs diff --git a/XElement/DotNet/System/Environment/UserInformation.Implementation/UserInformation.Implementation.csproj b/XElement/DotNet/System/Environment/UserInformation.Implementation/UserInformation.Implementation.csproj index 9a89119..4405aab 100644 --- a/XElement/DotNet/System/Environment/UserInformation.Implementation/UserInformation.Implementation.csproj +++ b/XElement/DotNet/System/Environment/UserInformation.Implementation/UserInformation.Implementation.csproj @@ -49,6 +49,7 @@ + diff --git a/XElement/DotNet/System/Environment/UserInformation.Implementation/UserInformation.cs b/XElement/DotNet/System/Environment/UserInformation.Implementation/UserInformation.cs index fd2a819..f92e22f 100644 --- a/XElement/DotNet/System/Environment/UserInformation.Implementation/UserInformation.cs +++ b/XElement/DotNet/System/Environment/UserInformation.Implementation/UserInformation.cs @@ -1,7 +1,7 @@ namespace XElement.DotNet.System.Environment.UserInformation { #region not unit-tested - internal class UserInformation : IUserInformationInt + public class UserInformation : IUserInformationInt { public string Domain { get; set; } @@ -9,6 +9,9 @@ internal class UserInformation : IUserInformationInt public string FullName { get; set; } + public Role? Role { get; set; } + + public string TechnicalName { get; set; } } #endregion diff --git a/XElement/DotNet/System/Environment/UserInformation.Implementation/WindowsPrincipalRetriever.cs b/XElement/DotNet/System/Environment/UserInformation.Implementation/WindowsPrincipalRetriever.cs new file mode 100644 index 0000000..4575d1a --- /dev/null +++ b/XElement/DotNet/System/Environment/UserInformation.Implementation/WindowsPrincipalRetriever.cs @@ -0,0 +1,41 @@ +using System.Security.Principal; + +namespace XElement.DotNet.System.Environment.UserInformation +{ +#region not unit-tested + public class WindowsPrincipalRetriever : IUserInformationService + { + public IUserInformation CurrentUser + { + get + { + var role = WindowsPrincipalRetriever.Role; + var userInfo = new UserInformation + { + Role = role + }; + return userInfo; + } + } + + + // --> https://stackoverflow.com/questions/3600322/check-if-the-current-user-is-administrator + // Last visited: 2016-07-17 + private static Role Role + { + get + { + Role result = Role.User; + + WindowsIdentity identity = WindowsIdentity.GetCurrent(); + WindowsPrincipal principal = new WindowsPrincipal( identity ); + var isAdmin = principal.IsInRole( WindowsBuiltInRole.Administrator ); + if ( isAdmin ) + result = Role.Administrator; + + return result; + } + } + } +#endregion +} diff --git a/XElement/DotNet/System/Environment/UserInformation.Interface/IUserInformation.cs b/XElement/DotNet/System/Environment/UserInformation.Interface/IUserInformation.cs index 6943e2b..6ffaa76 100644 --- a/XElement/DotNet/System/Environment/UserInformation.Interface/IUserInformation.cs +++ b/XElement/DotNet/System/Environment/UserInformation.Interface/IUserInformation.cs @@ -3,5 +3,8 @@ public interface IUserInformation { string FullName { get; } + + + Role? Role { get; } } } diff --git a/XElement/DotNet/System/Environment/UserInformation.Interface/RoleEnum.cs b/XElement/DotNet/System/Environment/UserInformation.Interface/RoleEnum.cs new file mode 100644 index 0000000..d7a1f64 --- /dev/null +++ b/XElement/DotNet/System/Environment/UserInformation.Interface/RoleEnum.cs @@ -0,0 +1,8 @@ +namespace XElement.DotNet.System.Environment.UserInformation +{ + public enum Role + { + Administrator, + User + } +} diff --git a/XElement/DotNet/System/Environment/UserInformation.Interface/UserInformation.Interface.csproj b/XElement/DotNet/System/Environment/UserInformation.Interface/UserInformation.Interface.csproj index e22719b..d903338 100644 --- a/XElement/DotNet/System/Environment/UserInformation.Interface/UserInformation.Interface.csproj +++ b/XElement/DotNet/System/Environment/UserInformation.Interface/UserInformation.Interface.csproj @@ -44,6 +44,7 @@ + http://www.dotnetspark.com/links/14003-systemdirectoryservicesaccountmanagement.aspx - var domainName = global::System.Environment.UserDomainName; - var userName = global::System.Environment.UserName; - var context = new PrincipalContext( ContextType.Domain, domainName, userName ); - UserPrincipal user = new UserPrincipal( context ); - user = UserPrincipal.FindByIdentity( context, userName ); - return user; - } - } -#endregion -} diff --git a/XElement/DotNet/System/Environment/UserInformation.Implementation/UserInformation.Implementation.csproj b/XElement/DotNet/System/Environment/UserInformation.Implementation/UserInformation.Implementation.csproj index 4405aab..f993dea 100644 --- a/XElement/DotNet/System/Environment/UserInformation.Implementation/UserInformation.Implementation.csproj +++ b/XElement/DotNet/System/Environment/UserInformation.Implementation/UserInformation.Implementation.csproj @@ -45,7 +45,6 @@ - diff --git a/XElement/DotNet/System/Environment/UserInformation.MefExtensions/PrincipalContextRetriever.cs b/XElement/DotNet/System/Environment/UserInformation.MefExtensions/PrincipalContextRetriever.cs deleted file mode 100644 index a5c15d7..0000000 --- a/XElement/DotNet/System/Environment/UserInformation.MefExtensions/PrincipalContextRetriever.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace XElement.DotNet.System.Environment.UserInformation.MefExtensions -{ -#region not unit-tested - //[Export( typeof( IUserInformationService ) )] - internal class PrincipalContextRetriever : - global::XElement.DotNet.System.Environment.UserInformation.PrincipalContextRetriever { } -#endregion -} diff --git a/XElement/DotNet/System/Environment/UserInformation.MefExtensions/UserInformation.MefExtensions.csproj b/XElement/DotNet/System/Environment/UserInformation.MefExtensions/UserInformation.MefExtensions.csproj index 47b278b..529272c 100644 --- a/XElement/DotNet/System/Environment/UserInformation.MefExtensions/UserInformation.MefExtensions.csproj +++ b/XElement/DotNet/System/Environment/UserInformation.MefExtensions/UserInformation.MefExtensions.csproj @@ -42,7 +42,6 @@ - From 83d2a6304eeedd2149154b522e7604c302d3d974 Mon Sep 17 00:00:00 2001 From: IanStorm Date: Tue, 19 Jul 2016 11:14:11 +0200 Subject: [PATCH 13/69] * implemented MergeAllRetriever in MEF project to combine the results of the various retrievers --- .../DirectoryEntryRetriever.cs | 2 +- .../IUserInformationServiceInt.cs | 4 + .../MergeAllRetriever.cs | 80 +++++++++++++++++++ .../SysEnvironmentRetriever.cs | 6 +- .../UserInformation.MefExtensions.csproj | 3 + .../WindowsPrincipalRetriever.cs | 10 +++ 6 files changed, 102 insertions(+), 3 deletions(-) create mode 100644 XElement/DotNet/System/Environment/UserInformation.MefExtensions/IUserInformationServiceInt.cs create mode 100644 XElement/DotNet/System/Environment/UserInformation.MefExtensions/MergeAllRetriever.cs create mode 100644 XElement/DotNet/System/Environment/UserInformation.MefExtensions/WindowsPrincipalRetriever.cs diff --git a/XElement/DotNet/System/Environment/UserInformation.MefExtensions/DirectoryEntryRetriever.cs b/XElement/DotNet/System/Environment/UserInformation.MefExtensions/DirectoryEntryRetriever.cs index d904d15..4ae9c96 100644 --- a/XElement/DotNet/System/Environment/UserInformation.MefExtensions/DirectoryEntryRetriever.cs +++ b/XElement/DotNet/System/Environment/UserInformation.MefExtensions/DirectoryEntryRetriever.cs @@ -3,7 +3,7 @@ namespace XElement.DotNet.System.Environment.UserInformation.MefExtensions { #region not unit-tested - [Export( typeof( IUserInformationService ) )] + [Export( typeof( IUserInformationServiceInt ) )] internal class DirectoryEntryRetriever : global::XElement.DotNet.System.Environment.UserInformation.DirectoryEntryRetriever { } #endregion diff --git a/XElement/DotNet/System/Environment/UserInformation.MefExtensions/IUserInformationServiceInt.cs b/XElement/DotNet/System/Environment/UserInformation.MefExtensions/IUserInformationServiceInt.cs new file mode 100644 index 0000000..b827ee1 --- /dev/null +++ b/XElement/DotNet/System/Environment/UserInformation.MefExtensions/IUserInformationServiceInt.cs @@ -0,0 +1,4 @@ +namespace XElement.DotNet.System.Environment.UserInformation.MefExtensions +{ + internal interface IUserInformationServiceInt : IUserInformationService { } +} diff --git a/XElement/DotNet/System/Environment/UserInformation.MefExtensions/MergeAllRetriever.cs b/XElement/DotNet/System/Environment/UserInformation.MefExtensions/MergeAllRetriever.cs new file mode 100644 index 0000000..e8fdc31 --- /dev/null +++ b/XElement/DotNet/System/Environment/UserInformation.MefExtensions/MergeAllRetriever.cs @@ -0,0 +1,80 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.Composition; +using System.Linq; + +namespace XElement.DotNet.System.Environment.UserInformation.MefExtensions +{ +#region not unit-tested + [Export( typeof( IUserInformationService ) )] + internal class MergeAllRetriever : IUserInformationService, IPartImportsSatisfiedNotification + { + public IUserInformation CurrentUser + { + get + { + var merged = new UserInformation(); + + var userInfos = this.UserInformations; + foreach ( var userInfo in userInfos ) + { + if ( merged.FullName == null | merged.FullName == String.Empty ) + merged.FullName = userInfo.FullName; + if ( merged.Role == null ) + merged.Role = userInfo.Role; + } + + return merged; + } + } + + + void IPartImportsSatisfiedNotification.OnImportsSatisfied() + { + var comparer = new ReliabilityComparer(); + var orderedSvcs = this._userInfoServices.OrderBy( svc => svc, comparer ).ToList(); + this._orderedUserInfoServices = orderedSvcs; + } + + + private IEnumerable UserInformations + { + get + { + var userInfos = this._orderedUserInfoServices.Select( svc => svc.CurrentUser ) + .ToList(); + return userInfos; + } + } + + + private IEnumerable _orderedUserInfoServices; + + + [ImportMany( typeof( IUserInformationServiceInt ) )] + private IEnumerable _userInfoServices = null; + } + + + internal class ReliabilityComparer : IComparer + { + public int Compare( IUserInformationService x, IUserInformationService y ) + { + var indexOfX = _reliabilityOrder.IndexOf( x.GetType() ); + var indexOfY = _reliabilityOrder.IndexOf( y.GetType() ); + return indexOfX.CompareTo( indexOfY ); + } + + + // + // Summary: + // In order of ascending reliability, i.e. most reliable comes last. (Such that information of less reliable retrievers can simply be overwritten.) + private static IList _reliabilityOrder = new List + { + typeof( SysEnvironmentRetriever ), + typeof( WindowsPrincipalRetriever ), + typeof( DirectoryEntryRetriever ) + }; + } + #endregion +} diff --git a/XElement/DotNet/System/Environment/UserInformation.MefExtensions/SysEnvironmentRetriever.cs b/XElement/DotNet/System/Environment/UserInformation.MefExtensions/SysEnvironmentRetriever.cs index b84eb9c..9669f12 100644 --- a/XElement/DotNet/System/Environment/UserInformation.MefExtensions/SysEnvironmentRetriever.cs +++ b/XElement/DotNet/System/Environment/UserInformation.MefExtensions/SysEnvironmentRetriever.cs @@ -1,7 +1,9 @@ -namespace XElement.DotNet.System.Environment.UserInformation.MefExtensions +using System.ComponentModel.Composition; + +namespace XElement.DotNet.System.Environment.UserInformation.MefExtensions { #region not unit-tested - //[Export( typeof( IUserInformationService ) )] + [Export( typeof( IUserInformationServiceInt ) )] internal class SysEnvironmentRetriever : global::XElement.DotNet.System.Environment.UserInformation.SysEnvironmentRetriever { } #endregion diff --git a/XElement/DotNet/System/Environment/UserInformation.MefExtensions/UserInformation.MefExtensions.csproj b/XElement/DotNet/System/Environment/UserInformation.MefExtensions/UserInformation.MefExtensions.csproj index 529272c..4b07956 100644 --- a/XElement/DotNet/System/Environment/UserInformation.MefExtensions/UserInformation.MefExtensions.csproj +++ b/XElement/DotNet/System/Environment/UserInformation.MefExtensions/UserInformation.MefExtensions.csproj @@ -41,8 +41,11 @@ + + + diff --git a/XElement/DotNet/System/Environment/UserInformation.MefExtensions/WindowsPrincipalRetriever.cs b/XElement/DotNet/System/Environment/UserInformation.MefExtensions/WindowsPrincipalRetriever.cs new file mode 100644 index 0000000..d064789 --- /dev/null +++ b/XElement/DotNet/System/Environment/UserInformation.MefExtensions/WindowsPrincipalRetriever.cs @@ -0,0 +1,10 @@ +using System.ComponentModel.Composition; + +namespace XElement.DotNet.System.Environment.UserInformation.MefExtensions +{ +#region not unit-tested + [Export( typeof( IUserInformationServiceInt ) )] + internal class WindowsPrincipalRetriever : + global::XElement.DotNet.System.Environment.UserInformation.WindowsPrincipalRetriever { } +#endregion +} From efb5e125180d95bc3992ad2abbba9905970d6994 Mon Sep 17 00:00:00 2001 From: IanStorm Date: Tue, 19 Jul 2016 11:21:32 +0200 Subject: [PATCH 14/69] * fixed documentation of MergeAllRetriever --- .../UserInformation.MefExtensions/MergeAllRetriever.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/XElement/DotNet/System/Environment/UserInformation.MefExtensions/MergeAllRetriever.cs b/XElement/DotNet/System/Environment/UserInformation.MefExtensions/MergeAllRetriever.cs index e8fdc31..935b0ec 100644 --- a/XElement/DotNet/System/Environment/UserInformation.MefExtensions/MergeAllRetriever.cs +++ b/XElement/DotNet/System/Environment/UserInformation.MefExtensions/MergeAllRetriever.cs @@ -66,9 +66,9 @@ public int Compare( IUserInformationService x, IUserInformationService y ) } - // - // Summary: - // In order of ascending reliability, i.e. most reliable comes last. (Such that information of less reliable retrievers can simply be overwritten.) + /// + /// In order of ascending reliability, i.e. most reliable comes last. (Such that information of less reliable retrievers can simply be overwritten.) + /// private static IList _reliabilityOrder = new List { typeof( SysEnvironmentRetriever ), From a2d8ef4892e1db2b5dd5742839efe5b58b5c6bf0 Mon Sep 17 00:00:00 2001 From: IanStorm Date: Tue, 19 Jul 2016 11:30:52 +0200 Subject: [PATCH 15/69] * better alignment of user profile icon in UserProfileUC --- UI/Win32/Modules/UserProfileUC/Styles.xaml | 1 + 1 file changed, 1 insertion(+) diff --git a/UI/Win32/Modules/UserProfileUC/Styles.xaml b/UI/Win32/Modules/UserProfileUC/Styles.xaml index 55d5ca9..c137a09 100644 --- a/UI/Win32/Modules/UserProfileUC/Styles.xaml +++ b/UI/Win32/Modules/UserProfileUC/Styles.xaml @@ -28,6 +28,7 @@ CornerRadius="20"> From 6b81d4fb58e2e3fd98e1edf20a54be8e4d02eda6 Mon Sep 17 00:00:00 2001 From: IanStorm Date: Tue, 19 Jul 2016 11:32:44 +0200 Subject: [PATCH 16/69] * UserProfileUC now shows the user's name and his/her role * no localization yet --- UI/Win32/Modules/UserProfileUC/Model.cs | 6 ++-- .../UserProfileUC/ModelParametersDTO.cs | 4 +++ UI/Win32/Modules/UserProfileUC/Styles.xaml | 21 +++++++++++ .../UserProfileUC/UserProfileUC.csproj | 4 +++ UI/Win32/Modules/UserProfileUC/View.xaml | 36 ++++++++++++++++--- UI/Win32/Modules/UserProfileUC/ViewModel.cs | 10 +++--- 6 files changed, 69 insertions(+), 12 deletions(-) diff --git a/UI/Win32/Modules/UserProfileUC/Model.cs b/UI/Win32/Modules/UserProfileUC/Model.cs index 155cb83..3156500 100644 --- a/UI/Win32/Modules/UserProfileUC/Model.cs +++ b/UI/Win32/Modules/UserProfileUC/Model.cs @@ -1,4 +1,4 @@ -using System.Drawing; +using XElement.DotNet.System.Environment.UserInformation; namespace XElement.CloudSyncHelper.UI.Win32.Modules.UserProfile { @@ -8,14 +8,14 @@ public class Model public Model( ModelParametersDTO parameters ) { this.FullName = parameters.FullName; - this.ProfilePicture = parameters.ProfilePicture; + this.Role = parameters.Role; } public string FullName { get; private set; } - public Image ProfilePicture { get; private set; } + public Role? Role { get; private set; } } #endregion } diff --git a/UI/Win32/Modules/UserProfileUC/ModelParametersDTO.cs b/UI/Win32/Modules/UserProfileUC/ModelParametersDTO.cs index 6f8300b..c8f15a8 100644 --- a/UI/Win32/Modules/UserProfileUC/ModelParametersDTO.cs +++ b/UI/Win32/Modules/UserProfileUC/ModelParametersDTO.cs @@ -1,4 +1,5 @@ using System.Drawing; +using XElement.DotNet.System.Environment.UserInformation; namespace XElement.CloudSyncHelper.UI.Win32.Modules.UserProfile { @@ -14,6 +15,9 @@ public class ModelParametersDTO public Image ProfilePicture { get; set; } + public Role? Role { get; set; } + + public string Surname { get; set; } } #endregion diff --git a/UI/Win32/Modules/UserProfileUC/Styles.xaml b/UI/Win32/Modules/UserProfileUC/Styles.xaml index c137a09..3601216 100644 --- a/UI/Win32/Modules/UserProfileUC/Styles.xaml +++ b/UI/Win32/Modules/UserProfileUC/Styles.xaml @@ -7,6 +7,27 @@ + + + + + + + +