public void ShowPlan()
        {
            ExpectArgumentNull("navigable", delegate { NQuery.ShowPlan.FromXml(null); });

            Query query = QueryFactory.CreateQuery();

            query.Text = "SELECT * FROM Employees";
            ShowPlan showPlan = query.GetShowPlan();

            ExpectArgumentNull("textWriter", delegate { showPlan.WriteTo(null, 1); });
        }
Exemple #2
0
        private void SavePlan()
        {
            if (savePlanFileDialog.ShowDialog() == DialogResult.OK)
            {
                ShowPlan showPlan = _query.GetShowPlan();

                if (savePlanFileDialog.FilterIndex == 0)
                {
                    showPlan.ToXml().Save(savePlanFileDialog.FileName);
                }
                else
                {
                    using (StreamWriter sw = new StreamWriter(savePlanFileDialog.FileName))
                        showPlan.WriteTo(sw, 2);
                }
            }
        }