Exemple #1
0
 private bool CallLfMergeBridge(string bridgeInput, out string bridgeOutput)
 {
     bridgeOutput = string.Empty;
     using (var tmpFile = new SIL.IO.TempFile(bridgeInput))
     {
         var options = new Dictionary <string, string>
         {
             { "-p", _project.FwDataPath },
             { "serializedCommentsFromLfMerge", tmpFile.Path }
         };
         try {
             if (!LfMergeBridge.LfMergeBridge.Execute("Language_Forge_Write_To_Chorus_Notes", _progress,
                                                      options, out bridgeOutput))
             {
                 _logger.Error("Got an error from Language_Forge_Write_To_Chorus_Notes: {0}", bridgeOutput);
                 return(false);
             }
             else
             {
                 // _logger.Debug("Good  output from Language_Forge_Write_To_Chorus_Notes: {0}", bridgeOutput);
                 return(true);
             }
         }
         catch (NullReferenceException)
         {
             _logger.Debug("Got an exception. Before rethrowing it, here is what LfMergeBridge sent:");
             _logger.Debug("{0}", bridgeOutput);
             throw;
         }
     }
 }
			public TestEnvironment(string liftFileContent)
			{
				_folder = new TemporaryFolder("WritingSystemsInLiftFileHelper");
				var pathtoLiftFile1 = Path.Combine(_folder.Path, "test1.lift");
				_liftFile1 = new SIL.IO.TempFile(liftFileContent);
				_liftFile1.MoveTo(pathtoLiftFile1);
				Helper = new WritingSystemsInLiftFileHelper(WritingSystems, _liftFile1.Path);
			}
Exemple #3
0
            public TestEnvironment(string liftFileContent)
            {
                _folder = new TemporaryFolder("WritingSystemsInLiftFileHelper");
                var pathtoLiftFile1 = Path.Combine(_folder.Path, "test1.lift");

                _liftFile1 = new SIL.IO.TempFile(liftFileContent);
                _liftFile1.MoveTo(pathtoLiftFile1);
                Helper = new WritingSystemsInLiftFileHelper(WritingSystems, _liftFile1.Path);
            }
Exemple #4
0
 private bool CallLfMergeBridge(string bridgeInput, out string bridgeOutput)
 {
     // Call into LF Bridge to do the work.
     bridgeOutput = string.Empty;
     using (var tmpFile = new SIL.IO.TempFile(bridgeInput))
     {
         var options = new Dictionary <string, string>
         {
             { "-p", _project.FwDataPath },
             { "serializedCommentsFromLfMerge", tmpFile.Path },
         };
         if (!LfMergeBridge.LfMergeBridge.Execute("Language_Forge_Get_Chorus_Notes", _progress,
                                                  options, out bridgeOutput))
         {
             _logger.Error("Got an error from Language_Forge_Get_Chorus_Notes: {0}", bridgeOutput);
             return(false);
         }
         else
         {
             // _logger.Debug("Got the JSON from Language_Forge_Get_Chorus_Notes: {0}", bridgeOutput);
             return(true);
         }
     }
 }