Ejemplo n.º 1
0
        private void SaveButton_Click(object sender, EventArgs e)
        {
            if (graphList == null || graphList.XenObject == null)
            {
                return;
            }

            designedGraph.DisplayName = GraphNameTextBox.Text;
            if (isNew)
            {
                graphList.AddGraph(designedGraph);
            }
            else
            {
                graphList.ReplaceGraphAt(graphList.SelectedGraphIndex, designedGraph);
            }

            List <DataSourceItem> dataSources = new List <DataSourceItem>();

            foreach (DataGridViewRow row in dataGridView.Rows)
            {
                DataSourceItem dsi = ((DataSourceGridViewRow)row).Dsi;
                if (dsi.ColorChanged)
                {
                    Palette.SetCustomColor(Palette.GetUuid(dsi.DataSource.name_label, graphList.XenObject), dsi.Color);
                }
                dataSources.Add(dsi);
            }
            graphList.SaveGraphs(dataSources);
        }
Ejemplo n.º 2
0
 private void SaveGraphs(ActionBase sender)
 {
     Program.Invoke(Program.MainWindow, delegate
     {
         var action = sender as GetDataSourcesAction;
         if (action != null)
         {
             var dataSources = DataSourceItemList.BuildList(action.IXenObject, action.DataSources);
             GraphList.SaveGraphs(dataSources);
         }
     });
 }
Ejemplo n.º 3
0
        private void MoveGraphDown()
        {
            if (XenObject == null)
            {
                return;
            }

            int index = GraphList.SelectedGraphIndex;

            if (GraphList.AuthorizedRole)
            {
                GraphList.ExchangeGraphs(index, index + 1);
                GraphList.SaveGraphs(null);
            }
        }