Ejemplo n.º 1
0
        private void ChangeViewFilter_Click(object sender, EventArgs e)
        {
            m_viewMask = 0;

            if (showSystemFilesToolStripMenuItem.Checked)
            {
                m_viewMask |= ViewFilter.ViewMask.ShowSystem;
            }

            if (showHiddenFilesToolStripMenuItem.Checked)
            {
                m_viewMask |= ViewFilter.ViewMask.ShowHidden;
            }

            if (showDotFilesToolStripMenuItem.Checked)
            {
                m_viewMask |= ViewFilter.ViewMask.ShowDot;
            }

            LeftFilePane.SetViewMask(m_viewMask);
            RightFilePane.SetViewMask(m_viewMask);

            BuildDrivesTreeView();
        }
Ejemplo n.º 2
0
        private void RangerMainForm_Load(object sender, EventArgs e)
        {
            string configFilename = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"YellowDroid\Ranger\settings.txt");

            m_config.Load(configFilename);

            LayoutFromConfig();

            m_smallImageList.ColorDepth = ColorDepth.Depth32Bit;
            m_smallImageList.ImageSize  = new System.Drawing.Size(16, 16);
            m_iconListManager           = new IconListManager(m_smallImageList);
            DrivesTreeView.ImageList    = m_smallImageList;

            LeftFilePane.LoadFromConfig(m_config, "left_");
            LeftFilePane.Initialise(m_smallImageList, m_iconListManager, m_supportedImageExtensions, m_windowManager, m_thumbnailCache);
            //LeftFilePane.ListView.SmallImageList = m_smallImageList;
            //LeftFilePane.IconListManager = m_iconListManager;
            //LeftFilePane.SupportedImageExtensions = m_supportedImageExtensions;
            //LeftFilePane.WindowManager = m_windowManager;

            RightFilePane.LoadFromConfig(m_config, "right_");
            RightFilePane.Initialise(m_smallImageList, m_iconListManager, m_supportedImageExtensions, m_windowManager, m_thumbnailCache);
            //RightFilePane.ListView.SmallImageList = m_smallImageList;
            //RightFilePane.IconListManager = m_iconListManager;
            //RightFilePane.SupportedImageExtensions = m_supportedImageExtensions;
            //RightFilePane.WindowManager = m_windowManager;

            // View Mask
            if (m_config.GetValue("showhiddenfiles", false.ToString()) != false.ToString())
            {
                m_viewMask |= ViewFilter.ViewMask.ShowHidden;
                showHiddenFilesToolStripMenuItem.Checked = true;
            }

            if (m_config.GetValue("showsystemfiles", false.ToString()) != false.ToString())
            {
                m_viewMask |= ViewFilter.ViewMask.ShowSystem;
                showSystemFilesToolStripMenuItem.Checked = true;
            }

            if (m_config.GetValue("showdotfiles", false.ToString()) != false.ToString())
            {
                m_viewMask |= ViewFilter.ViewMask.ShowDot;
                showDotFilesToolStripMenuItem.Checked = true;
            }

            DefaultEditorPath = m_config.GetValue("defaulteditorpath");

            LeftFilePane.SetViewMask(m_viewMask);
            RightFilePane.SetViewMask(m_viewMask);

            // Pane paths

            string firstReadyDrivePath = BuildDrivesTreeView();

            // Bookmarks
            SetBookmarksFromConfig();

            string leftDefaultPath  = m_config.GetValue("leftpath", firstReadyDrivePath);
            string rightDefaultPath = m_config.GetValue("rightpath", firstReadyDrivePath);

            LeftFilePane.OnFocusEvent  += LeftFilePane_OnFocusEvent;
            RightFilePane.OnFocusEvent += RightFilePane_OnFocusEvent;

            LeftFilePane.OnPathChangedEvent  += FilePane_OnPathChangedEvent;
            RightFilePane.OnPathChangedEvent += FilePane_OnPathChangedEvent;

            LeftFilePane.OnSyncronisationRequested  += FilePane_OnSyncronisationRequested;
            RightFilePane.OnSyncronisationRequested += FilePane_OnSyncronisationRequested;

            LeftFilePane.OnSearchRequested  += FilePane_OnSearchRequested;
            RightFilePane.OnSearchRequested += FilePane_OnSearchRequested;

            m_activePane = LeftFilePane;

            RightFilePane.SetDirectory(rightDefaultPath);
            LeftFilePane.SetDirectory(leftDefaultPath);

            // Drive monitor
            WqlEventQuery query = new WqlEventQuery("SELECT * FROM Win32_VolumeChangeEvent WHERE EventType = 2 OR EventType = 3");

            m_driveWatcher.EventArrived += DriveWatcher_EventArrived;
            m_driveWatcher.Query         = query;
            m_driveWatcher.Start();

            /*
             * // Add the system recycle bin icon to the button
             * int dummyIcon;
             * var icon = Etier.IconHelper.IconReader.GetStockIcon(Etier.IconHelper.Shell32.SHSTOCKICONID.SIID_RECYCLER, out dummyIcon);
             * RecycleBinButton.Image = icon.ToBitmap();
             */

            this.Closing += new System.ComponentModel.CancelEventHandler(this.MyOnClosing);
        }