public XPathQueryPad()
 {
     xPathQueryControl = new XPathQueryControl();
     WorkbenchSingleton.Workbench.ActiveViewContentChanged += ActiveViewContentChanged;
     Properties properties = PropertyService.Get(XPathQueryControlProperties, new Properties());
     xPathQueryControl.SetMemento(properties);
     instance = this;
 }
Example #2
0
 public XPathQueryPad()
 {
     xpathQueryControl = new XPathQueryControl();
     SD.Workbench.ActiveViewContentChanged += ActiveViewContentChanged;
     Properties properties = PropertyService.NestedProperties(XPathQueryControlProperties);
     xpathQueryControl.SetMemento(properties);
     instance = this;
 }
Example #3
0
        public XPathQueryPad()
        {
            xPathQueryControl = new XPathQueryControl();
            WorkbenchSingleton.Workbench.ActiveViewContentChanged += ActiveViewContentChanged;
            Properties properties = PropertyService.Get(XPathQueryControlProperties, new Properties());

            xPathQueryControl.SetMemento(properties);
            instance = this;
        }
        public XPathQueryPad()
        {
            xpathQueryControl = new XPathQueryControl();
            SD.Workbench.ActiveViewContentChanged += ActiveViewContentChanged;
            Properties properties = PropertyService.NestedProperties(XPathQueryControlProperties);

            xpathQueryControl.SetMemento(properties);
            instance = this;
        }
        public void SetUpFixture()
        {
            using (XPathQueryControl queryControl = new XPathQueryControl()) {
                Properties p = new Properties();
                p.Set("NamespacesDataGridView.PrefixColumn.Width", 10);
                queryControl.SetMemento(p);

                prefixColumnWidthAfterLoad = queryControl.NamespacesDataGridView.Columns["prefixColumn"].Width;

                queryControl.NamespacesDataGridView.Columns["prefixColumn"].Width = 40;

                p = queryControl.CreateMemento();
                prefixColumnWidthAfterSave = p.Get<int>("NamespacesDataGridView.PrefixColumn.Width", 0);
            }
        }
		public void SetUpFixture()
		{
			using (XPathQueryControl queryControl = new XPathQueryControl()) {
				Properties p = new Properties();
				expectedNamespaces = new List<XmlNamespace>();
				expectedNamespaces.Add(new XmlNamespace("f", "http://foo.com"));
				expectedNamespaces.Add(new XmlNamespace("s", "http://sharpdevelop.com"));
				
				List<string> namespaces = new List<string>();
				foreach (XmlNamespace xmlNamespace in expectedNamespaces) {
					namespaces.Add(xmlNamespace.ToString());
				}
				p.Set("Namespaces", namespaces.ToArray());
				queryControl.SetMemento(p);
				actualNamespaces = queryControl.GetNamespaces();
			}
		}
		public void SetUpFixture()
		{
			using (XPathQueryControl queryControl = new XPathQueryControl()) {
				Properties p = new Properties();
				p.Set("XPathResultsListView.MatchColumn.Width", 10);
				p.Set("XPathResultsListView.LineColumn.Width", 20);
				queryControl.SetMemento(p);

				matchColumnWidthAfterLoad = queryControl.XPathResultsListView.Columns[0].Width;
				lineColumnWidthAfterLoad = queryControl.XPathResultsListView.Columns[1].Width;
				
				queryControl.XPathResultsListView.Columns[0].Width = 40;
				queryControl.XPathResultsListView.Columns[1].Width = 50;

				p = queryControl.CreateMemento();
				matchColumnWidthAfterSave = p.Get<int>("XPathResultsListView.MatchColumn.Width", 0);
				lineColumnWidthAfterSave = p.Get<int>("XPathResultsListView.LineColumn.Width", 0);
			}
		}
        public void SetUpFixture()
        {
            using (XPathQueryControl queryControl = new XPathQueryControl()) {
                expectedNamespaces = new List<XmlNamespace>();
                expectedNamespaces.Add(new XmlNamespace("f", "http://foo.com"));
                expectedNamespaces.Add(new XmlNamespace("s", "http://sharpdevelop.com"));

                foreach (XmlNamespace xmlNamespace in expectedNamespaces) {
                    queryControl.AddNamespace(xmlNamespace.Prefix, xmlNamespace.Name);
                }
                // Blank prefix and uris should be ignored.
                queryControl.AddNamespace(String.Empty, String.Empty);

                // Null cell values ignored.
                queryControl.NamespacesDataGridView.Rows.Add(new object[] {null, null});

                Properties p = queryControl.CreateMemento();
                actualNamespaces = p.GetList<string>("Namespaces").ToArray();
            }
        }
		public void SetUpFixture()
		{
			using (XPathQueryControl queryControl = new XPathQueryControl()) {
				expectedNamespaces = new List<XmlNamespace>();
				expectedNamespaces.Add(new XmlNamespace("w", "http://www.wix.com"));
				expectedNamespaces.Add(new XmlNamespace("s", "http://sharpdevelop.com"));
				
				foreach (XmlNamespace ns in expectedNamespaces) {
					queryControl.AddNamespace(ns.Prefix, ns.Uri);
				}
				
				namespacesAddedToGrid = new List<XmlNamespace>();
				for (int i = 0; i < queryControl.NamespacesDataGridView.Rows.Count - 1; ++i) {
					DataGridViewRow row = queryControl.NamespacesDataGridView.Rows[i];
					namespacesAddedToGrid.Add(new XmlNamespace((string)row.Cells[0].Value, (string)row.Cells[1].Value));
				}
				
				namespaces = queryControl.GetNamespaces();
			}
		}
		public void SetUpFixture()
		{
			using (XPathQueryControl queryControl = new XPathQueryControl()) {
				Properties p = new Properties();
				p.Set("XPathQuery.LastQuery", "//w:Wix");
				expectedXPathsAfterLoad = new string[] {"//w:Fragment", "//w:Dialog"};
				p.Set("XPathQuery.History", expectedXPathsAfterLoad);
				queryControl.SetMemento(p);

				comboBoxTextAfterLoad = queryControl.XPathComboBox.Text;
				comboBoxItemsAfterLoad = GetComboBoxItems(queryControl.XPathComboBox);

				queryControl.XPathComboBox.Text = "*";
				queryControl.XPathComboBox.Items.Clear();
				queryControl.XPathComboBox.Items.Add("xs:schema");
				expectedXPathsAfterSave = GetComboBoxItems(queryControl.XPathComboBox);

				p = queryControl.CreateMemento();
				
				xpathQueryAfterSave = p.Get("XPathQuery.LastQuery", String.Empty);
				xpathsAfterSave = p.Get("XPathQuery.History", new string[0]);
			}
		}