示例#1
0
        public AuditLogForm(SkylineViewContext viewContext)
            : base(viewContext, AuditLogStrings.AuditLogForm_AuditLogForm_Audit_Log)
        {
            InitializeComponent();

            _skylineWindow = viewContext.SkylineDataSchema.SkylineWindow;

            _clearLogButton = new ToolStripButton(AuditLogStrings.AuditLogForm_AuditLogForm_Clear_log);

            _enableAuditLogging = new CheckBox
            {
                Text      = AuditLogStrings.AuditLogForm_AuditLogForm_Enable_audit_logging,
                Checked   = Settings.Default.AuditLogging,
                BackColor = Color.Transparent
            };

            var checkBoxHost = new ToolStripControlHost(_enableAuditLogging)
            {
                Alignment = ToolStripItemAlignment.Right
            };

            NavBar.BindingNavigator.Items.Add(_clearLogButton);
            NavBar.BindingNavigator.Items.Add(checkBoxHost);

            if (!string.IsNullOrEmpty(Settings.Default.AuditLogView))
            {
                var viewName = ViewName.Parse(Settings.Default.AuditLogView);
                if (viewName.HasValue)
                {
                    DataboundGridControl.ChooseView(viewName.Value);
                }
            }
        }
示例#2
0
        public void VerifyActionsEnabled(DataboundGridControl databoundGridControl, params RowAction[] rowActions)
        {
            var enabledMenuItems = new HashSet <string>(rowActions.Select(action => action.GetMenuItemText(SrmDocument.DOCUMENT_TYPE.proteomic)));
            var menuItems        = GetDropDownItems(databoundGridControl.NavBar.ActionsButton);

            Assert.AreNotEqual(0, menuItems.Length);
            foreach (var item in menuItems)
            {
                Assert.AreEqual(enabledMenuItems.Contains(item.Text), item.Enabled);
            }
        }
示例#3
0
        private void Filter(DataboundGridControl databoundGridControl, PropertyPath propertyPath, string filterValue)
        {
            WaitForConditionUI(() => databoundGridControl.IsComplete);
            var filterDlg = ShowDialog <QuickFilterForm>(() =>
            {
                databoundGridControl.QuickFilter(databoundGridControl.FindColumn(propertyPath));
            });

            RunUI(() =>
            {
                filterDlg.SetFilterOperation(0, FilterOperations.OP_EQUALS);
                filterDlg.SetFilterOperand(0, filterValue);
            });
            OkDialog(filterDlg, filterDlg.OkDialog);
            WaitForConditionUI(() => databoundGridControl.IsComplete);
        }
示例#4
0
        protected bool ExportFromDatagridAndMaybeTryToCancel(DataboundGridControl databoundGridControl,
                                                             string filename, bool maybeTryToCancel)
        {
            Assert.IsFalse(File.Exists(filename));
            bool triedToCancel = RunAndMaybeTryCancel(() =>
            {
                var skylineViewContext = (SkylineViewContext)databoundGridControl.NavBar.ViewContext;
                skylineViewContext.ExportToFile(databoundGridControl, databoundGridControl.BindingListSource.ViewInfo, filename,
                                                new DsvWriter(CultureInfo.CurrentCulture, SEPARATOR_TO_USE));
            }, true);

            if (!triedToCancel)
            {
                Assert.IsTrue(File.Exists(filename));
            }
            return(File.Exists(filename));
        }
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DataboundGridForm));
     this.databoundGridControl = new pwiz.Skyline.Controls.Databinding.DataboundGridControl();
     this.SuspendLayout();
     //
     // databoundGridControl
     //
     resources.ApplyResources(this.databoundGridControl, "databoundGridControl");
     this.databoundGridControl.Name = "databoundGridControl";
     //
     // DataboundGridForm
     //
     resources.ApplyResources(this, "$this");
     this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     this.Controls.Add(this.databoundGridControl);
     this.Name = "DataboundGridForm";
     this.ShowInTaskbar = false;
     this.ResumeLayout(false);
 }
示例#6
0
        private List <string> GetColumnValues(DataboundGridControl databoundGridControl, PropertyPath propertyPath)
        {
            List <string> list = new List <string>();

            RunUI(() =>
            {
                var column = databoundGridControl.FindColumn(propertyPath);
                for (int i = 0; i < databoundGridControl.RowCount; i++)
                {
                    var value = databoundGridControl.DataGridView.Rows[i].Cells[column.Index].FormattedValue;
                    if (value == null)
                    {
                        list.Add(null);
                    }
                    else
                    {
                        list.Add(value as string ?? value.ToString());
                    }
                }
            });
            return(list);
        }