protected override void DoLoadFromStream(Stream aStream, HCStyle aStyle, ushort aFileVersion) { base.DoLoadFromStream(aStream, aStyle, aFileVersion); if (aFileVersion > 12) { int vFloatCount = 0; byte[] vBuffer = BitConverter.GetBytes(vFloatCount); aStream.Read(vBuffer, 0, vBuffer.Length); vFloatCount = BitConverter.ToInt32(vBuffer, 0); HCCustomFloatItem vFloatItem = null; while (vFloatCount > 0) { int vStyleNo = HCStyle.Null; vBuffer = BitConverter.GetBytes(vStyleNo); aStream.Read(vBuffer, 0, vBuffer.Length); vStyleNo = BitConverter.ToInt32(vBuffer, 0); if ((aFileVersion < 28) && (vStyleNo == (byte)HCShapeStyle.hssLine)) { vFloatItem = new HCFloatLineItem(this); } else { vFloatItem = CreateItemByStyle(vStyleNo) as HCCustomFloatItem; } vFloatItem.LoadFromStream(aStream, aStyle, aFileVersion); FFloatItems.Add(vFloatItem); vFloatCount--; } } }
private HCCustomFloatItem CreateFloatItemByStyle(int aStyleNo) { HCCustomFloatItem Result = null; if (aStyleNo == (byte)HCShapeStyle.hssLine) { Result = new HCFloatLineItem(this); } else { throw new Exception("未找到类型 " + aStyleNo.ToString() + " 对应的创建FloatItem代码!"); } return(Result); }
private HCFloatItem CreateFloatItemByStyle(int AStyleNo) { HCFloatItem Result = null; if (AStyleNo == HCFloatStyle.Line) { Result = new HCFloatLineItem(this); } else { throw new Exception("未找到类型 " + AStyleNo.ToString() + " 对应的创建FloatItem代码!"); } return(Result); }