Exemplo n.º 1
0
        static int Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            var catalog    = new AssemblyCatalog(System.Reflection.Assembly.GetExecutingAssembly());
            var container  = new CompositionContainer(catalog);
            var inspectors = container.GetExportedValues <IAudioFileInspector>();

            if (args.Length > 0)
            {
                if (args[0] == "-install")
                {
                    try
                    {
                        OptionsForm.Associate(inspectors);
                        Console.WriteLine("Created {0} file associations", inspectors.Count());
                    }
                    catch (Exception e)
                    {
                        Console.WriteLine("Unable to create file associations");
                        Console.WriteLine(e.ToString());
                        return(-1);
                    }

                    return(0);
                }
                else if (args[0] == "-uninstall")
                {
                    try
                    {
                        OptionsForm.Disassociate(inspectors);
                        Console.WriteLine("Removed {0} file associations", inspectors.Count());
                    }
                    catch (Exception e)
                    {
                        Console.WriteLine("Unable to remove file associations");
                        Console.WriteLine(e.ToString());
                        return(-1);
                    }
                    return(0);
                }
            }
            var mainForm = container.GetExportedValue <AudioFileInspectorForm>();

            mainForm.CommandLineArguments = args;
            Application.Run(mainForm);
            return(0);
        }
Exemplo n.º 2
0
        private void optionsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OptionsForm optionsForm = new OptionsForm(Inspectors);
            optionsForm.ShowDialog();

        }
Exemplo n.º 3
0
        private void optionsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OptionsForm optionsForm = new OptionsForm(Inspectors);

            optionsForm.ShowDialog();
        }