コード例 #1
0
ファイル: MainWindow.xaml.cs プロジェクト: Yegoroff/EsAdmin
        private void ExecuteHandler(object sender, EventArgs e)
        {
            try
            {
                var textToExecute = textEditor.SelectedText;
                if (string.IsNullOrEmpty(textToExecute))
                {
                    textToExecute = textEditor.Text;
                }

                var login    = Login.Text;
                var password = Password.Text;
                var host     = Host.Text;
                int port     = int.Parse(Port.Text);

                var    connector = new EsConnector(host, port, login, password);
                string result    = connector.Execute(textToExecute);
                output.Text = result.BeautifyJson();
            }
            catch (Exception ex)
            {
                var message = ex.Message;
                message     = System.Text.RegularExpressions.Regex.Unescape(message);
                output.Text = "Error : \r\n" + message;
            }
        }
コード例 #2
0
        private void ExecuteHandler(object sender, EventArgs e)
        {
            try
            {
                var textToExecute = textEditor.SelectedText;
                if (string.IsNullOrEmpty(textToExecute))
                {
                    textToExecute = textEditor.Text;
                }

                var login    = Login.Text;
                var password = Password.Text;
                var host     = Host.Text;
                int port     = int.Parse(Port.Text);

                var    connector = new EsConnector(host, port, login, password);
                string result    = connector.Execute(textToExecute);
                output.Text = result.BeautifyJson();
            }
            catch (Exception ex)
            {
                output.Text = "Exception : " + ex;
            }
        }
コード例 #3
0
ファイル: MainWindow.xaml.cs プロジェクト: devoyster/EsAdmin
        private void ExecuteHandler(object sender, EventArgs e)
        {
            try
            {
                var textToExecute = textEditor.SelectedText;
                if (string.IsNullOrEmpty(textToExecute))
                    textToExecute = textEditor.Text;

                var host = Host.Text;
                int port = int.Parse(Port.Text);

                var connector = new EsConnector(host, port);
                string result = connector.Execute(textToExecute);
                output.Text = result.ButifyJson();
            }
            catch (Exception ex)
            {
                output.Text = "Exception : " + ex;
            }
        }
コード例 #4
0
ファイル: MainWindow.xaml.cs プロジェクト: Yegoroff/EsAdmin
        private void ExecuteHandler(object sender, EventArgs e)
        {
            try
            {
                var textToExecute = textEditor.SelectedText;
                if (string.IsNullOrEmpty(textToExecute))
                    textToExecute = textEditor.Text;

                var login = Login.Text;
                var password = Password.Text;
                var host = Host.Text;
                int port = int.Parse(Port.Text);

                var connector = new EsConnector(host, port, login, password);
                string result = connector.Execute(textToExecute);
                output.Text = result.BeautifyJson();
            }
            catch (Exception ex)
            {
                var message = ex.Message;
                message = System.Text.RegularExpressions.Regex.Unescape(message);
                output.Text = "Error : \r\n" + message;
            }
        }