private void ProcessXmlNode(XmlNode xmlNode) { //Get the values from the xmlNode //Get the Id ID = xmlNode.Attributes.GetNamedItem("id").Value; //Get the Status Status = MFBIncidentItem.StringToIncidentStatus(xmlNode.Attributes.GetNamedItem("status_code").Value); //Get the type Type = MFBIncidentItem.StringToIncidentType(xmlNode.Attributes.GetNamedItem("type_code").Value); //Get the location Latitude = xmlNode.Attributes.GetNamedItem("lat").Value; Longitude = xmlNode.Attributes.GetNamedItem("lng").Value; //Get the appliance string ApplicanceString = xmlNode.Attributes.GetNamedItem("appliances").Value; //Get the suburb + Location string addressString = xmlNode.Attributes.GetNamedItem("address").Value; //Split into suburb + location string suburbString = ""; string locationString = ""; int suburbEnd = addressString.IndexOf(','); suburbString = addressString.Substring(0, suburbEnd); //Extract the location String locationString = addressString.Substring(suburbEnd + 2); //if the user does not want to view cross streets if (!mParentSource.GetOptions().CrossStreets) { //Remove the closest cross streets (there will be a space before the / if the actual address isnt on a corner) if (locationString.Contains(" /") == true) { //There is a ' /', the last / = the start of the cross refs, so remove them locationString = locationString.Remove(locationString.LastIndexOf('/') - 1); } } Suburb = suburbString; Location = locationString; }
public static string IncidentTypeToString(MFBTypes Type) { string returnString = ""; switch (Type) { case MFBTypes.Fire: returnString = "Fire"; break; case MFBTypes.FullCall: returnString = "Alarm"; break; case MFBTypes.HazardousIncident: returnString = "Hazmat"; break; case MFBTypes.Incident: returnString = "Incident"; break; case MFBTypes.MedicalEmergency: returnString = "EMR"; break; case MFBTypes.NonStructureFire: returnString = "Non Structure Fire"; break; case MFBTypes.StructureFire: returnString = "Structure Fire"; break; case MFBTypes.FalseAlarm: returnString = "False Alarm"; break; default: returnString = "Unknown"; break; } return returnString; }