예제 #1
0
            public override BaseMode BuildViewSchemaClone(Database.View.ViewSchema.Builder builder)
            {
                var newModeFirst = modeFirst.BuildViewSchemaClone(builder);

                if (newModeFirst == null)
                {
                    return(null);
                }
                var newModeSecond = modeSecond.BuildViewSchemaClone(builder);

                if (newModeSecond == null)
                {
                    return(null);
                }

                DiffMode copy = new DiffMode(this);

                copy.modeFirst      = newModeFirst;
                copy.modeSecond     = newModeSecond;
                copy.m_SchemaFirst  = copy.modeFirst.GetSchema();
                copy.m_SchemaSecond = copy.modeSecond.GetSchema();
                copy.m_SchemaDiff   = new Database.Operation.DiffSchema(copy.m_SchemaFirst, copy.m_SchemaSecond);
                copy.UpdateTableSelectionNames();

                return(copy);
            }
예제 #2
0
            void SetSnapshot(DataRenderer dataRenderer, 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 (Profiling.GetMarker(Profiling.MarkerId.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, dataRenderer);

                SchemaToDisplay = m_RawSchema;
                if (k_DefaultViewFilePath.Length > 0)
                {
                    using (ScopeDebugContext.Func(() => { return("File '" + k_DefaultViewFilePath + "'"); }))
                    {
                        Database.View.ViewSchema.Builder builder = null;
                        using (Profiling.GetMarker(Profiling.MarkerId.LoadViewDefinitionFile).Auto())
                        {
                            builder = Database.View.ViewSchema.Builder.LoadFromXMLFile(k_DefaultViewFilePath);
                        }
                        if (builder != null)
                        {
                            using (Profiling.GetMarker(Profiling.MarkerId.BuildViewDefinitionFile).Auto())
                            {
                                ViewSchema = builder.Build(m_RawSchema);
                            }
                            if (ViewSchema != null)
                            {
                                SchemaToDisplay = ViewSchema;
                            }
                        }
                    }
                }

                UpdateTableSelectionNames();
            }
예제 #3
0
            void SetSnapshot(ObjectDataFormatter objectDataFormatter, QueriedMemorySnapshot 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.GetReader().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();
            }
예제 #4
0
 public override BaseMode BuildViewSchemaClone(Database.View.ViewSchema.Builder builder)
 {
     Database.View.ViewSchema vs;
     vs = builder.Build(m_RawSchema);
     if (vs != null)
     {
         SnapshotMode copy = new SnapshotMode(this);
         copy.ViewSchema      = vs;
         copy.SchemaToDisplay = vs;
         copy.UpdateTableSelectionNames();
         return(copy);
     }
     return(null);
 }
예제 #5
0
 public override BaseMode BuildViewSchemaClone(Database.View.ViewSchema.Builder builder)
 {
     Database.View.ViewSchema vs;
     using (Profiling.GetMarker(Profiling.MarkerId.BuildViewDefinitionFile).Auto())
     {
         vs = builder.Build(m_RawSchema);
     }
     if (vs != null)
     {
         SnapshotMode copy = new SnapshotMode(this);
         copy.ViewSchema      = vs;
         copy.SchemaToDisplay = vs;
         copy.UpdateTableSelectionNames();
         return(copy);
     }
     return(null);
 }
예제 #6
0
 // return null if build failed
 public abstract BaseMode BuildViewSchemaClone(Database.View.ViewSchema.Builder builder);