private void btnNew_Click(object sender, EventArgs e) { if (_pFileAdapter.IsDirty) { var dr = MessageBox.Show("You have unsaved work. Do you want to save?", "Unsaved Work", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning); switch (dr) { case DialogResult.Yes: if (_pFileAdapter.IsNew) { using (var fd = new SaveFileDialog()) { if (fd.ShowDialog() != DialogResult.OK) { return; } DoSaveAs(fd.FileName); } } else { DoSave(); } break; case DialogResult.Cancel: return; } } SetupUiForBuildFile(BuildFileAdapter.CreateNewBuildFile()); }
private void SetupUiForBuildFile(BuildFileAdapter adapter) { if (_pFileAdapter != null) { _pFileAdapter.PropertyChanged -= PFileAdapterPropertyChanged; } _pFileAdapter = adapter; _pFileAdapter.PropertyChanged += PFileAdapterPropertyChanged; // check if we need to show any warnings tslblDuplicateEntries.Visible = _pFileAdapter.SameNameProjects; _pFileAdapter.Projects.Sort(); //buildFileSource.SuspendBinding(); //buildFileSource.DataSource = new MonitoredCollection<BuildFileAdapter>() { _pFileAdapter }; //buildFileSource.ResumeBinding(); //buildFileSource.ResetBindings(true); SwitchToPrimarySource(); projectDependencySource.DataSource = _pFileAdapter; projectChildDepsSource.DataSource = _pFileAdapter; }
public ProjectScanSettings(string root, string sccroot, bool csProjects, bool cppProjects, bool dspProjects, BuildFileAdapter buildFile) { Root = root; SccRoot = sccroot; CsProjects = csProjects; CppProjects = cppProjects; DspProjects = dspProjects; BuildFile = buildFile; Filenames = new List <string>(); }
public MainForm() { InitializeComponent(); // setup binding for checkbox listboxes // for some reason some brain child decided that they // don't need the datasource property visible in the Designer lstDependants.DataSource = projectChildDepsSource; lstDependencies.DataSource = projectDependencySource; //toolStrip.Renderer = new ToolStripProfessionalRenderer(new VsColorTable()); //txtName.DataBindings.Add( // "Text", this, "CurrentItem.Name", // true, DataSourceUpdateMode.OnPropertyChanged); //txtPath.DataBindings.Add( // "Text", this, "CurrentItem.Path", // true, DataSourceUpdateMode.OnPropertyChanged); //txtSccPath.DataBindings.Add( // "Text", this, "CurrentItem.SccPath", // true, DataSourceUpdateMode.OnPropertyChanged); //txtBuildOpt.DataBindings.Add( // "Text", this, "CurrentItem.BuildOpt", // true, DataSourceUpdateMode.OnPropertyChanged); //txtFramework.DataBindings.Add( // "Text", this, "CurrentItem.Framework", // true, DataSourceUpdateMode.OnPropertyChanged); //txtPlatform.DataBindings.Add( // "Text", this, "CurrentItem.PlatformName", // true, DataSourceUpdateMode.OnPropertyChanged); //txtConfigName.DataBindings.Add( // "Text", this, "CurrentItem.ConfigurationName", // true, DataSourceUpdateMode.OnPropertyChanged); SetupUiForBuildFile(BuildFileAdapter.CreateNewBuildFile()); // lets register some application hotkeys //HotkeyManager.RegisterLocalHotkey(Keys.J, Keys.Alt, MoveNextProjectEvent, this); //HotkeyManager.RegisterLocalHotkey(Keys.K, Keys.Alt, MovePrevProjectEvent, this); //HotkeyManager.RegisterLocalHotkey(Keys.D1, Keys.Alt, SwitchDetailsView, this); //HotkeyManager.RegisterLocalHotkey(Keys.D2, Keys.Alt, SwitchDependenciesView, this); //HotkeyManager.RegisterLocalHotkey(Keys.D3, Keys.Alt, SwitchChildDependsView, this); }