コード例 #1
0
        private async void Decompose(string decodedMessage)
        {
            SqlRemote sqlRemote = null;

            try
            {
                sqlRemote = JsonConvert.DeserializeObject <SqlRemote>(decodedMessage, new JsonSerializerSettings()
                {
                    NullValueHandling = NullValueHandling.Ignore,
                });
                string connectionString = sqlRemote.ConnectionString;


                ThreadHelper.Generic.BeginInvoke(() =>
                {
                    if (!DBWatchers.ContainsKey(connectionString))
                    {
                        SQLViz sqlViz           = new SQLViz();
                        sqlViz.ConnectionString = connectionString;
                        DBWatchers.Add(connectionString, sqlViz);
                        visualizer.AddVisualizer(sqlViz as IVisualizer);
                    }
                    DBWatchers[connectionString].AddSQLStatement(sqlRemote);
                });
            }
            catch { }
            return;
        }
コード例 #2
0
        public VisualizerHost()
        {
            InitializeComponent();
            InitalizeMefComponents();
            _messageServer    = new MessageServer(this);
            _messageServerLog = new MessageServerLog(this);
            System.Threading.Thread t  = new System.Threading.Thread(_messageServer.Monitor);
            System.Threading.Thread t1 = new System.Threading.Thread(_messageServerLog.Monitor);

            t.Start();
            t1.Start();

#if DEBUGUI
            SQLViz s = new SQLViz()
            {
                ConnectionString = "Server / Database",
            };
            AddVisualizer(s);
#endif
        }