internal void SetupWritingSystemsForTitle(FdoCache cache)
        {
            m_ttpWsLabel        = WritingSystemServices.AbbreviationTextProperties;
            m_writingSystems    = new IWritingSystem[2];
            m_writingSystems[0] = cache.ServiceLocator.WritingSystems.DefaultVernacularWritingSystem;
            m_writingSystems[1] = cache.ServiceLocator.WritingSystems.DefaultAnalysisWritingSystem;
            m_WsLabels          = new ITsString[m_writingSystems.Length];

            int wsEn = cache.LanguageWritingSystemFactoryAccessor.GetWsFromStr("en");

            if (wsEn == 0)
            {
                wsEn = cache.DefaultUserWs;
            }
            if (wsEn == 0)
            {
                wsEn = WritingSystemServices.FallbackUserWs(cache);
            }

            for (int i = 0; i < m_writingSystems.Length; i++)
            {
                //m_WsLabels[i] = LgWritingSystem.UserAbbr(cache, m_writingSystems[i].Hvo);
                // For now (August 2008), try English abbreviation before UI writing system.
                // (See LT-8185.)
                m_WsLabels[i] = cache.TsStrFactory.MakeString(m_writingSystems[i].Abbreviation, cache.DefaultUserWs);
                if (String.IsNullOrEmpty(m_WsLabels[i].Text))
                {
                    m_WsLabels[i] = cache.TsStrFactory.MakeString(m_writingSystems[i].Abbreviation, cache.DefaultUserWs);
                }
            }
        }
Exemplo n.º 2
0
        private IMoMorphType GetMorphType()
        {
            IMoMorphType morphType      = null;
            string       sMorphTypeName = (m_fPrefix ? "prefix" : "suffix");
            int          iEnglishWs     = WritingSystemServices.FallbackUserWs(m_cache);

            foreach (var type in m_cache.LanguageProject.LexDbOA.MorphTypesOA.ReallyReallyAllPossibilities)
            {
                if (sMorphTypeName == type.Name.get_String(iEnglishWs).Text)
                {
                    morphType = type as IMoMorphType;
                    break;
                }
            }
            return(morphType);
        }
Exemplo n.º 3
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Initializes a new instance of the <see cref="XmlScrNote"/> class based on
        /// the given Scripture note.
        /// </summary>
        /// <param name="ann">The Scripture annotation.</param>
        /// <param name="wsDefault">The default (analysis) writing system.</param>
        /// <param name="lgwsf">The writing system factory.</param>
        /// ------------------------------------------------------------------------------------
        public XmlScrNote(IScrScriptureNote ann, int wsDefault, ILgWritingSystemFactory lgwsf)
            : this()
        {
            m_wsDefault      = wsDefault;
            m_lgwsf          = lgwsf;
            ResolutionStatus = ann.ResolutionStatus;
            m_typeName       = ann.AnnotationTypeRA.Name.get_String(WritingSystemServices.FallbackUserWs(ann.Cache)).Text;
            m_guidType       = ann.AnnotationTypeRA.Guid;
            SetNoteType(ann);

            m_startRef = ann.BeginRef;
            if (ann.BeginRef != ann.EndRef)
            {
                m_endRef = ann.EndRef;
            }

            if (ann.BeginObjectRA != null)
            {
                m_guidBegObj = ann.BeginObjectRA.Guid;
            }

            if (ann.BeginObjectRA != ann.EndObjectRA && ann.EndObjectRA != null)
            {
                m_guidEndObj = ann.EndObjectRA.Guid;
            }

            BeginOffset = ann.BeginOffset;
            EndOffset   = ann.EndOffset;

            m_createdDate  = ann.DateCreated;
            m_modifiedDate = ann.DateModified;
            m_resolvedDate = ann.DateResolved;

            Quote      = XmlNotePara.GetParagraphList(ann.QuoteOA, m_wsDefault, m_lgwsf);
            Discussion = XmlNotePara.GetParagraphList(ann.DiscussionOA, m_wsDefault, m_lgwsf);
            Suggestion = XmlNotePara.GetParagraphList(ann.RecommendationOA, m_wsDefault, m_lgwsf);
            Resolution = XmlNotePara.GetParagraphList(ann.ResolutionOA, m_wsDefault, m_lgwsf);
            Categories = XmlNoteCategory.GetCategoryList(ann, m_lgwsf);
            Responses  = XmlNoteResponse.GetResponsesList(ann, m_wsDefault, m_lgwsf);
        }
Exemplo n.º 4
0
        private void SetupCacheToTestAgainst()
        {
            var lp = Cache.LangProject;

            lp.LinkedFilesRootDir = m_linkedFilesRootDir;
            ICmFolder picturesfolder  = DomainObjectServices.FindOrCreateFolder(Cache, LangProjectTags.kflidPictures, CmFolderTags.LocalPictures);
            ICmFolder mediafolder     = DomainObjectServices.FindOrCreateFolder(Cache, LangProjectTags.kflidMedia, CmFolderTags.LocalMedia);
            ICmFolder tsStringsfolder = Cache.ServiceLocator.GetInstance <ICmFolderFactory>().Create();

            lp.FilePathsInTsStringsOA = tsStringsfolder;
            tsStringsfolder.Name.AnalysisDefaultWritingSystem = Cache.TsStrFactory.MakeString(CmFolderTags.LocalFilePathsInTsStrings,
                                                                                              WritingSystemServices.FallbackUserWs(Cache));

            AddCmFileToCmFolder(picturesfolder, Path.Combine("Pictures", "JudeAndMeWithBeard.jpg"));
            AddCmFileToCmFolder(tsStringsfolder, Path.Combine("Others", "Chic Skype.png"));
            AddCmFileToCmFolder(mediafolder, Path.Combine("AudioVisual", "Untitled0.WMV"));
        }