Exemplo n.º 1
0
        private static int CheckArguments(XRefArguments cmdLineArgs)
        {
            if (string.IsNullOrEmpty(cmdLineArgs.AssemblyDirectory))
            {
                Console.Error.WriteLine("Input directory missing");
                return(1);
            }

            if (string.IsNullOrEmpty(cmdLineArgs.OutputDirectory))
            {
                Console.Error.WriteLine("Output directory missing");
                return(1);
            }

            if (cmdLineArgs.ReflectorSource == ReflectorSource.Unspecified)
            {
                Console.Error.WriteLine("Reflector is missing. Either provide a reflector assembly or a custom reflector.");
                return(1);
            }

            if (!string.IsNullOrEmpty(cmdLineArgs.IgnoredAssemblies))
            {
                Console.Error.WriteLine(@"IgnoredAssemblies parameter is obsolete. You will need to specify the ignore-list using the ""remotion.typeDiscovery""-element in the app.config file for the analyzed assemblies.");
                return(1);
            }

            return(0);
        }
Exemplo n.º 2
0
 private static void SerializeToFile(string file, XRefArguments args)
 {
     using (var stream = File.OpenWrite(file))
     {
         var formatter = new BinaryFormatter();
         formatter.Serialize(stream, args);
     }
 }
Exemplo n.º 3
0
        public Settings(string persistentSettingsFile, Action <XRefArguments> apply, Func <XRefArguments> get, XRefArguments defaultSettings = null)
        {
            _persistentSettingsFile = persistentSettingsFile;
            _apply           = apply;
            _get             = get;
            _defaultSettings = defaultSettings;

            Arguments = Load(_persistentSettingsFile) ?? defaultSettings;
        }
Exemplo n.º 4
0
        private XRefArguments Load(string persistentSettingsFile)
        {
            XRefArguments arguments = null;

            if (File.Exists(persistentSettingsFile))
            {
                arguments = DeserializeFromFile(persistentSettingsFile);
            }

            return(arguments ?? _defaultSettings);
        }
Exemplo n.º 5
0
 private void RunXRef(XRefArguments options)
 {
     try
     {
         AppendTextToLogTextBoxAsync("Running MixinXRef...");
         CrossAppDomainCommunicator.MessageReceivedDelegate onMessageReceived = (severity, message) => AppendTextToLogTextBoxAsync(message);
         new XRefInAppDomainRunner().Run(null, options, onMessageReceived);
     }
     catch (ArgumentException ex)
     {
         Action messageBoxDisplayer = () => MessageBox.Show(this, ex.Message, "Configuration error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         BeginInvoke(messageBoxDisplayer);
     }
 }
Exemplo n.º 6
0
        private void ApplySettings(XRefArguments settings)
        {
            assemblyPathTextBox.Text      = settings.AssemblyDirectory;
            outputPathTextBox.Text        = settings.OutputDirectory;
            reflectorAssemblyTextBox.Text = settings.ReflectorPath;
            customReflectorTextBox.Text   = settings.CustomReflectorAssemblyQualifiedTypeName;
            forceOverrideCheckBox.Checked = settings.OverwriteExistingFiles;
            appBaseDirectory.Text         = settings.AppBaseDirectory;
            appConfigFile.Text            = settings.AppConfigFile;

            switch (settings.ReflectorSource)
            {
            case ReflectorSource.ReflectorAssembly:
                reflectorAssemblyRadioButton.Checked = true;
                break;

            case ReflectorSource.CustomReflector:
                customReflectorRadioButton.Checked = true;
                break;
            }
        }
Exemplo n.º 7
0
        private static int CheckArguments(XRefArguments cmdLineArgs)
        {
            if (string.IsNullOrEmpty(cmdLineArgs.AssemblyDirectory))
            {
                Console.Error.WriteLine("Input directory missing");
                return(1);
            }

            if (string.IsNullOrEmpty(cmdLineArgs.XMLOutputFileName))
            {
                Console.Error.WriteLine("Output file missing");
                return(1);
            }

            if (cmdLineArgs.ReflectorSource == ReflectorSource.Unspecified)
            {
                Console.Error.WriteLine("Reflector is missing. Either provide a reflector assembly or a custom reflector.");
                return(1);
            }

            return(0);
        }