private void initTab() { for (int i = 0; i < TabSize; i++) { Tab.Add(i); } shuffleTab(); }
public void changeTabSize() { Tab.Clear(); for (int i = 0; i < TabSize; i++) { Tab.Add(i); } shuffleTab(); }
public static void Main(string[] args) { Console.OutputEncoding = System.Text.Encoding.UTF8; Restaurant restaurant = new Restaurant("Taco Palenque", "1200 Main ST."); Tab tab = new Tab(); tab.Add(7.99); tab.Add(6.55); tab.Add(2.345); Receipt receipt = restaurant.GetReceipt(tab); Console.Write(receipt); Console.WriteLine(); Console.WriteLine("Press any key to continue"); Console.ReadKey(); }
static void Main(string[] args) { Console.OutputEncoding = System.Text.Encoding.UTF8; Restaurant restaurant = new Restaurant("Resto restaurant", "1100 Main ST."); //object Tab tab = new Tab(); tab.Add(7.55); tab.Add(3.24); tab.Add(6.157); Receipt receipt = restaurant.GetReceipt(); Console.Write(receipt); Console.WriteLine(); Console.WriteLine("Press any key to continue!"); Console.ReadKey(); }
private void AddTab(Tab tabset) { var text = $"Tab {tabset.Items.Count() + 1}"; tabset.Add(new Dictionary <string, object> { [nameof(TabItem.Text)] = text, [nameof(TabItem.IsActive)] = true, [nameof(TabItem.ChildContent)] = new RenderFragment(builder => { var index = 0; builder.OpenElement(index++, "div"); builder.AddContent(index++, $"我是新建的 Tab 名称是 {text}"); builder.CloseElement(); }) }); }
private async Task AddTab(Tab tabset) { var text = $"Tab {tabset.Items.Count() + 1}"; var item = new TabItem(); var parameters = new Dictionary <string, object> { [nameof(TabItem.Text)] = text, [nameof(TabItem.IsActive)] = true, [nameof(TabItem.ChildContent)] = new RenderFragment(builder => { var index = 0; builder.OpenElement(index++, "div"); builder.AddContent(index++, $"我是新建的 Tab 名称是 {text}"); builder.CloseElement(); }) }; var _ = item.SetParametersAsync(ParameterView.FromDictionary(parameters)); await tabset.Add(item); }
//this method populates the Listbox public void populatelistbox(String s, String q) { System.Windows.Forms.Cursor old = this.Cursor; this.Cursor = Cursors.AppStarting; String loc = s; String f = q; OleDbConnection con = null; DataTable dt = null; string CconnectionString; CconnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + loc + ";Extended Properties=Excel 12.0;"; con = new OleDbConnection(CconnectionString); try { con.Open(); dt = con.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null); String[] excelSheetNames = new String[dt.Rows.Count]; int i = 0; foreach (DataRow row in dt.Rows) { excelSheetNames[i] = row["TABLE_NAME"].ToString(); Fnames.Add(f); Flocations.Add(loc); Tab.Add(row["TABLE_NAME"].ToString()); ARCHlb.Items.Add(f + " , " + excelSheetNames[i]); i++; } } catch (Exception ex) { MessageBox.Show("Could not read tab names. Error: " + ex.Message); } finally { con.Close(); this.Cursor = old; } }