Exemple #1
0
        private void btnExecute_Click(object sender, RoutedEventArgs e)
        {
            commandPanel.IsEnabled = false;
            btnStop.Visibility     = Visibility.Visible;

            ReflectorEventArgs args = new ReflectorEventArgs();

            cts = new CancellationTokenSource();
            args.CancellationToken           = cts.Token;
            args.LogLevel                    = (LogLevel)cbLogLevel.SelectedValue;
            args.AssemblyName                = tbAssembly.Text;
            args.RootDestinationFolder       = Path.GetFullPath(Path.Combine(tbDestinationFolder.Text, Const.FileNameAndDirectory.SourceDirectory));
            args.CsvDestinationFolder        = Path.GetFullPath(Path.Combine(tbDestinationFolder.Text, Const.FileNameAndDirectory.StatsDirectory));
            args.SplitFolderByAssembly       = cbEnableSplitFolder.IsChecked.Value;
            args.ForceRebuild                = cbForceRebuildIfFolderExist.IsChecked.Value;
            args.UseParallelBuild            = cbUseParallel.IsChecked.Value;
            args.CreateExceptionThrownClause = cbExportExceptions.IsChecked.Value;
            args.ExceptionThrownClauseDepth  = MaxDepth;
            args.EnableAbstract              = cbExportAbstract.IsChecked.Value;
            args.EnableArray                 = cbExportArray.IsChecked.Value;
            args.EnableDuplicateMethodNativeArrayWithJCRefOut = cbDuplicateMethodNativeArray.IsChecked.Value;
            args.EnableInheritance = cbEnableInheritance.IsChecked.Value;
            args.DryRun            = cbDryRun.IsChecked.Value;

            Task.Factory.StartNew(Reflector.ExportAssembly, args);
        }
Exemple #2
0
        private void btnExecute_Click(object sender, RoutedEventArgs e)
        {
            commandPanel.IsEnabled = false;
            btnStop.Visibility     = Visibility.Visible;

            ReflectorEventArgs args = new ReflectorEventArgs(RepositoryRoot, (LogLevel)cbLogLevel.SelectedValue);

            cts = new CancellationTokenSource();
            args.CancellationToken           = cts.Token;
            args.AssemblyNames               = string.IsNullOrEmpty(tbAssemblyNames.Text) ? new List <string>().ToArray() : tbAssemblyNames.Text.Replace("\r", "").Split('\n');
            args.SrcDestinationFolder        = tbDestinationFolder.Text;
            args.SplitFolderByAssembly       = cbEnableSplitFolder.IsChecked.Value;
            args.ForceRebuild                = cbForceRebuildIfFolderExist.IsChecked.Value;
            args.UseParallelBuild            = cbUseParallel.IsChecked.Value;
            args.CreateExceptionThrownClause = cbExportExceptions.IsChecked.Value;
            args.ExceptionThrownClauseDepth  = MaxDepth;
            args.EnableAbstract              = cbExportAbstract.IsChecked.Value;
            args.EnableArray = cbExportArray.IsChecked.Value;
            args.EnableDuplicateMethodNativeArrayWithJCRefOut = cbDuplicateMethodNativeArray.IsChecked.Value;
            args.EnableInheritance          = cbEnableInheritance.IsChecked.Value;
            args.EnableInterfaceInheritance = cbEnableInterfaceInheritance.IsChecked.Value;
            args.DryRun = cbDryRun.IsChecked.Value;

            if (cbExportToFile.IsChecked.Value)
            {
                export(args);
                if (MessageBox.Show("Continue operation?", string.Empty, MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.Yes) == MessageBoxResult.No)
                {
                    return;
                }
            }

            Task.Factory.StartNew(Reflector.ExecuteAction, args);
        }