Пример #1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(txtName.Text))
            {
                MessageBox.Show("'Name' is a required field.", "Missing Name", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            if (Gondwana.Common.Drawing.Tilesheet.AllTilesheets.Any(x => x.Name == txtName.Text))
            {
                MessageBox.Show(
                    string.Format("Tilesheet '{0}' already exists.  Please select another name, or delete the existing Tilesheet.", txtName.Text),
                    "Name Already Exists", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            if (string.IsNullOrWhiteSpace(cboName.Text))
            {
                MessageBox.Show("'Source Name' is a required field.", "Missing Source Name", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            Gondwana.Common.Drawing.Tilesheet tilesheet = null;

            // if cboType is "Assets Folder"...
            if (cboType.SelectedIndex == 0)
            {
                tilesheet = new Gondwana.Common.Drawing.Tilesheet(txtName.Text, Program.State.AssetsDirectory + cboName.Text);
            }
            else
            {
                tilesheet = new Gondwana.Common.Drawing.Tilesheet(GetResourceIdentifierFromListSelection(), txtName.Text);
            }

            Program.State.IsDirty = true;

            var parent = (ScriptDesigner)this.ParentForm;

            parent.PopulateTreeView();
            parent.treeSelect.SelectedNode = parent.treeSelect.Nodes["ndFile"].Nodes["ndTilesheets"].Nodes[txtName.Text];
        }
Пример #2
0
 public Tilesheet(Gondwana.Common.Drawing.Tilesheet sheet) : this()
 {
     this.Sheet = sheet;
 }
Пример #3
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(txtName.Text))
            {
                MessageBox.Show("'Name' is a required field.", "Missing Name", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            if (Gondwana.Common.Drawing.Tilesheet.AllTilesheets.Any(x => x.Name == txtName.Text))
            {
                MessageBox.Show(
                    string.Format("Tilesheet '{0}' already exists.  Please select another name, or delete the existing Tilesheet.", txtName.Text),
                    "Name Already Exists", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            if (string.IsNullOrWhiteSpace(cboName.Text))
            {
                MessageBox.Show("'Source Name' is a required field.", "Missing Source Name", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            Gondwana.Common.Drawing.Tilesheet tilesheet = null;

            // if cboType is "Assets Folder"...
            if (cboType.SelectedIndex == 0)
                tilesheet = new Gondwana.Common.Drawing.Tilesheet(txtName.Text, Program.State.AssetsDirectory + cboName.Text);
            else
                tilesheet = new Gondwana.Common.Drawing.Tilesheet(GetResourceIdentifierFromListSelection(), txtName.Text);

            Program.State.IsDirty = true;

            var parent = (ScriptDesigner)this.ParentForm;
            parent.PopulateTreeView();
            parent.treeSelect.SelectedNode = parent.treeSelect.Nodes["ndFile"].Nodes["ndTilesheets"].Nodes[txtName.Text];
        }