public void GetAuthTokenByPage(KeyValuePair <LGMServiceType, string> item) { //string updatedUrl = FormatUrl(item.Key); string result = string.Empty; string updatedUrl = string.Empty; using (IApiPage page = APIFactory.ApiFactory <IApiPage>(item.Key, Settings)) { updatedUrl = FormatUrl(page.ServiceName, Settings); // IApiPage i = new LGMFiltersService(); if (!string.IsNullOrEmpty(updatedUrl)) { //Dictionary<string, string> parms = new Dictionary<string, string>() //{ // { "url", updatedUrl }, // { "username", Settings.UserName }, // { "password", Settings.Password }, //}; result = page.GetAuthInfo(updatedUrl); //result = LGApitAction.GetAuthInfo(updatedUrl, Settings.UserName, Settings.Password); //result = LGApitAction.GetAuthInfo(updatedUrl, Settings.UserName, Settings.Password); //AuthTokens.Add(item.Key.ToString(), result.Trim('"')); } } //NUnit.Framework.Internal.TestExecutionContext t = PropertyHelper.GetPrivateFieldValue<NUnit.Framework.Internal.TestExecutionContext>(TestContext.CurrentContext, "_testExecuteContext"); Assert.IsFalse(string.IsNullOrWhiteSpace(result)); Console.WriteLine($"Url: {updatedUrl}"); Console.WriteLine($"Result: {result}"); Console.WriteLine("\r\n"); }
public void Start() { if (!IConfigurationStore.GetByType <WebPageConfig>().EnableThreadPage) { return; } this.Page = IApiPage.Create("Thread CPU Usage", Color.Aqua, IConfigurationStore.GetByType <WebPageConfig>().ThreadPageHandle); var tmr = new System.Timers.Timer(1000) { AutoReset = true }; tmr.Elapsed += Tick; tmr.Start(); }
public void Start() { if (!IConfigurationStore.GetByType <WebPageConfig>().EnableExceptionsPage) { return; } AppDomain.CurrentDomain.FirstChanceException += OnException; this.Page = IApiPage.Create( "Exceptions / second", Color.Red, IConfigurationStore.GetByType <WebPageConfig>().ExceptionsPageHandle); var tmr = new Timer(1000) { AutoReset = true }; tmr.Elapsed += Tick; tmr.Start(); }