Example #1
0
        public MainForm()
        {
            this.topologyContainer = new TopologyContainer();
            this.topologyForm = new TopologyForm(this.topologyContainer);

            InitializeComponent();

            // find all object that inherit from iSequence to get all the available sequences
            foreach (Type type in AppDomain.CurrentDomain.GetAssemblies()
                .SelectMany(s => s.GetTypes())
                .Where(p => typeof(PluginsFramework.iSequence).IsAssignableFrom(p) && p.IsClass))
            {
                var newSequence = new SequenceDefinition(type, this.tcMain, this.topologyContainer);
                this.sequences.Add(newSequence);

                this.addSequenceToolStripMenuItem.DropDownItems.Add(newSequence.Menu);
            }

            // find all objects that inherit from iTopology to get all the available topologies
            foreach (Type type in AppDomain.CurrentDomain.GetAssemblies()
                .SelectMany(s => s.GetTypes())
                .Where(p => typeof(PluginsFramework.iTopology).IsAssignableFrom(p) && p.IsClass))
            {
                var newTopology = new TopologyDefinition(type, this.topologyForm);
                this.topologyToolStripMenuItem.DropDownItems.Add(newTopology.Menu);
            }

            this.DoubleBuffered = true;
            this.topologyForm.Show();
            this.BringToFront();
        }
Example #2
0
        public SequenceDefinition(Type type, TabControl control, TopologyContainer container)
        {
            this.sequenceType = type;

            this.menu = new ToolStripMenuItem(this.sequenceType.Name);
            this.menu.Click += new EventHandler(this.OnMenuClick);

            this.control = control;
            this.topologyContainer = container;
            this.attachedSequences = new List<SequenceObject>();
        }