private void cmItemPropertiesFromSearch_Click(object sender, EventArgs e) { ItemInDatabase item = getSearchSelectedItem(); if (item != null) { showItemProperties(item); } }
private void cmFindInDatabase_Click(object sender, EventArgs e) { if (lvSearchResults.SelectedIndices.Count == 1) { int index = lvSearchResults.SelectedIndices[0]; ItemInDatabase itemInDatabase = searchResultList[index]; findInTree(itemInDatabase); } }
public DiscInDatabase GetDisc() { ItemInDatabase dad = Parent as ItemInDatabase; while (dad != null) { dad = dad.Parent as ItemInDatabase; } return(null); }
public DlgItemProperties(ItemInDatabase itemInDatabase) : this() { tbItemName.Text = itemInDatabase.Name; llVolumeUserName.Text = itemInDatabase.GetVolumeUserName(); tbPath.Text = itemInDatabase.GetPath(); tbKeywords.Text = itemInDatabase.Keywords; tbDescription.Text = itemInDatabase.Description; if (itemInDatabase.LogicalFolders != null) // na wszelki wypadek { ucItemFolderClassification.LogicalFolders = itemInDatabase.LogicalFolders.ToArray(); } //ucItemFolderClassification.ImageList = folderImages; // pbIcon.Image = BlueMirror.Commons.Win32.GetFileIcon(itemInDatabase.Name, BlueMirror.Commons.Win32.FileIconSize.Large).ToBitmap(); this.itemInDatabase = itemInDatabase; }
private static void ReadLogicalFolderItems(SQLiteConnection conn, VolumeDatabase mem) { string txt = "SELECT * FROM [LFoldMap]"; using (SQLiteCommand cmd = new SQLiteCommand(txt, conn)) { using (SQLiteDataReader rdr = cmd.ExecuteReader()) { while (rdr.Read()) { int lFoldId = rdr.GetInt32(1); int iidId = rdr.GetInt32(2); int typeId = rdr.GetInt16(3); LogicalFolder lfold = _lfoldHash[lFoldId] as LogicalFolder; ItemInDatabase iid = null; switch (typeId) { case 1: // folder iid = _foldHash[iidId] as ItemInDatabase; break; case 2: // file iid = _fileHash[iidId] as ItemInDatabase; break; case 3: // disc. brute it. foreach (var discInDatabase in mem.GetDiscs()) { if (-discInDatabase.DbId == iidId) { iid = discInDatabase as ItemInDatabase; break; } } break; } lfold.AddItem(iid); // TODO make sure the two-way mapping is set! } } } }
private static void ProcessCommon(ItemInDatabase item, Win32.WIN32_FIND_DATAW findData, string fullpath) { item.Name = findData.cFileName; item.Attributes = findData.dwFileAttributes; string tmp = Path.GetExtension(fullpath); if (!string.IsNullOrEmpty(tmp)) { tmp = tmp.ToLower(); if (tmp.StartsWith(".")) { tmp = tmp.Substring(1); } } item.Extension = tmp; item.FullName = fullpath; item.CreationTime = findData.ftCreationTime.ToDateTime(); item.LastAccessTime = findData.ftLastAccessTime.ToDateTime(); item.LastWriteTime = findData.ftLastWriteTime.ToDateTime(); }
internal bool ContainsItem(ItemInDatabase iid) { return(items.Contains(iid)); }
internal void RemoveItem(ItemInDatabase iid) { items.Remove(iid); iid.LogicalFolders.Remove(this); }
internal void AddItem(ItemInDatabase iid) { items.Add(iid); iid.LogicalFolders.Add(this); }
public FolderImpl(ItemInDatabase owner, int imageIndex) { this.owner = owner; this.imageIndex = imageIndex; }