void ServerStatusViewer_AfterLoadAsync(object sender, DataActionAfterEventArgs e)
        {
            bindingList.Clear();
            e.GetData <ServerStatusElement[]>().ToList().ForEach(s => bindingList.Add(s));
            bindingList.ResetBindings();

            AsyncStatusRevert(e.StatusGuid);
        }
Пример #2
0
        void WebsiteViewer_AfterLoadAsync(object sender, DataActionAfterEventArgs e)
        {
            lock (websiteList)
            {
                websiteList.Clear();
                websiteList.AddRange(e.GetData <Website[]>());

                listView.VirtualListSize = websiteList.Count;
                listView.Refresh();
            }
        }
        void CustomerViewer_AfterLoadAsync(object sender, DataActionAfterEventArgs e)
        {
            lock (customerList)
            {
                customerList.Clear();
                customerList.AddRange(e.GetData <Customer[]>());

                listView.VirtualListSize = customerList.Count;
                listView.Refresh();
            }
        }
        void dataEditor_AfterLoadAsync(object sender, DataActionAfterEventArgs e)
        {
            if (e.CheckType <LoadEditorArgs>())
            {
                LoadEditorArgs args       = e.GetData <LoadEditorArgs>();
                DataEditorForm dataEditor = (DataEditorForm)sender;

                if (args.ShowAfterLoad)
                {
                    dataEditor.Show();
                }

                AsyncStatusRevert(args.StatusGuid);

                // Ensure that status auto changes again (assumes it was enabled before).
                dataEditor.AutoChangeStatus = true;
            }
        }
        void ServerStatusViewer_AfterOpenAsync(object sender, DataActionAfterEventArgs e)
        {
            AsyncStatusRevert(e.StatusGuid);
            serverDataGridView.Enabled = true;

            RunLoadAsync();

            ServerStatusActionResult result = e.GetData <ServerStatusActionResult>();
            MessageBoxIcon           icon;

            if (result.Success)
            {
                icon = MessageBoxIcon.Information;
            }
            else
            {
                icon = MessageBoxIcon.Warning;
            }

            MessageBox.Show(this, result.UserMessage, "Action result", MessageBoxButtons.OK, icon);
        }