//Parse private void ParseRSS() { try { XmlDocument rssXmlDoc = new XmlDocument(); // Load the RSS file from the RSS URL rssXmlDoc.Load(URL); //Store initial values - title and link XmlNode TL = rssXmlDoc.SelectSingleNode("rss/channel"); this.Title = TL.SelectSingleNode("title").InnerText.Trim(); this.Link = TL.SelectSingleNode("link").InnerText.Trim(); this.Language = TL.SelectSingleNode("language").InnerText.Trim(); this.PublishedDate = TL.SelectSingleNode("pubDate").InnerText.Trim(); this.LastBuildDate = TL.SelectSingleNode("lastBuildDate").InnerText.Trim(); // Parse the Items in the RSS file XmlNodeList rssNodes = rssXmlDoc.SelectNodes("rss/channel/item"); foreach (XmlNode rssNode in rssNodes) { //Title XmlNode rssSubNode = rssNode.SelectSingleNode("title"); string title = rssSubNode != null ? rssSubNode.InnerText : ""; //Link/Url rssSubNode = rssNode.SelectSingleNode("link"); string link = rssSubNode != null ? rssSubNode.InnerText : ""; link = ParseLink(link); Titles.Add(title); URLs.Add(link); TitlesURLs.Add(title + " - " + link); } } catch (Exception e) { throw e; } }
private void DownloadFiles() { var client = new WebClient(); foreach (var url in URLs) { var fileName = url.Substring(url.LastIndexOf('/') + 1); var localPath = Path.GetFullPath(Path.Combine(ComponentManager.BasePath ?? "", ComponentManager.PATH_COMPONENTS, fileName)); try { client.DownloadFile(new Uri(url), localPath); if (url != URLs.First()) { var factory = ComponentManager.LoadFactory(localPath); if (factory != null) { ComponentManager.ComponentFactories.Add(fileName, factory); } } } catch (WebException) { Log.Error("Error downloading file from " + url); } } if (Type == AutoSplitterType.Component) { var factory = ComponentManager.LoadFactory(LocalPath); ComponentManager.ComponentFactories.Add(Path.GetFileName(LocalPath), factory); } }
public void NavigationMenu_Test() { IWebDriver driver = DriverUtils.CreateDriver(); driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5); TestWrapper.Test(driver, () => { // Open Landing Page URLs.OpenUrl(driver); var navigationMenu = new Navigation_Menu(driver); var aboutMePage = navigationMenu.ClickAboutMeLink(); aboutMePage.GetHeaderText().ShouldBe("About Me", "About Me"); var contactsPage = navigationMenu.ClickContactMeLink(); contactsPage.GetHeaderText().ShouldBe("Contact Me", "Contact Me"); var picturesPage = navigationMenu.ClickPicturesLink(); picturesPage.GetHeaderText().ShouldBe("Pictures", "Pictures"); var pricesPage = navigationMenu.ClickPricesLink(); pricesPage.GetHeaderTitle().ShouldBe("Prices", "Prices"); var careRequestPage = navigationMenu.ClickCareRequestLink(); careRequestPage.GetHeaderText().ShouldBe("Care Request", "Care Request"); }); }
/* * Go throught all possible two char combinations and query server * Result is DB with all characters from server * Filled informations * - Name, Level, ClassId, GenderId, RaceId, FactionId, Guild, LastRefresh * Missing informations * - AP, HK * ForceUpdate = true */ public async Task MakeCharacterNameListAsync(IProgress <Tuple <int, string> > progres) { DateTime start = DateTime.Now; Downloader <Character> d = new Downloader <Character>(this._concurrency, Parser.CharacterNameListParser, DBAccess.SaveCharacterNameList); List <string> URLs; int safeGuard = DEF_SAVEGUARD; int URLCount = 0; Console.WriteLine("CHARACTERS STARTED!"); URLs = InitNameListURLs(URLBASE1, URLCHARSUFFIX); while (URLs.Count > 0 && safeGuard-- > 0) { URLCount += URLs.Count; Task <List <Tuple <string, bool> > > nameListTask = d.StartDownloadAsync(progres, URLs); await nameListTask; Console.WriteLine("\nPass {0} done!", (DEF_SAVEGUARD - safeGuard).ToString()); URLs.Clear(); foreach (Tuple <string, bool> res in nameListTask.Result) { if (!res.Item2) { URLs.AddRange(ExpandNameListURL(res.Item1, URLCHARSUFFIX)); } } URLs = URLs.Distinct().ToList(); } Console.WriteLine("CHARACTERS DONE! elapsed time: {0}", DateTime.Now.Subtract(start).ToString()); }
private static void CreateUrl() { IRepository repository = new Repository(SessionFactoryProvider); var q = (from code in repository.AsQueryable<ResponseCodes>() where code.ResponseCode == 501 select code).Single(); using (var transaction = new TransactionScope()){ var ses = new Sesions { ExecutionTime = 4525, CreationTime = DateTime.Now, userIP = "asad" }; repository.Save(ses); var url = new URLs { url = new Uri("http://www.google.lt"), sesion = ses, }; repository.Save(url); var response = new Responses { ResponseTime = 12345, URL = url, ResponseCode = q, RequestStartTime = DateTime.Now }; repository.Save(response); repository.Commit(); transaction.Complete(); } Sesions q2 = (from ses in repository.AsQueryable<Sesions>() where ses.userIP == "asad" select ses).Single(); //ISesionToXML s2x = new SesionToXML(); //s2x.ConvertSesionToXML(q2, "C:/hugas.xml"); }
public void ClientTestPage() { // TODO: think how to avoid duplicating the same username and password in each test. Also what if another environment the credentials are different? var userName = "******"; var password = "******"; var customer = new Customer(); using (var driver = new ChromeDriver()) { driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5); URLs.OpenUrl(driver); var loginPage = new LoginPage(driver); var navigationMenuPage = new NavigationMenuPage(driver); var addClientPage = new AddClientPage(driver); loginPage.Login(userName, password); navigationMenuPage.AddClientButtonClick(); addClientPage.AddClientHeader().ShouldContain("Add Client"); addClientPage.FillOutContactInformation(customer); addClientPage.GetClientHeader().ShouldContain("Client"); } }
public void URLLoad() { string text; string[] items; string[] splits = new string[1]; splits[0] = OVERHEAD; try { foreach (var txtFile in urlDirectoryInfo.GetFiles()) { text = File.ReadAllText(URL_FILE_PATH + txtFile); items = text.Split(splits, StringSplitOptions.RemoveEmptyEntries); URLData url = new URLData { BookMark = Convert.ToBoolean(items[0]), Vpn = Convert.ToBoolean(items[1]), Title = items[2], Url = items[3], CategoryName = items[4], SelectThis = false, }; URLs.Add(url); } } catch (Exception ex) { Debug.WriteLine(ex + DateTime.Now.ToLongTimeString()); } }
/// <summary> /// Update data into URLs table /// </summary> /// <param name="DSObject">DominoServers object</param> /// <returns></returns> public Object UpdateData(URLs URLObject) { Object Update; try { //11/19/2013 NS modified //string SqlQuery = "UPDATE URLs SET Name='" + URLObject.Name + "',Category='" + URLObject.Category + "',ScanInterval=" + URLObject.ScanInterval + //",ResponseThreshold=" + URLObject.ResponseThreshold + ",Enabled='" + URLObject.Enabled + "',OffHoursScanInterval=" + URLObject.OffHoursScanInterval + //",RetryInterval=" + URLObject.RetryInterval +",SearchString='" + URLObject.SearchString +"',UserName='******',PW='" + URLObject.PW+ //"',LocationId=" + URLObject.LocationId + ",ServerTypeId=" + URLObject.ServerTypeId + ",FailureThreshold=" + URLObject.FailureThreshold + " WHERE [TheURL]='" + URLObject.TheURL + "'"; string SqlQuery = "UPDATE URLs SET Name='" + URLObject.Name + "', TheURL='" + URLObject.TheURL + "',Category='" + URLObject.Category + "',ScanInterval=" + URLObject.ScanInterval + ",ResponseThreshold=" + URLObject.ResponseThreshold + ",Enabled='" + URLObject.Enabled + "',OffHoursScanInterval=" + URLObject.OffHoursScanInterval + ",RetryInterval=" + URLObject.RetryInterval + ",SearchString='" + URLObject.SearchStringNotFound + "',AlertStringFound='" + URLObject.SearchStringFound + "',UserName='******',PW='" + URLObject.PW + "',LocationId=" + URLObject.LocationId + ",ServerTypeId=" + URLObject.ServerTypeId + ",FailureThreshold=" + URLObject.FailureThreshold + " WHERE [ID]=" + URLObject.ID; Update = objAdaptor.ExecuteNonQuery(SqlQuery); } catch { Update = false; } finally { } return(Update); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.activity_about); SupportWidget.Toolbar toolbar = FindViewById <SupportWidget.Toolbar>(Resource.Id.toolbar); SetSupportActionBar(toolbar); SupportActionBar.SetDisplayHomeAsUpEnabled(true); SupportActionBar.SetHomeButtonEnabled(true); //Assign the correct layout for the TextView for the verison number versionNumberTextView = FindViewById <TextView>(Resource.Id.txt_version); string versionNumberString = GetString(Resource.String.about_version, Application.Context.ApplicationContext.PackageManager.GetPackageInfo(Application.Context.ApplicationContext.PackageName, 0).VersionName); versionNumberTextView.Text = versionNumberString; FindViewById(Resource.Id.layout_model_repository).Click += delegate { URLs.Launch(this, SharedConstants.MLModelRepository); }; FindViewById(Resource.Id.layout_application_repository).Click += delegate { URLs.Launch(this, SharedConstants.ApplicationRepository); }; FindViewById(Resource.Id.button_clear_data).Click += delegate { DeleteCache(Application.Context); }; }
public void DeleteClient() { { using (var driver = new ChromeDriver()) { driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5); URLs.OpenUrl(driver); var loginPage = new LoginPage(driver); var navigationMenuPage = new NavigationMenuPage(driver); var addClientPage = new AddClientPage(driver); var clientSearchPage = new ClientSearchPage(driver); loginPage.Login(userName, password); navigationMenuPage.AddClientButtonClick(); addClientPage.FillOutContactInformation(customer); string id = addClientPage.GetClientId(); addClientPage.GetClientId().ShouldContain(id); addClientPage.DeleteButtonClick(); addClientPage.ConfirmDeleteButtonClick(); clientSearchPage.SearchInputId(id); clientSearchPage.SearchInputClick(); clientSearchPage.GetAllSeargPage().ShouldContain(clientSearchPage.GetNoRecords()); } } }
public DataTable GetIPAddress(URLs UrlObj, string mode) { //SametimeServers SametimeObj = new SametimeServers(); DataTable UrlTable = new DataTable(); try { if (mode == "Insert")//UrlObj.TheURL == "" && UrlObj.TheURL == null) { //11/19/2013 NS modified string sqlQuery = "Select * from URLs where TheURL='" + UrlObj.TheURL + "' or Name='" + UrlObj.Name + "' "; //string sqlQuery = "Select * from URLs where ID=" + UrlObj.ID; UrlTable = objAdaptor.FetchData(sqlQuery); } else { string sqlQuery = "Select * from URLs where ID<>" + UrlObj.ID + " AND TheURL='" + UrlObj.TheURL + "' "; UrlTable = objAdaptor.FetchData(sqlQuery); } } catch (Exception ex) { throw ex; } return(UrlTable); }
public UserService(IOptions <AppSettings> appSettings, IOptions <JWT_Settings> jwtSettings, ILogger <UserService> logger, IOptions <URLs> urls, IOptions <EmailSettings> emailSettings, RecipeContext context, ITokenBuilder tokenBuilder, IHostEnvironment env) { _jwtSettings = jwtSettings.Value; _appSettings = appSettings.Value; _emailSettings = emailSettings.Value; _urls = urls.Value; _logger = logger; _context = context; _tokenBuilder = tokenBuilder; _passwordHasher = new PasswordHasher <Users>(); _emailService = new Mail(this._emailSettings.NameOfSender, this._emailSettings.Sender, this._emailSettings.SenderPassword, this._emailSettings.Host, this._emailSettings.Port); if (env.IsDevelopment()) { this.url = this._urls.Development; } else if (env.IsStaging()) { this.url = this._urls.Staging; } else if (env.IsProduction()) { this.url = this._urls.Production; } }
/// <summary> /// Insert data into URLs table /// </summary> /// <param name="DSObject">URLs object</param> /// <returns></returns> public bool InsertData(URLs URLObject) { bool Insert = false; try { string SqlQuery = "INSERT INTO URLs (TheURL,Name,Category,ScanInterval,OffHoursScanInterval,Enabled" + ",ResponseThreshold,RetryInterval,SearchString,AlertStringFound,UserName,PW,LocationId,ServerTypeId,FailureThreshold)" + "VALUES('" + URLObject.TheURL + "','" + URLObject.Name + "','" + URLObject.Category + "'," + URLObject.ScanInterval + "," + URLObject.OffHoursScanInterval + ",'" + URLObject.Enabled + "'," + URLObject.ResponseThreshold + "," + URLObject.RetryInterval + ",'" + URLObject.SearchStringNotFound + "','" + URLObject.SearchStringFound + "','" + URLObject.UserName + "','" + URLObject.PW + "'," + URLObject.LocationId + "," + URLObject.ServerTypeId + "," + URLObject.FailureThreshold + ")"; Insert = objAdaptor.ExecuteNonQuery(SqlQuery); } catch { Insert = false; } finally { } return(Insert); }
//Запуск асинхронно анализа всех ссылок на количество тэгов //Количество потоков равно количеству ссылок, так как каждый поток использует крайне малое количество процессорной мощности //большая часть времени тратится на ожидание ответа от сервера public async Task Run_it() { cts = new CancellationTokenSource(); await Task.WhenAll(URLs.Select(e => e.Process(cts).ContinueWith(t => Progress++)).ToArray()); //Progressbar отображает кол-во завершенных потоков (обработанных ссылок) Maxtags = URLs.OrderByDescending(e => e.Count).Take(1).ToArray()[0]; //Находим ссылку с максимальным количеством тэгов из ранее проанализированных }
public void Contact_Test() { IWebDriver driver = DriverUtils.CreateDriver(); driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5); TestWrapper.Test(driver, () => { // Open Landing Page var landingPage = URLs.OpenUrl(driver); //Open Contact page var contactPage = landingPage.ClickContactMeLink(); //Verify Header text var header = contactPage.ContactHeader.Text; header.ShouldBe("Contact Me", "Contact Me header"); //Verify Care Request link var careRequestLink = contactPage.GetCareRequestLink(); careRequestLink.ShouldBe(Config.GetURL("AlexsPetsURL") + "careRequest.html", "URL"); //Verify Email link var emailLink = contactPage.GetEmailLink(); emailLink.ShouldBe("mailto:[email protected]", "Email"); //Verify Envelope image var envelopeImage = contactPage.GetEnvelopeImage(); envelopeImage.ShouldBe(Config.GetURL("AlexsPetsURL") + "images/mail.png", "Envelope"); }); }
/// <summary> /// Get Data from URLs based on Key /// </summary> public URLs GetData(URLs URLObject) { DataTable URLsDataTable = new DataTable(); URLs ReturnObject = new URLs(); try { //11/19/2013 NS modified //string SqlQuery = "Select urls.*,t2.Location from URLs INNER JOIN [Locations] t2 ON urls.[LocationID] = t2.[ID] where [TheURL]='" + URLObject.TheURL + "'"; string SqlQuery = "Select urls.*,t2.Location from URLs INNER JOIN [Locations] t2 ON urls.[LocationID] = t2.[ID] " + "where urls.[ID]=" + URLObject.ID; //string SqlQuery="select * from urls where URLs where ID="URLObject.ID URLsDataTable = objAdaptor.FetchData(SqlQuery); //populate & return data object //11/19/2013 NS added ReturnObject.ID = URLsDataTable.Rows[0]["ID"].ToString(); ReturnObject.Name = URLsDataTable.Rows[0]["Name"].ToString(); if (URLsDataTable.Rows[0]["ScanInterval"].ToString() != "") { ReturnObject.ScanInterval = int.Parse(URLsDataTable.Rows[0]["ScanInterval"].ToString()); } if (URLsDataTable.Rows[0]["OffHoursScanInterval"].ToString() != "") { ReturnObject.OffHoursScanInterval = int.Parse(URLsDataTable.Rows[0]["OffHoursScanInterval"].ToString()); } ReturnObject.Category = URLsDataTable.Rows[0]["Category"].ToString(); if (URLsDataTable.Rows[0]["Enabled"].ToString() != "") { ReturnObject.Enabled = bool.Parse(URLsDataTable.Rows[0]["Enabled"].ToString()); } if (URLsDataTable.Rows[0]["RetryInterval"].ToString() != "") { ReturnObject.RetryInterval = int.Parse(URLsDataTable.Rows[0]["RetryInterval"].ToString()); } if (URLsDataTable.Rows[0]["ResponseThreshold"].ToString() != "") { ReturnObject.ResponseThreshold = int.Parse(URLsDataTable.Rows[0]["ResponseThreshold"].ToString()); } ReturnObject.TheURL = URLsDataTable.Rows[0]["TheURL"].ToString(); ReturnObject.SearchStringNotFound = URLsDataTable.Rows[0]["SearchString"].ToString(); ReturnObject.SearchStringFound = URLsDataTable.Rows[0]["AlertStringFound"].ToString(); ReturnObject.UserName = URLsDataTable.Rows[0]["UserName"].ToString(); ReturnObject.PW = URLsDataTable.Rows[0]["PW"].ToString(); ReturnObject.Location = URLsDataTable.Rows[0]["Location"].ToString(); if (URLsDataTable.Rows[0]["FailureThreshold"].ToString() != null) { ReturnObject.FailureThreshold = Convert.ToInt32(URLsDataTable.Rows[0]["FailureThreshold"]); } } catch (Exception ex) { throw ex; } finally { } return(ReturnObject); }
void Awake() { urls = new URLs(); urls.getSystems = "https://www.edsm.net/api-v1/systems"; urls.getDistances = "http://edstarcoordinator.com/api.asmx/GetDistances"; urls.setDistances = "http://edstarcoordinator.com/api.asmx/SetDistances"; rawData = new RawData(); }
public Texture2D GetChampionIcon(string id) { byte[] byteArray = File.ReadAllBytes(URLs.GetChampionIcon(id)); Texture2D texture = new Texture2D(2, 2); texture.LoadImage(byteArray); return(texture); }
public Texture2D GetMapImage(int id) { byte[] byteArray = File.ReadAllBytes(URLs.GetMap(id)); Texture2D texture = new Texture2D(2, 2); texture.LoadImage(byteArray); return(texture); }
public void CareRequest_Test() { IWebDriver driver = DriverUtils.CreateDriver(); driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5); TestWrapper.Test(driver, () => { // Open Landing Page var landingPage = URLs.OpenUrl(driver); //Open Care Request page var careRequestPage = landingPage.ClickCareRequestLink(); var customer = new Person(); var catsNumber = "2"; var otherNumber = "3+"; var visitsPerDay = "2"; var comment = "Please be quiet, our spiders are easily scared"; //Fill out inputs careRequestPage.FillOutContactInformation(customer); //Click Animal Type checkboxes careRequestPage.RequestCatCare(catsNumber); careRequestPage.RequestOtherCare(otherNumber); //Visits per day careRequestPage.SetVisitsPerDay(visitsPerDay); //Comments careRequestPage.FillOutComments(comment); //Open Request summary page RequestSummaryPage requestSummaryPage = careRequestPage.ClickRequestButton(); //Verify Page opened by checking page element is visible requestSummaryPage.IsSummaryBlockDisplayed().ShouldBeTrue("Summary Block is Displayed"); //Verify Header text var header = requestSummaryPage.PageHeader.Text; header.ShouldBe("Request Summary", "Header"); //Verify contact info VerifyContactInformation(requestSummaryPage, customer); //Verify all other information is populated correctly VerifyOtherInformation(requestSummaryPage, catsNumber, otherNumber, visitsPerDay, comment); string[] data = { $"{catsNumber} cat(s)", $"{otherNumber} other animal(s)", $"{visitsPerDay} visits per day are required.", comment }; VerifyOtherInformationAlternative(requestSummaryPage, data); //Click Close button and verify the page was closed requestSummaryPage.CloseButton.Click(); Thread.Sleep(1000); requestSummaryPage.IsSummaryBlockDisplayed().ShouldBeFalse("Summary Block is not displayed"); }); }
private URLs CollectDataForURLs() { try { //Cluster Settings URLs URLsObject = new URLs(); //12/9/2013 NS added URLsObject.ID = ID; URLsObject.Name = NameTextBox.Text; URLsObject.Enabled = EnabledCheckBox.Checked; URLsObject.Category = CategoryTextBox.Text; //URLsObject.First_Alert_Threshold = int.Parse(AlertTextBox.Text); URLsObject.OffHoursScanInterval = int.Parse(OffScanTextBox.Text); URLsObject.ScanInterval = int.Parse(ScanTextBox.Text); URLsObject.RetryInterval = int.Parse(RetryTextBox.Text); URLsObject.ResponseThreshold = int.Parse(RespThrTextBox.Text); URLsObject.SearchStringNotFound = RequiredTextBox.Text; URLsObject.SearchStringFound = AlertConditionRB.SelectedItem.Value.ToString(); URLsObject.TheURL = IPAddressTextBox.Text; URLsObject.UserName = UserNameTextBox.Text; //URLsObject.PW = PasswordTextBox.Text; if (PasswordTextBox.Text != "") { if (PasswordTextBox.Text == " ") { PasswordTextBox.Text = ViewState["PWD"].ToString(); } TripleDES tripleDES = new TripleDES(); byte[] encryptedPass = tripleDES.Encrypt(PasswordTextBox.Text); string encryptedPassAsString = string.Join(", ", encryptedPass.Select(s => s.ToString()).ToArray()); URLsObject.PW = encryptedPassAsString; } Locations LOCobject = new Locations(); LOCobject.Location = LocationComboBox.Text; ServerTypes STypeobject = new ServerTypes(); STypeobject.ServerType = "URL"; ServerTypes ReturnValue = VSWebBL.SecurityBL.ServerTypesBL.Ins.GetDataForServerType(STypeobject); URLsObject.ServerTypeId = ReturnValue.ID; Locations ReturnLocValue = VSWebBL.SecurityBL.LocationsBL.Ins.GetDataForLocation(LOCobject); URLsObject.LocationId = ReturnLocValue.ID; URLsObject.FailureThreshold = int.Parse(SrvAtrFailBefAlertTextBox.Text); return(URLsObject); } catch (Exception ex) { //6/27/2014 NS added for VSPLUS-634 Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex); throw ex; } finally { } }
public ProgramManager(Uri uri, Sesions sesion) { responsesGotten = 0; url = new URLs(); url.sesion = sesion; url.url = uri; IRepository repository = new Repository(SessionFactoryProvider); repository.Save(url); repository.Commit(); }
private void DownloadFiles() { var client = new WebClient(); foreach (var url in URLs) { var fileName = url.Substring(url.LastIndexOf('/') + 1); var tempFileName = fileName + "-temp"; var localPath = Path.GetFullPath(Path.Combine(ComponentManager.BasePath ?? "", ComponentManager.PATH_COMPONENTS, fileName)); var tempLocalPath = Path.GetFullPath(Path.Combine(ComponentManager.BasePath ?? "", ComponentManager.PATH_COMPONENTS, tempFileName)); try { // Download to temp file so the original file is kept if it fails downloading client.DownloadFile(new Uri(url), tempLocalPath); File.Copy(tempLocalPath, localPath, true); if (url != URLs.First() && localPath.EndsWith(".dll")) { var factory = ComponentManager.LoadFactory <IComponentFactory>(localPath); if (factory != null) { ComponentManager.ComponentFactories.Add(fileName, factory); } } } catch (WebException) { Log.Error("Error downloading file from " + url); } catch (Exception ex) { // Catch errors of File.Copy() if necessary Log.Error(ex); } finally { try { // This is not required to run the AutoSplitter, but should still try to clean up File.Delete(tempLocalPath); } catch (Exception) { Log.Error($"Failed to delete temp file: {tempLocalPath}"); } } } if (Type == AutoSplitterType.Component) { var factory = ComponentManager.LoadFactory <IComponentFactory>(LocalPath); ComponentManager.ComponentFactories.Add(Path.GetFileName(LocalPath), factory); } }
public void KievlTime_Test() { IWebDriver driver = DriverUtils.CreateDriver(); driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5); TestWrapper.Test(driver, () => { // Open Landing Page var landingPage = URLs.OpenUrl(driver); //Open Local Time Page var localTimePage = landingPage.ClickLocalTimeItem(); string input = "Kiev"; //Find Kiev using the Search field??? localTimePage.FillOutSearchField(input); driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5); var KievPage = localTimePage.ClickKievUkraineQuery(); driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5); //Verify the time displayed in the search results is correct one DateTime kievTime = DateTime.UtcNow.AddHours(3); var kievTimeString = kievTime.ToLongTimeString(); var appKievTimeString = KievPage.GetAppKievTime(); kievTimeString.ShouldBe(appKievTimeString, "Local Kiev Time"); //Verify the breadcrumbs say Home / Local Time / Ukraine / Kiev var breadcrumbs = KievPage.GetBreadcrumbsText(); driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5); breadcrumbs.ShouldBe("Home Local Time Ukraine Kiev", "Breadcrumbs"); // Verify Kiev-specific elements on the page var currentLocalTimeHeader = KievPage.CurrentLocalTimeHeader.Text; currentLocalTimeHeader.ShouldBe("Current local time in Kiev, Ukraine", "Container Header"); var convertTimeHeader = KievPage.ConvertTimeHeader.Text; convertTimeHeader.ShouldBe("Convert Kiev Time", "Convert Kiev Time Header"); var kievInformationHeader = KievPage.KievInformationHeader.Text; kievInformationHeader.ShouldBe("Kiev Information", "Kiev Information Header"); var kievFactsHeader = KievPage.KievFactsHeader.Text; kievFactsHeader.ShouldBe("Kiev Facts", "Kiev Facts Header"); var countryName = KievPage.CountryName.Text; countryName.ShouldBe("Ukraine", "Country Name"); var currencyName = KievPage.CurrencyName.Text; currencyName.ShouldBe("Hryvnia (UAH)", "Currency Name"); var timeZoneName = KievPage.TimeZoneName.Text; timeZoneName.ShouldBe("(EEST)", "Time Zone Name"); }); }
/// <summary> /// Call DAL Delete Data /// </summary> /// <param name="URLObject"></param> /// <returns></returns> public Object DeleteData(URLs URLObject) { try { return(VSWebDAL.ConfiguratorDAL.URLsDAL.Ins.DeleteData(URLObject)); } catch (Exception ex) { throw ex; } }
public DataTable GetIPAddress(URLs UrlObj, string mode) { try { return(VSWebDAL.ConfiguratorDAL.URLsDAL.Ins.GetIPAddress(UrlObj, mode)); } catch (Exception ex) { throw ex; } }
/// <summary> /// Call to Get Data from URLs based on Primary key /// </summary> /// <param name="URLsObject">URLsObject object</param> /// <returns></returns> public URLs GetData(URLs URLsObject) { try { return(VSWebDAL.ConfiguratorDAL.URLsDAL.Ins.GetData(URLsObject)); } catch (Exception ex) { throw ex; } }
public TimedHostedService(ILogger <TimedHostedService> logger, IOptions <AppSettings> appSettings, IOptions <KnowageHeaders> headers, IOptions <URLs> urls, IOptions <Paths> paths, IOptions <SMTPConfig> smtp) { _logger = logger; AppSettings _appSettings1 = appSettings.Value; KnowageHeaders _headers = headers.Value; URLs _urls = urls.Value; Paths _paths = paths.Value; SMTPConfig _smtp = smtp.Value; }
public Texture2D GetItemIcon(int id) { if (id == 0) { return(null); } byte[] byteArray = File.ReadAllBytes(URLs.GetItemIcon(id)); Texture2D texture = new Texture2D(2, 2); texture.LoadImage(byteArray); return(texture); }
/// <summary> /// Invoked when the URL has been parsed by the MediaManager. /// </summary> /// <param name="track">The track representing the audio at the URL</param> private void URL_Parsed(TrackData track) { URLs.Clear(); URLs.Add(track); Dispatcher.Invoke(DispatcherPriority.Background, new Action(delegate() { ToggleProgressbar(false); })); if (callCallback && callback != null) { callback(URLs); } }
/// <summary> /// Load Urls in AdvanScene xml /// </summary> /// <param name="xnd">Xml Node</param> private void LoadURL(XmlNode xnd) { foreach (XmlNode xndd in xnd.ChildNodes) { URLs.Add(xndd.Name, xndd.InnerText); if (xndd.Name == "datURL") { foreach (XmlAttribute xat in xndd.Attributes) { URLs.Add("datFileName", xat.InnerText); } } } }
private void URLDelete() { foreach (var url in URLs.Where(x => x.SelectThis == true)) { FileInfo file = new FileInfo(URL_FILE_PATH + url.Title + URL_FILE_NAME); if (file.Exists) { file.Delete(); } } URLs.Clear(); URLLoad(); }
private static void StartResponse(int i, URLs url, IDbBuffer<Responses> buffer) { IRequests request = new Requests(url.url); string response = request.SendRequests(); var map = new StringCruncher(response); map.CrunchString(); Responses responseEntitie = new Responses(); responseEntitie.ResponseCode = map.code; responseEntitie.ResponseTime = map.timeTaken; responseEntitie.RequestStartTime = map.pr; responseEntitie.URL = url; lock (buffer) { buffer.AddToBuffer(responseEntitie); } responsesGotten++; }
/// <summary> /// A single place to obtain URL for any page in the app /// Currently Used: In all navigation services of the page /// </summary> /// <param name="urlFor">Enumerated value of page for which URL is required</param> /// <returns>Relative URL string</returns> public static string GetUrlFor(URLs urlFor) { string URL = ""; switch (urlFor) { case URLs.MainPage: URL = "/Views/MainPage.xaml"; break; case URLs.DetailsPage: URL = "/Views/DetailsPage.xaml?medicineId="; break; case URLs.AboutPage: URL = "/Views/About.xaml"; break; case URLs.AddPage: URL = "/Views/AddUpdateMedicine.xaml"; break; case URLs.UpdatePage: URL = "/Views/AddUpdateMedicine.xaml?medicineId="; break; case URLs.SettingsPage: URL = "/Views/Settings.xaml"; break; case URLs.AddReminderPage: URL = "/Views/AddReminders.xaml?medicineId="; break; default: goto case URLs.MainPage; } return URL; }