コード例 #1
0
ファイル: Controller.cs プロジェクト: sahwar/Pixelaria
        /// <summary>
        /// Controller constructor
        /// </summary>
        /// <param name="mainForm">The form to use as the main form of the application</param>
        public Controller(MainForm mainForm)
        {
            _files = new List <PixelariaFile>();

            // Initialize the factories
            FrameFactory = new DefaultFrameFactory(this);

            // Initialize the validators and exporters
            DefaultValidator defValidator = new DefaultValidator(this);

            AnimationValidator      = defValidator;
            AnimationSheetValidator = defValidator;

            DefaultImporter = new DefaultPngImporter();

            // Initialize the Settings singleton
            Settings.GetSettings(Path.GetDirectoryName(Application.LocalUserAppDataPath) + "\\settings.ini");

            CurrentRecentFileList = new RecentFileList(10);

            if (mainForm != null)
            {
                mainForm.Controller = this;
                // Initialize the basic fields
                _mainForm = mainForm;
                _mainForm.UpdateRecentFilesList();

                // Start with a new empty bundle
                ShowNewBundle();
            }
        }