Example #1
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="f">database file object</param>
        public TreeNodeFile(DataBase.File f, TreeViewCatalog tvc)
            : base(f.Name, f, false, false, "GenericFile", f.Size, f.Date, true, false, false, false, false)
        {
            this.file = f;

            if (f.Attributes == 1)
            {
                this.ImageIndex = TreeImages.Folder;
                this.SelectedImageIndex = TreeImages.FolderOpen;
                this.typeName = "Folder";
                this.size = -1;
            }
            else
            {
                int pos = f.Name.LastIndexOf(".");

                string ext = "";

                if (pos >= 0)
                {
                    ext = f.Name.Substring(pos);
                }

                this.ImageIndex = tvc.FileIcons.GetFileIconId(ext);
                this.SelectedImageIndex = this.ImageIndex;
                this.typeName = "File";
            }
        }
Example #2
0
 /// <summary>
 /// Constructs CD Box tree item
 /// </summary>
 /// <param name="db">database</param>
 /// <param name="box">database object of cdbox</param>
 public TreeNodeBox(DisksDB.DataBase.DataBase db, DataBase.Box box, TreeViewCatalog trv)
     : base(box.Name, box, true, true, "CD/DVD Box", -1, DateTime.Now, true, true, false, false, false)
 {
     this.trv = trv;
     this.db = db;
     this.box = box;
     this.ImageIndex = TreeImages.CDBox;
     this.SelectedImageIndex = TreeImages.CDBoxOpen;
     this.box.ChildItemAdded += new EventHandlerItemAdded(ChildItemAdded);
     this.box.ChildItemRemoved += new EventHandlerItemRemoved(ChildItemRemoved);
     this.box.NameChanged += new EventHandler(NameChanged);
     this.box.ChildsChanged += new EventHandler(ChildsChanged);
 }
Example #3
0
        /// <summary>
        /// Constructs TreeNode object from database Category object
        /// </summary>
        /// <param name="db">database object</param>
        /// <param name="cat">category object</param>
        /// <param name="trv">tree view</param>
        public TreeNodeCategory(DisksDB.DataBase.DataBase db, DataBase.Category cat, TreeViewCatalog trv)
            : base(cat.Name, cat, true, true, "Category", -1, DateTime.Now, true, false, true, true, false)
        {
            Debug.Assert(null != trv);

            this.trv = trv;
            this.db = db;
            this.cat = cat;
            this.ImageIndex = TreeImages.Category;
            this.SelectedImageIndex = TreeImages.CategoryOpen;
            this.cat.NameChanged += new EventHandler(NameChanged);
            this.cat.ChildItemAdded += new EventHandlerItemAdded(ChildItemAdded);
            this.cat.ChildItemRemoved += new EventHandlerItemRemoved(ChildItemRemoved);
            this.cat.ChildsChanged += new EventHandler(ChildsChanged);
        }
Example #4
0
        public FormMain()
        {
            InitializeComponent();
            InitializeToolBar();

            this.cdTreeview = new TreeViewCatalog(this.imageListCatalog);

            InitializeDockingWindows();

            ShowDisksExplorer(null, EventArgs.Empty);

            this.cdTreeview.DataBase = DisksDB.DataBase.DataBase.Instance;
            this.cdTreeview.InfoVew = this.infoView;
            this.cdTreeview.LoadTree();
            this.menuItemEdit.MenuItems.AddRange(this.mnu.MenuItems);
            this.cdTreeview.ItemSelected += new EventHandlerItemSelected(ControlItemSelected);

            InitSyncServer(Config.Config.Instance.GetValue("SyncServerRunning", false));

            SyncServer.Instance.ClientConnected += new SyncServer.ClientConnectedEvent(Instance_ClientConnected);
            SyncServer.Instance.ClientDisconnected += new SyncServer.ClientDisconnectedEvent(Instance_ClientDisconnected);
        }