Exemple #1
0
        public override void OnNewPropertyGridItem(object sender, EventArgs e)
        {
            EnterIntegerForm frm = new EnterIntegerForm();
            frm.Text = "Enter Error Number";

            if (DialogResult.OK == frm.ShowDialog())
            {
                if (CurrentParent == null)
                {
                    MessageBox.Show(String.Format("No location found to add \"{0}\" element, need parent element!", CurrentElementName));
                    return;
                }

                WixFiles.UndoManager.BeginNewCommandRange();

                XmlElement newProp = WixFiles.WxsDocument.CreateElement(CurrentElementName, WixFiles.WixNamespaceUri);
                XmlAttribute newAttr = WixFiles.WxsDocument.CreateAttribute(CurrentKeyName);

                newAttr.Value = frm.SelectedString;

                newProp.Attributes.Append(newAttr);

                InsertNewXmlNode(CurrentParent, newProp);

                RefreshGrid(frm.SelectedString);
            }
        }
Exemple #2
0
        public override void OnRenamePropertyGridItem(object sender, EventArgs e)
        {
            XmlNode element = GetSelectedGridObject();
            if (element != null)
            {
                EnterIntegerForm frm = new EnterIntegerForm(element.Attributes[CurrentKeyName].Value);
                frm.Text = "Enter Error Number";

                if (DialogResult.OK == frm.ShowDialog())
                {
                    WixFiles.UndoManager.BeginNewCommandRange();

                    element.Attributes[CurrentKeyName].Value = frm.SelectedString;

                    RefreshGrid();
                }
            }
        }
Exemple #3
0
        private void SnapToGrid_Click(object sender, EventArgs e)
        {
            EnterIntegerForm form = new EnterIntegerForm();
            form.Text = "Enter number of pixels to snap to:";
            form.SelectedInteger = WixEditSettings.Instance.SnapToGrid;

            if (form.ShowDialog() == DialogResult.OK)
            {
                SelectionOverlay.SnapToGrid = form.SelectedInteger;
                WixEditSettings.Instance.SnapToGrid = form.SelectedInteger;
                WixEditSettings.Instance.SaveChanges();
            }
        }
Exemple #4
0
        private void DialogScale_Click(object sender, EventArgs e)
        {
            EnterIntegerForm form = new EnterIntegerForm();
            form.Text = "Enter percentage to scale to:";
            form.SelectedInteger = (int)(WixEditSettings.Instance.Scale * 100);

            if (form.ShowDialog() == DialogResult.OK)
            {
                DialogGenerator.Scale = ((double)form.SelectedInteger) / 100.00;
                WixEditSettings.Instance.Scale = ((double)form.SelectedInteger) / 100.00;
                WixEditSettings.Instance.SaveChanges();

                if (prevSelectedIndex >= 0 && wxsDialogs.Items.Count > prevSelectedIndex)
                {
                    XmlNode dialog = (XmlNode)wxsDialogs.Items[prevSelectedIndex].Tag;

                    ShowWixDialog(dialog);
                }
            }
        }