public override void Create(QbItemType type)
{
if (type != QbItemType.SectionStruct && type != QbItemType.StructItemStruct && type != QbItemType.StructHeader)
throw new ApplicationException(string.Format("type '{0}' is not a struct item type", type.ToString()));
base.Create(type);
if (type != QbItemType.StructHeader)
{
_headerType = QbItemType.StructHeader;
_headerValue = this.Root.PakFormat.GetQbItemValue(_headerType, this.Root);
}
}
/// <summary> /// Deep clones this item and all children. Positions and lengths are not cloned. When inserted in to another item they should be calculated. /// </summary> /// <returns></returns> public override QbItemBase Clone() { QbItemStruct s = new QbItemStruct(this.Root); s.Create(this.QbItemType); if (this.ItemQbKey != null) s.ItemQbKey = this.ItemQbKey.Clone(); foreach (QbItemBase qib in this.Items) s.Items.Add(qib.Clone()); s.ItemCount = this.ItemCount; return s; }