├── 2LCS ├── favicon-blue.ico ├── favicon-white.ico ├── Third Party Notices.txt ├── favicon-white - Copy.ico ├── Cache │ ├── EnvironmentCredentials.cs │ ├── CredentialsStore.cs │ └── CredentialsCacheHelper.cs ├── Forms │ ├── LogDisplay.cs │ ├── Login.cs │ ├── Credentials.cs │ ├── CookieEdit.cs │ ├── PowerShell.cs │ ├── AvailableKBs.cs │ ├── UpcomingUpdates.cs │ ├── BuildInfoDetails.cs │ ├── EnvironmentChanges.cs │ ├── ChooseService.cs │ ├── AddNSG.cs │ ├── Login.Designer.cs │ ├── PowerShell.Designer.cs │ ├── LogDisplay.Designer.cs │ ├── ChooseNSG.cs │ ├── ChooseMachine.cs │ ├── ChoosePackage.cs │ ├── Credentials.Designer.cs │ ├── ChooseService.Designer.cs │ ├── CustomLinks.cs │ ├── About2LCS.cs │ ├── CookieEdit.Designer.cs │ ├── Parameters.cs │ ├── AddNSG.resx │ ├── Login.resx │ ├── CookieEdit.resx │ ├── Credentials.resx │ ├── ChooseService.resx │ ├── Parameters.resx │ ├── AddNSG.Designer.cs │ ├── ChooseProject.cs │ ├── ChooseNSG.resx │ ├── EnvironmentChanges.resx │ ├── CustomLinks.resx │ ├── ChooseMachine.resx │ └── AvailableKBs.resx ├── Properties │ ├── AssemblyInfo.cs │ ├── Settings.settings │ ├── Resources.Designer.cs │ └── Resources.resx ├── Utils │ └── CacheUtil.cs ├── AssetLibrary │ ├── AssetVersionForExport.cs │ ├── AssetLibrarySearch.cs │ └── HttpClientHelperAssetLibraryExtension.cs ├── NativeMethods.cs ├── LICENSE ├── RDPCredentials.cs ├── ExtendedWebBrowser.cs ├── Program.cs ├── URIHandler.cs ├── WebBrowserHelper.cs ├── App.config └── 2LCS.csproj ├── Third Party Notices.txt ├── .github └── workflows │ ├── build-release.yml │ └── version-release.yml ├── 2LCS.sln ├── LICENSE ├── README.md ├── SECURITY.md └── .gitignore /2LCS/favicon-blue.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/2LCS/master/2LCS/favicon-blue.ico -------------------------------------------------------------------------------- /2LCS/favicon-white.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/2LCS/master/2LCS/favicon-white.ico -------------------------------------------------------------------------------- /Third Party Notices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/2LCS/master/Third Party Notices.txt -------------------------------------------------------------------------------- /2LCS/Third Party Notices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/2LCS/master/2LCS/Third Party Notices.txt -------------------------------------------------------------------------------- /2LCS/favicon-white - Copy.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/2LCS/master/2LCS/favicon-white - Copy.ico -------------------------------------------------------------------------------- /2LCS/Cache/EnvironmentCredentials.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace LCS.Cache 4 | { 5 | class EnvironmentCredentials 6 | { 7 | public string EnvironmentId { get; set; } 8 | public Dictionary Credentials { get; set; } 9 | 10 | public EnvironmentCredentials() 11 | { 12 | 13 | } 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /2LCS/Forms/LogDisplay.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | 4 | namespace LCS.Forms 5 | { 6 | public partial class LogDisplay : Form 7 | { 8 | public LogDisplay() 9 | { 10 | InitializeComponent(); 11 | } 12 | 13 | public string LogEntries { get; set; } 14 | 15 | private void LogDisplay_Load(object sender, EventArgs e) 16 | { 17 | logTextBox.Text = LogEntries; 18 | logTextBox.Select(0, 0); 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /2LCS/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | [assembly: AssemblyTrademark("")] 4 | [assembly: AssemblyCulture("")] 5 | 6 | // Setting ComVisible to false makes the types in this assembly not visible 7 | // to COM components. If you need to access a type in this assembly from 8 | // COM, set the ComVisible attribute to true on that type. 9 | [assembly: ComVisible(false)] 10 | 11 | // The following GUID is for the ID of the typelib if this project is exposed to COM 12 | [assembly: Guid("85fb6b59-642b-4a17-bb96-213abb45bce3")] 13 | -------------------------------------------------------------------------------- /2LCS/Forms/Login.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | 4 | namespace LCS.Forms 5 | { 6 | public partial class Login : Form 7 | { 8 | public Login() 9 | { 10 | InitializeComponent(); 11 | } 12 | 13 | internal bool Cancelled { get; private set; } 14 | 15 | private void Login_Load(object sender, EventArgs e) 16 | { 17 | Cancelled = true; 18 | webBrowser1.Navigate($"{URIHandler.LCS_URL}/Logon/AdLogon"); 19 | } 20 | 21 | private void WebBrowser1_Navigated(object sender, WebBrowserNavigatedEventArgs e) 22 | { 23 | if (e.Url.ToString().StartsWith($"{URIHandler.LCS_URL}/v2")) 24 | { 25 | Cancelled = false; 26 | Close(); 27 | } 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /2LCS/Forms/Credentials.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Windows.Forms; 4 | 5 | namespace LCS.Forms 6 | { 7 | public partial class Credentials : Form 8 | { 9 | public Credentials() 10 | { 11 | InitializeComponent(); 12 | } 13 | 14 | public Dictionary CredentialsDict { get; set; } 15 | 16 | private void Credentials_Load(object sender, EventArgs e) 17 | { 18 | BindingSource bs = new BindingSource 19 | { 20 | DataSource = CredentialsDict 21 | }; 22 | credentialsDataGridView.DataSource = bs; 23 | credentialsDataGridView.Columns[0].HeaderText = "Login"; 24 | credentialsDataGridView.Columns[1].HeaderText = "Password"; 25 | bs.ResetBindings(false); 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /2LCS/Cache/CredentialsStore.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | 4 | namespace LCS.Cache 5 | { 6 | class CredentialsStore 7 | { 8 | public List EnvironmentCredentials { get; set; } 9 | 10 | public CredentialsStore() 11 | { 12 | EnvironmentCredentials = new List(); 13 | } 14 | 15 | public void RebuildMemCache() 16 | { 17 | if (EnvironmentCredentials == null) 18 | return; 19 | 20 | if (!EnvironmentCredentials.Any()) 21 | return; 22 | 23 | foreach (var cachedCredential in EnvironmentCredentials) 24 | { 25 | CredentialsCacheHelper.AddCredentialsCache(cachedCredential.EnvironmentId, cachedCredential.Credentials); 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /.github/workflows/build-release.yml: -------------------------------------------------------------------------------- 1 | # Build the C# windows form application when receiving a pull request 2 | 3 | name: Build for pull request 4 | 5 | on: 6 | pull_request: 7 | workflow_dispatch: 8 | 9 | jobs: 10 | build: 11 | runs-on: windows-latest 12 | steps: 13 | - uses: actions/checkout@v4 14 | 15 | - name: Add msbuild to PATH 16 | uses: microsoft/setup-msbuild@v2 17 | 18 | - name: Setup NuGet 19 | uses: nuget/setup-nuget@v2 20 | 21 | - name: Restore NuGet packages 22 | run: nuget restore 2LCS/2LCS.csproj 23 | 24 | - name: Build 25 | run: msbuild 2LCS/2LCS.csproj /p:VersionSuffix=pr /p:Configuration=Release /p:Version=0.0.0.${{ github.event.pull_request.number }} /p:InformationalVersion=0.0.0.${{ github.event.pull_request.number }}-pr 26 | 27 | - name: Upload 2LCS.zip 28 | uses: actions/upload-artifact@v4 29 | with: 30 | name: 2LCS 31 | path: 2LCS/bin/Release 32 | -------------------------------------------------------------------------------- /2LCS/Utils/CacheUtil.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.IO; 7 | using System.Runtime.Caching; 8 | 9 | namespace LCS.Utils 10 | { 11 | public class CacheUtil 12 | { 13 | public static bool IsCachingEnabled() 14 | { 15 | return Properties.Settings.Default.cachingEnabled; 16 | } 17 | public static bool SaveCacheToStoreEnabled() 18 | { 19 | return Properties.Settings.Default.keepCache; 20 | } 21 | 22 | public static void Add(string key, object o) 23 | { 24 | if (o == null) 25 | return; 26 | 27 | MemoryCache.Default.Add(key, o, new CacheItemPolicy { AbsoluteExpiration = DateTimeOffset.Now.AddDays(30) }); 28 | } 29 | 30 | public static T Get(string key) 31 | { 32 | return (T)MemoryCache.Default.Get(key); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /2LCS/AssetLibrary/AssetVersionForExport.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace LCS.AssetLibrary; 4 | 5 | public class AssetVersionForExport 6 | { 7 | public string ApplicationOrPlatformVersion { get; set; } 8 | 9 | public string Name { get; set; } 10 | public string Id { get; set; } 11 | public string FileName { get; set; } 12 | public string DisplayVersion { get; set; } 13 | public int FileType { get; set; } 14 | public string CreatedByName { get; set; } 15 | public string ModifiedByName { get; set; } 16 | public string ReleaseDetailsAssetId { get; set; } 17 | public string ReleaseDetailsLink { get; set; } 18 | public string ParentAssetId { get; set; } 19 | public bool IsInvalid { get; set; } 20 | public string Description { get; set; } 21 | public string Location { get; set; } 22 | public int CreatedBy { get; set; } 23 | public DateTime CreatedDate { get; set; } 24 | public int ModifiedBy { get; set; } 25 | public DateTime ModifiedDate { get; set; } 26 | } 27 | -------------------------------------------------------------------------------- /2LCS/NativeMethods.cs: -------------------------------------------------------------------------------- 1 | using LCS.Forms; 2 | using System; 3 | using System.Runtime.InteropServices; 4 | using System.Text; 5 | 6 | namespace LCS 7 | { 8 | class NativeMethods 9 | { 10 | [DllImport("user32.dll")] 11 | public static extern IntPtr GetWindow(IntPtr hWnd, int uCmd); 12 | 13 | [DllImport("user32.dll")] 14 | [return: MarshalAs(UnmanagedType.Bool)] 15 | public static extern bool GetWindowRect(IntPtr hWnd, [Out] out MainForm.RECT lpRect); 16 | 17 | [DllImport("wininet.dll", SetLastError = true, CharSet = CharSet.Unicode)] 18 | public static extern bool InternetGetCookieEx(string url, string cookieName, StringBuilder cookieData, ref int size, Int32 dwFlags, IntPtr lpReserved); 19 | 20 | [DllImport("user32.dll")] 21 | [return: MarshalAs(UnmanagedType.Bool)] 22 | public static extern bool IntersectRect([Out] out MainForm.RECT lprcDst, [In] ref MainForm.RECT lprcSrc1, [In] ref MainForm.RECT lprcSrc2); 23 | 24 | [DllImport("user32.dll")] 25 | [return: MarshalAs(UnmanagedType.Bool)] 26 | public static extern bool IsWindowVisible(IntPtr hWnd); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /2LCS.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.29827.131 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "2LCS", "2LCS\2LCS.csproj", "{85FB6B59-642B-4A17-BB96-213ABB45BCE3}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {85FB6B59-642B-4A17-BB96-213ABB45BCE3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {85FB6B59-642B-4A17-BB96-213ABB45BCE3}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {85FB6B59-642B-4A17-BB96-213ABB45BCE3}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {85FB6B59-642B-4A17-BB96-213ABB45BCE3}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {8A478B07-EED9-4507-9D79-F1C183C8EF2E} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE 22 | -------------------------------------------------------------------------------- /2LCS/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE 22 | -------------------------------------------------------------------------------- /2LCS/Forms/CookieEdit.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | 4 | namespace LCS.Forms 5 | { 6 | public partial class CookieEdit : Form 7 | { 8 | private const int CpNocloseButton = 0x200; 9 | 10 | public CookieEdit() 11 | { 12 | InitializeComponent(); 13 | } 14 | 15 | public bool Cancelled { get; private set; } 16 | public string Cookie { get; private set; } 17 | 18 | protected override CreateParams CreateParams 19 | { 20 | get 21 | { 22 | var myCp = base.CreateParams; 23 | myCp.ClassStyle |= CpNocloseButton; 24 | return myCp; 25 | } 26 | } 27 | 28 | private void CancelButton_Click(object sender, EventArgs e) 29 | { 30 | Cancelled = true; 31 | Close(); 32 | } 33 | 34 | private void CookieEdit_Load(object sender, EventArgs e) 35 | { 36 | cookieTextBox.Text = Properties.Settings.Default.cookie; 37 | } 38 | 39 | private void OkButton_Click(object sender, EventArgs e) 40 | { 41 | Cookie = cookieTextBox.Text; 42 | Close(); 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /2LCS/Forms/PowerShell.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using System.Windows.Forms; 5 | 6 | namespace LCS.Forms 7 | { 8 | public partial class PowerShell : Form 9 | { 10 | public PowerShell() 11 | { 12 | InitializeComponent(); 13 | } 14 | 15 | public Dictionary CredentialsDict { get; set; } 16 | 17 | private void PowerShell_Load(object sender, EventArgs e) 18 | { 19 | var sbv1 = new StringBuilder(); 20 | var sbv2 = new StringBuilder(); 21 | 22 | sbv1.AppendLine("$params = @{}"); 23 | sbv2.AppendLine("$params = @{"); 24 | 25 | foreach (var item in CredentialsDict) 26 | { 27 | if (item.Key.ToString().Contains("\\")) 28 | { 29 | continue; 30 | } 31 | 32 | var splitIndex = item.Key.ToString().LastIndexOf("-") + 1; 33 | var name = item.Key.ToString().Substring(splitIndex, item.Key.ToString().Length - splitIndex); 34 | var value = item.Value; 35 | 36 | sbv1.AppendLine($"$params.{name} = \"{value}\""); 37 | sbv2.AppendLine($"{name} = \"{value}\";"); 38 | } 39 | 40 | sbv2.AppendLine("}"); 41 | 42 | textBox1.Text = sbv1.ToString(); 43 | textBox1.Text += "\r\n\r\n#Or like this\r\n\r\n"; 44 | textBox1.Text += sbv2.ToString(); 45 | } 46 | } 47 | } -------------------------------------------------------------------------------- /2LCS/RDPCredentials.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.Threading; 4 | 5 | namespace LCS 6 | { 7 | internal class RdpCredentials : IDisposable 8 | { 9 | public RdpCredentials(string host, string userName, string password) 10 | { 11 | Host = host; 12 | var cmdkey = new Process 13 | { 14 | StartInfo = 15 | { 16 | FileName = Environment.ExpandEnvironmentVariables(@"%SystemRoot%\system32\cmdkey.exe"), 17 | Arguments = $@"/generic:TERMSRV/{host} /user:{userName} /pass:{password}", 18 | WindowStyle = ProcessWindowStyle.Hidden 19 | } 20 | }; 21 | cmdkey.Start(); 22 | } 23 | 24 | private string Host { get; } 25 | 26 | public void Dispose() 27 | { 28 | if (Host != null) 29 | { 30 | var task = new Thread(DeleteEntry); 31 | task.Start(); 32 | } 33 | } 34 | 35 | private void DeleteEntry() 36 | { 37 | Thread.Sleep(10000);//Give it time before deleting credentials 38 | var cmdkey = new Process 39 | { 40 | StartInfo = 41 | { 42 | FileName = Environment.ExpandEnvironmentVariables(@"%SystemRoot%\system32\cmdkey.exe"), 43 | Arguments = $@"/delete:TERMSRV/{Host}", 44 | WindowStyle = ProcessWindowStyle.Hidden 45 | } 46 | }; 47 | cmdkey.Start(); 48 | } 49 | } 50 | } -------------------------------------------------------------------------------- /2LCS/ExtendedWebBrowser.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Forms; 2 | 3 | namespace LCS 4 | { 5 | public class ExtendedWebBrowser : WebBrowser 6 | { 7 | private bool _renavigating; 8 | 9 | public ExtendedWebBrowser() 10 | { 11 | DocumentCompleted += SetupBrowser; 12 | 13 | //this will cause SetupBrowser to run (we need a document object) 14 | Navigate("about:blank"); 15 | } 16 | 17 | public string UserAgent { get; set; } 18 | 19 | private void BeforeNavigate(object pDisp, ref object url, ref object flags, ref object targetFrameName, 20 | ref object postData, ref object headers, ref bool cancel) 21 | { 22 | if (!string.IsNullOrEmpty(UserAgent)) 23 | { 24 | if (!_renavigating) 25 | { 26 | headers += $"User-Agent: {UserAgent}\r\n"; 27 | _renavigating = true; 28 | cancel = true; 29 | Navigate((string)url, (string)targetFrameName, (byte[])postData, (string)headers); 30 | } 31 | else 32 | { 33 | _renavigating = false; 34 | } 35 | } 36 | } 37 | 38 | private void PageLoaded(object sender, WebBrowserDocumentCompletedEventArgs e) 39 | { 40 | } 41 | 42 | private void SetupBrowser(object sender, WebBrowserDocumentCompletedEventArgs e) 43 | { 44 | DocumentCompleted -= SetupBrowser; 45 | SHDocVw.WebBrowser xBrowser = (SHDocVw.WebBrowser)ActiveXInstance; 46 | xBrowser.BeforeNavigate2 += BeforeNavigate; 47 | DocumentCompleted += PageLoaded; 48 | } 49 | } 50 | } -------------------------------------------------------------------------------- /2LCS/Forms/AvailableKBs.cs: -------------------------------------------------------------------------------- 1 | using LCS.JsonObjects; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Linq.Dynamic.Core; 6 | using System.Windows.Forms; 7 | 8 | namespace LCS.Forms 9 | { 10 | public partial class AvailableKBs : Form 11 | { 12 | public List Hotfixes; 13 | private readonly BindingSource _hotfixesSource = new BindingSource(); 14 | private bool _sortAscending; 15 | 16 | public AvailableKBs() 17 | { 18 | InitializeComponent(); 19 | } 20 | 21 | private void AvailableKBs_Load(object sender, EventArgs e) 22 | { 23 | availableKBsDataGridView.AutoGenerateColumns = false; 24 | if (!SystemInformation.TerminalServerSession) 25 | { 26 | var dgvType = availableKBsDataGridView.GetType(); 27 | var pi = dgvType.GetProperty("DoubleBuffered", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic); 28 | if (pi != null) pi.SetValue(availableKBsDataGridView, true, null); 29 | } 30 | availableKBsDataGridView.Columns["ReleasedDate"].DefaultCellStyle.Format = "yyyy-MM-dd HH:mm"; 31 | availableKBsDataGridView.DataSource = _hotfixesSource; 32 | _hotfixesSource.DataSource = Hotfixes.OrderBy(f => f.ReleasedDate).ThenBy(i => i.KBNumber).Reverse(); 33 | } 34 | 35 | private void AvailableKBsDataGridView_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e) 36 | { 37 | if (availableKBsDataGridView.DataSource == null) return; 38 | _hotfixesSource.DataSource = _sortAscending ? Hotfixes.AsQueryable().OrderBy(availableKBsDataGridView.Columns[e.ColumnIndex].DataPropertyName).ToList() : Hotfixes.AsQueryable().OrderBy(availableKBsDataGridView.Columns[e.ColumnIndex].DataPropertyName).Reverse().ToList(); 39 | _sortAscending = !_sortAscending; 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /2LCS/Forms/UpcomingUpdates.cs: -------------------------------------------------------------------------------- 1 | using LCS.JsonObjects; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Linq.Dynamic.Core; 6 | using System.Windows.Forms; 7 | 8 | namespace LCS.Forms 9 | { 10 | public partial class UpcomingUpdates : Form 11 | { 12 | public List Calendar; 13 | private readonly BindingSource _calendarSource = new BindingSource(); 14 | private bool _sortAscending; 15 | 16 | public UpcomingUpdates() 17 | { 18 | InitializeComponent(); 19 | } 20 | 21 | private void UpcomingUpdates_Load(object sender, EventArgs e) 22 | { 23 | upcomingUpdatesDataGridView.AutoGenerateColumns = false; 24 | if (!SystemInformation.TerminalServerSession) 25 | { 26 | var dgvType = upcomingUpdatesDataGridView.GetType(); 27 | var pi = dgvType.GetProperty("DoubleBuffered", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic); 28 | if (pi != null) pi.SetValue(upcomingUpdatesDataGridView, true, null); 29 | } 30 | upcomingUpdatesDataGridView.Columns["UtcStartDateTime"].DefaultCellStyle.Format = "yyyy-MM-dd HH:mm"; 31 | upcomingUpdatesDataGridView.DataSource = _calendarSource; 32 | _calendarSource.DataSource = Calendar; 33 | } 34 | 35 | private void UpcomingUpdatesDataGridView_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e) 36 | { 37 | if (upcomingUpdatesDataGridView.DataSource == null) return; 38 | _calendarSource.DataSource = _sortAscending ? Calendar.AsQueryable().OrderBy(upcomingUpdatesDataGridView.Columns[e.ColumnIndex].DataPropertyName).ToList() : Calendar.AsQueryable().OrderBy(upcomingUpdatesDataGridView.Columns[e.ColumnIndex].DataPropertyName).Reverse().ToList(); 39 | _sortAscending = !_sortAscending; 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /.github/workflows/version-release.yml: -------------------------------------------------------------------------------- 1 | # Action to build and release a new version of the project 2 | # The workflow is triggered manually. 3 | # The workflow builds the project, creates a new release and uploads the 2LCS.zip file to it. 4 | # The workflow uses the GitHub Actions softprops/action-gh-release action to create the release with the 2LCS.zip file. 5 | # The action takes a number of parameters, which are documented in the action's repository. 6 | 7 | name: Build and add to new release 8 | 9 | # trigger manually 10 | on: 11 | workflow_dispatch: 12 | inputs: 13 | release_name: 14 | description: 'Name of the release (e.g. v.0.47.0)' 15 | required: true 16 | version: 17 | description: 'Version of the release (e.g. 0.47.0)' 18 | required: true 19 | 20 | jobs: 21 | build: 22 | runs-on: windows-latest 23 | permissions: 24 | contents: write 25 | steps: 26 | - uses: actions/checkout@v4 27 | 28 | - name: Add msbuild to PATH 29 | uses: microsoft/setup-msbuild@v2 30 | 31 | - name: Setup NuGet 32 | uses: nuget/setup-nuget@v2 33 | 34 | - name: Restore NuGet packages 35 | run: nuget restore 2LCS/2LCS.csproj 36 | 37 | - name: Build 38 | run: msbuild 2LCS/2LCS.csproj /p:Configuration=Release /p:OutputPath=bin/Release /p:Version=${{ inputs.version }} 39 | 40 | - name: Upload ${{ inputs.release_name }}.zip 41 | uses: actions/upload-artifact@v4 42 | with: 43 | name: 2LCS_${{ inputs.release_name }} 44 | path: 2LCS/bin/Release 45 | 46 | - name: Create zip file from content of release folder 47 | run: Compress-Archive -Path 2LCS\bin\Release\* -DestinationPath 2LCS_${{ inputs.release_name }}.zip 48 | 49 | - name: Create release 50 | uses: softprops/action-gh-release@v2 51 | with: 52 | name: ${{ inputs.release_name }} 53 | tag_name: ${{ inputs.release_name }} 54 | draft: false 55 | prerelease: true 56 | generate_release_notes: true 57 | files: 2LCS_${{ inputs.release_name }}.zip 58 | -------------------------------------------------------------------------------- /2LCS/Forms/BuildInfoDetails.cs: -------------------------------------------------------------------------------- 1 | using LCS.JsonObjects; 2 | using System; 3 | using System.Linq; 4 | using System.Linq.Dynamic.Core; 5 | using System.Windows.Forms; 6 | 7 | namespace LCS.Forms 8 | { 9 | public partial class BuildInfoDetailsForm : Form 10 | { 11 | public BuildInfoDetails BuildInfo; 12 | private readonly BindingSource _buildInfoSource = new BindingSource(); 13 | private bool _sortAscending; 14 | 15 | public BuildInfoDetailsForm() 16 | { 17 | InitializeComponent(); 18 | } 19 | 20 | private void BuildInfoDetails_Load(object sender, EventArgs e) 21 | { 22 | buildInfoDetailsDataGridView.AutoGenerateColumns = false; 23 | if (!SystemInformation.TerminalServerSession) 24 | { 25 | var dgvType = buildInfoDetailsDataGridView.GetType(); 26 | var pi = dgvType.GetProperty("DoubleBuffered", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic); 27 | if (pi != null) pi.SetValue(buildInfoDetailsDataGridView, true, null); 28 | } 29 | buildInfoDetailsDataGridView.Columns["InstalledDate"].DefaultCellStyle.Format = "yyyy-MM-dd HH:mm"; 30 | buildInfoDetailsDataGridView.DataSource = _buildInfoSource; 31 | _buildInfoSource.DataSource = BuildInfo.BuildInfoTreeView.OrderBy(f => f.ParentId).ThenBy(i => i.ModelName); 32 | } 33 | 34 | private void BuildInfoDetailsDataGridView_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e) 35 | { 36 | if (buildInfoDetailsDataGridView.DataSource == null) return; 37 | _buildInfoSource.DataSource = _sortAscending ? BuildInfo.BuildInfoTreeView.AsQueryable().OrderBy(buildInfoDetailsDataGridView.Columns[e.ColumnIndex].DataPropertyName).ToList() : BuildInfo.BuildInfoTreeView.AsQueryable().OrderBy(buildInfoDetailsDataGridView.Columns[e.ColumnIndex].DataPropertyName).Reverse().ToList(); 38 | _sortAscending = !_sortAscending; 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /2LCS/Forms/EnvironmentChanges.cs: -------------------------------------------------------------------------------- 1 | using LCS.JsonObjects; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Linq.Dynamic.Core; 6 | using System.Windows.Forms; 7 | 8 | namespace LCS.Forms 9 | { 10 | public partial class EnvironmentChanges : Form 11 | { 12 | public List ActionDetails; 13 | private readonly BindingSource _actionDetailsSource = new BindingSource(); 14 | private bool _sortAscending; 15 | 16 | public EnvironmentChanges() 17 | { 18 | InitializeComponent(); 19 | } 20 | 21 | private void EnvironmentChanges_Load(object sender, EventArgs e) 22 | { 23 | environmentChangesDataGridView.AutoGenerateColumns = false; 24 | if (!SystemInformation.TerminalServerSession) 25 | { 26 | var dgvType = environmentChangesDataGridView.GetType(); 27 | var pi = dgvType.GetProperty("DoubleBuffered", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic); 28 | if (pi != null) pi.SetValue(environmentChangesDataGridView, true, null); 29 | } 30 | //environmentChangesDataGridView.Columns["ReleasedDate"].DefaultCellStyle.Format = "yyyy-MM-dd HH:mm"; 31 | environmentChangesDataGridView.DataSource = _actionDetailsSource; 32 | _actionDetailsSource.DataSource = ActionDetails;//.OrderBy(f => f.ReleasedDate).ThenBy(i => i.KBNumber).Reverse(); 33 | } 34 | 35 | private void EnvironmentChangesDataGridView_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e) 36 | { 37 | if (environmentChangesDataGridView.DataSource == null) return; 38 | _actionDetailsSource.DataSource = _sortAscending ? ActionDetails.AsQueryable().OrderBy(environmentChangesDataGridView.Columns[e.ColumnIndex].DataPropertyName).ToList() : ActionDetails.AsQueryable().OrderBy(environmentChangesDataGridView.Columns[e.ColumnIndex].DataPropertyName).Reverse().ToList(); 39 | _sortAscending = !_sortAscending; 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /2LCS/Program.cs: -------------------------------------------------------------------------------- 1 | using LCS.Forms; 2 | using System; 3 | using System.Diagnostics; 4 | using System.Threading; 5 | using System.Windows.Forms; 6 | 7 | namespace LCS 8 | { 9 | internal static class Program 10 | { 11 | static MainForm mainForm; 12 | 13 | private static void Application_ThreadException(object sender, ThreadExceptionEventArgs e) 14 | { 15 | MessageBox.Show("Please login to LCS again. Your cookie probably expired."); 16 | GetMainFormAndCloseOthers(); 17 | mainForm.Cursor = Cursors.Default; 18 | mainForm.SetLoginButtonEnabled(); 19 | mainForm.LoginToLCSMenuItem_Click(null, null); 20 | } 21 | 22 | private static void GetMainFormAndCloseOthers() 23 | { 24 | foreach (Form form in Application.OpenForms) 25 | { 26 | if (form is MainForm locMainForm) 27 | { 28 | mainForm = locMainForm; 29 | } 30 | else 31 | { 32 | form.Hide(); 33 | form.Close(); 34 | } 35 | } 36 | } 37 | 38 | /// 39 | /// The main entry point for the application. 40 | /// 41 | [STAThread] 42 | private static void Main() 43 | { 44 | Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException); 45 | 46 | // Copy user settings from previous application version if necessary 47 | if (Properties.Settings.Default.update) 48 | { 49 | Properties.Settings.Default.Upgrade(); 50 | Properties.Settings.Default.update = false; 51 | Properties.Settings.Default.Save(); 52 | } 53 | Application.EnableVisualStyles(); 54 | Application.SetCompatibleTextRenderingDefault(false); 55 | 56 | if (URIHandler.DetectURILaunch(Environment.GetCommandLineArgs())) 57 | { 58 | Application.Run(new RDPConnect()); 59 | } else 60 | { 61 | Application.Run(new MainForm()); 62 | } 63 | } 64 | } 65 | } -------------------------------------------------------------------------------- /2LCS/Forms/ChooseService.cs: -------------------------------------------------------------------------------- 1 | using LCS.JsonObjects; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Drawing; 5 | using System.Linq; 6 | using System.Linq.Dynamic; 7 | using System.Windows.Forms; 8 | 9 | namespace LCS.Forms 10 | { 11 | public partial class ChooseService : Form 12 | { 13 | public List AvailableServices; 14 | public List ServicesToRestart; 15 | private const int CpNocloseButton = 0x200; 16 | 17 | public ChooseService() 18 | { 19 | InitializeComponent(); 20 | } 21 | 22 | internal bool Cancelled { get; private set; } 23 | 24 | protected override CreateParams CreateParams 25 | { 26 | get 27 | { 28 | var myCp = base.CreateParams; 29 | myCp.ClassStyle |= CpNocloseButton; 30 | return myCp; 31 | } 32 | } 33 | 34 | private void CancelButton_Click(object sender, EventArgs e) 35 | { 36 | Cancelled = true; 37 | Close(); 38 | } 39 | 40 | private void ChooseService_Load(object sender, EventArgs e) 41 | { 42 | ServicesToRestart = new List(); 43 | RadioButton box; 44 | var i = 1; 45 | foreach(var service in AvailableServices) 46 | { 47 | box = new RadioButton 48 | { 49 | Tag = i.ToString(), 50 | Text = service.Label, 51 | Name = service.Value, 52 | AutoSize = true, 53 | Location = new Point(20, i * 20) 54 | }; 55 | Controls.Add(box); 56 | i++; 57 | } 58 | } 59 | 60 | private void OkButton_Click(object sender, EventArgs e) 61 | { 62 | foreach (var checkBox in Controls.OfType().Where(c=>c.Checked)) 63 | { 64 | ServicesToRestart.Add(new ServiceToRestart { Label = checkBox.Text, Value = checkBox.Name }); 65 | } 66 | 67 | 68 | if (ServicesToRestart.Count == 0) 69 | { 70 | Cancelled = true; 71 | } 72 | Close(); 73 | } 74 | } 75 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 2LCS - Lifecycle Services companion app 2 | 3 | This small utility can help you manage D365FO instances deployed in your LCS project. Both cloud-hosted - in your Azure subscription and Microsoft-hosted sandboxes. It offers only a subset of functionalities that LCS offers, but you can execute them a bit faster. 4 | To download latest version go to [Releases section](https://github.com/Microsoft/2LCS/releases) and download zip archive (2LCS-X.X.X.X.zip) with compiled app. 5 | # Quick tips 6 | 7 | * After you run it for the first time you need to login to LCS in the app. It will log you in automatically if you are already logged in active Internet Explorer or Edge session. 8 | * Second step is to refresh list of projects you can access in LCS. 9 | * Third one is to refresh the list of D365 instances for chosen project. 10 | 11 | You can access most of the functionality by right-clicking instance row on the grid. It is possible to execute most of the commands on multiple instances at once. To do that you need to select them first using row header on the left side of the grid. Similar to Excel. 12 | 13 | During logon 2LCS intercepts and saves the cookie to use it for later authentication. This cookie will expire after some time. You will be notified in the app. Then you need to repeat initial steps again. 14 | 15 | # No support 16 | 17 | **Please note that this is only a sample code that is not supported by Microsoft in anyway.** It is provided AS IS and it can break anytime because of changes introduced in LCS. 18 | 19 | # Contributing 20 | 21 | This project welcomes contributions and suggestions. Most contributions require you to agree to a 22 | Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us 23 | the rights to use your contribution. For details, visit https://cla.microsoft.com. 24 | 25 | When you submit a pull request, a CLA-bot will automatically determine whether you need to provide 26 | a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions 27 | provided by the bot. You will only need to do this once across all repos using our CLA. 28 | 29 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). 30 | For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or 31 | contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. 32 | -------------------------------------------------------------------------------- /2LCS/Forms/AddNSG.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Net.Http; 4 | using System.Windows.Forms; 5 | 6 | namespace LCS.Forms 7 | { 8 | public partial class AddNsg : Form 9 | { 10 | private const int CpNocloseButton = 0x200; 11 | 12 | public AddNsg() 13 | { 14 | InitializeComponent(); 15 | 16 | PopulateWithOwnIP(); 17 | } 18 | 19 | public bool Cancelled { get; private set; } 20 | public Dictionary Rule { get; set; } 21 | 22 | protected override CreateParams CreateParams 23 | { 24 | get 25 | { 26 | var myCp = base.CreateParams; 27 | myCp.ClassStyle = myCp.ClassStyle | CpNocloseButton; 28 | return myCp; 29 | } 30 | } 31 | 32 | private void Button1_Click(object sender, EventArgs e) 33 | { 34 | if (!ValidateRule()) 35 | { 36 | Cancelled = true; 37 | } 38 | Close(); 39 | } 40 | 41 | private void CancelButton_Click(object sender, EventArgs e) 42 | { 43 | Cancelled = true; 44 | Close(); 45 | } 46 | 47 | private void PopulateWithOwnIP() 48 | { 49 | if (Properties.Settings.Default.populateOwnIPForNSG) 50 | { 51 | try 52 | { 53 | var ownIpAddress = new HttpClient().GetStringAsync("http://icanhazip.com").Result; 54 | ownIpAddress = ownIpAddress.Replace("\\r\\n", "").Replace("\\n", "").Trim(); 55 | 56 | if (!string.IsNullOrEmpty(ownIpAddress)) 57 | { 58 | textBox2.Text = ownIpAddress; 59 | } 60 | } 61 | catch 62 | { 63 | MessageBox.Show("Failed to get your IP address. Please enter it manually."); 64 | } 65 | } 66 | } 67 | 68 | private bool ValidateRule() 69 | { 70 | if (string.IsNullOrEmpty(textBox1.Text)) 71 | { 72 | MessageBox.Show("Rule name is empty."); 73 | return false; 74 | } 75 | if (string.IsNullOrEmpty(textBox2.Text)) 76 | { 77 | MessageBox.Show("IP address field is empty."); 78 | return false; 79 | } 80 | Rule = new Dictionary(StringComparer.OrdinalIgnoreCase) 81 | { 82 | { textBox1.Text, textBox2.Text} 83 | }; 84 | return true; 85 | } 86 | } 87 | } -------------------------------------------------------------------------------- /2LCS/Forms/Login.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace LCS.Forms 2 | { 3 | partial class Login 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.webBrowser1 = new LCS.ExtendedWebBrowser(); 32 | this.SuspendLayout(); 33 | // 34 | // webBrowser1 35 | // 36 | this.webBrowser1.Dock = System.Windows.Forms.DockStyle.Fill; 37 | this.webBrowser1.Location = new System.Drawing.Point(0, 0); 38 | this.webBrowser1.MinimumSize = new System.Drawing.Size(450, 410); 39 | this.webBrowser1.Name = "webBrowser1"; 40 | this.webBrowser1.ScriptErrorsSuppressed = true; 41 | this.webBrowser1.Size = new System.Drawing.Size(700, 650); 42 | this.webBrowser1.TabIndex = 0; 43 | this.webBrowser1.UserAgent = null; 44 | this.webBrowser1.Navigated += new System.Windows.Forms.WebBrowserNavigatedEventHandler(this.WebBrowser1_Navigated); 45 | // 46 | // Login 47 | // 48 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 49 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 50 | this.ClientSize = new System.Drawing.Size(700, 650); 51 | this.Controls.Add(this.webBrowser1); 52 | this.Icon = global::LCS.Properties.Resources.favicon_blue; 53 | this.MinimizeBox = false; 54 | this.MinimumSize = new System.Drawing.Size(450, 410); 55 | this.Name = "Login"; 56 | this.ShowInTaskbar = false; 57 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; 58 | this.Text = "Login to LCS"; 59 | this.Load += new System.EventHandler(this.Login_Load); 60 | this.ResumeLayout(false); 61 | 62 | } 63 | 64 | #endregion 65 | 66 | private ExtendedWebBrowser webBrowser1; 67 | } 68 | } -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## Security 4 | 5 | Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). 6 | 7 | If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below. 8 | 9 | ## Reporting Security Issues 10 | 11 | **Please do not report security vulnerabilities through public GitHub issues.** 12 | 13 | Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report). 14 | 15 | If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey). 16 | 17 | You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc). 18 | 19 | Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: 20 | 21 | * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) 22 | * Full paths of source file(s) related to the manifestation of the issue 23 | * The location of the affected source code (tag/branch/commit or direct URL) 24 | * Any special configuration required to reproduce the issue 25 | * Step-by-step instructions to reproduce the issue 26 | * Proof-of-concept or exploit code (if possible) 27 | * Impact of the issue, including how an attacker might exploit the issue 28 | 29 | This information will help us triage your report more quickly. 30 | 31 | If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs. 32 | 33 | ## Preferred Languages 34 | 35 | We prefer all communications to be in English. 36 | 37 | ## Policy 38 | 39 | Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd). 40 | 41 | 42 | -------------------------------------------------------------------------------- /2LCS/Forms/PowerShell.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace LCS.Forms 2 | { 3 | partial class PowerShell 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PowerShell)); 32 | this.textBox1 = new System.Windows.Forms.TextBox(); 33 | this.SuspendLayout(); 34 | // 35 | // textBox1 36 | // 37 | this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 38 | | System.Windows.Forms.AnchorStyles.Left) 39 | | System.Windows.Forms.AnchorStyles.Right))); 40 | this.textBox1.Location = new System.Drawing.Point(14, 15); 41 | this.textBox1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); 42 | this.textBox1.Multiline = true; 43 | this.textBox1.Name = "textBox1"; 44 | this.textBox1.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; 45 | this.textBox1.Size = new System.Drawing.Size(605, 494); 46 | this.textBox1.TabIndex = 0; 47 | // 48 | // PowerShell 49 | // 50 | this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); 51 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 52 | this.ClientSize = new System.Drawing.Size(632, 525); 53 | this.Controls.Add(this.textBox1); 54 | this.Icon = global::LCS.Properties.Resources.favicon_blue; 55 | this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); 56 | this.MaximizeBox = false; 57 | this.MinimizeBox = false; 58 | this.Name = "PowerShell"; 59 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; 60 | this.Text = "PowerShell"; 61 | this.Load += new System.EventHandler(this.PowerShell_Load); 62 | this.ResumeLayout(false); 63 | this.PerformLayout(); 64 | 65 | } 66 | 67 | #endregion 68 | 69 | private System.Windows.Forms.TextBox textBox1; 70 | } 71 | } -------------------------------------------------------------------------------- /2LCS/Forms/LogDisplay.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace LCS.Forms 2 | { 3 | partial class LogDisplay 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LogDisplay)); 32 | this.logTextBox = new System.Windows.Forms.TextBox(); 33 | this.SuspendLayout(); 34 | // 35 | // logTextBox 36 | // 37 | this.logTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 38 | | System.Windows.Forms.AnchorStyles.Left) 39 | | System.Windows.Forms.AnchorStyles.Right))); 40 | this.logTextBox.Location = new System.Drawing.Point(14, 15); 41 | this.logTextBox.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); 42 | this.logTextBox.Multiline = true; 43 | this.logTextBox.Name = "logTextBox"; 44 | this.logTextBox.ReadOnly = true; 45 | this.logTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; 46 | this.logTextBox.Size = new System.Drawing.Size(951, 513); 47 | this.logTextBox.TabIndex = 0; 48 | // 49 | // Log 50 | // 51 | this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); 52 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 53 | this.ClientSize = new System.Drawing.Size(978, 544); 54 | this.Controls.Add(this.logTextBox); 55 | this.Icon = global::LCS.Properties.Resources.favicon_blue; 56 | this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); 57 | this.MinimizeBox = false; 58 | this.Name = "Log"; 59 | this.ShowInTaskbar = false; 60 | this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Show; 61 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; 62 | this.Load += new System.EventHandler(this.LogDisplay_Load); 63 | this.ResumeLayout(false); 64 | this.PerformLayout(); 65 | 66 | } 67 | 68 | #endregion 69 | 70 | private System.Windows.Forms.TextBox logTextBox; 71 | } 72 | } -------------------------------------------------------------------------------- /2LCS/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | True 19 | 20 | 21 | False 22 | 23 | 24 | 25 | 26 | 27 | False 28 | 29 | 30 | 31 | 32 | 33 | False 34 | 35 | 36 | False 37 | 38 | 39 | False 40 | 41 | 42 | False 43 | 44 | 45 | False 46 | 47 | 48 | False 49 | 50 | 51 | https://lcs.dynamics.com 52 | 53 | 54 | https://diag.lcs.dynamics.com 55 | 56 | 57 | https://update.lcs.dynamics.com 58 | 59 | 60 | https://fix.lcs.dynamics.com 61 | 62 | 63 | False 64 | 65 | 66 | -------------------------------------------------------------------------------- /2LCS/Forms/ChooseNSG.cs: -------------------------------------------------------------------------------- 1 | using LCS.JsonObjects; 2 | using System; 3 | using System.Linq; 4 | using System.Linq.Dynamic.Core; 5 | using System.Windows.Forms; 6 | 7 | namespace LCS.Forms 8 | { 9 | public partial class ChooseNSG : Form 10 | { 11 | public NetworkSecurityGroup NetworkSecurityGroup; 12 | public NSGRule NSGRule; 13 | private const int CpNocloseButton = 0x200; 14 | private readonly BindingSource _nsgRulesSource = new BindingSource(); 15 | private bool _sortAscending; 16 | 17 | public ChooseNSG() 18 | { 19 | InitializeComponent(); 20 | } 21 | 22 | internal bool Cancelled { get; private set; } 23 | 24 | protected override CreateParams CreateParams 25 | { 26 | get 27 | { 28 | var myCp = base.CreateParams; 29 | myCp.ClassStyle |= CpNocloseButton; 30 | return myCp; 31 | } 32 | } 33 | 34 | private void CancelButton_Click(object sender, EventArgs e) 35 | { 36 | Cancelled = true; 37 | Close(); 38 | } 39 | 40 | private void ChooseNSG_Load(object sender, EventArgs e) 41 | { 42 | nsgRulesDataGridView.AutoGenerateColumns = false; 43 | if (!SystemInformation.TerminalServerSession) 44 | { 45 | var dgvType = nsgRulesDataGridView.GetType(); 46 | var pi = dgvType.GetProperty("DoubleBuffered", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic); 47 | if (pi != null) pi.SetValue(nsgRulesDataGridView, true, null); 48 | } 49 | nsgRulesDataGridView.DataSource = _nsgRulesSource; 50 | if (NetworkSecurityGroup != null) 51 | { 52 | _nsgRulesSource.DataSource = NetworkSecurityGroup.Rules.OrderBy(f => f.Name); 53 | } 54 | } 55 | 56 | private void OkButton_Click(object sender, EventArgs e) 57 | { 58 | if (nsgRulesDataGridView.SelectedRows.Count > 0) 59 | { 60 | NSGRule = (NSGRule)nsgRulesDataGridView.SelectedRows[0].DataBoundItem; 61 | } 62 | else 63 | { 64 | Cancelled = true; 65 | } 66 | Close(); 67 | } 68 | 69 | private void NsgRulesDataGridView_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) 70 | { 71 | if (nsgRulesDataGridView.SelectedRows.Count > 0) 72 | { 73 | NSGRule = (NSGRule)nsgRulesDataGridView.SelectedRows[0].DataBoundItem; 74 | } 75 | else 76 | { 77 | Cancelled = true; 78 | } 79 | Close(); 80 | } 81 | 82 | private void NsgRulesDataGridView_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e) 83 | { 84 | if (nsgRulesDataGridView.DataSource == null) return; 85 | _nsgRulesSource.DataSource = _sortAscending ? NetworkSecurityGroup.Rules.AsQueryable().OrderBy(nsgRulesDataGridView.Columns[e.ColumnIndex].DataPropertyName).ToList() : NetworkSecurityGroup.Rules.AsQueryable().OrderBy(nsgRulesDataGridView.Columns[e.ColumnIndex].DataPropertyName).Reverse().ToList(); 86 | _sortAscending = !_sortAscending; 87 | } 88 | } 89 | } -------------------------------------------------------------------------------- /2LCS/Forms/ChooseMachine.cs: -------------------------------------------------------------------------------- 1 | using LCS.JsonObjects; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Linq.Dynamic.Core; 6 | using System.Windows.Forms; 7 | 8 | namespace LCS.Forms 9 | { 10 | public partial class ChooseMachine : Form 11 | { 12 | public RDPConnectionDetails RDPConnection; 13 | public List RDPConnections; 14 | private const int CpNocloseButton = 0x200; 15 | private readonly BindingSource _rdpConnectionsSource = new BindingSource(); 16 | private bool _sortAscending; 17 | 18 | public ChooseMachine() 19 | { 20 | InitializeComponent(); 21 | } 22 | 23 | internal bool Cancelled { get; private set; } 24 | 25 | protected override CreateParams CreateParams 26 | { 27 | get 28 | { 29 | var myCp = base.CreateParams; 30 | myCp.ClassStyle |= CpNocloseButton; 31 | return myCp; 32 | } 33 | } 34 | 35 | private void CancelButton_Click(object sender, EventArgs e) 36 | { 37 | Cancelled = true; 38 | Close(); 39 | } 40 | 41 | private void ChoosePackage_Load(object sender, EventArgs e) 42 | { 43 | rdpConnectionsDataGridView.AutoGenerateColumns = false; 44 | if (!SystemInformation.TerminalServerSession) 45 | { 46 | var dgvType = rdpConnectionsDataGridView.GetType(); 47 | var pi = dgvType.GetProperty("DoubleBuffered", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic); 48 | if (pi != null) pi.SetValue(rdpConnectionsDataGridView, true, null); 49 | } 50 | rdpConnectionsDataGridView.DataSource = _rdpConnectionsSource; 51 | if (RDPConnections != null) 52 | { 53 | _rdpConnectionsSource.DataSource = RDPConnections.OrderBy(f => f.Machine); 54 | } 55 | } 56 | 57 | private void OkButton_Click(object sender, EventArgs e) 58 | { 59 | if (rdpConnectionsDataGridView.SelectedRows.Count > 0) 60 | { 61 | RDPConnection = (RDPConnectionDetails)rdpConnectionsDataGridView.SelectedRows[0].DataBoundItem; 62 | } 63 | else 64 | { 65 | Cancelled = true; 66 | } 67 | Close(); 68 | } 69 | 70 | private void PackagesDataGridView_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) 71 | { 72 | if (rdpConnectionsDataGridView.SelectedRows.Count > 0) 73 | { 74 | RDPConnection = (RDPConnectionDetails)rdpConnectionsDataGridView.SelectedRows[0].DataBoundItem; 75 | } 76 | else 77 | { 78 | Cancelled = true; 79 | } 80 | Close(); 81 | } 82 | 83 | private void PackagesDataGridView_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e) 84 | { 85 | if (rdpConnectionsDataGridView.DataSource == null) return; 86 | _rdpConnectionsSource.DataSource = _sortAscending ? RDPConnections.AsQueryable().OrderBy(rdpConnectionsDataGridView.Columns[e.ColumnIndex].DataPropertyName).ToList() : RDPConnections.AsQueryable().OrderBy(rdpConnectionsDataGridView.Columns[e.ColumnIndex].DataPropertyName).Reverse().ToList(); 87 | _sortAscending = !_sortAscending; 88 | } 89 | } 90 | } -------------------------------------------------------------------------------- /2LCS/AssetLibrary/AssetLibrarySearch.cs: -------------------------------------------------------------------------------- 1 | using AutoMapper; 2 | using CsvHelper; 3 | using LCS.JsonObjects; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Data; 7 | using System.Globalization; 8 | using System.IO; 9 | using System.Linq; 10 | using System.Text; 11 | using System.Windows.Forms; 12 | 13 | namespace LCS.AssetLibrary; 14 | 15 | public partial class AssetLibrarySearch : Form 16 | { 17 | private HttpClientHelper _httpClientHelper; 18 | 19 | internal AssetLibrarySearch(HttpClientHelper httpClientHelper) 20 | { 21 | InitializeComponent(); 22 | _httpClientHelper = httpClientHelper; 23 | } 24 | 25 | private void AssetLibrarySearch_Load(object sender, EventArgs e) 26 | { 27 | assetsCreatedAfter.Value = DateTime.Now.AddMonths(-6); 28 | assetsCreatedBefore.Value = DateTime.Now; 29 | } 30 | 31 | private void search_Click(object sender, EventArgs e) 32 | { 33 | Cursor.Current = Cursors.WaitCursor; 34 | 35 | var assets = _httpClientHelper.GetSharedAssetList(AssetFileType.NuGetPackage); 36 | 37 | var assetVersionsForExportList = new List(); 38 | 39 | var config = new MapperConfiguration( 40 | cfg => cfg.CreateMap()); 41 | var mapper = config.CreateMapper(); 42 | 43 | // linear with progress, only assets in date range 44 | assetExportProgress.Maximum = assets.Count; 45 | assetExportProgress.Value = 0; 46 | foreach (var asset in assets) 47 | { 48 | assetExportProgress.Value++; 49 | assetExportProgressNumberOfMax.Text = $"{assetExportProgress.Value} of {assetExportProgress.Maximum}"; 50 | assetExportProgressAssetName.Text = asset.Name; 51 | var assetVersions = _httpClientHelper.GetSharedAssetVersionList(asset.ParentAssetId) 52 | .Where(assetVersion => assetVersion.CreatedDate >= assetsCreatedAfter.Value 53 | && assetVersion.CreatedDate <= assetsCreatedBefore.Value); 54 | if (assetVersions.Any() == false) 55 | { 56 | break; 57 | } 58 | assetVersionsForExportList.AddRange(assetVersions 59 | .Select(assetVersion => 60 | { 61 | var fileDescription = assetVersion.FileDescription.Split('\n').Last(); 62 | assetVersion.ApplicationOrPlatformVersion = fileDescription; 63 | return mapper.Map(assetVersion); 64 | })); 65 | ; } 66 | 67 | Cursor.Current = Cursors.Default; 68 | assetExportProgress.Value = 0; 69 | assetExportProgressNumberOfMax.Text = string.Empty; 70 | assetExportProgressAssetName.Text = string.Empty; 71 | 72 | SaveFileDialog saveFile = new() 73 | { 74 | FileName = "D365FO NuGet Packages.csv", 75 | Filter = "CSV files (*.csv)|*.csv|All files (*.*)|*.*" 76 | }; 77 | 78 | if (saveFile.ShowDialog() == DialogResult.OK) 79 | { 80 | try 81 | { 82 | using StreamWriter sw = new(saveFile.FileName, false, Encoding.Unicode); 83 | var csv = new CsvWriter(sw, CultureInfo.CurrentCulture); 84 | csv.WriteRecords(assetVersionsForExportList); 85 | } 86 | catch (Exception ex) 87 | { 88 | MessageBox.Show(ex.Message); 89 | } 90 | } 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /2LCS/Forms/ChoosePackage.cs: -------------------------------------------------------------------------------- 1 | using LCS.JsonObjects; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Linq.Dynamic.Core; 6 | using System.Windows.Forms; 7 | 8 | namespace LCS.Forms 9 | { 10 | public partial class ChoosePackage : Form 11 | { 12 | public List Packages; 13 | private const int CpNocloseButton = 0x200; 14 | private readonly BindingSource _packagesSource = new BindingSource(); 15 | private bool _sortAscending; 16 | 17 | public ChoosePackage() 18 | { 19 | InitializeComponent(); 20 | } 21 | 22 | internal bool Cancelled { get; private set; } 23 | internal DeployablePackage DeployablePackage { get; private set; } 24 | 25 | protected override CreateParams CreateParams 26 | { 27 | get 28 | { 29 | var myCp = base.CreateParams; 30 | myCp.ClassStyle |= CpNocloseButton; 31 | return myCp; 32 | } 33 | } 34 | 35 | private void CancelButton_Click(object sender, EventArgs e) 36 | { 37 | Cancelled = true; 38 | Close(); 39 | } 40 | 41 | private void ChoosePackage_Load(object sender, EventArgs e) 42 | { 43 | packagesDataGridView.AutoGenerateColumns = false; 44 | if (!SystemInformation.TerminalServerSession) 45 | { 46 | var dgvType = packagesDataGridView.GetType(); 47 | var pi = dgvType.GetProperty("DoubleBuffered", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic); 48 | if (pi != null) pi.SetValue(packagesDataGridView, true, null); 49 | } 50 | packagesDataGridView.Columns["ModifiedDate"].DefaultCellStyle.Format = "yyyy-MM-dd HH:mm"; 51 | packagesDataGridView.DataSource = _packagesSource; 52 | if (Packages != null) 53 | { 54 | _packagesSource.DataSource = Packages.OrderBy(f => f.ModifiedDate).Reverse(); 55 | } 56 | } 57 | 58 | private void OkButton_Click(object sender, EventArgs e) 59 | { 60 | if (packagesDataGridView.SelectedRows.Count > 0) 61 | { 62 | DeployablePackage = (DeployablePackage)packagesDataGridView.SelectedRows[0].DataBoundItem; 63 | } 64 | else 65 | { 66 | Cancelled = true; 67 | } 68 | Close(); 69 | } 70 | 71 | private void PackagesDataGridView_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) 72 | { 73 | if (packagesDataGridView.SelectedRows.Count > 0) 74 | { 75 | DeployablePackage = (DeployablePackage)packagesDataGridView.SelectedRows[0].DataBoundItem; 76 | } 77 | else 78 | { 79 | Cancelled = true; 80 | } 81 | Close(); 82 | } 83 | 84 | private void PackagesDataGridView_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e) 85 | { 86 | if (packagesDataGridView.DataSource == null) return; 87 | _packagesSource.DataSource = _sortAscending ? Packages.AsQueryable().OrderBy(packagesDataGridView.Columns[e.ColumnIndex].DataPropertyName).ToList() : Packages.AsQueryable().OrderBy(packagesDataGridView.Columns[e.ColumnIndex].DataPropertyName).Reverse().ToList(); 88 | _sortAscending = !_sortAscending; 89 | } 90 | } 91 | } -------------------------------------------------------------------------------- /2LCS/Forms/Credentials.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace LCS.Forms 2 | { 3 | partial class Credentials 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.credentialsDataGridView = new System.Windows.Forms.DataGridView(); 32 | ((System.ComponentModel.ISupportInitialize)(this.credentialsDataGridView)).BeginInit(); 33 | this.SuspendLayout(); 34 | // 35 | // credentialsDataGridView 36 | // 37 | this.credentialsDataGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 38 | | System.Windows.Forms.AnchorStyles.Left) 39 | | System.Windows.Forms.AnchorStyles.Right))); 40 | this.credentialsDataGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; 41 | this.credentialsDataGridView.BackgroundColor = System.Drawing.SystemColors.Window; 42 | this.credentialsDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; 43 | this.credentialsDataGridView.Location = new System.Drawing.Point(20, 20); 44 | this.credentialsDataGridView.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); 45 | this.credentialsDataGridView.Name = "credentialsDataGridView"; 46 | this.credentialsDataGridView.RowHeadersWidth = 62; 47 | this.credentialsDataGridView.Size = new System.Drawing.Size(646, 357); 48 | this.credentialsDataGridView.TabIndex = 0; 49 | // 50 | // Credentials 51 | // 52 | this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); 53 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 54 | this.ClientSize = new System.Drawing.Size(684, 429); 55 | this.Controls.Add(this.credentialsDataGridView); 56 | this.Icon = global::LCS.Properties.Resources.favicon_blue; 57 | this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); 58 | this.MinimizeBox = false; 59 | this.MinimumSize = new System.Drawing.Size(560, 320); 60 | this.Name = "Credentials"; 61 | this.ShowInTaskbar = false; 62 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; 63 | this.Text = "Credentials"; 64 | this.Load += new System.EventHandler(this.Credentials_Load); 65 | ((System.ComponentModel.ISupportInitialize)(this.credentialsDataGridView)).EndInit(); 66 | this.ResumeLayout(false); 67 | 68 | } 69 | 70 | #endregion 71 | 72 | private System.Windows.Forms.DataGridView credentialsDataGridView; 73 | } 74 | } -------------------------------------------------------------------------------- /2LCS/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace LCS.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("LCS.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). 65 | /// 66 | internal static System.Drawing.Icon favicon_blue { 67 | get { 68 | object obj = ResourceManager.GetObject("favicon_blue", resourceCulture); 69 | return ((System.Drawing.Icon)(obj)); 70 | } 71 | } 72 | 73 | /// 74 | /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). 75 | /// 76 | internal static System.Drawing.Icon favicon_white { 77 | get { 78 | object obj = ResourceManager.GetObject("favicon_white", resourceCulture); 79 | return ((System.Drawing.Icon)(obj)); 80 | } 81 | } 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /2LCS/Forms/ChooseService.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace LCS.Forms 2 | { 3 | partial class ChooseService 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.OkButton = new System.Windows.Forms.Button(); 32 | this.cancelButton = new System.Windows.Forms.Button(); 33 | this.SuspendLayout(); 34 | // 35 | // OkButton 36 | // 37 | this.OkButton.Anchor = System.Windows.Forms.AnchorStyles.Bottom; 38 | this.OkButton.Location = new System.Drawing.Point(70, 203); 39 | this.OkButton.Margin = new System.Windows.Forms.Padding(4); 40 | this.OkButton.Name = "OkButton"; 41 | this.OkButton.Size = new System.Drawing.Size(222, 40); 42 | this.OkButton.TabIndex = 1; 43 | this.OkButton.Text = "OK"; 44 | this.OkButton.UseVisualStyleBackColor = true; 45 | this.OkButton.Click += new System.EventHandler(this.OkButton_Click); 46 | // 47 | // cancelButton 48 | // 49 | this.cancelButton.Anchor = System.Windows.Forms.AnchorStyles.Bottom; 50 | this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; 51 | this.cancelButton.Location = new System.Drawing.Point(300, 203); 52 | this.cancelButton.Margin = new System.Windows.Forms.Padding(4); 53 | this.cancelButton.Name = "cancelButton"; 54 | this.cancelButton.Size = new System.Drawing.Size(210, 40); 55 | this.cancelButton.TabIndex = 2; 56 | this.cancelButton.Text = "Cancel"; 57 | this.cancelButton.UseVisualStyleBackColor = true; 58 | this.cancelButton.Click += new System.EventHandler(this.CancelButton_Click); 59 | // 60 | // ChooseService 61 | // 62 | this.AcceptButton = this.OkButton; 63 | this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 24F); 64 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 65 | this.CancelButton = this.cancelButton; 66 | this.ClientSize = new System.Drawing.Size(576, 256); 67 | this.Controls.Add(this.cancelButton); 68 | this.Controls.Add(this.OkButton); 69 | this.Icon = global::LCS.Properties.Resources.favicon_blue; 70 | this.Margin = new System.Windows.Forms.Padding(4); 71 | this.MaximizeBox = false; 72 | this.MinimizeBox = false; 73 | this.MinimumSize = new System.Drawing.Size(600, 320); 74 | this.Name = "ChooseService"; 75 | this.ShowInTaskbar = false; 76 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; 77 | this.Text = "Choose service(s) to restart"; 78 | this.Load += new System.EventHandler(this.ChooseService_Load); 79 | this.ResumeLayout(false); 80 | 81 | } 82 | 83 | #endregion 84 | private System.Windows.Forms.Button OkButton; 85 | private System.Windows.Forms.Button cancelButton; 86 | } 87 | } -------------------------------------------------------------------------------- /2LCS/Forms/CustomLinks.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Linq.Dynamic.Core; 6 | using System.Windows.Forms; 7 | 8 | namespace LCS.Forms 9 | { 10 | public partial class CustomLinks : Form 11 | { 12 | private const int CpNocloseButton = 0x200; 13 | private readonly BindingSource _linksSource = new BindingSource(); 14 | private List _linksList; 15 | private bool _sortAscending = true; 16 | 17 | public CustomLinks() 18 | { 19 | InitializeComponent(); 20 | } 21 | 22 | internal bool Cancelled { get; private set; } 23 | 24 | protected override CreateParams CreateParams 25 | { 26 | get 27 | { 28 | var myCp = base.CreateParams; 29 | myCp.ClassStyle |= CpNocloseButton; 30 | return myCp; 31 | } 32 | } 33 | 34 | private void Button1_Click(object sender, EventArgs e) 35 | { 36 | Properties.Settings.Default.links = JsonConvert.SerializeObject(_linksList, new JsonSerializerSettings { TypeNameHandling = TypeNameHandling.Auto }); 37 | Properties.Settings.Default.Save(); 38 | Close(); 39 | } 40 | 41 | private void CancelButton_Click(object sender, EventArgs e) 42 | { 43 | Cancelled = true; 44 | Close(); 45 | } 46 | 47 | private void CustomLinks_Load(object sender, EventArgs e) 48 | { 49 | linksDataGridView.AutoGenerateColumns = false; 50 | if (!SystemInformation.TerminalServerSession) 51 | { 52 | var dgvType = linksDataGridView.GetType(); 53 | var pi = dgvType.GetProperty("DoubleBuffered", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic); 54 | if (pi != null) pi.SetValue(linksDataGridView, true, null); 55 | } 56 | _linksList = JsonConvert.DeserializeObject>(Properties.Settings.Default.links) ?? 57 | new List(); 58 | _linksSource.DataSource = _linksList; 59 | linksDataGridView.DataSource = _linksSource; 60 | } 61 | 62 | private void DeleteToolStripMenuItem_Click(object sender, EventArgs e) 63 | { 64 | var count = linksDataGridView.SelectedRows.Count; 65 | if (count <= 0) return; 66 | for (var i = 0; i < count; i++) 67 | { 68 | if (!linksDataGridView.SelectedRows[0].IsNewRow) 69 | { 70 | linksDataGridView.Rows.RemoveAt(linksDataGridView.SelectedRows[0].Index); 71 | } 72 | } 73 | } 74 | 75 | private void LinksDataGridView_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e) 76 | { 77 | if (linksDataGridView.DataSource == null || _linksList == null) return; 78 | _linksSource.DataSource = _sortAscending ? _linksList.AsQueryable().OrderBy(linksDataGridView.Columns[e.ColumnIndex].DataPropertyName).ToList() : _linksList.AsQueryable().OrderBy(linksDataGridView.Columns[e.ColumnIndex].DataPropertyName).Reverse().ToList(); 79 | _sortAscending = !_sortAscending; 80 | linksDataGridView.ClearSelection(); 81 | } 82 | 83 | private void LinksDataGridView_MouseDown(object sender, MouseEventArgs e) 84 | { 85 | if (e.Button == MouseButtons.Right) 86 | { 87 | var hti = linksDataGridView.HitTest(e.X, e.Y); 88 | if (hti.RowIndex >= 0 && linksDataGridView.Rows[hti.RowIndex].Selected != true) 89 | { 90 | linksDataGridView.ClearSelection(); 91 | linksDataGridView.Rows[hti.RowIndex].Selected = true; 92 | } 93 | } 94 | } 95 | } 96 | } -------------------------------------------------------------------------------- /2LCS/URIHandler.cs: -------------------------------------------------------------------------------- 1 | using LCS.Forms; 2 | using LCS.JsonObjects; 3 | using Microsoft.Win32; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Diagnostics; 7 | using System.Linq; 8 | using System.Net; 9 | using System.Reflection; 10 | using System.Security.Principal; 11 | using System.Text; 12 | using System.Threading.Tasks; 13 | using System.Web; 14 | using System.Windows.Forms; 15 | 16 | namespace LCS 17 | { 18 | public class URIHandler 19 | { 20 | public const string URI_PROTOCOL_NAME = "MS-2LCS"; 21 | 22 | public static string LCS_DIAG_URL = Properties.Settings.Default.lcsDiagURL; 23 | public static string LCS_UPDATE_URL = Properties.Settings.Default.lcsUpdateURL; 24 | public static string LCS_URL = Properties.Settings.Default.lcsURL; 25 | public static string LCS_FIX_URL = Properties.Settings.Default.lcsFixURL; 26 | 27 | public static bool DetectURILaunch(string[] args) 28 | { 29 | bool retVal = false; 30 | 31 | foreach (string arg in args) 32 | { 33 | if (Uri.TryCreate(arg, UriKind.RelativeOrAbsolute, out Uri srcUri)) 34 | { 35 | Uri uri = srcUri.IsAbsoluteUri ? srcUri : new Uri(new Uri("ms-2lcs://lcs.dynamics.com/"), arg); 36 | retVal = retVal || uri.Scheme == URI_PROTOCOL_NAME.ToLower(); 37 | if (retVal) break; 38 | } 39 | } 40 | 41 | return retVal; 42 | } 43 | 44 | public static bool RemoveHandler() 45 | { 46 | bool retVal = false; 47 | if (IsAdministratorAccessProvided()) 48 | { 49 | Registry.ClassesRoot.DeleteSubKeyTree(URI_PROTOCOL_NAME, false); 50 | 51 | MessageBox.Show($"{URI_PROTOCOL_NAME} protocol handler registration removed."); 52 | retVal = true; 53 | } 54 | return retVal; 55 | } 56 | 57 | public static bool RegisterHandler() 58 | { 59 | bool retVal = true; 60 | 61 | retVal = retVal && IsAdministratorAccessProvided(); 62 | retVal = retVal && RemoveHandler(); 63 | 64 | if (retVal) 65 | { 66 | RegistryKey rootKey = Registry.ClassesRoot.CreateSubKey(URI_PROTOCOL_NAME.ToLower()); 67 | 68 | if (rootKey != null) 69 | { 70 | string appAssemblyLocation = Assembly.GetExecutingAssembly().Location; 71 | 72 | rootKey.SetValue("", $"URL:{URI_PROTOCOL_NAME.ToLower()}"); 73 | rootKey.SetValue("URL Protocol", ""); 74 | 75 | rootKey.CreateSubKey("DefaultIcon") 76 | .SetValue("", appAssemblyLocation); 77 | 78 | rootKey.CreateSubKey("shell") 79 | .CreateSubKey("open") 80 | .CreateSubKey("command") 81 | .SetValue("", $@"""{appAssemblyLocation}"" ""%1"""); 82 | } 83 | 84 | MessageBox.Show($"{URI_PROTOCOL_NAME} protocol handler registration completed.\nRemember to not move the executable to other location or re-register it after."); 85 | retVal = true; 86 | } 87 | return retVal; 88 | } 89 | 90 | private static bool IsAdministratorAccessProvided() 91 | { 92 | bool isAdmin = CheckIsUserAdministrator(); 93 | 94 | if (!isAdmin) 95 | { 96 | MessageBox.Show("You must be system administrator", "Insufficient privilidges", MessageBoxButtons.OK, MessageBoxIcon.Error); 97 | } 98 | 99 | return isAdmin; 100 | } 101 | 102 | private static bool CheckIsUserAdministrator() => new WindowsPrincipal(WindowsIdentity.GetCurrent()).IsInRole(WindowsBuiltInRole.Administrator); 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /2LCS/Cache/CredentialsCacheHelper.cs: -------------------------------------------------------------------------------- 1 | using LCS.Utils; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.IO; 5 | using System.Linq; 6 | using System.Runtime.Caching; 7 | using Newtonsoft.Json; 8 | 9 | namespace LCS.Cache 10 | { 11 | class CredentialsCacheHelper 12 | { 13 | public static void AddCredentialsCache(string environmentId, Dictionary credentialDict) 14 | { 15 | CacheUtil.Add(environmentId, credentialDict); 16 | } 17 | 18 | public static Dictionary GetCredentialsCache(string environmentId) 19 | { 20 | return CacheUtil.Get>(environmentId); 21 | } 22 | 23 | public static void SaveCredentialsOffline() 24 | { 25 | var EnvironmentCredentialCache = new CredentialsStore(); 26 | 27 | MemoryCache.Default.ToList().ForEach(c => 28 | { 29 | EnvironmentCredentialCache.EnvironmentCredentials.Add(new EnvironmentCredentials 30 | { 31 | EnvironmentId = c.Key, 32 | Credentials = (Dictionary)c.Value 33 | }); 34 | }); 35 | 36 | var tempFile = Properties.Settings.Default.cachingStore; 37 | 38 | if (string.IsNullOrEmpty(tempFile)) 39 | { 40 | tempFile = Path.GetTempFileName(); 41 | 42 | try 43 | { 44 | using var creationStream = File.Create(tempFile); 45 | 46 | Properties.Settings.Default.cachingStore = tempFile; 47 | Properties.Settings.Default.Save(); 48 | } 49 | catch (Exception) 50 | { 51 | throw; 52 | } 53 | } 54 | 55 | if(File.Exists(tempFile)) 56 | { 57 | using(var writer = new StreamWriter(tempFile)) 58 | { 59 | writer.Write(JsonConvert.SerializeObject(EnvironmentCredentialCache)); 60 | } 61 | } 62 | } 63 | 64 | public static void LoadOffLineCredentials() 65 | { 66 | CredentialsStore store; 67 | 68 | var tempFile = Properties.Settings.Default.cachingStore; 69 | 70 | if (string.IsNullOrEmpty(tempFile)) 71 | return; 72 | 73 | if (!File.Exists(tempFile)) 74 | return; 75 | 76 | try 77 | { 78 | using (var reader = new StreamReader(tempFile)) 79 | { 80 | var cache = reader.ReadToEnd(); 81 | 82 | store = JsonConvert.DeserializeObject(cache); 83 | 84 | store.RebuildMemCache(); 85 | } 86 | } 87 | catch (Exception) 88 | { 89 | //deal with corrupted cache 90 | DisableCache(); 91 | ClearCache(); 92 | } 93 | } 94 | 95 | public static void DisableCache() 96 | { 97 | Properties.Settings.Default.cachingEnabled = false; 98 | Properties.Settings.Default.keepCache = false; 99 | Properties.Settings.Default.cachingStore = ""; 100 | Properties.Settings.Default.Save(); 101 | } 102 | 103 | 104 | public static string ClearCache() 105 | { 106 | var tempFile = Properties.Settings.Default.cachingStore; 107 | 108 | if (string.IsNullOrEmpty(tempFile)) 109 | return null; 110 | 111 | try 112 | { 113 | File.Delete(tempFile); 114 | Properties.Settings.Default.cachingStore = ""; 115 | Properties.Settings.Default.Save(); 116 | 117 | return null; 118 | } 119 | catch (Exception ex) 120 | { 121 | DisableCache(); 122 | return ex.Message; 123 | } 124 | } 125 | 126 | } 127 | } 128 | -------------------------------------------------------------------------------- /2LCS/WebBrowserHelper.cs: -------------------------------------------------------------------------------- 1 | //Use latest version of Internet Explorer in the webbrowser control 2 | //https://stackoverflow.com/questions/17922308/use-latest-version-of-internet-explorer-in-the-webbrowser-control 3 | using System; 4 | using System.Diagnostics; 5 | 6 | namespace LCS 7 | { 8 | public static class WebBrowserHelper 9 | { 10 | public static void FixBrowserVersion() 11 | { 12 | var appName = System.IO.Path.GetFileNameWithoutExtension(System.Reflection.Assembly.GetExecutingAssembly().Location); 13 | FixBrowserVersion(appName); 14 | } 15 | 16 | public static void FixBrowserVersion(string appName) 17 | { 18 | FixBrowserVersion(appName, GetEmbVersion()); 19 | } 20 | 21 | // FixBrowserVersion("", 9000); 22 | public static void FixBrowserVersion(string appName, int ieVer) 23 | { 24 | FixBrowserVersion_Internal("HKEY_LOCAL_MACHINE", appName + ".exe", ieVer); 25 | FixBrowserVersion_Internal("HKEY_CURRENT_USER", appName + ".exe", ieVer); 26 | FixBrowserVersion_Internal("HKEY_LOCAL_MACHINE", appName + ".vshost.exe", ieVer); 27 | FixBrowserVersion_Internal("HKEY_CURRENT_USER", appName + ".vshost.exe", ieVer); 28 | } 29 | 30 | public static int GetEmbVersion() 31 | { 32 | var ieVer = GetBrowserVersion(); 33 | 34 | if (ieVer > 9) 35 | return ieVer * 1000 + 1; 36 | 37 | if (ieVer > 7) 38 | return ieVer * 1111; 39 | 40 | return 7000; 41 | } // End Function GetEmbVersion 42 | 43 | // End Sub FixBrowserVersion 44 | 45 | // End Sub FixBrowserVersion 46 | 47 | private static void FixBrowserVersion_Internal(string root, string appName, int ieVer) 48 | { 49 | try 50 | { 51 | //For 64 bit Machine 52 | if (Environment.Is64BitOperatingSystem) 53 | Microsoft.Win32.Registry.SetValue(root + @"\Software\Wow6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION", appName, ieVer); 54 | //For both 32 bit and 64 bit Machine 55 | Microsoft.Win32.Registry.SetValue(root + @"\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION", appName, ieVer); 56 | } 57 | catch (Exception) 58 | { 59 | // some config will hit access rights exceptions 60 | // this is why we try with both LOCAL_MACHINE and CURRENT_USER 61 | } 62 | } // End Sub FixBrowserVersion_Internal 63 | 64 | private static int GetBrowserVersion() 65 | { 66 | // string strKeyPath = @"HKLM\SOFTWARE\Microsoft\Internet Explorer"; 67 | const string strKeyPath = @"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer"; 68 | var ls = new[] { "svcVersion", "svcUpdateVersion", "Version", "W2kVersion" }; 69 | 70 | var maxVer = 0; 71 | foreach (var t in ls) 72 | { 73 | var objVal = Microsoft.Win32.Registry.GetValue(strKeyPath, t, "0"); 74 | var strVal = Convert.ToString(objVal); 75 | var iPos = strVal.IndexOf('.'); 76 | if (iPos > 0) 77 | strVal = strVal.Substring(0, iPos); 78 | 79 | if (int.TryParse(strVal, out var res)) 80 | maxVer = Math.Max(maxVer, res); 81 | } 82 | 83 | return maxVer; 84 | } // End Function GetBrowserVersion 85 | 86 | /// 87 | /// Opens a web page. 88 | /// 89 | /// Url of web page. 90 | /// 91 | /// See https://github.com/microsoft/2LCS/issues/77 92 | /// 93 | public static void OpenUri(string uri) 94 | { 95 | var processStartInfo = new ProcessStartInfo 96 | { 97 | FileName = uri, 98 | UseShellExecute = true 99 | }; 100 | Process.Start(processStartInfo); 101 | } 102 | } 103 | } -------------------------------------------------------------------------------- /2LCS/Forms/About2LCS.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Reflection; 3 | using System.Windows.Forms; 4 | 5 | namespace LCS.Forms 6 | { 7 | partial class About2LCS : Form 8 | { 9 | public About2LCS() 10 | { 11 | InitializeComponent(); 12 | this.Text = String.Format("About {0}", AssemblyTitle); 13 | this.labelProductName.Text = AssemblyProduct; 14 | this.labelVersion.Text = String.Format("Version {0}", AssemblyVersion); 15 | this.labelCopyright.Text = AssemblyCopyright; 16 | this.labelCompanyName.Text = AssemblyCompany; 17 | this.textBoxDescription.Text = AssemblyDescription; 18 | this.linkLabelRepository.Text = AssemblyRepositoryLink; 19 | this.logoPictureBox.Image = Properties.Resources.favicon_white.ToBitmap(); 20 | this.logoPictureBox.SizeMode = PictureBoxSizeMode.CenterImage; 21 | } 22 | 23 | #region Assembly Attribute Accessors 24 | 25 | public string AssemblyTitle 26 | { 27 | get 28 | { 29 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false); 30 | if (attributes.Length > 0) 31 | { 32 | AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)attributes[0]; 33 | if (titleAttribute.Title != "") 34 | { 35 | return titleAttribute.Title; 36 | } 37 | } 38 | return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().Location); 39 | } 40 | } 41 | 42 | public string AssemblyVersion 43 | { 44 | get 45 | { 46 | return Assembly.GetExecutingAssembly().GetName().Version.ToString(); 47 | } 48 | } 49 | 50 | public string AssemblyDescription 51 | { 52 | get 53 | { 54 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false); 55 | if (attributes.Length == 0) 56 | { 57 | return ""; 58 | } 59 | return ((AssemblyDescriptionAttribute)attributes[0]).Description; 60 | } 61 | } 62 | 63 | public string AssemblyProduct 64 | { 65 | get 66 | { 67 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false); 68 | if (attributes.Length == 0) 69 | { 70 | return ""; 71 | } 72 | return ((AssemblyProductAttribute)attributes[0]).Product; 73 | } 74 | } 75 | 76 | public string AssemblyCopyright 77 | { 78 | get 79 | { 80 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false); 81 | if (attributes.Length == 0) 82 | { 83 | return ""; 84 | } 85 | return ((AssemblyCopyrightAttribute)attributes[0]).Copyright; 86 | } 87 | } 88 | 89 | public string AssemblyCompany 90 | { 91 | get 92 | { 93 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false); 94 | if (attributes.Length == 0) 95 | { 96 | return ""; 97 | } 98 | return ((AssemblyCompanyAttribute)attributes[0]).Company; 99 | } 100 | } 101 | 102 | public string AssemblyRepositoryLink 103 | { 104 | get 105 | { 106 | return "https://github.com/microsoft/2LCS"; 107 | } 108 | } 109 | #endregion 110 | 111 | private void linkLabelRepository_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) 112 | { 113 | WebBrowserHelper.OpenUri(AssemblyRepositoryLink); 114 | } 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /2LCS/AssetLibrary/HttpClientHelperAssetLibraryExtension.cs: -------------------------------------------------------------------------------- 1 | using LCS.JsonObjects; 2 | using Newtonsoft.Json; 3 | using Newtonsoft.Json.Linq; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Net.Http; 7 | using System.Text; 8 | 9 | namespace LCS.AssetLibrary; 10 | 11 | internal static class HttpClientHelperAssetLibraryExtension 12 | { 13 | internal static string GetGetSharedAssetsUrl( 14 | this HttpClientHelper httpClientHelper, 15 | AssetFileType assetFileType) 16 | { 17 | return $"{httpClientHelper.LcsUrl}/FileAsset/GetSharedAssets/?assetKind={((int)assetFileType)}&_={DateTimeOffset.Now.ToUnixTimeSeconds()}"; 18 | } 19 | 20 | internal static string GetGetFileAssetVersionsUrl( 21 | this HttpClientHelper httpClientHelper) 22 | { 23 | return $"{httpClientHelper.LcsUrl}/FileAsset/GetFileAssetVersions"; 24 | } 25 | 26 | internal static string GetDownloadReleaseDetailsForAssetUrl( 27 | this HttpClientHelper httpClientHelper, 28 | string releaseDetailsLink) 29 | { 30 | return $"{httpClientHelper.LcsUrl}{releaseDetailsLink}&_={DateTimeOffset.Now.ToUnixTimeSeconds()}"; 31 | } 32 | 33 | internal static List GetSharedAssetList( 34 | this HttpClientHelper httpClientHelper, 35 | AssetFileType assetFileType) 36 | { 37 | var assetList = new List(); 38 | 39 | var url = httpClientHelper.GetGetSharedAssetsUrl(assetFileType); 40 | var result = httpClientHelper.GetHttpClient().GetAsync(url).Result; 41 | result.EnsureSuccessStatusCode(); 42 | 43 | var responseBody = result.Content.ReadAsStringAsync().Result; 44 | var response = JsonConvert.DeserializeObject(responseBody); 45 | if (response.Success 46 | && response.Data != null 47 | && response.Data is JToken responseData) 48 | { 49 | var assetData = responseData[0].ToObject(); 50 | assetList = assetData.Assets; 51 | } 52 | 53 | return assetList; 54 | } 55 | 56 | internal static List GetSharedAssetVersionList( 57 | this HttpClientHelper httpClientHelper, 58 | string parentFileAssetId) 59 | { 60 | var assetVersionList = new List(); 61 | 62 | var url = httpClientHelper.GetGetFileAssetVersionsUrl(); 63 | var stringContent = new StringContent( 64 | $"parentFileAssetId={parentFileAssetId}", 65 | Encoding.UTF8, 66 | "application/x-www-form-urlencoded"); 67 | httpClientHelper.SetRequestVerificationToken($"{httpClientHelper.LcsUrl}/V2"); 68 | var result = httpClientHelper.GetHttpClient().PostAsync(url, stringContent).Result; 69 | result.EnsureSuccessStatusCode(); 70 | 71 | var responseBody = result.Content.ReadAsStringAsync().Result; 72 | var response = JsonConvert.DeserializeObject(responseBody); 73 | if (response.Success 74 | && response.Data != null 75 | && response.Data is JToken responseData) 76 | { 77 | assetVersionList = responseData.ToObject>(); 78 | } 79 | 80 | return assetVersionList; 81 | } 82 | 83 | internal static string GetAssetReleaseDetails( 84 | this HttpClientHelper httpClientHelper, 85 | string releaseDetailsLink) 86 | { 87 | if (string.IsNullOrEmpty(releaseDetailsLink)) 88 | { 89 | return string.Empty; 90 | } 91 | 92 | var url = httpClientHelper.GetDownloadReleaseDetailsForAssetUrl(releaseDetailsLink); 93 | var result = httpClientHelper.GetHttpClient().GetAsync(url).Result; 94 | result.EnsureSuccessStatusCode(); 95 | 96 | var responseBody = result.Content.ReadAsStringAsync().Result; 97 | var response = JsonConvert.DeserializeObject(responseBody); 98 | if (response.Success 99 | && response.Data != null 100 | && response.Data is JToken responseData) 101 | { 102 | var releaseNotesLink = responseData["RedirectLink"].ToString(); 103 | var releaseNotes = httpClientHelper.GetHttpClient().GetAsync(releaseNotesLink).Result; 104 | return releaseNotes.Content.ReadAsStringAsync().Result; 105 | } 106 | 107 | return string.Empty; 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /2LCS/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | True 27 | 28 | 29 | False 30 | 31 | 32 | 33 | 34 | 35 | False 36 | 37 | 38 | 39 | 40 | 41 | False 42 | 43 | 44 | False 45 | 46 | 47 | False 48 | 49 | 50 | False 51 | 52 | 53 | False 54 | 55 | 56 | False 57 | 58 | 59 | https://lcs.dynamics.com 60 | 61 | 62 | https://diag.lcs.dynamics.com 63 | 64 | 65 | https://update.lcs.dynamics.com 66 | 67 | 68 | https://fix.lcs.dynamics.com 69 | 70 | 71 | False 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /2LCS/Forms/CookieEdit.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace LCS.Forms 2 | { 3 | partial class CookieEdit 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.cookieTextBox = new System.Windows.Forms.TextBox(); 32 | this.okButton = new System.Windows.Forms.Button(); 33 | this.cancelButton = new System.Windows.Forms.Button(); 34 | this.cookieLabel = new System.Windows.Forms.Label(); 35 | this.SuspendLayout(); 36 | // 37 | // cookieTextBox 38 | // 39 | this.cookieTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 40 | | System.Windows.Forms.AnchorStyles.Right))); 41 | this.cookieTextBox.Location = new System.Drawing.Point(12, 34); 42 | this.cookieTextBox.Multiline = true; 43 | this.cookieTextBox.Name = "cookieTextBox"; 44 | this.cookieTextBox.Size = new System.Drawing.Size(644, 101); 45 | this.cookieTextBox.TabIndex = 0; 46 | // 47 | // okButton 48 | // 49 | this.okButton.Anchor = System.Windows.Forms.AnchorStyles.Bottom; 50 | this.okButton.Location = new System.Drawing.Point(142, 141); 51 | this.okButton.Name = "okButton"; 52 | this.okButton.Size = new System.Drawing.Size(182, 33); 53 | this.okButton.TabIndex = 2; 54 | this.okButton.Text = "OK"; 55 | this.okButton.UseVisualStyleBackColor = true; 56 | this.okButton.Click += new System.EventHandler(this.OkButton_Click); 57 | // 58 | // cancelButton 59 | // 60 | this.cancelButton.Anchor = System.Windows.Forms.AnchorStyles.Bottom; 61 | this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; 62 | this.cancelButton.Location = new System.Drawing.Point(330, 141); 63 | this.cancelButton.Name = "cancelButton"; 64 | this.cancelButton.Size = new System.Drawing.Size(172, 33); 65 | this.cancelButton.TabIndex = 3; 66 | this.cancelButton.Text = "Cancel"; 67 | this.cancelButton.UseVisualStyleBackColor = true; 68 | this.cancelButton.Click += new System.EventHandler(this.CancelButton_Click); 69 | // 70 | // cookieLabel 71 | // 72 | this.cookieLabel.AutoSize = true; 73 | this.cookieLabel.Location = new System.Drawing.Point(13, 11); 74 | this.cookieLabel.Name = "cookieLabel"; 75 | this.cookieLabel.Size = new System.Drawing.Size(58, 20); 76 | this.cookieLabel.TabIndex = 4; 77 | this.cookieLabel.Text = "Cookie"; 78 | // 79 | // CookieEdit 80 | // 81 | this.AcceptButton = this.okButton; 82 | this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); 83 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 84 | this.CancelButton = this.cancelButton; 85 | this.ClientSize = new System.Drawing.Size(668, 186); 86 | this.Controls.Add(this.cookieLabel); 87 | this.Controls.Add(this.cancelButton); 88 | this.Controls.Add(this.okButton); 89 | this.Controls.Add(this.cookieTextBox); 90 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; 91 | this.Icon = global::LCS.Properties.Resources.favicon_blue; 92 | this.MaximizeBox = false; 93 | this.MinimizeBox = false; 94 | this.Name = "CookieEdit"; 95 | this.ShowInTaskbar = false; 96 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; 97 | this.Text = "LCS cookie"; 98 | this.Load += new System.EventHandler(this.CookieEdit_Load); 99 | this.ResumeLayout(false); 100 | this.PerformLayout(); 101 | 102 | } 103 | 104 | #endregion 105 | 106 | private System.Windows.Forms.TextBox cookieTextBox; 107 | private System.Windows.Forms.Button okButton; 108 | private System.Windows.Forms.Button cancelButton; 109 | private System.Windows.Forms.Label cookieLabel; 110 | } 111 | } -------------------------------------------------------------------------------- /2LCS/2LCS.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net8.0-windows7.0 4 | WinExe 5 | LCS 6 | false 7 | 2d4f869a87b44c629f8f8c2f36ed4f54 8 | publish\ 9 | true 10 | Disk 11 | false 12 | Foreground 13 | 7 14 | Days 15 | false 16 | false 17 | true 18 | 0 19 | 1.0.0.%2a 20 | false 21 | true 22 | true 23 | true 24 | true 25 | true 26 | 10.0 27 | 28 | 29 | 30 | 31 | 32 | 33 | favicon-white.ico 34 | 35 | 36 | LCS.Program 37 | 2LCS 38 | Microsoft 39 | 2LCS 40 | 0.42.0 41 | Copyright © 2023 42 | This small utility can help you manage D365FO instances deployed in your LCS project. Both cloud-hosted - in your Azure subscription and Microsoft-hosted sandboxes. It offers only a subset of functionalities that LCS offers, but you can execute them a bit faster. 43 | https://github.com/microsoft/2LCS 44 | https://github.com/microsoft/2LCS 45 | 46 | 47 | 48 | Component 49 | 50 | 51 | True 52 | True 53 | Settings.settings 54 | 55 | 56 | PreserveNewest 57 | 58 | 59 | SettingsSingleFileGenerator 60 | Settings.Designer.cs 61 | 62 | 63 | 64 | 65 | False 66 | Microsoft .NET Framework 4.6.1 %28x86 and x64%29 67 | true 68 | 69 | 70 | False 71 | .NET Framework 3.5 SP1 72 | false 73 | 74 | 75 | 76 | 77 | {EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B} 78 | 1 79 | 1 80 | 0 81 | tlbimp 82 | False 83 | True 84 | 85 | 86 | 87 | 88 | 89 | 90 | PreserveNewest 91 | 92 | 93 | 94 | 95 | 96 | 33.0.1 97 | 98 | 99 | 3.0.23523.1209 100 | 101 | 102 | 1.11.72 103 | 104 | 105 | 106 | 107 | 1.6.1 108 | 109 | 110 | 111 | 112 | 113 | 114 | -------------------------------------------------------------------------------- /2LCS/Forms/Parameters.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | using LCS.Cache; 4 | 5 | namespace LCS.Forms 6 | { 7 | public partial class Parameters : Form 8 | { 9 | public Parameters() 10 | { 11 | InitializeComponent(); 12 | } 13 | 14 | public bool Autorefresh { get; private set; } 15 | public bool Cancelled { get; private set; } 16 | public bool CachingEnabled { get; private set; } 17 | public bool StoreCache { get; private set; } 18 | 19 | private void CancelButton_Click(object sender, EventArgs e) 20 | { 21 | Close(); 22 | } 23 | 24 | private void OkButton_Click(object sender, EventArgs e) 25 | { 26 | SetParameters(); 27 | Close(); 28 | } 29 | 30 | private void Parameters_Load(object sender, EventArgs e) 31 | { 32 | LoadParameters(); 33 | } 34 | 35 | private void LoadParameters() 36 | { 37 | AutoRefreshCheckBox.Checked = Properties.Settings.Default.autorefresh; 38 | minimizeToNotificationArea.Checked = Properties.Settings.Default.minimizeToNotificationArea; 39 | textBoxProjectExcl.Text = Properties.Settings.Default.projOrgExcl; 40 | RDPCredentialsCheckbox.Checked = Properties.Settings.Default.RDPCredentialsEnabled; 41 | LocalCredentialsCheckbox.Checked = Properties.Settings.Default.LocalCredentialsEnabled; 42 | CachingEnabledCheckbox.Checked = Properties.Settings.Default.cachingEnabled; 43 | StoreCacheCheckBox.Checked = Properties.Settings.Default.keepCache; 44 | alwaysLogAsAdmin.Checked = Properties.Settings.Default.alwaysLogAsAdmin; 45 | uriSchemeEnabled.Checked = Properties.Settings.Default.uriSchemeEnabled; 46 | textBoxLcsUrl.Text = Properties.Settings.Default.lcsURL; 47 | textBoxLcsUpdateUrl.Text = Properties.Settings.Default.lcsUpdateURL; 48 | textBoxLcsDiagUrl.Text = Properties.Settings.Default.lcsDiagURL; 49 | textBoxLcsFixUrl.Text = Properties.Settings.Default.lcsFixURL; 50 | addExternalIpAddress.Checked = Properties.Settings.Default.populateOwnIPForNSG; 51 | 52 | SetStoreCacheEnabledDisabled(); 53 | } 54 | 55 | private void SetParameters() 56 | { 57 | Properties.Settings.Default.autorefresh = AutoRefreshCheckBox.Checked; 58 | Properties.Settings.Default.minimizeToNotificationArea = minimizeToNotificationArea.Checked; 59 | Properties.Settings.Default.projOrgExcl = textBoxProjectExcl.Text; 60 | Properties.Settings.Default.RDPCredentialsEnabled = RDPCredentialsCheckbox.Checked; 61 | Properties.Settings.Default.LocalCredentialsEnabled = LocalCredentialsCheckbox.Checked; 62 | Properties.Settings.Default.cachingEnabled = CachingEnabledCheckbox.Checked; 63 | Properties.Settings.Default.keepCache = StoreCacheCheckBox.Checked; 64 | Properties.Settings.Default.alwaysLogAsAdmin = alwaysLogAsAdmin.Checked; 65 | Properties.Settings.Default.uriSchemeEnabled = uriSchemeEnabled.Checked; 66 | Properties.Settings.Default.lcsURL = textBoxLcsUrl.Text; 67 | Properties.Settings.Default.lcsUpdateURL = textBoxLcsUpdateUrl.Text; 68 | Properties.Settings.Default.lcsDiagURL = textBoxLcsDiagUrl.Text; 69 | Properties.Settings.Default.lcsFixURL = textBoxLcsFixUrl.Text; 70 | Properties.Settings.Default.populateOwnIPForNSG = addExternalIpAddress.Checked; 71 | 72 | Properties.Settings.Default.Save(); 73 | } 74 | 75 | private void CachingEnabledCheckbox_CheckedChanged(object sender, EventArgs e) 76 | { 77 | SetStoreCacheEnabledDisabled(); 78 | } 79 | 80 | private void SetStoreCacheEnabledDisabled() 81 | { 82 | if (CachingEnabledCheckbox.Checked) 83 | { 84 | StoreCacheCheckBox.Enabled = true; 85 | } 86 | else 87 | { 88 | StoreCacheCheckBox.Enabled = false; 89 | StoreCacheCheckBox.Checked = false; 90 | CredentialsCacheHelper.DisableCache(); 91 | } 92 | } 93 | 94 | private void ClearCacheButton_Click(object sender, EventArgs e) 95 | { 96 | var result = CredentialsCacheHelper.ClearCache(); 97 | 98 | if (result != null) 99 | { 100 | MessageBox.Show(string.Format("Error while trying to clear cache, caching disabled.\n {0}", result), "Error"); 101 | } 102 | } 103 | 104 | private void OnUriSchemeEnabledCheckedChanged(object sender, EventArgs e) 105 | { 106 | if (Properties.Settings.Default.uriSchemeEnabled != uriSchemeEnabled.Checked) 107 | { 108 | try 109 | { 110 | bool success = false; 111 | if (uriSchemeEnabled.Checked) 112 | { 113 | success = URIHandler.RegisterHandler(); 114 | } 115 | else 116 | { 117 | success = URIHandler.RemoveHandler(); 118 | } 119 | if (success) 120 | { 121 | SetParameters(); 122 | } 123 | } 124 | finally 125 | { 126 | LoadParameters(); 127 | } 128 | } 129 | } 130 | } 131 | } -------------------------------------------------------------------------------- /2LCS/Forms/AddNSG.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /2LCS/Forms/Login.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /2LCS/Forms/CookieEdit.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /2LCS/Forms/Credentials.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /2LCS/Forms/ChooseService.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /2LCS/Forms/Parameters.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /2LCS/Forms/AddNSG.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace LCS.Forms 2 | { 3 | partial class AddNsg 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.textBox1 = new System.Windows.Forms.TextBox(); 32 | this.button1 = new System.Windows.Forms.Button(); 33 | this.cancelButton = new System.Windows.Forms.Button(); 34 | this.label1 = new System.Windows.Forms.Label(); 35 | this.label2 = new System.Windows.Forms.Label(); 36 | this.textBox2 = new System.Windows.Forms.TextBox(); 37 | this.SuspendLayout(); 38 | // 39 | // textBox1 40 | // 41 | this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 42 | | System.Windows.Forms.AnchorStyles.Right))); 43 | this.textBox1.Location = new System.Drawing.Point(12, 34); 44 | this.textBox1.Name = "textBox1"; 45 | this.textBox1.Size = new System.Drawing.Size(644, 26); 46 | this.textBox1.TabIndex = 0; 47 | // 48 | // button1 49 | // 50 | this.button1.Anchor = System.Windows.Forms.AnchorStyles.Bottom; 51 | this.button1.Location = new System.Drawing.Point(142, 141); 52 | this.button1.Name = "button1"; 53 | this.button1.Size = new System.Drawing.Size(182, 33); 54 | this.button1.TabIndex = 2; 55 | this.button1.Text = "OK"; 56 | this.button1.UseVisualStyleBackColor = true; 57 | this.button1.Click += new System.EventHandler(this.Button1_Click); 58 | // 59 | // cancelButton 60 | // 61 | this.cancelButton.Anchor = System.Windows.Forms.AnchorStyles.Bottom; 62 | this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; 63 | this.cancelButton.Location = new System.Drawing.Point(330, 141); 64 | this.cancelButton.Name = "cancelButton"; 65 | this.cancelButton.Size = new System.Drawing.Size(172, 33); 66 | this.cancelButton.TabIndex = 3; 67 | this.cancelButton.Text = "Cancel"; 68 | this.cancelButton.UseVisualStyleBackColor = true; 69 | this.cancelButton.Click += new System.EventHandler(this.CancelButton_Click); 70 | // 71 | // label1 72 | // 73 | this.label1.AutoSize = true; 74 | this.label1.Location = new System.Drawing.Point(13, 11); 75 | this.label1.Name = "label1"; 76 | this.label1.Size = new System.Drawing.Size(173, 20); 77 | this.label1.TabIndex = 4; 78 | this.label1.Text = "Rule name (no spaces)"; 79 | // 80 | // label2 81 | // 82 | this.label2.AutoSize = true; 83 | this.label2.Location = new System.Drawing.Point(13, 76); 84 | this.label2.Name = "label2"; 85 | this.label2.Size = new System.Drawing.Size(147, 20); 86 | this.label2.TabIndex = 5; 87 | this.label2.Text = "IP address or CIDR"; 88 | // 89 | // textBox2 90 | // 91 | this.textBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 92 | | System.Windows.Forms.AnchorStyles.Right))); 93 | this.textBox2.Location = new System.Drawing.Point(12, 99); 94 | this.textBox2.Name = "textBox2"; 95 | this.textBox2.Size = new System.Drawing.Size(644, 26); 96 | this.textBox2.TabIndex = 1; 97 | // 98 | // AddNSG 99 | // 100 | this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); 101 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 102 | this.CancelButton = this.cancelButton; 103 | this.ClientSize = new System.Drawing.Size(668, 186); 104 | this.Controls.Add(this.textBox2); 105 | this.Controls.Add(this.label2); 106 | this.Controls.Add(this.label1); 107 | this.Controls.Add(this.cancelButton); 108 | this.Controls.Add(this.button1); 109 | this.Controls.Add(this.textBox1); 110 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; 111 | this.Icon = global::LCS.Properties.Resources.favicon_blue; 112 | this.MaximizeBox = false; 113 | this.MinimizeBox = false; 114 | this.Name = "AddNsg"; 115 | this.ShowInTaskbar = false; 116 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; 117 | this.Text = "Add firewall exception"; 118 | this.ResumeLayout(false); 119 | this.PerformLayout(); 120 | 121 | } 122 | 123 | #endregion 124 | 125 | private System.Windows.Forms.TextBox textBox1; 126 | private System.Windows.Forms.Button button1; 127 | private System.Windows.Forms.Button cancelButton; 128 | private System.Windows.Forms.Label label1; 129 | private System.Windows.Forms.Label label2; 130 | private System.Windows.Forms.TextBox textBox2; 131 | } 132 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.suo 8 | *.user 9 | *.userosscache 10 | *.sln.docstates 11 | 12 | # User-specific files (MonoDevelop/Xamarin Studio) 13 | *.userprefs 14 | 15 | # Build results 16 | [Dd]ebug/ 17 | [Dd]ebugPublic/ 18 | [Rr]elease/ 19 | [Rr]eleases/ 20 | x64/ 21 | x86/ 22 | bld/ 23 | [Bb]in/ 24 | [Oo]bj/ 25 | [Ll]og/ 26 | 27 | # Visual Studio 2015 cache/options directory 28 | .vs/ 29 | # Uncomment if you have tasks that create the project's static files in wwwroot 30 | #wwwroot/ 31 | 32 | # MSTest test Results 33 | [Tt]est[Rr]esult*/ 34 | [Bb]uild[Ll]og.* 35 | 36 | # NUNIT 37 | *.VisualState.xml 38 | TestResult.xml 39 | 40 | # Build Results of an ATL Project 41 | [Dd]ebugPS/ 42 | [Rr]eleasePS/ 43 | dlldata.c 44 | 45 | # .NET Core 46 | project.lock.json 47 | project.fragment.lock.json 48 | artifacts/ 49 | **/Properties/launchSettings.json 50 | 51 | *_i.c 52 | *_p.c 53 | *_i.h 54 | *.ilk 55 | *.meta 56 | *.obj 57 | *.pch 58 | *.pdb 59 | *.pgc 60 | *.pgd 61 | *.rsp 62 | *.sbr 63 | *.tlb 64 | *.tli 65 | *.tlh 66 | *.tmp 67 | *.tmp_proj 68 | *.log 69 | *.vspscc 70 | *.vssscc 71 | .builds 72 | *.pidb 73 | *.svclog 74 | *.scc 75 | 76 | # Chutzpah Test files 77 | _Chutzpah* 78 | 79 | # Visual C++ cache files 80 | ipch/ 81 | *.aps 82 | *.ncb 83 | *.opendb 84 | *.opensdf 85 | *.sdf 86 | *.cachefile 87 | *.VC.db 88 | *.VC.VC.opendb 89 | 90 | # Visual Studio profiler 91 | *.psess 92 | *.vsp 93 | *.vspx 94 | *.sap 95 | 96 | # TFS 2012 Local Workspace 97 | $tf/ 98 | 99 | # Guidance Automation Toolkit 100 | *.gpState 101 | 102 | # ReSharper is a .NET coding add-in 103 | _ReSharper*/ 104 | *.[Rr]e[Ss]harper 105 | *.DotSettings.user 106 | 107 | # JustCode is a .NET coding add-in 108 | .JustCode 109 | 110 | # TeamCity is a build add-in 111 | _TeamCity* 112 | 113 | # DotCover is a Code Coverage Tool 114 | *.dotCover 115 | 116 | # Visual Studio code coverage results 117 | *.coverage 118 | *.coveragexml 119 | 120 | # NCrunch 121 | _NCrunch_* 122 | .*crunch*.local.xml 123 | nCrunchTemp_* 124 | 125 | # MightyMoose 126 | *.mm.* 127 | AutoTest.Net/ 128 | 129 | # Web workbench (sass) 130 | .sass-cache/ 131 | 132 | # Installshield output folder 133 | [Ee]xpress/ 134 | 135 | # DocProject is a documentation generator add-in 136 | DocProject/buildhelp/ 137 | DocProject/Help/*.HxT 138 | DocProject/Help/*.HxC 139 | DocProject/Help/*.hhc 140 | DocProject/Help/*.hhk 141 | DocProject/Help/*.hhp 142 | DocProject/Help/Html2 143 | DocProject/Help/html 144 | 145 | # Click-Once directory 146 | publish/ 147 | 148 | # Publish Web Output 149 | *.[Pp]ublish.xml 150 | *.azurePubxml 151 | # TODO: Comment the next line if you want to checkin your web deploy settings 152 | # but database connection strings (with potential passwords) will be unencrypted 153 | *.pubxml 154 | *.publishproj 155 | 156 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 157 | # checkin your Azure Web App publish settings, but sensitive information contained 158 | # in these scripts will be unencrypted 159 | PublishScripts/ 160 | 161 | # NuGet Packages 162 | *.nupkg 163 | # The packages folder can be ignored because of Package Restore 164 | **/packages/* 165 | # except build/, which is used as an MSBuild target. 166 | !**/packages/build/ 167 | # Uncomment if necessary however generally it will be regenerated when needed 168 | #!**/packages/repositories.config 169 | # NuGet v3's project.json files produces more ignorable files 170 | *.nuget.props 171 | *.nuget.targets 172 | 173 | # Microsoft Azure Build Output 174 | csx/ 175 | *.build.csdef 176 | 177 | # Microsoft Azure Emulator 178 | ecf/ 179 | rcf/ 180 | 181 | # Windows Store app package directories and files 182 | AppPackages/ 183 | BundleArtifacts/ 184 | Package.StoreAssociation.xml 185 | _pkginfo.txt 186 | 187 | # Visual Studio cache files 188 | # files ending in .cache can be ignored 189 | *.[Cc]ache 190 | # but keep track of directories ending in .cache 191 | !*.[Cc]ache/ 192 | 193 | # Others 194 | ClientBin/ 195 | ~$* 196 | *~ 197 | *.dbmdl 198 | *.dbproj.schemaview 199 | *.jfm 200 | *.pfx 201 | *.publishsettings 202 | orleans.codegen.cs 203 | 204 | # Since there are multiple workflows, uncomment next line to ignore bower_components 205 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 206 | #bower_components/ 207 | 208 | # RIA/Silverlight projects 209 | Generated_Code/ 210 | 211 | # Backup & report files from converting an old project file 212 | # to a newer Visual Studio version. Backup files are not needed, 213 | # because we have git ;-) 214 | _UpgradeReport_Files/ 215 | Backup*/ 216 | UpgradeLog*.XML 217 | UpgradeLog*.htm 218 | 219 | # SQL Server files 220 | *.mdf 221 | *.ldf 222 | *.ndf 223 | 224 | # Business Intelligence projects 225 | *.rdl.data 226 | *.bim.layout 227 | *.bim_*.settings 228 | 229 | # Microsoft Fakes 230 | FakesAssemblies/ 231 | 232 | # GhostDoc plugin setting file 233 | *.GhostDoc.xml 234 | 235 | # Node.js Tools for Visual Studio 236 | .ntvs_analysis.dat 237 | node_modules/ 238 | 239 | # Typescript v1 declaration files 240 | typings/ 241 | 242 | # Visual Studio 6 build log 243 | *.plg 244 | 245 | # Visual Studio 6 workspace options file 246 | *.opt 247 | 248 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 249 | *.vbw 250 | 251 | # Visual Studio LightSwitch build output 252 | **/*.HTMLClient/GeneratedArtifacts 253 | **/*.DesktopClient/GeneratedArtifacts 254 | **/*.DesktopClient/ModelManifest.xml 255 | **/*.Server/GeneratedArtifacts 256 | **/*.Server/ModelManifest.xml 257 | _Pvt_Extensions 258 | 259 | # Paket dependency manager 260 | .paket/paket.exe 261 | paket-files/ 262 | 263 | # FAKE - F# Make 264 | .fake/ 265 | 266 | # JetBrains Rider 267 | .idea/ 268 | *.sln.iml 269 | 270 | # CodeRush 271 | .cr/ 272 | 273 | # Python Tools for Visual Studio (PTVS) 274 | __pycache__/ 275 | *.pyc 276 | 277 | # Cake - Uncomment if you are using it 278 | # tools/** 279 | # !tools/packages.config 280 | 281 | # Telerik's JustMock configuration file 282 | *.jmconfig 283 | 284 | # BizTalk build output 285 | *.btp.cs 286 | *.btm.cs 287 | *.odx.cs 288 | *.xsd.cs 289 | -------------------------------------------------------------------------------- /2LCS/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 122 | ..\favicon-blue.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 123 | 124 | 125 | ..\favicon-white.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 126 | 127 | -------------------------------------------------------------------------------- /2LCS/Forms/ChooseProject.cs: -------------------------------------------------------------------------------- 1 | using LCS.JsonObjects; 2 | using Newtonsoft.Json; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Linq.Dynamic.Core; 7 | using System.Threading.Tasks; 8 | using System.Windows.Forms; 9 | 10 | namespace LCS.Forms 11 | { 12 | public partial class ChooseProject : Form 13 | { 14 | public List Projects; 15 | private const int CpNocloseButton = 0x200; 16 | private readonly BindingSource _projectsSource = new BindingSource(); 17 | private bool _sortAscending; 18 | 19 | public ChooseProject() 20 | { 21 | InitializeComponent(); 22 | } 23 | 24 | internal bool Cancelled { get; private set; } 25 | internal HttpClientHelper HttpClientHelper { get; set; } 26 | internal LcsProject LcsProject { get; private set; } 27 | 28 | protected override CreateParams CreateParams 29 | { 30 | get 31 | { 32 | var myCp = base.CreateParams; 33 | myCp.ClassStyle |= CpNocloseButton; 34 | return myCp; 35 | } 36 | } 37 | 38 | private void CancelButton_Click(object sender, EventArgs e) 39 | { 40 | Cancelled = true; 41 | Close(); 42 | } 43 | 44 | private void ChooseProject_Load(object sender, EventArgs e) 45 | { 46 | projectsDataGridView.AutoGenerateColumns = false; 47 | if (!SystemInformation.TerminalServerSession) 48 | { 49 | var dgvType = projectsDataGridView.GetType(); 50 | var pi = dgvType.GetProperty("DoubleBuffered", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic); 51 | if (pi != null) pi.SetValue(projectsDataGridView, true, null); 52 | } 53 | projectsDataGridView.DataSource = _projectsSource; 54 | Projects = JsonConvert.DeserializeObject>(Properties.Settings.Default.projects); 55 | if (Projects != null) 56 | { 57 | _projectsSource.DataSource = Projects.OrderBy(f => f.Favorite).ThenBy(i => i.Id).Reverse(); 58 | } 59 | } 60 | 61 | private void OkButton_Click(object sender, EventArgs e) 62 | { 63 | if (projectsDataGridView.SelectedRows.Count > 0) 64 | { 65 | LcsProject = (LcsProject)projectsDataGridView.SelectedRows[0].DataBoundItem; 66 | if (LcsProject.RequestPending == true) 67 | { 68 | MessageBox.Show($"Invitation to the project {LcsProject.Name} has not been completed yet for your user account.\n\nVisit LCS and accept invitation first!", "Warning! Action needed."); 69 | return; 70 | } 71 | UpdateProjectLinks(); 72 | } 73 | else 74 | { 75 | Cancelled = true; 76 | } 77 | Close(); 78 | } 79 | 80 | private void ProjectsDataGridView_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) 81 | { 82 | if (projectsDataGridView.SelectedRows.Count > 0) 83 | { 84 | LcsProject = (LcsProject)projectsDataGridView.SelectedRows[0].DataBoundItem; 85 | if (LcsProject.RequestPending == true) 86 | { 87 | MessageBox.Show($"Invitation to the project {LcsProject.Name} has not been completed yet for your user account.\n\nVisit LCS and accept invitation first!", "Warning! Action needed."); 88 | return; 89 | } 90 | UpdateProjectLinks(); 91 | } 92 | else 93 | { 94 | Cancelled = true; 95 | } 96 | Close(); 97 | } 98 | 99 | private void ProjectsDataGridView_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e) 100 | { 101 | if (projectsDataGridView.DataSource == null) return; 102 | _projectsSource.DataSource = _sortAscending ? Projects.AsQueryable().OrderBy(projectsDataGridView.Columns[e.ColumnIndex].DataPropertyName).ToList() : Projects.AsQueryable().OrderBy(projectsDataGridView.Columns[e.ColumnIndex].DataPropertyName).Reverse().ToList(); 103 | _sortAscending = !_sortAscending; 104 | } 105 | 106 | private async void RefreshButton_Click(object sender, EventArgs e) 107 | { 108 | var refreshButtonText = refreshButton.Text; 109 | refreshButton.Enabled = false; 110 | refreshButton.Text = "Refreshing..."; 111 | await RefreshProjectsAsync(); 112 | refreshButton.Text = refreshButtonText; 113 | refreshButton.Enabled = true; 114 | } 115 | 116 | private async Task RefreshProjectsAsync() 117 | { 118 | var favoritesSaved = new List(); 119 | if (Projects != null) 120 | { 121 | favoritesSaved = Projects.Where(x => x.Favorite == true).ToList(); 122 | } 123 | Projects = await HttpClientHelper.GetAllProjectsAsync(); 124 | foreach (var savedProject in favoritesSaved) 125 | { 126 | Projects.Where(newProject => newProject.Id == savedProject.Id) 127 | .Select(newProject => { newProject.Favorite = true; return newProject; }) 128 | .ToList(); 129 | } 130 | _projectsSource.DataSource = Projects.OrderBy(f => f.Favorite).ThenBy(i => i.Id).Reverse(); 131 | _projectsSource.ResetBindings(false); 132 | } 133 | 134 | private void UpdateProjectLinks() 135 | { 136 | var projectDetails = HttpClientHelper.GetProject(LcsProject.Id.ToString()); 137 | if (projectDetails != null) 138 | { 139 | var project = Projects.FirstOrDefault(prj => prj.Id == LcsProject.Id); 140 | project.SharepointSite = projectDetails.Settings.SharepointSite; 141 | project.TfsServerSite = projectDetails.Settings.TfsServerSite; 142 | project.TfsProjectName = projectDetails.Settings.TfsProjectName; 143 | Properties.Settings.Default.projects = JsonConvert.SerializeObject(Projects, new JsonSerializerSettings { TypeNameHandling = TypeNameHandling.Auto }); 144 | Properties.Settings.Default.Save(); 145 | 146 | LcsProject.SharepointSite = projectDetails.Settings.SharepointSite; 147 | LcsProject.TfsServerSite = projectDetails.Settings.TfsServerSite; 148 | LcsProject.TfsProjectName = projectDetails.Settings.TfsProjectName; 149 | } 150 | } 151 | } 152 | } -------------------------------------------------------------------------------- /2LCS/Forms/ChooseNSG.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | True 122 | 123 | 124 | True 125 | 126 | 127 | True 128 | 129 | 130 | True 131 | 132 | -------------------------------------------------------------------------------- /2LCS/Forms/EnvironmentChanges.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | True 122 | 123 | 124 | True 125 | 126 | 127 | True 128 | 129 | 130 | True 131 | 132 | 133 | True 134 | 135 | -------------------------------------------------------------------------------- /2LCS/Forms/CustomLinks.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | True 122 | 123 | 124 | True 125 | 126 | 127 | 17, 17 128 | 129 | 130 | You can add placeholders for the following variables: 131 | 132 | %%AosUrl%% 133 | %%PosUrl%% 134 | %%RetailStorefront%% 135 | %%RetailServer%% 136 | %%EnvironmentId%% 137 | %%AzureSubscriptionId%% 138 | %%InstanceId%% 139 | %%DisplayName%% 140 | %%TopologyName%% 141 | %%TopologyType%% 142 | %%CurrentPlatformVersion%% 143 | %%CurrentPlatformReleaseName%% 144 | %%TopologyVersion%% 145 | %%ActivityId%% 146 | %%BuildNumber%% 147 | %%BuildInfo%% 148 | 149 | -------------------------------------------------------------------------------- /2LCS/Forms/ChooseMachine.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | True 122 | 123 | 124 | True 125 | 126 | 127 | True 128 | 129 | 130 | True 131 | 132 | 133 | True 134 | 135 | 136 | True 137 | 138 | -------------------------------------------------------------------------------- /2LCS/Forms/AvailableKBs.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | True 122 | 123 | 124 | True 125 | 126 | 127 | True 128 | 129 | 130 | True 131 | 132 | 133 | True 134 | 135 | 136 | True 137 | 138 | --------------------------------------------------------------------------------