Beispiel #1
0
        public string GetJson()
        {
            var m = new QueryPlanModel()
            {
                PhysicalQueryPlanRows = this.PhysicalQueryPlanRows,
                LogicalQueryPlanRows  = this.LogicalQueryPlanRows
            };
            var json = Newtonsoft.Json.JsonConvert.SerializeObject(m, Newtonsoft.Json.Formatting.Indented);

            return(json);
        }
        void ISaveState.Save(string filename)
        {
            var m = new QueryPlanModel()
            {
                PhysicalQueryPlanRows = this.PhysicalQueryPlanRows,
                LogicalQueryPlanRows  = this.LogicalQueryPlanRows
            };
            var json = Newtonsoft.Json.JsonConvert.SerializeObject(m, Newtonsoft.Json.Formatting.Indented);

            File.WriteAllText(filename + ".queryPlans", json);
        }
Beispiel #3
0
        public void LoadJson(string data)
        {
            QueryPlanModel m = JsonConvert.DeserializeObject <QueryPlanModel>(data);

            PhysicalQueryPlanRows = m.PhysicalQueryPlanRows;
            LogicalQueryPlanRows  = m.LogicalQueryPlanRows;


            NotifyOfPropertyChange(() => PhysicalQueryPlanRows);
            NotifyOfPropertyChange(() => LogicalQueryPlanRows);
            NotifyOfPropertyChange(() => CanExport);
        }
        void ISaveState.Load(string filename)
        {
            filename = filename + ".queryPlans";
            if (!File.Exists(filename))
            {
                return;
            }

            this.IsChecked = true;
            string         data = File.ReadAllText(filename);
            QueryPlanModel m    = JsonConvert.DeserializeObject <QueryPlanModel>(data);

            PhysicalQueryPlanRows = m.PhysicalQueryPlanRows;
            LogicalQueryPlanRows  = m.LogicalQueryPlanRows;


            NotifyOfPropertyChange(() => PhysicalQueryPlanRows);
            NotifyOfPropertyChange(() => LogicalQueryPlanRows);
        }
Beispiel #5
0
        void ISaveState.Load(string filename)
        {
            filename = filename + ".queryPlans";
            if (!File.Exists(filename))
            {
                return;
            }

            _eventAggregator.PublishOnUIThread(new ShowTraceWindowEvent(this));
            string         data = File.ReadAllText(filename);
            QueryPlanModel m    = JsonConvert.DeserializeObject <QueryPlanModel>(data);

            PhysicalQueryPlanRows = m.PhysicalQueryPlanRows;
            LogicalQueryPlanRows  = m.LogicalQueryPlanRows;


            NotifyOfPropertyChange(() => PhysicalQueryPlanRows);
            NotifyOfPropertyChange(() => LogicalQueryPlanRows);
        }