private void SearchContent(string sPage, string sName, string sCategory) { ContentList.Clear(); DataSet dsContsResult = callQuery.S_MA_CTS_SRCH_LIST(sPage, sName, sCategory); UdtContentItem udtResult; for (int i = 0; i < dsContsResult.Tables[0].Rows.Count; i++) { udtResult = new UdtContentItem(); udtResult.ContentID = dsContsResult.Tables[0].Rows[i]["CONS_ID"].ToString(); udtResult.ContentTitle = dsContsResult.Tables[0].Rows[i]["CONS_NM"].ToString(); udtResult.ContentDesc = dsContsResult.Tables[0].Rows[i]["CONS_DOC"].ToString(); udtResult.CopyWriterName = dsContsResult.Tables[0].Rows[i]["COPY_NM"].ToString(); udtResult.DownloadRate = dsContsResult.Tables[0].Rows[i]["DOWN_RATE"].ToString(); udtResult.Price = dsContsResult.Tables[0].Rows[i]["CONS_PRICE"].ToString(); udtResult.StarRate = dsContsResult.Tables[0].Rows[i]["STAR_RATE"].ToString(); System.Drawing.Image thumbnailImg = IMRUtils.TypeParser.ByteArrayToImage(Convert.FromBase64String(dsContsResult.Tables[0].Rows[i]["CONS_THUMB_PATH"].ToString())); udtResult.Thumbnail = StaticUtils.ImageToImageSource(thumbnailImg); ContentList.Add(udtResult); } }
// Update the ContentList list of files with all files and directories in the currently selected directory public void UpdateContentList() { if (SelectedDirectory != null) { FileFilter = string.Empty; ContentList.Clear(); SelectedDirectory.UpdateFileList(ref _userMessage); SelectedDirectory.UpdateSubFolderList(); foreach (UserDirectory folder in SelectedDirectory.Subfolders) { ContentList.Add(folder); } foreach (UserFile file in SelectedDirectory.Files) { //file.UpdateFileStatus(); ContentList.Add(file); file.CheckFile(ref _userMessage); } SelectedDirectory.UpdatePerforceStatus(); RaisePropertyChanged("UserMessage"); } if (ContentList != null) { UserMessage = ContentList.Any(x => x.P4Success == false) ? P4ErrorMessage : UserMessage; } }
public override void Load() { ContentList.Clear(); if (ScriptProvider != null) { ScriptProvider.LoadData(this); } }
public void RefrechData(DbViewModel db) { ContentList.Clear(); ContentList.Add(new AdditionalDbInfoViewModel("Trigger", db.Triggers.Cast <IAddtionalDbInfo>().ToList())); ContentList.Add(new AdditionalDbInfoViewModel("Index", db.Indexes.Cast <IAddtionalDbInfo>().ToList())); ContentList.Add(new AdditionalDbInfoViewModel("Domain", db.Domains.Cast <IAddtionalDbInfo>().ToList())); CurrentContent = ContentList; }
public void RefreshContentList() { if (!IsLoggedInAlready()) { return; } DisplayContentList.Clear(); ContentList.Clear(); var foundContent = service.GetAllContentNames(); foreach (var contentName in foundContent) { AddNewContent(contentName); } FilterContentList(); RaisePropertyChanged("DisplayContentList"); isShowingStartContent = true; }
// Searches all files and directories in the directory tree starting at the selected directory for any that match // the FileFilter string public void GetFilteredFilesFromSelected() { ContentList.Clear(); List <UserFile> FilteredFileList = SelectedDirectory.GetFilteredFiles(FileFilter); UpdatePerforceStatus(FilteredFileList); foreach (UserFile file in SelectedDirectory.GetFilteredFiles(FileFilter)) { file.UpdateFileStatus(); ContentList.Add(file); file.CheckFile(ref _userMessage); RaisePropertyChanged("UserMessage"); } if (ContentList != null) { UserMessage = ContentList.Any(x => x.P4Success == false) ? P4ErrorMessage : UserMessage; } }
public void TestMethod1() { string assemblyPath = Assembly.GetExecutingAssembly().Location; string workDirPath = Path.GetDirectoryName(assemblyPath); string dbPath = Path.Combine(workDirPath, "testdb.sqlite"); var contentList = new ContentList(dbPath); contentList.Clear(); string testPath = assemblyPath; var testTimestamp = File.GetLastWriteTime(testPath).ToUnixTimestamp(); contentList.Add(testPath, testTimestamp, removed: false); Assert.IsTrue(contentList.ContainsKey(testPath)); Assert.AreEqual(1, contentList.Count); Assert.AreEqual(contentList.Keys.First(), testPath); Assert.IsTrue(contentList.TryGetValue(testPath, out int storedTimestamp, out bool removed)); Assert.AreEqual(testTimestamp, storedTimestamp); contentList.Remove(testPath); Assert.AreEqual(0, contentList.Count); contentList.Dispose(); File.Delete(dbPath); }
public void Clear() { ContentList.Clear(); }