Exemple #1
0
        private void CreateTileSheet(Command command)
        {
            try
            {
                ImportSheetCommand cmd = (ImportSheetCommand)command;
                int        sheetID     = 0;
                SheetError err         = m_tileManager.CreateNewSheet(cmd.m_filename, cmd.m_tileSize, ref sheetID);

                // Check Error - SIZE_MISMATCH is considered okay for now
                if ((err == SheetError.SUCCESS || err == SheetError.SIZE_MISMATCH) && sheetID != -1)
                {
                    m_mainWindow.Dispatcher.InvokeAsync((Action) delegate() { m_mainWindow.AddTileSheet(m_tileManager.GetSheet(sheetID)); });
                    DisplayMessage("Importing " + cmd.m_filename + " at " + cmd.m_tileSize.ToString() + " pixels per tile.");
                }
                m_mainWindow.Dispatcher.InvokeAsync((Action) delegate() { cmd.m_callBack(err); });
            }
            catch (InvalidCastException) { /*Add Logging in Future for Internal Error*/ }
        }
Exemple #2
0
        static public Command CreateLoadTileSheetCmd(string filename, int tileSize, ImportCallBack cBack)
        {
            ImportSheetCommand cmd = new ImportSheetCommand(filename, tileSize, cBack);

            return(cmd);
        }