Пример #1
0
        private void LoadDeprocessor(string path)
        {
            var DLL = Assembly.LoadFile(path);

            foreach (Type type in DLL.GetExportedTypes())
            {
                deprocessor = (Deprocessor)Activator.CreateInstance(type);
            }
        }
Пример #2
0
        private void LoadDeprocessorViaAdapter(string path)
        {
            var    DLL     = Assembly.LoadFile(path);
            object adaptee = null;

            foreach (Type type in DLL.GetExportedTypes())
            {
                adaptee = Activator.CreateInstance(type);
            }
            deprocessor = new DeprocessorAdapter(adaptee, textBox2.Text);
        }
Пример #3
0
 public Form1()
 {
     InitializeComponent();
     panel1.GetType().GetMethod("SetStyle",
                                System.Reflection.BindingFlags.Instance |
                                System.Reflection.BindingFlags.NonPublic).Invoke(panel1,
                                                                                 new object[] { System.Windows.Forms.ControlStyles.UserPaint |
                                                                                                System.Windows.Forms.ControlStyles.AllPaintingInWmPaint |
                                                                                                System.Windows.Forms.ControlStyles.DoubleBuffer, true });
     processor   = new ProcessorStub();
     deprocessor = new DeprocessorStub();
     currentProcessorToolStripMenuItem.Text = "Current processor: " + processor.GetType().Name;
     loadDeprocessorToolStripMenuItem.Text  = "Current deprocessor: " + deprocessor.GetType().Name;
 }
Пример #4
0
 private void testToolStripMenuItem1_Click(object sender, EventArgs e)
 {
     deprocessor = new DeprocessorStub();
     loadDeprocessorToolStripMenuItem.Text = "Current deprocessor: " + deprocessor.GetType().Name;
 }