コード例 #1
0
    protected void OnOk(object o, EventArgs args)
    {
        try {
            uint newWidth  = UInt32.Parse(WidthEntry.Text);
            uint newHeight = UInt32.Parse(HeightEntry.Text);
            //application.TakeUndoSnapshot( "Sector resized to " + newWidth + "x" + newHeight);
            SectorSizeChangeCommand command = new SectorSizeChangeCommand(
                undoTitleBase + " resized to " + newWidth + "x" + newHeight,
                sector,
                tilemap,
                newWidth,
                newHeight);
            command.Do();
            UndoManager.AddCommand(command);
        } catch (Exception e) {
            ErrorDialog.Exception(e);
        }

        resizeDialog.Hide();
    }
コード例 #2
0
    protected void OnOk(object o, EventArgs args)
    {
        try {
            int xOffset = Int32.Parse(XOffsetEntry.Text);
            int yOffset = Int32.Parse(YOffsetEntry.Text);
            int newWidth = Int32.Parse(WidthEntry.Text);
            int newHeight = Int32.Parse(HeightEntry.Text);
            //application.TakeUndoSnapshot( "Sector resized to " + newWidth + "x" + newHeight);
            SectorSizeChangeCommand command = new SectorSizeChangeCommand(
                undoTitleBase + " resized to " + newWidth + "x" + newHeight,
                sector,
                tilemap,
                xOffset,
                yOffset,
                newWidth,
                newHeight);
            command.Do();
            UndoManager.AddCommand(command);
        } catch(Exception e) {
            ErrorDialog.Exception(e);
        }

        resizeDialog.Hide();
    }