Example #1
0
        public MainForm()
        {
            InitializeComponent();

            ResourceManager = new ResourceManager();

            SpriteManager = new SpriteManager();

            TTM = new ThingTypeManager();
            TTM.Init();

            // Add the control scroll message filter to re-route all mousewheel events
            // to the control the user is currently hovering over with their cursor.
            Application.AddMessageFilter(new ControlScrollFilter());

            // Add the dock content drag message filter to handle moving dock content around.
            Application.AddMessageFilter(DockPanel.DockContentDragFilter);

            // Add the dock panel message filter to filter through for dock panel splitter
            // input before letting events pass through to the rest of the application.
            Application.AddMessageFilter(DockPanel.DockResizeFilter);

            // Hook in all the UI events manually for clarity.
            HookEvents();

            // Build the tool windows and add them to the dock panel
            _client      = new Client();
            _thingsView  = new ThingsView();
            _spritesView = new SpritesView();

            // Add the tool windows to a list
            _toolWindows.Add(_thingsView);
            _toolWindows.Add(_spritesView);
            _toolWindows.Add(_client);

            // Deserialize if a previous state is stored
            if (File.Exists("dockpanel.config"))
            {
                //DeserializeDockPanel("dockpanel.config");
            }
            else
            {
                // Add the tool window list contents to the dock panel
                foreach (var toolWindow in _toolWindows)
                {
                    DockPanel.AddContent(toolWindow);
                }
            }
        }
Example #2
0
 // type shortcuts
 public virtual ThingType GetThingType()
 {
     return(ThingTypeManager.GetNullThingType());
 }