Exemplo n.º 1
0
 private void AddColumns(ViewEditor viewEditor, params PropertyPath[] propertyPaths)
 {
     RunUI(() =>
     {
         foreach (var propertyPath in propertyPaths)
         {
             Assert.IsTrue(viewEditor.ChooseColumnsTab.TrySelect(propertyPath), "Unable to select {0}",
                           propertyPath);
             viewEditor.ChooseColumnsTab.AddSelectedColumn();
         }
     });
 }
Exemplo n.º 2
0
        private string[] CheckPreview(ViewEditor viewEditor, Action <DocumentGridForm, SrmDocument> checkPreview)
        {
            string[] columnNames = null;
            var      dlg         = ShowDialog <DocumentGridForm>(viewEditor.ShowPreview);

            WaitForConditionUI(() => dlg.IsComplete);
            RunUI(() =>
            {
                checkPreview(dlg, SkylineWindow.DocumentUI);
                columnNames = dlg.ColumnHeaderNames;
            });
            OkDialog(dlg, dlg.Close);
            return(columnNames);
        }
Exemplo n.º 3
0
        private PropertyPath GetSelectedPath(ViewEditor viewEditor)
        {
            PropertyPath selectedPath = null;

            RunUI(() =>
            {
                var tree   = viewEditor.ActiveAvailableFieldsTree;
                var column = tree.GetTreeColumn(tree.SelectedNode);
                if (null != column)
                {
                    selectedPath = column.PropertyPath;
                }
            });
            return(selectedPath);
        }
Exemplo n.º 4
0
        private void tsbEditXml_Click(object sender, EventArgs e)
        {
            if (ViewEditor == null || ViewEditor.LayoutXml == null)
            {
                MessageBox.Show("First select a view to design.", ((ToolStripButton)sender).Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            var xcdDialog = new XmlContentDisplayDialog(ViewEditor.LayoutXml.OuterXml, "LayoutXml", true, true);

            xcdDialog.StartPosition = FormStartPosition.CenterParent;
            if (xcdDialog.ShowDialog() == DialogResult.OK)
            {
                var entity = new Entity();
                entity.Attributes.Add("layoutxml", xcdDialog.result.OuterXml);

                ViewEditor.Set(entity);
                ViewEditor.IsLayoutXmlChanged = true;
            }
        }
Exemplo n.º 5
0
        private void tsbOpen_Click(object sender, EventArgs e)
        {
            if (Service == null)
            {
                MessageBox.Show("Please connect to CRM.", ((ToolStripButton)sender).Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            var select = new SelectViewDialog(this);

            select.StartPosition = FormStartPosition.CenterParent;
            if (select.ShowDialog() == DialogResult.OK)
            {
                tsbSnap.Checked = true;

                ViewEditor.Enabled = true;
                ViewEditor.Set(select.View);
                tsbSnap.Checked = ViewEditor.Snapped;
            }
        }
Exemplo n.º 6
0
        private void tsbEditColumns_Click(object sender, EventArgs e)
        {
            if (ViewEditor == null || ViewEditor.FetchXml == null)
            {
                MessageBox.Show("First select a view to design.", ((ToolStripButton)sender).Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            var select = new SelectColumnsDialog(ViewEditor.FetchXml, ViewEditor.LayoutXml);

            select.StartPosition = FormStartPosition.CenterParent;
            if (select.ShowDialog() == DialogResult.OK)
            {
                var entity = new Entity();
                entity.Attributes.Add("layoutxml", select.LayoutXml.OuterXml);

                //tsbSnap.Checked = true;

                ViewEditor.Set(entity);
                ViewEditor.IsLayoutXmlChanged = true;
            }
        }
 public static void SetPivotIsotopeLabel(ViewEditor viewEditor, bool pivotIsotopeLabel)
 {
     viewEditor.ViewEditorWidgets.OfType <PivotReplicateAndIsotopeLabelWidget>().First().SetPivotIsotopeLabel(pivotIsotopeLabel);
 }
Exemplo n.º 8
0
        protected void DoResultsGridView()
        {
            // Results Grid View
            RestoreViewOnScreen(25);
            PauseForScreenShot <LiveResultsGrid>("Take full screen capture of floating windows", 25);
            RestoreViewOnScreen(26);
            PauseForScreenShot("Main window layout", 26);

            // Not understood: WaitForOpenForm occasionally hangs in nightly test runs. Fixed it by calling
            // ShowDialog when LiveResultsGrid cannot be found.
            //var resultsGridForm = WaitForOpenForm<LiveResultsGrid>();
            var resultsGridForm = FindOpenForm <LiveResultsGrid>() ??
                                  ShowDialog <LiveResultsGrid>(() => SkylineWindow.ShowResultsGrid(true));
            BoundDataGridView resultsGrid = null;

            RunUI(() =>
            {
                resultsGrid = resultsGridForm.DataGridView;
                SkylineWindow.AutoZoomBestPeak();
                SkylineWindow.SelectedPath = ((SrmTreeNode)SkylineWindow.SequenceTree.SelectedNode.Nodes[0]).Path;
            });
            WaitForGraphs();

            RunUI(() =>
            {
                var precursorNoteColumn =
                    resultsGrid.Columns.Cast <DataGridViewColumn>()
                    .First(col => GetLocalizedCaption("PrecursorReplicateNote") == col.HeaderText);
                resultsGrid.CurrentCell = resultsGrid.Rows[0].Cells[precursorNoteColumn.Index];
                resultsGrid.BeginEdit(true);
                // ReSharper disable LocalizableElement
                resultsGrid.EditingControl.Text = "Low signal";   // Not L10N
                // ReSharper restore LocalizableElement
                resultsGrid.EndEdit();
                resultsGrid.CurrentCell = resultsGrid.Rows[1].Cells[resultsGrid.CurrentCell.ColumnIndex];
            });
            WaitForGraphs();
            RunUI(() => SkylineWindow.SelectedResultsIndex = 1);
            WaitForGraphs();

            PauseForScreenShot("Results Grid view subsection", 27);

            RunDlg <ViewEditor>(resultsGridForm.NavBar.CustomizeView, resultsGridViewEditor =>
            {
                // TODO: Update tutorial instructions with new name.
                resultsGridViewEditor.ViewName = "NewResultsGridView";
                var chooseColumnTab            = resultsGridViewEditor.ChooseColumnsTab;
                foreach (
                    var column in
                    new[]
                {
                    PropertyPath.Parse("MinStartTime"), PropertyPath.Parse("MaxEndTime"),
                    PropertyPath.Parse("LibraryDotProduct"), PropertyPath.Parse("TotalBackground"),
                    PropertyPath.Parse("TotalAreaRatio")
                })
                {
                    Assert.IsTrue(chooseColumnTab.ColumnNames.Contains(GetLocalizedCaption(column.Name)));
                    Assert.IsTrue(chooseColumnTab.TrySelect(column), "Unable to select {0}", column);
                    chooseColumnTab.RemoveColumn(column);
                    Assert.IsFalse(chooseColumnTab.ColumnNames.Contains(GetLocalizedCaption(column.Name)));
                }
                resultsGridViewEditor.OkDialog();
            });

            RunUI(() => SkylineWindow.SelectedNode.Expand());

            // Custom Annotations, p. 25
            var chooseAnnotationsDlg = ShowDialog <DocumentSettingsDlg>(SkylineWindow.ShowDocumentSettingsDialog);
            var editListDlg          = ShowDialog <EditListDlg <SettingsListBase <AnnotationDef>, AnnotationDef> >(chooseAnnotationsDlg.EditAnnotationList);
            var defineAnnotationDlg  = ShowDialog <DefineAnnotationDlg>(editListDlg.AddItem);

            RunUI(() =>
            {
                defineAnnotationDlg.AnnotationName    = "Tailing"; // Not L10N
                defineAnnotationDlg.AnnotationType    = AnnotationDef.AnnotationType.true_false;
                defineAnnotationDlg.AnnotationTargets = AnnotationDef.AnnotationTargetSet.Singleton(AnnotationDef.AnnotationTarget.precursor_result);
            });
            PauseForScreenShot <DefineAnnotationDlg>("Define Annotation form", 28);

            OkDialog(defineAnnotationDlg, defineAnnotationDlg.OkDialog);
            OkDialog(editListDlg, editListDlg.OkDialog);
            RunUI(() => chooseAnnotationsDlg.AnnotationsCheckedListBox.SetItemChecked(0, true));
            PauseForScreenShot <DocumentSettingsDlg>("Annotation Settings form", 29);   // p. 26

            OkDialog(chooseAnnotationsDlg, chooseAnnotationsDlg.OkDialog);

            FindNode((564.7746).ToString(LocalizationHelper.CurrentCulture) + "++");
            var        liveResultsGrid = FindOpenForm <LiveResultsGrid>();
            ViewEditor viewEditor      = ShowDialog <ViewEditor>(liveResultsGrid.NavBar.CustomizeView);

            RunUI(() =>
            {
                viewEditor.ChooseColumnsTab.ActivateColumn(2);
                Assert.IsTrue(viewEditor.ChooseColumnsTab.TrySelect(
                                  PropertyPath.Root.Property(AnnotationDef.ANNOTATION_PREFIX + "Tailing")));
                viewEditor.ChooseColumnsTab.AddSelectedColumn();
            });
            PauseForScreenShot <ViewEditor.ChooseColumnsView>("Customize View form showing Tailing annotation checked", 30);
            OkDialog(viewEditor, viewEditor.OkDialog);
            PauseForScreenShot("Main window with Tailing column added to Results Grid");   // p. 27
        }
Exemplo n.º 9
0
 private void tsbLivePreview_Click(object sender, EventArgs e)
 {
     ViewEditor.Preview(((ToolStripButton)sender).Checked);
 }
Exemplo n.º 10
0
 private void tsbSnap_Click(object sender, EventArgs e)
 {
     ViewEditor.Snap(((ToolStripButton)sender).Checked);
 }