public DocumentGridForm(SkylineViewContext viewContext) { InitializeComponent(); _originalFormTitle = Text; BindingListSource.SetViewContext(viewContext); BindingListSource.ListChanged += BindingListSourceOnListChanged; }
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); } } }
protected override void OnViewChange() { base.OnViewChange(); var currentViewSpec = ViewInfo.ViewSpec; var pivotedViewSpec = PivotIsotopeLabel(currentViewSpec, true); var unpivotedViewSpec = PivotIsotopeLabel(currentViewSpec, false); if (pivotedViewSpec.Equals(unpivotedViewSpec)) { cbxPivotIsotopeLabel.CheckState = CheckState.Indeterminate; cbxPivotIsotopeLabel.Enabled = false; } else { cbxPivotIsotopeLabel.Enabled = true; if (currentViewSpec.Equals(unpivotedViewSpec)) { cbxPivotIsotopeLabel.CheckState = CheckState.Unchecked; } else if (currentViewSpec.Equals(pivotedViewSpec)) { cbxPivotIsotopeLabel.CheckState = CheckState.Checked; } else { cbxPivotIsotopeLabel.CheckState = CheckState.Indeterminate; } } cbxPivotReplicate.Checked = !ViewSpec.SublistId.StartsWith(SkylineViewContext.GetReplicateSublist(ViewInfo.ParentColumn.PropertyType)); }
public void TestDefaultViews() { SkylineDataSchema dataSchema = GetDataSchema(); foreach (var type in new[] { typeof(Protein), typeof(Peptide), typeof(Precursor), typeof(Transition), typeof(Replicate) }) { var viewInfo = SkylineViewContext.GetDefaultViewInfo(ColumnDescriptor.RootColumn(dataSchema, type)); EnsureViewRoundTrips(viewInfo); } }
public LiveReportForm(IDocumentContainer documentContainer) { InitializeComponent(); Icon = Resources.Skyline; _dataSchema = new SkylineDataSchema(documentContainer); var parentColumn = new ColumnDescriptor(_dataSchema, typeof (Protein)); var viewContext = new SkylineViewContext(parentColumn); bindingListSource.SetViewContext(viewContext); bindingListSource.RowSource = new Proteins(_dataSchema); navBar.BindingNavigator.Items.Insert(0, toolStripDropDownRowSource); }
public void SetPivotReplicate(bool pivot) { if (pivot) { ViewSpec = ViewSpec.SetSublistId(PropertyPath.Root); } else { ViewSpec = ViewSpec.SetSublistId(SkylineViewContext.GetReplicateSublist(ViewInfo.ParentColumn.PropertyType)); } }
public LiveReportForm(IDocumentContainer documentContainer) { InitializeComponent(); Icon = Resources.Skyline; _dataSchema = new SkylineDataSchema(documentContainer); var parentColumn = new ColumnDescriptor(_dataSchema, typeof(Protein)); var viewContext = new SkylineViewContext(parentColumn); bindingListSource.SetViewContext(viewContext); bindingListSource.RowSource = new Proteins(_dataSchema); navBar.BindingNavigator.Items.Insert(0, toolStripDropDownRowSource); }
public DocumentGridForm(SkylineViewContext viewContext) { InitializeComponent(); BindingListSource.QueryLock = viewContext.SkylineDataSchema.QueryLock; _originalFormTitle = Text; BindingListSource.SetViewContext(viewContext); BindingListSource.ListChanged += BindingListSourceOnListChanged; _skylineWindow = viewContext.SkylineDataSchema.SkylineWindow; var documentGridViewContext = viewContext as DocumentGridViewContext; if (documentGridViewContext != null) { documentGridViewContext.BoundDataGridView = DataGridView; } }
public static AuditLogForm MakeAuditLogForm(SkylineWindow skylineWindow) { var dataSchema = new SkylineDataSchema(skylineWindow, SkylineDataSchema.GetLocalizedSchemaLocalizer()); var viewInfos = new[] { CreateAuditLogViewInfo(dataSchema, AuditLogStrings.AuditLogForm_MakeAuditLogForm_Undo_Redo, @"TimeStamp", @"UndoRedoMessage"), CreateAuditLogViewInfo(dataSchema, AuditLogStrings.AuditLogForm_MakeAuditLogForm_Summary, @"TimeStamp", @"SummaryMessage"), CreateAuditLogViewInfo(dataSchema, AuditLogStrings.AuditLogForm_MakeAuditLogForm_All_Info, @"TimeStamp", @"Details!*.AllInfoMessage") }; var rowSource = new AuditLogRowSource(dataSchema); var rowSourceInfo = new RowSourceInfo(typeof(AuditLogRow), rowSource, viewInfos); var viewContext = new SkylineViewContext(dataSchema, new[] { rowSourceInfo }); return(new AuditLogForm(viewContext, viewInfos[2].Name)); }
public MetadataRuleEditor(IDocumentContainer documentContainer) { InitializeComponent(); _dataSchema = new SkylineDataSchema(documentContainer, SkylineDataSchema.GetLocalizedSchemaLocalizer()); var rootColumn = ColumnDescriptor.RootColumn(_dataSchema, typeof(ResultFile)); var viewContext = new SkylineViewContext(rootColumn, new StaticRowSource(new ExtractedMetadataResultRow[0])); _metadataExtractor = new MetadataExtractor(_dataSchema, typeof(ResultFile)); bindingListSource1.SetViewContext(viewContext); var sources = _metadataExtractor.GetSourceColumns().ToArray(); comboSourceText.Items.AddRange(sources); comboMetadataTarget.Items.AddRange(_metadataExtractor.GetTargetColumns().ToArray()); SelectItem(comboSourceText, PropertyPath.Root.Property(nameof(ResultFile.FileName))); FormatCultureInfo = CultureInfo.InvariantCulture; }
public DocumentGridForm(SkylineViewContext viewContext, string text) { InitializeComponent(); if (!string.IsNullOrEmpty(text)) { Text = text; } _originalFormTitle = Text; if (viewContext == null) // For designer { return; } BindingListSource.QueryLock = viewContext.SkylineDataSchema.QueryLock; BindingListSource.SetViewContext(viewContext); BindingListSource.ListChanged += BindingListSourceOnListChanged; _skylineWindow = viewContext.SkylineDataSchema.SkylineWindow; var documentGridViewContext = viewContext as DocumentGridViewContext; if (documentGridViewContext != null) { documentGridViewContext.BoundDataGridView = DataGridView; } }
private void UpdateViewContext() { RememberActiveView(); IRowSource rowSource = null; Type rowType = null; string builtInViewName = null; if (_selectedIdentityPaths.Count == 1) { var identityPath = _selectedIdentityPaths[0]; if (identityPath.Length == 2) { rowSource = new PeptideResultList(new Peptide(_dataSchema, identityPath)); rowType = typeof(PeptideResult); builtInViewName = "Peptide Results"; // Not L10N } else if (identityPath.Length == 3) { rowSource = new PrecursorResultList(new Precursor(_dataSchema, identityPath)); rowType = typeof(PrecursorResult); builtInViewName = "Precursor Results"; // Not L10N } else if (identityPath.Length == 4) { rowSource = new TransitionResultList(new Transition(_dataSchema, identityPath)); rowType = typeof(TransitionResult); builtInViewName = "Transition Results"; // Not L10N } } else { // ReSharper disable PossibleMultipleEnumeration var pathLengths = _selectedIdentityPaths.Select(path => path.Length).Distinct().ToArray(); if (pathLengths.Length == 1) { var pathLength = pathLengths[0]; if (pathLength == 3) { rowSource = new MultiPrecursorResultList(_dataSchema, _selectedIdentityPaths.Select(idPath => new Precursor(_dataSchema, idPath))); rowType = typeof(MultiPrecursorResult); builtInViewName = "Multiple Precursor Results"; // Not L10N } if (pathLength == 4) { rowSource = new MultiTransitionResultList(_dataSchema, _selectedIdentityPaths.Select(idPath => new Transition(_dataSchema, idPath))); rowType = typeof(MultiTransitionResult); builtInViewName = "Multiple Transition Results"; // Not L10N } } // ReSharper restore PossibleMultipleEnumeration } if (rowSource == null) { rowSource = new ReplicateList(_dataSchema); rowType = typeof(Replicate); builtInViewName = "Replicates"; // Not L10N } var parentColumn = ColumnDescriptor.RootColumn(_dataSchema, rowType); var builtInViewSpec = SkylineViewContext.GetDefaultViewInfo(parentColumn).GetViewSpec() .SetName(builtInViewName).SetRowType(rowType); if (null == BindingListSource.ViewContext || !BindingListSource.ViewContext.GetViewSpecList(ViewGroup.BUILT_IN.Id).ViewSpecs.Contains(builtInViewSpec)) { var oldViewContext = BindingListSource.ViewContext as ResultsGridViewContext; if (null != oldViewContext) { oldViewContext.RememberColumnWidths(DataGridView); } Debug.Assert(null != builtInViewName); var builtInView = new ViewInfo(parentColumn, builtInViewSpec).ChangeViewGroup(ViewGroup.BUILT_IN); var rowSourceInfo = new RowSourceInfo(rowSource, builtInView); var viewContext = new ResultsGridViewContext(_dataSchema, new[] { rowSourceInfo }); ViewInfo activeView = null; string activeViewName; if (Settings.Default.ResultsGridActiveViews.TryGetValue(rowSourceInfo.Name, out activeViewName)) { activeView = viewContext.GetViewInfo(ViewName.Parse(activeViewName)); } activeView = activeView ?? builtInView; BindingListSource.SetViewContext(viewContext, activeView); } BindingListSource.RowSource = rowSource; }
public DocumentGridForm(SkylineViewContext viewContext) : this(viewContext, null) { }