public PropertyValue(object value, RegistryValueKind kind) { this.Value = value; if (kind == RegistryValueKind.Unknown) { this.Kind = (int)Utils.GetValueKind(value); return; } this.Kind = (int)kind; }
public XElement ToXElement(string propertyName) { if (this.Kind == 0) { this.Kind = (int)Utils.GetValueKind(this.Value); } XElement xelement = new XElement("Value", new object[] { new XAttribute("Name", propertyName), new XAttribute("Kind", this.Kind.ToString()) }); if (this.Kind == 7) { string[] array = (from o in (object[])this.Value select o.ToString()).ToArray <string>(); foreach (string value in array) { XElement content = new XElement("String") { Value = value }; xelement.Add(content); } } else if (this.Kind == 3) { SoapHexBinary soapHexBinary = new SoapHexBinary((byte[])this.Value); xelement.Value = soapHexBinary.ToString(); } else { xelement.Value = this.Value.ToString(); } return(xelement); }
public PropertyValue(object value) { this.Value = value; this.Kind = (int)Utils.GetValueKind(value); }