internal override void Parse() { Properties = new WebspaceProperties(); XNamespace serialisationNamespace = SerialisationNamespace; XElement rootElements = Document.Element(GetSchema() + "WebSpace"); // get the compute modefrom the instance if (rootElements.Element(GetSchema() + "ComputeMode") != null) { Properties.ComputeMode = (ComputeMode) Enum.Parse(typeof (ComputeMode), rootElements.Element(GetSchema() + "ComputeMode").Value, true); } // get the name of the site as in xxxx.azurewebsites.net if (rootElements.Element(GetSchema() + "Name") != null) { Properties.Name = rootElements.Element(GetSchema() + "Name").Value; } // test to see whether the sitehas been enabled if (rootElements.Element(GetSchema() + "NumberOfInstances") != null) { Properties.InstanceCount = int.Parse(rootElements.Element(GetSchema() + "NumberOfInstances").Value); } CommandResponse = Properties; }
// TODO: parse the response on the way back protected override void ResponseCallback(System.Net.HttpWebResponse webResponse) { WebspaceProperties = Parse(webResponse, BaseParser.WebsiteListParser, new WebspacePropertiesParser(null)); SitAndWait.Set(); }
/// <summary> /// Used to construct a website parser /// </summary> /// <param name="document"></param> public WebspacePropertiesParser(XDocument document) : base(document) { CommandResponse = new WebspaceProperties(); }