Beispiel #1
0
        private void saveToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // save the current project
              if (mCurrentFileName.Length == 0)
              {
            saveAsToolStripMenuItem_Click(sender, e);
            return;
              }

              CursorScopedWait waiter = new CursorScopedWait(ref mWaitCursorCounter);

              try
              {
            string json = DeserializeSettings();
            SaveFileAs(mCurrentFileName, json);
              }
              finally
              {
            waiter.Dispose();
              }
        }
Beispiel #2
0
        private void saveAsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (textBoxLocation.Text.Length == 0 ||
            textBoxVersion.Text.Length == 0 ||
            textBoxProject.Text.Length == 0)
              {
            return;
              }

              // save the current project under a new name
              saveFileDialog1.FileName = String.Empty;
              saveFileDialog1.AddExtension = true;
              saveFileDialog1.CheckPathExists = true;
              saveFileDialog1.CreatePrompt = true;
              saveFileDialog1.DefaultExt = "settings";
              saveFileDialog1.Filter = "Settings Files (.settings)|*.settings";
              saveFileDialog1.OverwritePrompt = true;
              saveFileDialog1.Title = "Save Settings";
              if (saveFileDialog1.ShowDialog() == DialogResult.OK)
              {
            CursorScopedWait waiter = new CursorScopedWait(ref mWaitCursorCounter);

            try
            {
              string json = DeserializeSettings();
              SaveFileAs(saveFileDialog1.FileName, json);
            }
            finally
            {
              waiter.Dispose();
            }
              }
        }
Beispiel #3
0
        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (mUpdated)
              {
            DialogResult result = MessageBox.Show("Do you want to discard changes?", "Project Changed", MessageBoxButtons.YesNo);
            if (result == DialogResult.No)
            {
              return;
            }
              }

              // open an existing project
              openFileDialog1.FileName = String.Empty;
              openFileDialog1.AddExtension = true;
              openFileDialog1.CheckPathExists = true;
              openFileDialog1.Filter = "Settings Files (.settings)|*.settings";
              openFileDialog1.Multiselect = false;
              openFileDialog1.Title = "Open Settings File";
              if (openFileDialog1.ShowDialog() == DialogResult.OK)
              {
            CursorScopedWait waiter = new CursorScopedWait(ref mWaitCursorCounter);

            try
            {
              mCurrentFileName = openFileDialog1.FileName;
              string json = ReadSettingsFile(mCurrentFileName);
              SerializeSettings(json);
              textBoxOutput.Text = textBoxOutput.Text + "\r\n\r\n *** opened " + mCurrentFileName + "\r\n";
              ScrollOutputToBottom();
            }
            finally
            {
              waiter.Dispose();
            }
              }
        }
Beispiel #4
0
        private void newToolStripMenuItem_Click(object sender, EventArgs e)
        {
            CursorScopedWait waiter = new CursorScopedWait(ref mWaitCursorCounter);

              try
              {
            if (mUpdated)
            {
              DialogResult result = MessageBox.Show("Do you want to discard changes?", "Project Changed", MessageBoxButtons.YesNo);
              if (result == DialogResult.No)
              {
            return;
              }
            }

            // create a new project
            mCurrentFileName = "";
            mUpdated = false;
            textBoxProject.Text = "";
            textBoxVersion.Text = "";
            textBoxLocation.Text = "";
            textBoxOutput.Text = textBoxOutput.Text + "\r\n\r\n *** new project\r\n";
            ScrollOutputToBottom();
              }
              finally
              {
            waiter.Dispose();
              }
        }
Beispiel #5
0
        private void cleanToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (textBoxLocation.Text.Length == 0 ||
            textBoxVersion.Text.Length == 0 ||
            textBoxProject.Text.Length == 0)
              {
            return;
              }

              if (mCurrentFileName.Length == 0)
              {
            saveAsToolStripMenuItem_Click(sender, e);
            if (!mUpdated || mCurrentFileName.Length == 0)
            {
              return;
            }
              }

              CursorScopedWait waiter = new CursorScopedWait(ref mWaitCursorCounter);

              try
              {
            string json = DeserializeSettings();
            SaveFileAs(mCurrentFileName, json);

            string location = Path.GetDirectoryName(mCurrentFileName);
            string wixobj = location + @"\" + Path.GetFileNameWithoutExtension(mCurrentFileName) + ".wixobj";
            string wixpdb = location + @"\" + Path.GetFileNameWithoutExtension(mCurrentFileName) + ".wixpdb";
            string msi = location + @"\" + Path.GetFileNameWithoutExtension(mCurrentFileName) + ".msi";
            // clean the current project

            File.Delete(wixobj);
            File.Delete(wixpdb);
            File.Delete(msi);

            textBoxOutput.Text = textBoxOutput.Text + "\r\n\r\n *** cleaned \r\n" + wixobj +
              "\r\n" + wixpdb +
              "\r\n" + msi + "\r\n";
            ScrollOutputToBottom();
              }
              finally
              {
            waiter.Dispose();
              }
        }
Beispiel #6
0
        private void buildToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (textBoxLocation.Text.Length == 0 ||
            textBoxVersion.Text.Length == 0 ||
            textBoxProject.Text.Length == 0)
              {
            return;
              }

              // build the current project
              cleanToolStripMenuItem_Click(sender, e);
              if (mUpdated || mCurrentFileName.Length == 0)
              {
            return;
              }
              CursorScopedWait waiter = new CursorScopedWait(ref mWaitCursorCounter);

              try
              {
            CompileWiX();
              }
              finally
              {
            waiter.Dispose();
              }
        }