public TestThemeSpeed() { InitializeComponent(); theme = new ThemeList(); theme.LoadBaseThemes(); theme.SetThemeByName("Elite Verdana"); // Theme.Current.ButtonStyle = "System"; // if removed, its faster Theme.Current.WindowsFrame = true; System.Diagnostics.Debug.WriteLine($"start {AppTicks.TickCountLap("AP", true)}"); for (int i = 0; i < 1000; i++) { ExtComboBox cb = new ExtComboBox(); cb.Location = new Point(1, 30 * i); cb.Size = new Size(200, 24); cb.Items = new string[] { "one", "two" }; cb.SelectedIndex = 0; panelMain.Controls.Add(cb); } Theme.Current.ApplyStd(this); System.Diagnostics.Debug.WriteLine($"added {AppTicks.TickCountLap("AP")}"); }
internal static void Register() // .config -> gtyperegister_static_function= { ExtTextBox.Register(); ExtComboBox.Register();
protected override void OnInit(EventArgs e) { #region Data Random rand = new Random(); List<string> currencies = new List<string>() { "EUR", "USD", "JPY", "BOB" }; // Données opur alimenter le tableau for (int i = 0; i < 100; i++) { data.Add(new MySampleObject() { DateProperty = DateTime.UtcNow.AddSeconds(-rand.Next()), DoNotShowProperty = "I am the hidden one.", IntProperty = i * 10000, StringProperty = String.Concat("I am property number ", i), BoolProperty = true, FloatProperty = i * 1000.01F, Amount = new Dictionary<string, double>() { { "EUR", 1 }, { "USD", 2 }, { "JPY", 3 }, { "BOB", 1000 } }, Currency = currencies[rand.Next(0, 3)], InnerObject = new MySampleObject() { StringProperty = "InnerObject.StringProperty", InnerObject = new MySampleObject() { StringProperty = "InnerObject.InnerObject.StringProperty" } } }); } #endregion combo1 = new ExtComboBox<MySampleObject>(); combo2 = new ExtComboBox<MySampleObject>(); combo3 = new ExtComboBox<MySampleObject>(); combo4 = new ExtComboBox<MySampleObject>(); combo1.SetDataAndConfiguration(GetConfigComboBox(1), data.Take(10).ToList(), Combobox1Container); combo2.SetDataAndConfiguration(GetConfigComboBox(2), data.Take(10).ToList(), Combobox2Container); combo3.SetDataAndConfiguration(GetConfigComboBox(3), data.Take(10).ToList(), Combobox3Container); combo4.SetDataAndConfiguration(GetConfigComboBox(4), data.Take(10).ToList(), Combobox4Container); //BtnListener.Listeners.Click.Handler = //@"Ext.net.DirectMethods.ThrowAjaxException(item, e)"; // { // success: { }, // failure: function (errorMsg) { } // }); //"; //"Ext.Msg.alert('Confirm', 'TEST');"; Load += new EventHandler(Page_Load); base.OnInit(e); }