Exemple #1
0
        public bool InsertLiteStream(Stream stream)
        {
            bool vResult = false;

            DataLoadLiteStream(stream, delegate(ushort fileVersion, HCStyle style)
            {
                vResult = ActiveSection.InsertStream(stream, style, fileVersion);
            });

            return(vResult);
        }
Exemple #2
0
        /// <summary> 直接设置当前数据元的值为扩展内容 </summary>
        /// <param name="aStream">扩展内容流</param>
        public void SetActiveItemExtra(Stream aStream)
        {
            string vFileFormat  = "";
            ushort vFileVersion = 0;
            byte   vLang        = 0;

            HC.View.HC._LoadFileFormatAndVersion(aStream, ref vFileFormat, ref vFileVersion, ref vLang);
            HCStyle vStyle = new HCStyle();

            try
            {
                vStyle.LoadFromStream(aStream, vFileVersion);
                this.BeginUpdate();
                try
                {
                    this.UndoGroupBegin();
                    try
                    {
                        HCRichData vTopData = this.ActiveSectionTopLevelData() as HCRichData;
                        this.DeleteActiveDataItems(vTopData.SelectInfo.StartItemNo);
                        ActiveSection.InsertStream(aStream, vStyle, vFileVersion);
                    }
                    finally
                    {
                        this.UndoGroupEnd();
                    }
                }
                finally
                {
                    this.EndUpdate();
                }
            }
            finally
            {
                vStyle.Dispose();
            }
        }