Exemple #1
0
        public void LoadDataSources(Action <ActionBase> completedEventHandler)
        {
            if (XenObject == null)
            {
                return;
            }
            GetDataSourcesAction action = new GetDataSourcesAction(XenObject.Connection, XenObject);

            action.Completed += completedEventHandler;
            action.RunAsync();
        }
 void getDataSorucesAction_Completed(ActionBase sender)
 {
     Program.Invoke(this, delegate
     {
         tableLayoutPanel1.Visible   = false;
         GetDataSourcesAction action = sender as GetDataSourcesAction;
         if (action != null)
         {
             _dataSources = DataSourceItemList.BuildList(action.IXenObject, action.DataSources);
             PopulateDataGridView();
         }
         searchTextBox.Enabled = true;
         EnableControls();
     });
 }
Exemple #3
0
        void getDataSorucesAction_Completed(ActionBase sender)
        {
            Program.Invoke(this, delegate
            {
                GetDataSourcesAction action = sender as GetDataSourcesAction;
                if (action != null)
                {
                    List <DataSourceItem> dataSources = DataSourceItemList.BuildList(action.IXenObject, action.DataSources);
                    foreach (DataSourceItem dataSourceItem in dataSources)
                    {
                        bool displayOnGraph = designedGraph.DataSources.Contains(dataSourceItem);
                        dataGridView.Rows.Add(new DataSourceGridViewRow(dataSourceItem, displayOnGraph));
                    }

                    dataGridView.Sort(dataGridView.Columns[DisplayOnGraphColumnIndex], ListSortDirection.Ascending);
                    if (dataGridView.Rows.Count > 0)
                    {
                        dataGridView.Rows[0].Cells[DisplayOnGraphColumnIndex].Selected = true;
                    }
                }
                EnableControls();
            });
        }