public override void FixtureInit()
		{
			XmlSchemaCompletionDataCollection schemas = new XmlSchemaCompletionDataCollection();
			schemas.Add(SchemaCompletionData);
			XmlSchemaCompletionData xsdSchemaCompletionData = new XmlSchemaCompletionData(ResourceManager.GetXsdSchema());
			schemas.Add(xsdSchemaCompletionData);
			XmlCompletionDataProvider provider = new XmlCompletionDataProvider(schemas, xsdSchemaCompletionData, String.Empty, null);
			
			string xml = GetSchema();			
			int index = xml.IndexOf("ref=\"coreattrs\"");
			index = xml.IndexOf("coreattrs", index);
			schemaAttributeGroup = (XmlSchemaAttributeGroup)XmlEditorView.GetSchemaObjectSelected(xml, index, provider, SchemaCompletionData);
		}
		public void FixtureInit()
		{
			XmlSchemaCompletionDataCollection items = new XmlSchemaCompletionDataCollection();
			
			StringReader reader = new StringReader(GetSchema(firstNamespace));
			XmlSchemaCompletionData schema = new XmlSchemaCompletionData(reader);
			items.Add(schema);
			
			reader = new StringReader(GetSchema(secondNamespace));
			schema = new XmlSchemaCompletionData(reader);
			items.Add(schema);
			namespaceCompletionData = new CompletionDataList(items.GetNamespaceCompletionData());
		}
		public override void FixtureInit()
		{
			XmlSchemaCompletionDataCollection schemas = new XmlSchemaCompletionDataCollection();
			schemas.Add(SchemaCompletionData);
			XmlSchemaCompletionData xsdSchemaCompletionData = new XmlSchemaCompletionData(ResourceManager.GetXsdSchema());
			schemas.Add(xsdSchemaCompletionData);
			XmlCompletionDataProvider provider = new XmlCompletionDataProvider(schemas, xsdSchemaCompletionData, String.Empty, null);

			string xml = GetSchema();
			int index = xml.IndexOf("type=\"dir\"/>");
			index = xml.IndexOf("dir", index);
			schemaSimpleType = (XmlSchemaSimpleType)XmlEditorView.GetSchemaObjectSelected(xml, index, provider, SchemaCompletionData);
		}
		public override void FixtureInit()
		{
			XmlSchemaCompletionDataCollection schemas = new XmlSchemaCompletionDataCollection();
			schemas.Add(SchemaCompletionData);
			XmlSchemaCompletionData xsdSchemaCompletionData = new XmlSchemaCompletionData(ResourceManager.GetXsdSchema());
			schemas.Add(xsdSchemaCompletionData);
			XmlCompletionDataProvider provider = new XmlCompletionDataProvider(schemas, xsdSchemaCompletionData, String.Empty, null);
			
			string xml = GetSchema();
			
			int index = xml.IndexOf("ref=\"xs:list");
			index = xml.IndexOf("xs", index);
			referencedSchemaElement = (XmlSchemaElement)XmlEditorView.GetSchemaObjectSelected(xml, index, provider, SchemaCompletionData);
		}
		public override void FixtureInit()
		{
			XmlSchemaCompletionDataCollection schemas = new XmlSchemaCompletionDataCollection();
			schemas.Add(SchemaCompletionData);
			XmlCompletionDataProvider provider = new XmlCompletionDataProvider(schemas, SchemaCompletionData, String.Empty, null);
			string xml = "<note xmlns='http://www.w3schools.com' name=''></note>";
			schemaAttribute = (XmlSchemaAttribute)XmlEditorView.GetSchemaObjectSelected(xml, xml.IndexOf("name"), provider);
		}
Esempio n. 6
0
        public override void FixtureInit()
        {
            XmlSchemaCompletionDataCollection schemas = new XmlSchemaCompletionDataCollection();

            schemas.Add(SchemaCompletionData);
            XmlCompletionDataProvider provider = new XmlCompletionDataProvider(schemas, SchemaCompletionData, String.Empty);
            string xml = "<note xmlns='http://www.w3schools.com' name=''></note>";

            schemaAttribute = (XmlSchemaAttribute)XmlView.GetSchemaObjectSelected(xml, xml.IndexOf("name"), provider);
        }
Esempio n. 7
0
        public override void FixtureInit()
        {
            XmlSchemaCompletionDataCollection schemas = new XmlSchemaCompletionDataCollection();

            schemas.Add(SchemaCompletionData);
            XmlSchemaCompletionData xsdSchemaCompletionData = new XmlSchemaCompletionData(ResourceManager.GetXsdSchema());

            schemas.Add(xsdSchemaCompletionData);
            XmlCompletionDataProvider provider = new XmlCompletionDataProvider(schemas, xsdSchemaCompletionData, String.Empty);

            string xml = GetSchema();

            schemaAttribute = (XmlSchemaAttribute)XmlView.GetSchemaObjectSelected(xml, xml.IndexOf("ref=\"name"), provider, SchemaCompletionData);

            int index = xml.IndexOf("ref=\"name");

            index = xml.IndexOf('n', index);
            referencedSchemaElement = (XmlSchemaElement)XmlView.GetSchemaObjectSelected(xml, index, provider, SchemaCompletionData);
        }
        public override void FixtureInit()
        {
            XmlSchemaCompletionDataCollection schemas = new XmlSchemaCompletionDataCollection();

            schemas.Add(SchemaCompletionData);
            XmlCompletionDataProvider provider = new XmlCompletionDataProvider(schemas, SchemaCompletionData, String.Empty, null);
            string xml = "<note xmlns='http://www.w3schools.com'></note>";

            schemaElement = (XmlSchemaElement)XmlEditorView.GetSchemaObjectSelected(xml, xml.IndexOf("note xmlns"), provider);
        }
		public void SetUpFixture()
		{
			schemas = new XmlSchemaCompletionDataCollection();
			XmlSchemaCompletionData completionData = new XmlSchemaCompletionData(ResourceManager.GetXsdSchema());
			expectedNamespace = completionData.NamespaceUri;
			completionData.FileName = @"/home/Schemas/MySchema.xsd";
			schemas.Add(completionData);
			
			provider = new XmlCompletionDataProvider(schemas, completionData, String.Empty, null);
		}
Esempio n. 10
0
        public void SetUpFixture()
        {
            schemas = new XmlSchemaCompletionDataCollection();
            XmlSchemaCompletionData completionData = new XmlSchemaCompletionData(ResourceManager.GetXsdSchema());

            expectedNamespace       = completionData.NamespaceUri;
            completionData.FileName = @"C:\Schemas\MySchema.xsd";
            schemas.Add(completionData);

            provider = new XmlCompletionDataProvider(schemas, completionData, String.Empty);
        }
Esempio n. 11
0
        public void SetUpFixture()
        {
            Form parentForm = new Form();

            parentForm.CreateControl();

            XmlSchemaCompletionData           schema  = new XmlSchemaCompletionData(ResourceManager.GetXhtmlStrictSchema());
            XmlSchemaCompletionDataCollection schemas = new XmlSchemaCompletionDataCollection();

            schemas.Add(schema);
            provider = new XmlCompletionDataProvider(schemas, schema, String.Empty);
            TextEditorControl textEditor = new TextEditorControl();

            completionDataItems = provider.GenerateCompletionData(@"C:\Test.xml", textEditor.ActiveTextAreaControl.TextArea, '<');
            using (CodeCompletionWindow completionWindow = CodeCompletionWindow.ShowCompletionWindow(parentForm, textEditor, @"C:\Test.xml", provider, '<')) {
                CodeCompletionListView listView = (CodeCompletionListView)completionWindow.Controls[0];
                selectedCompletionData = listView.SelectedCompletionData;
                completionWindow.Close();
            }
        }
Esempio n. 12
0
        public void LoadData()
        {
            editor.Text = _mgr.Document.ToString();
            editor.TextEditorProperties.EnableFolding      = true;
            editor.Document.FoldingManager.FoldingStrategy = new XmlFoldingStrategy();
            editor.Document.FoldingManager.UpdateFoldings("", null);
            this.editor.TextChanged += new System.EventHandler(this.editor_TextChanged);
            editor.Validating       += new CancelEventHandler(editor_Validating);
            this.editor.SetHighlighting("XML");
            ValidateXML();
            XmlSchemaCompletionDataCollection schemas = new XmlSchemaCompletionDataCollection();

            string schemasDir;

            try
            {
                if (_mgr.Document.GetWiXNameSpace() == "http://schemas.microsoft.com/wix/2006/wi")
                {
                    schemasDir = Path.Combine(PropertyService.DataDirectory, "Schemas");
                }
                else
                {
                    schemasDir = Path.Combine(PropertyService.DataDirectory, @"Schemas\v4");
                }


                foreach (var file in new DirectoryInfo(schemasDir).GetFiles("*.xsd"))
                {
                    schemas.Add(new XmlSchemaCompletionData(file.FullName));
                }
            }
            catch (Exception)
            {
            }
            editor.SchemaCompletionDataItems = schemas;
        }