public static BrowsingHistory GetInstance(string name, string path) { if (_mOInstance == null) { lock (_mutex) { if (_mOInstance == null) { _mOInstance = new BrowsingHistory(name, path); } } } return(_mOInstance); }
/// <summary> /// Getting web browsing history. /// </summary> /// <returns>Lists with browsing history.</returns> public BrowsingHistoryLists GetBrowsingHistory() { var configModel = _configurationManagement.GetConfigModel(); var browsing = BrowsingHistory.GetInstance("Default", configModel.WebHistoryPath); var browsingHistoryLists = new BrowsingHistoryLists(); List <BrowsingHistoryTab> browsingHistoryTabs = new List <BrowsingHistoryTab>(); foreach (var f in browsing.GetHistoryFromDatabase(configModel.WebHistoryQueryLimit)) { browsingHistoryTabs.Add(new BrowsingHistoryTab(f.GetUrl(), f.GetTitle(), f.GetLastVisitTime(), f.GetDurationTime())); } browsingHistoryLists.BrowsingHistoryList = browsingHistoryTabs; browsingHistoryLists.Timestamp = new DateTimeOffset(DateTime.UtcNow).ToUnixTimeSeconds(); return(browsingHistoryLists); }