protected DiffMode(DiffMode copy) { m_ObjectDataFormatter = copy.m_ObjectDataFormatter; m_ObjectDataFormatter.PrettyNamesOptionChanged += UpdateTableSelectionNames; modeFirst = copy.modeFirst; modeSecond = copy.modeSecond; m_SchemaFirst = copy.m_SchemaFirst; m_SchemaSecond = copy.m_SchemaSecond; m_SchemaDiff = copy.m_SchemaDiff; }
public DiffMode(ObjectDataFormatter objectDataFormatter, BaseMode snapshotFirst, BaseMode snapshotSecond) { m_ObjectDataFormatter = objectDataFormatter; m_ObjectDataFormatter.PrettyNamesOptionChanged += UpdateTableSelectionNames; modeFirst = snapshotFirst; modeSecond = snapshotSecond; m_SchemaFirst = modeFirst.GetSchema(); m_SchemaSecond = modeSecond.GetSchema(); m_SchemaDiff = new Database.Operation.DiffSchema(m_SchemaFirst, m_SchemaSecond); UpdateTableSelectionNames(); }
void SetSnapshot(ObjectDataFormatter objectDataFormatter, PackedMemorySnapshot snapshot) { if (snapshot == null) { m_RawSnapshot = null; m_RawSchema = null; SchemaToDisplay = null; UpdateTableSelectionNames(); return; } m_RawSnapshot = snapshot; ProgressBarDisplay.ShowBar(string.Format("Opening snapshot: {0}", System.IO.Path.GetFileNameWithoutExtension(snapshot.filePath))); var cachedSnapshot = new CachedSnapshot(snapshot); using (s_CrawlManagedData.Auto()) { var crawling = Crawler.Crawl(cachedSnapshot); crawling.MoveNext(); //start execution var status = crawling.Current as EnumerationStatus; float progressPerStep = 1.0f / status.StepCount; while (crawling.MoveNext()) { ProgressBarDisplay.UpdateProgress(status.CurrentStep * progressPerStep, status.StepStatus); } } ProgressBarDisplay.ClearBar(); m_RawSchema = new RawSchema(); m_RawSchema.SetupSchema(cachedSnapshot, objectDataFormatter); SchemaToDisplay = m_RawSchema; if (k_DefaultViewFilePath.Length > 0) { Database.View.ViewSchema.Builder builder = null; builder = Database.View.ViewSchema.Builder.LoadFromXMLFile(k_DefaultViewFilePath); if (builder != null) { ViewSchema = builder.Build(m_RawSchema); if (ViewSchema != null) { SchemaToDisplay = ViewSchema; } } } UpdateTableSelectionNames(); }
public DiffMode(ObjectDataFormatter objectDataFormatter, BaseMode snapshotFirst, BaseMode snapshotSecond) { ProgressBarDisplay.ShowBar("Snapshot diff in progress"); m_ObjectDataFormatter = objectDataFormatter; m_ObjectDataFormatter.PrettyNamesOptionChanged += UpdateTableSelectionNames; modeFirst = snapshotFirst; modeSecond = snapshotSecond; m_SchemaFirst = modeFirst.GetSchema(); m_SchemaSecond = modeSecond.GetSchema(); ProgressBarDisplay.UpdateProgress(0.1f, "Building diff schema."); m_SchemaDiff = new Database.Operation.DiffSchema(m_SchemaFirst, m_SchemaSecond, () => { ProgressBarDisplay.UpdateProgress(0.3f, "Computing table data"); }); ProgressBarDisplay.UpdateProgress(0.85f, "Updating table selection."); UpdateTableSelectionNames(); ProgressBarDisplay.ClearBar(); }
protected void UpdateTableSelectionNamesFromSchema(ObjectDataFormatter objectDataFormatter, Database.Schema schema) { if (schema == null) { m_TableNames = new string[1]; m_TableNames[0] = "none"; m_Tables = new Database.Table[1]; m_Tables[0] = null; return; } m_TableNames = new string[schema.GetTableCount() + 1]; m_Tables = new Database.Table[schema.GetTableCount() + 1]; m_TableNames[0] = "none"; m_Tables[0] = null; for (long i = 0; i != schema.GetTableCount(); ++i) { var tab = schema.GetTableByIndex(i); long rowCount = tab.GetRowCount(); m_TableNames[i + 1] = (objectDataFormatter.ShowPrettyNames ? tab.GetDisplayName() : tab.GetName()) + " (" + (rowCount >= 0 ? rowCount.ToString() : "?") + ")"; m_Tables[i + 1] = tab; } }
public SnapshotMode(ObjectDataFormatter objectDataFormatter, PackedMemorySnapshot snapshot) { objectDataFormatter.PrettyNamesOptionChanged += UpdateTableSelectionNames; SetSnapshot(objectDataFormatter, snapshot); }