Пример #1
0
        public override void Run(Altaxo.Worksheet.GUI.WorksheetController ctrl)
        {
            Altaxo.Data.DataTable dataTable = ctrl.DataTable;
            if (ctrl.SelectedDataColumns.Count == 0)
            {
                return;
            }
            m_Column = dataTable.DataColumns[ctrl.SelectedDataColumns[0]];

            IScriptText script = (IScriptText)dataTable.DataColumns.ColumnScripts[m_Column];

            if (script == null)
            {
                script = new DataColumnScript();
            }

            object[] args = new object[] { script, new ScriptExecutionHandler(this.EhScriptExecution) };
            if (Current.Gui.ShowDialog(args, "DataColumnScript of " + m_Column.Name))
            {
                if (null != dataTable.DataColumns.ColumnScripts[m_Column])
                {
                    dataTable.DataColumns.ColumnScripts[m_Column] = (IColumnScriptText)args[0];
                }
                else
                {
                    dataTable.DataColumns.ColumnScripts.Add(m_Column, args[0]);
                }
            }
            this.m_Column = null;
        }
Пример #2
0
        public override void Run(Altaxo.Gui.Worksheet.Viewing.WorksheetController ctrl)
        {
            Altaxo.Data.DataTable dataTable = ctrl.DataTable;
            if (ctrl.SelectedDataColumns.Count == 0)
            {
                return;
            }
            m_Column = dataTable.DataColumns[ctrl.SelectedDataColumns[0]];

            dataTable.DataColumns.ColumnScripts.TryGetValue(m_Column, out var script);
            if (script == null)
            {
                script = new DataColumnScript();
            }

            object[] args = new object[] { script, new ScriptExecutionHandler(EhScriptExecution) };
            if (Current.Gui.ShowDialog(args, "DataColumnScript of " + m_Column.Name))
            {
                dataTable.DataColumns.ColumnScripts[m_Column] = (IColumnScriptText)args[0];
            }
            m_Column = null;
        }