private void OpenFile() { OpenFileDialog openDialog = new OpenFileDialog(); openDialog.CheckPathExists = true; openDialog.AddExtension = true; openDialog.AutoUpgradeEnabled = true; openDialog.InitialDirectory = System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyComputer); openDialog.DefaultExt = ".beta"; openDialog.Filter = "BetaData Files (*.beta)|*.beta"; openDialog.FilterIndex = 0; openDialog.Multiselect = false; System.Windows.Forms.DialogResult dr = openDialog.ShowDialog(); if (dr == System.Windows.Forms.DialogResult.OK) { this.BetaData = BetaData.Load(null, openDialog.FileName); this.BetaData.DependencyProducts.ListChanged += DependencyProducts_ListChanged; this.NewBetaDataFile = false; this.HasChanges = false; this.Cursor = Cursors.WaitCursor; this.LoadProducts(); this.InitControls(); this.Cursor = Cursors.Default; } }
private void tsbCreateCustomBeta_Click(object sender, System.EventArgs e) { BetaData customBeta = new BetaData(); using (BetaDataEditorForm form = new BetaDataEditorForm(customBeta, false)) form.ShowDialog(this); }
public BetaDataEditorForm(BetaData beta) { this.Cursor = Cursors.WaitCursor; if (this.Owner == null) { this.StartPosition = FormStartPosition.CenterScreen; } else { this.StartPosition = FormStartPosition.CenterParent; } this._betaData = beta; this.InitializeComponent(); if (this.BetaData.Parent != null) { this.BetaData.UpdateCheckout(this.BetaData.Path, this.BetaData.Url); } else { this._newBetaDataFile = true; } this.Init(); this.Translate(); this.Cursor = Cursors.Default; }
public override object EditValue(ITypeDescriptorContext context, System.IServiceProvider provider, object value) { IWindowsFormsEditorService svc = provider.GetService(typeof(IWindowsFormsEditorService)) as IWindowsFormsEditorService; BetaData beta = value as BetaData; if (svc != null && beta != null) { using (BetaDataEditorForm form = new BetaDataEditorForm(beta)) form.ShowDialog(); } return(beta); }