Ejemplo n.º 1
0
        /// <summary>
        /// Merges the lineked information types from cat into this instance
        /// </summary>
        /// <param name="cat">category instance</param>
        internal void MergeInfoTypes(Category cat)
        {
            if (cat != null)
            {
                if (cat.InformationTypes.Count > 0)
                {
                    for (int i = 0; i < cat.InformationTypes.Count; i++)
                    {
                        InformationType curType = cat.InformationTypes[i] as InformationType;

                        if (!ContainsInformationType(curType.Name))
                        {
                            curType.SetCategoryFlag(true);
                            _infoTypes.Add(curType);
                        }
                    }
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Reads the object data from a dump store
        /// </summary>
        /// <param name="reader">reader to read the data</param>
        /// <param name="chmFile">current CHMFile instance which reads from dump</param>
        internal void ReadDump(ref BinaryReader reader, CHMFile chmFile)
        {
            _name        = reader.ReadString();
            _description = reader.ReadString();

            int nCnt = reader.ReadInt32();

            for (int i = 0; i < nCnt; i++)
            {
                string sITName = reader.ReadString();

                InformationType linkedType = chmFile.GetInformationType(sITName);

                if (linkedType != null)
                {
                    linkedType.SetCategoryFlag(true);
                    _infoTypes.Add(linkedType);
                }
            }
        }