/// <summary> /// Determines the currently active worksheet and issues the command to that worksheet by calling /// Run with the worksheet as a parameter. /// </summary> public override void Run() { Altaxo.Gui.SharpDevelop.SDWorksheetViewContent ctrl = Current.Workbench.ActiveViewContent as Altaxo.Gui.SharpDevelop.SDWorksheetViewContent; if (null != ctrl) { Run(ctrl.Controller); } }
public bool IsValid(object caller, Condition condition) { string selectedData = condition.Properties["selected"].ToLower(); if (Current.Workbench.ActiveViewContent == null) { return(false); } if (!(Current.Workbench.ActiveViewContent is Altaxo.Gui.SharpDevelop.SDWorksheetViewContent)) { return(false); } Altaxo.Gui.SharpDevelop.SDWorksheetViewContent ctrl = Current.Workbench.ActiveViewContent as Altaxo.Gui.SharpDevelop.SDWorksheetViewContent; int val = ctrl.Controller.SelectedDataColumns.Count; switch (selectedData) { case "none": return(val == 0); case "one": return(val == 1); case "two": return(val == 2); case "all": return(val == ctrl.Controller.Doc.DataColumnCount); case "any": return(val > 0); case "*": return(val > 0); default: { try { int num = int.Parse(selectedData); return(val == num); } catch (Exception) { return(false); } } } }
/// <summary> /// Creates a view content for a table. /// </summary> /// <param name="table">The table which should be viewed.</param> /// <param name="layout">The layout for the table.</param> /// <returns>The view content for the provided table.</returns> public Altaxo.Worksheet.GUI.IWorksheetController CreateNewWorksheet(Altaxo.Data.DataTable table, Altaxo.Worksheet.WorksheetLayout layout) { layout.DataTable = table; Altaxo.Gui.SharpDevelop.SDWorksheetViewContent ctrl = new Altaxo.Gui.SharpDevelop.SDWorksheetViewContent(layout); Altaxo.Worksheet.GUI.WorksheetView view = new Altaxo.Worksheet.GUI.WorksheetView(); ctrl.Controller.View = view; if (null != Current.Workbench) { Current.Workbench.ShowView(ctrl); } return(ctrl.Controller); }
public bool IsValid(object caller, Condition condition) { string selectedData = condition.Properties["ContainsPLSModelData"]; if (Current.Workbench.ActiveViewContent == null) { return(false); } if (!(Current.Workbench.ActiveViewContent is Altaxo.Gui.SharpDevelop.SDWorksheetViewContent)) { return(false); } Altaxo.Gui.SharpDevelop.SDWorksheetViewContent ctrl = Current.Workbench.ActiveViewContent as Altaxo.Gui.SharpDevelop.SDWorksheetViewContent; return(ctrl.Controller.DataTable.GetTableProperty("Content") is Altaxo.Calc.Regression.Multivariate.MultivariateContentMemento); }
/// <summary> /// Creates a view content for a table. /// </summary> /// <param name="table">The table which should be viewed.</param> /// <param name="layout">The layout for the table.</param> /// <returns>The view content for the provided table.</returns> public Altaxo.Worksheet.GUI.IWorksheetController CreateNewWorksheet(Altaxo.Data.DataTable table, Altaxo.Worksheet.WorksheetLayout layout) { layout.DataTable = table; Altaxo.Gui.SharpDevelop.SDWorksheetViewContent ctrl = new Altaxo.Gui.SharpDevelop.SDWorksheetViewContent(layout); Altaxo.Worksheet.GUI.WorksheetView view = new Altaxo.Worksheet.GUI.WorksheetView(); ctrl.Controller.View = view; if (null != Current.Workbench) Current.Workbench.ShowView(ctrl); return ctrl.Controller; }
/// <summary> /// Creates a view content for a table. /// </summary> /// <param name="table">The table which should be viewed.</param> /// <param name="layout">The layout for the table.</param> /// <returns>The view content for the provided table.</returns> private Altaxo.Gui.Worksheet.Viewing.IWorksheetController CreateNewWorksheet_Unsynchronized(Altaxo.Data.DataTable table, Altaxo.Worksheet.WorksheetLayout layout) { layout.DataTable = table; var ctrl = new Altaxo.Gui.SharpDevelop.SDWorksheetViewContent(layout); var view = new Altaxo.Gui.Worksheet.Viewing.WorksheetViewWpf(); ctrl.Controller.ViewObject = view; if (null != Current.Workbench) Current.Workbench.ShowView(ctrl); return ctrl.Controller; }