private void SetupDataGrids() { // data sources this.SummaryDataGrid.DataSource = this.SummaryDataGridBindingSource; this.TransactionDataGrid.DataSource = this.TransactionDataGridBindingSource; this.YearSummaryDataGrid.DataSource = this.YearSummaryDataGridBindingSource; this.TransactionDataGrid.UserDeletingRow += (object o, DataGridViewRowCancelEventArgs e) => { // don't let the normal delete row happen. The data grid will be updated when the item is removed from it binding list e.Cancel = true; this.Transactions.Remove((Transaction)e.Row.DataBoundItem); }; this.TransactionDataGrid.MouseDown += this.TransactionDataGrid_Click; // setup formatting this.TransactionDataGrid.CellFormatting += this.TransactionDataGrid_CellFormatting; this.SummaryDataGrid.CellFormatting += this.SummaryDataGrid_CellFormatting; this.YearSummaryDataGrid.CellFormatting += this.YearSummaryDataGrid_CellFormatting; this.TransactionDataGrid.Sort(this.TransactionDataGrid.Columns[0], ListSortDirection.Descending); this.SummaryDataGrid.Sort(this.SummaryDataGrid.Columns[3], ListSortDirection.Descending); this.Transactions.ListChanged += this.TransactionsUpdated; var cryptocurrenyFilterInput = ((ToolStripComboBox)this.toolStrip2.Items["CryptoFilterInput"]); var noneOption = new NoneOption(); cryptocurrenyFilterInput.Items.Add(noneOption); cryptocurrenyFilterInput.SelectedIndex = 0; cryptocurrenyFilterInput.Items .AddRange(Enum.GetValues(typeof(CryptoType)).Cast <object>().ToArray()); cryptocurrenyFilterInput.SelectedIndexChanged += this.OnCryptoFilterInputChange; cryptocurrenyFilterInput.TextChanged += this.OnCryptoFilterInputChange; }
public void DefaultOption_Is_Considered_None() { Option <string> option = default; Assert.Equal(option, Option.None); Option <string> option2 = new NoneOption(); Assert.Equal(option2, Option.None); }
public static Option <TValue, TError> None(TError?error = default) => NoneOption <TValue, TError> .Create(error);
public static NoneOptionNotifyCompletion GetAwaiter(this NoneOption option) { return(new NoneOptionNotifyCompletion()); }