Exemple #1
0
    private void Open( string filePath )
    {

      Task = TranslateTask.LoadTranslateTask( filePath );
      WebBrowser.Navigate( Task.Translate() );
      DataView.ItemsSource = Task.Terms;

    }
Exemple #2
0
        private void Open(string filePath)
        {
            Task = TranslateTask.LoadTranslateTask(filePath);
            WebBrowser.Navigate(Task.Translate());
            DataView.DataContext = Task;
            DataView.Resources["CandidateTermsConverter"].CastTo <CandidateTermsConverter>().Task = Task;

            TranslationProgress.Maximum = Task.Terms.Length;
            FilenameTextBlock.Text      = filePath;

            TranslationProgress.Value = Task.Terms.Count(t => t.SourceTerm != t.TranslatedTerm && !string.IsNullOrWhiteSpace(t.TranslatedTerm));
        }
Exemple #3
0
    private void Open( string filePath )
    {

      Task = TranslateTask.LoadTranslateTask( filePath );
      WebBrowser.Navigate( Task.Translate() );
      DataView.DataContext = Task;
      DataView.Resources["CandidateTermsConverter"].CastTo<CandidateTermsConverter>().Task = Task;

      TranslationProgress.Maximum = Task.Terms.Length;
      FilenameTextBlock.Text = filePath;

      TranslationProgress.Value = Task.Terms.Count( t => t.SourceTerm != t.TranslatedTerm && !string.IsNullOrWhiteSpace( t.TranslatedTerm ) );


    }
Exemple #4
0
        public static TranslateTask LoadTranslateTask(string filepath)
        {
            if (filepath == null)
            {
                throw new ArgumentNullException("filepath");
            }

            if (!File.Exists(filepath))
            {
                throw new InvalidOperationException("文件不存在");
            }


            var document = new JumonyParser().LoadDocument(File.OpenText(filepath), new Uri(filepath));

            var task = new TranslateTask(document);

            task.Initialize();

            return(task);
        }
Exemple #5
0
    public static TranslateTask LoadTranslateTask( string filepath )
    {

      if ( filepath == null )
        throw new ArgumentNullException( "filepath" );

      if ( !File.Exists( filepath ) )
        throw new InvalidOperationException( "文件不存在" );


      var document = new JumonyParser().LoadDocument( File.OpenText( filepath ), new Uri( filepath ) );

      var task = new TranslateTask( document );

      task.Initialize();

      return task;

    }
Exemple #6
0
 private void Open(string filePath)
 {
     Task = TranslateTask.LoadTranslateTask(filePath);
     WebBrowser.Navigate(Task.Translate());
     DataView.ItemsSource = Task.Terms;
 }