public SelectCircuit(CircuitController controller) { InitializeComponent(); // Initialize circuit uids circuitUIDs.DataSource = controller.circuits; }
public void initialize() { // Initialize graphics device service _graphicsDeviceService = GraphicsDeviceService.AddRef(view.Handle, view.Width, view.Height); // Initialize core resource controller ResourceManager.initialize(_graphicsDeviceService.GraphicsDevice); ResourceManager.rootDirectory = resourcesSourcePath + "\\"; // Create controllers _levelController = new LevelController(this, _editorView.levelView); _materialController = new MaterialController(this, _editorView.materialView); _blueprintController = new BlueprintController(this, _editorView.blueprintView); _circuitController = new CircuitController(this, _editorView.circuitsView); _backgroundController = new BackgroundController(this, _editorView.backgroundView); }
// setController public void setController(CircuitController controller) { _controller = controller; circuitsList.DataSource = _controller.circuits; }
// Initialize protected override void Initialize() { if (!IsDesignerHosted) { _spriteBatch = new SpriteBatch(GraphicsDevice); _contentManager = new ContentManager(Services, "Content"); System.Diagnostics.Debug.Assert(Parent.Parent.Parent is CircuitsView); _view = Parent.Parent.Parent as CircuitsView; _controller = _view.controller; // Resources _pixel = new Texture2D(GraphicsDevice, 1, 1); _pixel.SetData<Color>(new[] { Color.White }); _and = _contentManager.Load<Texture2D>("logic_gate_icons\\and"); _or = _contentManager.Load<Texture2D>("logic_gate_icons\\or"); _not = _contentManager.Load<Texture2D>("logic_gate_icons\\not"); _input = _contentManager.Load<Texture2D>("logic_gate_icons\\input"); _output = _contentManager.Load<Texture2D>("logic_gate_icons\\output"); _circle = _contentManager.Load<Texture2D>("circle"); _font = _contentManager.Load<SpriteFont>("gate_font"); // Events Application.Idle += delegate { Invalidate(); }; MouseMove += new System.Windows.Forms.MouseEventHandler(CircuitsView_MouseMove); MouseDown += new MouseEventHandler(CircuitDisplay_MouseDown); FindForm().KeyDown += new KeyEventHandler(Parent_KeyDown); FindForm().KeyUp += new KeyEventHandler(Parent_KeyUp); } }