Example #1
0
        private void DataGridProjectMapping_OnMouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            if (sender == null)
            {
                return;
            }

            DataGrid grid = sender as DataGrid;

            if (grid != null && grid.SelectedItems != null && grid.SelectedItems.Count == 1)
            {
                ProjectFolderInfo projectFolder = grid.SelectedItem as ProjectFolderInfo;
                if (projectFolder != null)
                {
                    MainService.CreateVSFolder(projectFolder.FullPath);

                    ProjectFolderDialogWindow dialog = new ProjectFolderDialogWindow();
                    dialog.RootPath             = this.RootPath;
                    dialog.CurrentProjectFolder = projectFolder;
                    dialog.CurrentMapping       = this.CurrentMapping;
                    dialog.TridionFolders       = this.CurrentMapping.TridionFolders.FillNamedPath(this.CurrentMapping);
                    bool res = dialog.ShowDialog() == true;
                    if (res)
                    {
                        CollectionViewSource.GetDefaultView(this.dataGridProjectMapping.ItemsSource).Refresh();
                    }
                }
            }
        }
 private void btnAddProjectFolder_Click(object sender, RoutedEventArgs e)
 {
     ProjectFolderDialogWindow dialog = new ProjectFolderDialogWindow();
     dialog.RootPath = this.RootPath;
     dialog.CurrentProjectFolder = new ProjectFolderInfo { RootPath = this.RootPath, Path = "", Checked = false };
     dialog.TridionFolders = this.CurrentMapping.TridionFolders.FillNamedPath(this.CurrentMapping);
     bool res = dialog.ShowDialog() == true;
     if (res)
     {
         ProjectFolderInfo projectFolder = dialog.CurrentProjectFolder;
         if (projectFolder != null)
         {
             this.CurrentMapping.ProjectFolders.Add(projectFolder);
             CollectionViewSource.GetDefaultView(this.dataGridProjectMapping.ItemsSource).Refresh();
         }
     }
 }
Example #3
0
        private void btnAddProjectFolder_Click(object sender, RoutedEventArgs e)
        {
            ProjectFolderDialogWindow dialog = new ProjectFolderDialogWindow();

            dialog.RootPath             = this.RootPath;
            dialog.CurrentProjectFolder = new ProjectFolderInfo {
                RootPath = this.RootPath, Path = "", Checked = false
            };
            dialog.CurrentMapping = this.CurrentMapping;
            dialog.TridionFolders = this.CurrentMapping.TridionFolders.FillNamedPath(this.CurrentMapping);
            bool res = dialog.ShowDialog() == true;

            if (res)
            {
                ProjectFolderInfo projectFolder = dialog.CurrentProjectFolder;
                if (projectFolder != null)
                {
                    this.CurrentMapping.ProjectFolders.Add(projectFolder);
                    CollectionViewSource.GetDefaultView(this.dataGridProjectMapping.ItemsSource).Refresh();
                }
            }
        }
        private void DataGridProjectMapping_OnMouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            if (sender == null)
                return;

            DataGrid grid = sender as DataGrid;
            if (grid != null && grid.SelectedItems != null && grid.SelectedItems.Count == 1)
            {
                ProjectFolderInfo projectFolder = grid.SelectedItem as ProjectFolderInfo;
                if (projectFolder != null)
                {
                    MainService.CreateVSFolder(projectFolder.FullPath);

                    ProjectFolderDialogWindow dialog = new ProjectFolderDialogWindow();
                    dialog.RootPath = this.RootPath;
                    dialog.CurrentProjectFolder = projectFolder;
                    dialog.CurrentMapping = this.CurrentMapping;
                    dialog.TridionFolders = this.CurrentMapping.TridionFolders.FillNamedPath(this.CurrentMapping);
                    bool res = dialog.ShowDialog() == true;
                    if (res)
                    {
                        CollectionViewSource.GetDefaultView(this.dataGridProjectMapping.ItemsSource).Refresh();
                    }
                }
            }
        }