public void Store(XmlWriter writer) { writer.WriteStartElement("Program"); // Note: ID must be first!!! ID.Store(writer); writer.WriteElementString("Description", Description); writer.WriteStartElement("FwRules"); foreach (FirewallRuleEx rule in Rules.Values) { rule.Store(writer); } writer.WriteEndElement(); writer.WriteStartElement("DnsLog"); foreach (DnsEntry Entry in DnsLog.Values) { Entry.Store(writer); } writer.WriteEndElement(); writer.WriteEndElement(); }
public void Store(XmlWriter writer, bool WithId = false) { writer.WriteStartElement("Entry"); if (WithId) { ProgID.Store(writer); } writer.WriteElementString("HostName", HostName); writer.WriteElementString("LastSeen", LastSeen.ToString()); writer.WriteElementString("SeenCounter", SeenCounter.ToString()); writer.WriteElementString("ConCounter", ConCounter.ToString()); writer.WriteElementString("ReceivedBytes", TotalDownload.ToString()); writer.WriteElementString("SentBytes", TotalUpload.ToString()); writer.WriteEndElement(); }
public virtual void Store(XmlWriter writer, bool bRaw = false) { if (!bRaw) { writer.WriteStartElement("FwRule"); } if (guid != null) { writer.WriteElementString("Guid", guid); } if (BinaryPath != null) { writer.WriteElementString("BinaryPath", BinaryPath); } if (ServiceTag != null) { writer.WriteElementString("ServiceTag", ServiceTag); } if (AppSID != null) { writer.WriteElementString("AppSID", AppSID); } ProgID.Store(writer, "ProgID"); if (Name != null) { writer.WriteElementString("Name", Name); } if (Grouping != null) { writer.WriteElementString("Grouping", Grouping); } if (Description != null) { writer.WriteElementString("Description", Description); } writer.WriteElementString("Enabled", Enabled.ToString()); writer.WriteElementString("Action", Action.ToString()); writer.WriteElementString("Direction", Direction.ToString()); if (Profile != (int)Profiles.All) { writer.WriteElementString("Profile", Profile.ToString()); } if (Protocol != (int)NetFunc.KnownProtocols.Any) { writer.WriteElementString("Protocol", Protocol.ToString()); } if (Interface != (int)Interfaces.All) { writer.WriteElementString("Interface", Interface.ToString()); } if (!IsEmptyOrStar(LocalPorts)) { writer.WriteElementString("LocalPorts", LocalPorts); } if (!IsEmptyOrStar(LocalAddresses)) { writer.WriteElementString("LocalAddresses", LocalAddresses); } if (!IsEmptyOrStar(RemoteAddresses)) { writer.WriteElementString("RemoteAddresses", RemoteAddresses); } if (!IsEmptyOrStar(RemotePorts)) { writer.WriteElementString("RemotePorts", RemotePorts); } if (IcmpTypesAndCodes != null) { writer.WriteElementString("IcmpTypesAndCodes", GetIcmpTypesAndCodes()); } if (EdgeTraversal != 0) { writer.WriteElementString("EdgeTraversal", EdgeTraversal.ToString()); } if (!bRaw) { writer.WriteEndElement(); } }