Exemplo n.º 1
0
        private void MnuCopyTab_Click(object sender, RoutedEventArgs e)
        {
            var dialog = new StringQueryDialog("Enter Tab name:")
            {
                Owner = this
            };

            if (dialog.ShowDialog() == true)
            {
                String       tabName         = dialog.QueryString;
                BuildTabItem originalTab     = tabs.SelectedItem as BuildTabItem;
                String       originalBaseDir = originalTab.BaseDir;
                String       newBaseDir      = originalBaseDir.Replace(originalTab.TabName, tabName);
                BuildTabItem tab             = new BuildTabItem()
                {
                    TabName = tabName, BaseDir = newBaseDir, BaseOptions = originalTab.BaseOptions
                };
                var clonedList = _Model.Scope2SolutionObjects[originalTab.TabName].Select(obj => (SolutionObject)obj.Clone()).ToList();
                _Model.Scope2SolutionObjects[tabName] = new System.Collections.ObjectModel.ObservableCollection <SolutionObject>(clonedList);
                tab.BindToModel(ref _Model, ref _ViewModel);
                _ViewModel.Tabs.Add(tab);
            }
        }
Exemplo n.º 2
0
        private void MnuNewTab_Click(object sender, RoutedEventArgs e)
        {
            var dialog = new ListViewQueryDialog("New Tab")
            {
                Owner = this
            };

            dialog.Entries.Add(new SettingsPair("Name", ""));
            dialog.Entries.Add(new SettingsPair("Base dir", ""));
            if (dialog.ShowDialog() == true)
            {
                String tabName = dialog.Entries.FirstOrDefault(x => x.Key == "Name").Value;
                if (tabName == null && tabName.Length <= 0)
                {
                    return;
                }
                BuildTabItem tab = new BuildTabItem()
                {
                    TabName = tabName
                };
                tab.BindToModel(ref _Model, ref _ViewModel);
                _ViewModel.Tabs.Add(tab);
            }
        }