/// <summary> /// Copies the given PropertyItem. /// </summary> /// <param name="pi">The PropertyItem to clone.</param> /// <returns>A copy of the given PropertyItem.</returns> public static PropertyItem ClonePropertyItem(PropertyItem pi) { byte[] valueClone; if (pi.Value == null) { valueClone = new byte[0]; } else { valueClone = (byte[])pi.Value.Clone(); } PropertyItem2 pi2 = new PropertyItem2(pi.Id, pi.Len, pi.Type, valueClone); return pi2.ToPropertyItem(); }
/// <summary> /// Creates a new, zero-filled PropertyItem. /// </summary> /// <returns>A PropertyItem that is zero-filled.</returns> public static PropertyItem CreatePropertyItem() { PropertyItem2 pi2 = new PropertyItem2(0, 0, 0, new byte[0]); return pi2.ToPropertyItem(); }