private void OnRefresh(object sender, EventArgs e) { // TODO: clear table (? or update it for slightly better performance) // TODO: load servers from db // TODO: fill table RefreshClick?.Invoke(this, EventArgs.Empty); }
public AuthenticatorListHolder(View view) : base(view) { Issuer = view.FindViewById <TextView>(Resource.Id.textIssuer); Username = view.FindViewById <TextView>(Resource.Id.textUsername); Code = view.FindViewById <TextView>(Resource.Id.textCode); ProgressBar = view.FindViewById <ProgressBar>(Resource.Id.progressBar); RefreshButton = view.FindViewById <ImageButton>(Resource.Id.buttonRefresh); Icon = view.FindViewById <ImageView>(Resource.Id.imageIcon); var menuButton = view.FindViewById <ImageButton>(Resource.Id.buttonMenu); view.Click += delegate { Click?.Invoke(this, AdapterPosition); }; menuButton.Click += delegate { MenuClick?.Invoke(this, AdapterPosition); }; RefreshButton.Click += delegate { RefreshClick?.Invoke(this, AdapterPosition); }; }
private void OnRefresh(object sender, EventArgs e) { // TODO: clear table (? or update it for slightly better performance) // TODO: load servers from db // TODO: fill table RefreshClick?.Invoke(this, EventArgs.Empty); AppendServer(new GameServerEntry() { Name = "Пустышка сервер 1", MaxPlayers = 10 }); AppendServer(new GameServerEntry() { Name = "Пустышка сервер 2", MaxPlayers = 40 }); AppendServer(new GameServerEntry() { Name = "Пустышка сервер 3", MaxPlayers = 100 }); }
private void DrawSceneAssetList() { using (new EditorGUILayout.HorizontalScope()) { EditorGUILayout.LabelField("Quick Switch Scenes"); if (GUILayout.Button("Refresh", EditorStyles.miniButton, GUILayout.MaxWidth(60))) { RefreshClick?.Invoke(); } } GUILayout.Space(10); if (_sceneAssets.Count == 0) { EditorGUILayout.LabelField("Press “+” to add Scene Assets..."); } else { for (int i = 0; i < _sceneAssets.Count; i++) { if (i != 0) { GUILayout.Space(2.5f); } DrawSceneAssetLine(i); } } GUILayout.Space(5); if (GUILayout.Button(new GUIContent("+", "Add a scene asset"), EditorStyles.miniButton)) { _sceneAssets.Add(null); LayoutChanged?.Invoke(); } }
/// <summary> /// 初始化布局 /// </summary> public override void InitializeLayout() { this.MaximumSize = new Size(150, 40); this.MinimumSize = new Size(150, 40); this.Add(this.GoBackButton = new ControlBase()); this.Add(this.RefreshButton = new ControlBase()); this.Add(this.LogButton = new ControlBase()); this.GoBackButton.SetLocation(5, 0); this.GoBackButton.Mouseable = true; this.GoBackButton.MaxSize = new Size(40, 40); this.GoBackButton.MinSize = new Size(40, 40); this.GoBackButton.Image = UnityResource.GoBack_0; this.GoBackButton.MouseEnter += (s, e) => { this.Invalidate(this.GoBackButton.Rectangle); this.GoBackButton.Image = UnityResource.GoBack_1; }; this.GoBackButton.MouseLeave += (s, e) => { this.Invalidate(this.GoBackButton.Rectangle); this.GoBackButton.Image = UnityResource.GoBack_0; }; this.GoBackButton.Click += (s, e) => { GoBackClick?.Invoke(this, EventArgs.Empty); }; this.RefreshButton.SetLocation(55, 0); this.RefreshButton.Mouseable = true; this.RefreshButton.MaxSize = new Size(40, 40); this.RefreshButton.MinSize = new Size(40, 40); this.RefreshButton.Image = UnityResource.Refresh_0; this.RefreshButton.MouseEnter += (s, e) => { this.Invalidate(this.RefreshButton.Rectangle); this.RefreshButton.Image = UnityResource.Refresh_1; }; this.RefreshButton.MouseLeave += (s, e) => { this.Invalidate(this.RefreshButton.Rectangle); this.RefreshButton.Image = UnityResource.Refresh_0; }; this.RefreshButton.Click += (s, e) => { RefreshClick?.Invoke(this, EventArgs.Empty); }; this.LogButton.SetLocation(105, 0); this.LogButton.Mouseable = true; this.LogButton.MaxSize = new Size(40, 40); this.LogButton.MinSize = new Size(40, 40); this.LogButton.Image = UnityResource.Log_0; this.LogButton.MouseEnter += (s, e) => { this.Invalidate(this.LogButton.Rectangle); this.LogButton.Image = UnityResource.Log_1; }; this.LogButton.MouseLeave += (s, e) => { this.Invalidate(this.LogButton.Rectangle); this.LogButton.Image = UnityResource.Log_0; }; this.LogButton.Click += (s, e) => { LogClick?.Invoke(this, EventArgs.Empty); }; }
private void RefreshButtonOnClick(object sender, RoutedEventArgs e) { RefreshClick?.Invoke(sender, e); }
private void LblRefresh_Click(object sender, EventArgs e) { RefreshClick?.Invoke(sender, e); }