Example #1
0
        private string GetMasterHHC(IList <TopicEntry> hhcTopics)
        {
            string sRet = "";

            if ((hhcTopics != null) && (hhcTopics.Count > 0))
            {
                if (hhcTopics.Count == 1)
                {
                    sRet = hhcTopics[0].Locale;
                }
                else
                {
                    foreach (TopicEntry curEntry in hhcTopics)
                    {
                        ITStorageWrapper iw = null;
                        // Open the internal chm system files and parse their content
                        FileObject fileObject = null;

                        if (_associatedFile.CurrentStorageWrapper == null)
                        {
                            iw = new ITStorageWrapper(_associatedFile.ChmFilePath, false);
                        }
                        else
                        {
                            iw = _associatedFile.CurrentStorageWrapper;
                        }

                        fileObject = iw.OpenUCOMStream(null, curEntry.Locale);
                        if (fileObject != null)
                        {
                            string fileString = fileObject.ReadFromFile(_associatedFile.TextEncoding);
                            fileObject.Close();

                            if (HHCParser.HasGlobalObjectTag(fileString, _associatedFile))
                            {
                                sRet = curEntry.Locale;
                                break;
                            }
                        }
                    }
                }
            }

            return(sRet);
        }