Ejemplo n.º 1
0
        private void cmItemPropertiesFromSearch_Click(object sender, EventArgs e)
        {
            ItemInDatabase item = getSearchSelectedItem();

            if (item != null)
            {
                showItemProperties(item);
            }
        }
Ejemplo n.º 2
0
 private void cmFindInDatabase_Click(object sender, EventArgs e)
 {
     if (lvSearchResults.SelectedIndices.Count == 1)
     {
         int            index          = lvSearchResults.SelectedIndices[0];
         ItemInDatabase itemInDatabase = searchResultList[index];
         findInTree(itemInDatabase);
     }
 }
Ejemplo n.º 3
0
        public DiscInDatabase GetDisc()
        {
            ItemInDatabase dad = Parent as ItemInDatabase;

            while (dad != null)
            {
                dad = dad.Parent as ItemInDatabase;
            }
            return(null);
        }
Ejemplo n.º 4
0
 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;
 }
Ejemplo n.º 5
0
        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!
                    }
                }
            }
        }
Ejemplo n.º 6
0
        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();
        }
Ejemplo n.º 7
0
 internal bool ContainsItem(ItemInDatabase iid)
 {
     return(items.Contains(iid));
 }
Ejemplo n.º 8
0
 internal void RemoveItem(ItemInDatabase iid)
 {
     items.Remove(iid);
     iid.LogicalFolders.Remove(this);
 }
Ejemplo n.º 9
0
 internal void AddItem(ItemInDatabase iid)
 {
     items.Add(iid);
     iid.LogicalFolders.Add(this);
 }
Ejemplo n.º 10
0
 public FolderImpl(ItemInDatabase owner, int imageIndex)
 {
     this.owner      = owner;
     this.imageIndex = imageIndex;
 }