public bool OpenLinkRequest(Database.LinkRequestTable link, Database.TableReference tableLink, Database.Table table) { using (ScopeDebugContext.String("OpenLinkRequest")) { if (link.LinkToOpen.RowWhere != null && link.LinkToOpen.RowWhere.Count > 0) { Database.Table filteredTable = table; if (table.GetMetaData().defaultFilter != null) { filteredTable = table.GetMetaData().defaultFilter.CreateFilter(table); } var whereUnion = new Database.View.WhereUnion(link.LinkToOpen.RowWhere, null, null, null, null, m_UIState.CurrentMode.GetSchema(), filteredTable, link.SourceView == null ? null : link.SourceView.ExpressionParsingContext); long rowToSelect = whereUnion.GetIndexFirstMatch(link.SourceRow); if (rowToSelect < 0) { DebugUtility.LogWarning("Could not find entry in target table '" + link.LinkToOpen.TableName + "'"); return(false); } DebugUtility.DebugLog("Opening table '" + link.LinkToOpen.TableName + "' at row " + rowToSelect); OpenTable(tableLink, table, new Database.CellPosition(rowToSelect, 0)); } else { OpenTable(tableLink, table, new Database.CellPosition(0, 0)); } return(true); } }
public void Restore(SpreadsheetPane pane) { DebugUtility.DebugLog("Open History: " + ToString()); var table = pane.m_UIState.CurrentMode.GetSchema().GetTableByReference(m_Table); if (table == null) { DebugUtility.LogError("No table named '" + m_Table.Name + "' found."); return; } pane.m_CurrentTableLink = m_Table; pane.CurrentTableIndex = pane.m_UIState.CurrentMode.GetTableIndex(table); pane.m_Spreadsheet = new UI.DatabaseSpreadsheet(pane.m_UIState.FormattingOptions, table, pane, m_SpreadsheetState); pane.m_Spreadsheet.onClickLink += pane.OnSpreadsheetClick; pane.m_EventListener.OnRepaint(); }
public ObjectData GetArrayElement(CachedSnapshot snapshot, ArrayInfo ai, int index, bool expandToTarget) { switch (m_dataType) { case ObjectDataType.Array: case ObjectDataType.ReferenceArray: break; default: DebugUtility.DebugLog("Requesting an array element on an invalid data type"); return(invalid); } ObjectData o = new ObjectData(); o.m_Parent = new ObjectDataParent(this, -1, index, expandToTarget); o.SetManagedType(snapshot, ai.elementTypeDescription); o.m_data.managed.objectPtr = m_data.managed.objectPtr; o.m_dataType = TypeToSubDataType(snapshot, ai.elementTypeDescription); o.managedObjectData = ai.GetArrayElement(index); return(o); }