Ejemplo n.º 1
0
        private static DataGridResultViewer InitializeResultViewer()
        {
            var columnHeaders =
                new[]
            {
                new ColumnHeader {
                    ColumnIndex = 0, DatabaseDataType = "Varchar2", DataType = typeof(string), Name = "DUMMY1"
                },
                new ColumnHeader {
                    ColumnIndex = 1, DatabaseDataType = "Date", DataType = typeof(DateTime), Name = "DUMMY_WITH_UNDERSCORES"
                },
                //new ColumnHeader { ColumnIndex = 2, DatabaseDataType = "Varchar2", DataType = typeof (string), Name = "\"'\\\"><?,.;:{}[]%$#@!~^&*()_+-§'''||(1/2*3+4-CASEWHEN1<=2OR2>=1THEN5ELSE6END)" }
            };

            var documentPage = new DocumentPage {
                CurrentConnection = ConfigurationProvider.ConnectionStrings[0]
            };

            documentPage.DatabaseModel.Dispose();

            var outputViewer = new OutputViewer(documentPage);

            var dataRows =
                new[]
            {
                new object[] { "Value \"1\" '2' <3>", new DateTime(2014, 8, 16, 22, 25, 34) },
                new object[] { "\"2.\"Value", new DateTime(2014, 8, 16) },
                //new object[] {"\"><?,.;:{}[]%$#@!~^&*()_+-§' ,5", new DateTime(2015, 5, 30) }
            };

            var resultInfo = new ResultInfo(null, "Test result", ResultIdentifierType.UserDefined);

            var executionResult =
                new StatementExecutionResult
            {
                StatementModel =
                    new StatementExecutionModel
                {
                    StatementText = "SELECT * FROM DUAL"
                },
                ResultInfoColumnHeaders =
                    new Dictionary <ResultInfo, IReadOnlyList <ColumnHeader> >
                {
                    { resultInfo, columnHeaders }
                }
            };

            var resultViewer =
                new DataGridResultViewer(outputViewer, executionResult, resultInfo)
            {
                ResultGrid = { ItemsSource = dataRows }
            };

            DataGridHelper.InitializeDataGridColumns(resultViewer.ResultGrid, columnHeaders, outputViewer.StatementValidator, outputViewer.ConnectionAdapter);

            return(resultViewer);
        }
Ejemplo n.º 2
0
		public ExecutionPlanViewer(OutputViewer outputViewer)
		{
			InitializeComponent();

			_outputViewer = outputViewer;
		}
Ejemplo n.º 3
0
		private static DataGridResultViewer InitializeResultViewer()
		{
			var columnHeaders =
				new[]
				{
					new ColumnHeader { ColumnIndex = 0, DatabaseDataType = "Varchar2", DataType = typeof (string), Name = "DUMMY1" },
					new ColumnHeader { ColumnIndex = 1, DatabaseDataType = "Date", DataType = typeof (DateTime), Name = "DUMMY_WITH_UNDERSCORES" },
					//new ColumnHeader { ColumnIndex = 2, DatabaseDataType = "Varchar2", DataType = typeof (string), Name = "\"'\\\"><?,.;:{}[]%$#@!~^&*()_+-§'''||(1/2*3+4-CASEWHEN1<=2OR2>=1THEN5ELSE6END)" }
				};

			var documentPage = new DocumentPage { CurrentConnection = ConfigurationProvider.ConnectionStrings[0] };
			documentPage.DatabaseModel.Dispose();
			
			var outputViewer = new OutputViewer(documentPage);

			var dataRows =
				new[]
				{
					new object[] {"Value \"1\" '2' <3>", new DateTime(2014, 8, 16, 22, 25, 34)},
					new object[] {"\"2.\"Value", new DateTime(2014, 8, 16)},
					//new object[] {"\"><?,.;:{}[]%$#@!~^&*()_+-§' ,5", new DateTime(2015, 5, 30) }
				};

			var resultInfo = new ResultInfo(null, "Test result", ResultIdentifierType.UserDefined);

			var executionResult =
				new StatementExecutionResult
				{
					StatementModel =
						new StatementExecutionModel
						{
							StatementText = "SELECT * FROM DUAL"
						},
					ResultInfoColumnHeaders =
						new Dictionary<ResultInfo, IReadOnlyList<ColumnHeader>>
						{
							{ resultInfo, columnHeaders }
						}
				};

			var resultViewer =
				new DataGridResultViewer(outputViewer, executionResult, resultInfo)
				{
					ResultGrid = { ItemsSource = dataRows }
				};

			DataGridHelper.InitializeDataGridColumns(resultViewer.ResultGrid, columnHeaders, outputViewer.StatementValidator, outputViewer.ConnectionAdapter);

			return resultViewer;
		}
Ejemplo n.º 4
0
        public ExecutionPlanViewer(OutputViewer outputViewer)
        {
            InitializeComponent();

            _outputViewer = outputViewer;
        }
Ejemplo n.º 5
0
 private void OutputViewerSizeChanged(object sender, SizeChangedEventArgs e)
 {
     OutputViewer.ScrollToBottom();
 }
 public IExecutionPlanViewer CreateExecutionPlanViewer(OutputViewer outputViewer)
 {
     return(new ExecutionPlanViewer(outputViewer));
 }