Ejemplo n.º 1
0
 private void listView_DoubleClick(object sender, EventArgs e)
 {
     if (SelectedDirectoryFile != null)
     {
         ViewForm.Show(Repository, SelectedDirectoryFile);
     }
 }
Ejemplo n.º 2
0
        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (folderBrowserDialog.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            try
            {
                IRepository repository;
                DirectoryTree <TREInfoFile> directoryTree;
                LoadRepository(folderBrowserDialog.SelectedPath, out repository, out directoryTree);
                Repository    = repository;
                DirectoryTree = directoryTree;
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex.Message);
                MessageBox.Show("Error opening solution", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            DirectoryName = folderBrowserDialog.SelectedPath;

            Wxv.Swg.Explorer.Properties.Settings.Default.RepositoryDirectoryName = DirectoryName;
            Wxv.Swg.Explorer.Properties.Settings.Default.Save();

            ViewForm.CloseAll();

            RefreshData();
        }
Ejemplo n.º 3
0
 private void viewToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (SelectedDirectoryFile != null)
     {
         ViewForm.Show(Repository, SelectedDirectoryFile);
     }
 }
Ejemplo n.º 4
0
        public static bool Show(IRepository repository, TREInfoFile treInfoFile)
        {
            ViewForm viewForm;

            if (viewForms.TryGetValue(treInfoFile.Path, out viewForm))
            {
                viewForm.Activate();
                return(true);
            }

            var data = repository.Load <byte[]>(
                treInfoFile.TreFileName,
                treInfoFile.Path,
                stream => stream.ReadBytes());

            if (data == null)
            {
                return(false);
            }

            viewForm = new ViewForm
            {
                Repository  = repository,
                TREInfoFile = treInfoFile,
                Data        = data
            };
            viewForms.Add(treInfoFile.Path, viewForm);
            viewForm.Show();
            return(true);
        }