Exemple #1
0
        public void SetUpPerfectMatch(FileBasedProject project)
        {
            #region "ScanPreviousProject"

            ProjectInfo   info  = GetProjectInfo();
            ProjectFile[] files = project.AddFiles(AddProjectFiles(@"c:\ProjectFiles\Documents\"));


            //Using a helper function to return an array of BilingualFileMappings which are added to the project
            project.AddBilingualReferenceFiles(GetBilingualFileMappings(info.TargetLanguages, files, @"c:\ProjectFiles\PreviousProjectFiles"));

            //Assigning one or more reference files manually
            project.AddBilingualReferenceFiles(
                new BilingualFileMapping[] {
                new BilingualFileMapping(files[0].Id, new Language("fr-FE"), @"c:\ProjectFiles\PreviousProjectFiles\fr-FR\mydocument.docx.sdlxliff"),
                new BilingualFileMapping(files[0].Id, new Language("de-DE"), @"c:\ProjectFiles\PreviousProjectFiles\de-DE\mydocument.docx.sdlxliff"),
                new BilingualFileMapping(files[1].Id, new Language("fr-FE"), @"c:\ProjectFiles\PreviousProjectFiles\fr-FR\myotherdocument.docx.sdlxliff"),
            });


            #endregion

            Guid FileIdFromOriginalSourceFile = files[0].Id;

            #region "AddBilingualReferenceFile"

            //Add a single reference file using a BilingualFileMapping Object
            project.AddBilingualReferenceFile(new BilingualFileMapping(FileIdFromOriginalSourceFile, new Language("fr-FR"), @"c:\ProjectFiles\PreviousProjectFiles\fr-FR\mydocument.docx.sdlxliff"));

            #endregion
        }