void IXmlSerializable.ReadXml(XmlReader reader) { DisplayName = reader.ReadString("display"); Name = reader.ReadString("name"); ServiceType = reader.ReadEnum <ServiceType>("type"); UserName = reader.ReadString("user"); ImagePath = reader.ReadString("path"); ServiceDll = reader.ReadString("dll"); ProtectionLevel = reader.ReadEnum <ServiceProtectionLevel>("prot"); }
internal COMAppIDServiceEntry(RegistryKey key, ServiceController service) { DisplayName = service.DisplayName; Name = service.ServiceName; ServiceType = service.ServiceType; ServiceDll = string.Empty; ImagePath = string.Empty; UserName = string.Empty; if (key != null) { UserName = key.ReadString(null, "ObjectName"); ImagePath = key.ReadString(null, "ImagePath"); ServiceDll = key.ReadString("Parameters", "ServiceDll"); if (string.IsNullOrEmpty(ServiceDll)) { ServiceDll = key.ReadString(null, "ServiceDll"); } ProtectionLevel = (ServiceProtectionLevel)COMUtilities.ReadInt(key, null, "LaunchProtected"); } }