Пример #1
0
        internal static void ReadExtension(XmlDocument doc, XmlReader reader, object ob)
        {
            ServiceDescriptionFormatExtensionCollection extensions = ExtensionManager.GetExtensionPoint(ob);

            if (extensions != null)
            {
                ExtensionInfo info = ExtensionManager.GetFormatExtensionInfo(reader.LocalName, reader.NamespaceURI);
                if (info != null)
                {
                    object extension = info.Serializer.Deserialize(reader);
                    extensions.Add((ServiceDescriptionFormatExtension)extension);
                    return;
                }
            }

            //No XmlFormatExtensionPoint attribute found

#if NET_2_0
            //Add to DocumentableItem.Extensions property
            DocumentableItem item = ob as DocumentableItem;
            if (item == null)
            {
                reader.Skip();
                return;
            }

            item.Extensions.Add(doc.ReadNode(reader));
#else
            reader.Skip();
#endif
        }
Пример #2
0
		public void InitializeItem()
		{
			// workaround for base class
			item = new Types();
		}
Пример #3
0
		void CheckEA (DocumentableItem di, string att, string val)
		{
			Assert.IsNotNull (di.ExtensibleAttributes);
			
			Assert.AreEqual (1, di.ExtensibleAttributes.Length);
			Assert.AreEqual (att, di.ExtensibleAttributes [0].Name);
			Assert.AreEqual (val, di.ExtensibleAttributes [0].Value);
		}
Пример #4
0
		void CheckExtensions (DocumentableItem di, string elemName, string val)
		{
			Assert.IsNotNull (di.Extensions);

			Assert.AreEqual (1, di.Extensions.Count);

			Assert.AreEqual (typeof (XmlElement), di.Extensions [0].GetType ());
			Assert.AreEqual (elemName, ((XmlElement) di.Extensions [0]).Name);
			Assert.AreEqual (val, ((XmlElement) di.Extensions [0]).InnerText);
		}
Пример #5
0
 private static string GetDocumentation(DocumentableItem item)
 {
     if (item.DocumentationElement != null)
         return item.DocumentationElement.InnerText;
     return item.Documentation;
 }
 private void AttachItemPolicy(ICollection<XmlElement> assertions, string key, System.Web.Services.Description.ServiceDescription policyWsdl, DocumentableItem item)
 {
     string policyKey = this.InsertPolicy(key, policyWsdl, assertions);
     this.InsertPolicyReference(policyKey, item);
 }
 private void InsertPolicyReference(string policyKey, DocumentableItem item)
 {
     XmlElement extension = WsdlExporter.XmlDoc.CreateElement("wsp", "PolicyReference", this.policyVersion.Namespace);
     System.Xml.XmlAttribute node = WsdlExporter.XmlDoc.CreateAttribute("URI");
     node.Value = policyKey;
     extension.Attributes.Append(node);
     item.Extensions.Add(extension);
 }