Beispiel #1
0
        private void contextMenu_Opening(object sender, CancelEventArgs e)
        {
            BaseIncrementSettings selectedIncrementSettings = this.SelectedIncrementSettings;

            if (selectedIncrementSettings == null)
            {
                e.Cancel = true;
            }
            this.copyToGlobalSettingsToolStripMenuItem.Enabled = (selectedIncrementSettings is SolutionItemIncrementSettings);
        }
 /// <summary>
 /// Copies settings from another instance.
 /// </summary>
 /// <param name="source">The source to copy the settings from.</param>
 public override void CopyFrom(BaseIncrementSettings source)
 {
     base.CopyFrom(source);
     if (source.GetType().IsAssignableFrom(typeof(SolutionItemIncrementSettings)))
     {
         SolutionItemIncrementSettings solutionItemSettings = (SolutionItemIncrementSettings)source;
         AssemblyInfoFilename = solutionItemSettings.AssemblyInfoFilename;
         ConfigurationName    = solutionItemSettings.ConfigurationName;
         UseGlobalSettings    = solutionItemSettings.UseGlobalSettings;
     }
 }
Beispiel #3
0
 private static void CopySettingsToAll(SolutionItem item, BaseIncrementSettings settings)
 {
     if (item.ItemType == SolutionItemType.Solution || item.ItemType == SolutionItemType.Project)
     {
         Logger.Write("Copying IncrementSettings to \"" + item.Name + "\"", LogLevel.Debug);
         item.IncrementSettings.CopyFrom(settings);
     }
     foreach (SolutionItem current in item.SubItems)
     {
         AddInSettingsForm.CopySettingsToAll(current, settings);
     }
 }
Beispiel #4
0
        private void contextMenu_Opening(object sender, CancelEventArgs e)
        {
            BaseIncrementSettings settings = SelectedIncrementSettings;

            if (settings == null)
            {
                e.Cancel = true;
            }

            // Only allow the copy to global settings if the current node isn't the global settings self

            copyToGlobalSettingsToolStripMenuItem.Enabled = settings is SolutionItemIncrementSettings;
        }
Beispiel #5
0
        private void undoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            BaseIncrementSettings selectedIncrementSettings = this.SelectedIncrementSettings;

            if (selectedIncrementSettings != null)
            {
                DialogResult dialogResult = MessageBox.Show(this, "Discard changes to \"" + this.solutionTreeView.SelectedNode.Text + "\"?", "Undo changes", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (dialogResult == DialogResult.Yes)
                {
                    Logger.Write("Discard changes to \"" + this.solutionTreeView.SelectedNode.Text + "\"", LogLevel.Debug);
                    selectedIncrementSettings.Load();
                    this.propertyGrid.Refresh();
                }
            }
        }
Beispiel #6
0
        private void clearToolStripMenuItem_Click(object sender, EventArgs e)
        {
            BaseIncrementSettings selectedIncrementSettings = this.SelectedIncrementSettings;

            if (selectedIncrementSettings != null)
            {
                DialogResult dialogResult = MessageBox.Show(this, "Reset the increment settings of \"" + this.solutionTreeView.SelectedNode.Text + "\" to the defaults?", "Reset settings", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (dialogResult == DialogResult.Yes)
                {
                    Logger.Write("Resetting increment settings  of \"" + this.solutionTreeView.SelectedNode.Text + "\"", LogLevel.Debug);
                    selectedIncrementSettings.Reset();
                    this.propertyGrid.Refresh();
                }
            }
        }
Beispiel #7
0
        private void undoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            BaseIncrementSettings toReload = SelectedIncrementSettings;

            if (toReload != null)
            {
                DialogResult r = MessageBox.Show(this, "Discard changes to \"" + solutionTreeView.SelectedNode.Text + "\"?", "Undo changes", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                if (r == System.Windows.Forms.DialogResult.Yes)
                {
                    Logger.Write("Discard changes to \"" + solutionTreeView.SelectedNode.Text + "\"", LogLevel.Debug);

                    toReload.Load();
                    propertyGrid.Refresh();
                }
            }
        }
Beispiel #8
0
        private void clearToolStripMenuItem_Click(object sender, EventArgs e)
        {
            BaseIncrementSettings toReset = SelectedIncrementSettings;

            if (toReset != null)
            {
                DialogResult r = MessageBox.Show(this, "Reset the increment settings of \"" + solutionTreeView.SelectedNode.Text + "\" to the defaults?", "Reset settings", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                if (r == System.Windows.Forms.DialogResult.Yes)
                {
                    Logger.Write("Resetting increment settings  of \"" + solutionTreeView.SelectedNode.Text + "\"", LogLevel.Debug);

                    toReset.Reset();
                    propertyGrid.Refresh();
                }
            }
        }
Beispiel #9
0
        private void copyToAllProjectsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            BaseIncrementSettings selectedIncrementSettings = this.SelectedIncrementSettings;

            if (selectedIncrementSettings != null)
            {
                string str = "Global Settings";
                if (selectedIncrementSettings is SolutionItemIncrementSettings)
                {
                    str = ((SolutionItemIncrementSettings)selectedIncrementSettings).Name;
                }
                DialogResult dialogResult = MessageBox.Show(this, "Copy the increment settings of \"" + str + "\" to all other items?", "Copy to all", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (dialogResult == DialogResult.Yes)
                {
                    AddInSettingsForm.CopySettingsToAll(this._solution, selectedIncrementSettings);
                }
            }
        }
 public virtual void CopyFrom(BaseIncrementSettings source)
 {
     try
     {
         this.VersioningStyle           = new VersioningStyle(source.VersioningStyle);
         this.AutoUpdateAssemblyVersion = source.AutoUpdateAssemblyVersion;
         this.AutoUpdateFileVersion     = source.AutoUpdateFileVersion;
         this.BuildAction          = source.BuildAction;
         this.StartDate            = source.StartDate;
         this.IsUniversalTime      = source.IsUniversalTime;
         this.ReplaceNonNumerics   = source.ReplaceNonNumerics;
         this.IncrementBeforeBuild = source.IncrementBeforeBuild;
         this.DetectChanges        = source.DetectChanges;
     }
     catch (Exception ex)
     {
         Logger.Write("Exception occured while copying settings: " + ex.ToString(), LogLevel.Error);
     }
 }
Beispiel #11
0
        private void copyToAllProjectsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            BaseIncrementSettings settings = SelectedIncrementSettings;

            if (settings != null)
            {
                string name = "Global Settings";

                if (settings is SolutionItemIncrementSettings)
                {
                    name = ((SolutionItemIncrementSettings)settings).Name;
                }

                DialogResult r = MessageBox.Show(this, "Copy the increment settings of \"" + name + "\" to all other items?", "Copy to all", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                if (r == System.Windows.Forms.DialogResult.Yes)
                {
                    CopySettingsToAll(_solution, settings);
                }
            }
        }
 public virtual void CopyFrom(BaseIncrementSettings source)
 {
     try
     {
         this.VersioningStyle = new VersioningStyle(source.VersioningStyle);
         this.AutoUpdateAssemblyVersion = source.AutoUpdateAssemblyVersion;
         this.AutoUpdateFileVersion = source.AutoUpdateFileVersion;
         this.BuildAction = source.BuildAction;
         this.StartDate = source.StartDate;
         this.IsUniversalTime = source.IsUniversalTime;
         this.ReplaceNonNumerics = source.ReplaceNonNumerics;
         this.IncrementBeforeBuild = source.IncrementBeforeBuild;
         this.DetectChanges = source.DetectChanges;
     }
     catch (Exception ex)
     {
         Logger.Write("Exception occured while copying settings: " + ex.ToString(), LogLevel.Error);
     }
 }
 private static void CopySettingsToAll(SolutionItem item, BaseIncrementSettings settings)
 {
     if (item.ItemType == SolutionItemType.Solution || item.ItemType == SolutionItemType.Project)
     {
         Logger.Write("Copying IncrementSettings to \"" + item.Name + "\"", LogLevel.Debug);
         item.IncrementSettings.CopyFrom(settings);
     }
     foreach (SolutionItem current in item.SubItems)
     {
         AddInSettingsForm.CopySettingsToAll(current, settings);
     }
 }
 public override void CopyFrom(BaseIncrementSettings source)
 {
     base.CopyFrom(source);
     if (source.GetType().IsAssignableFrom(typeof(SolutionItemIncrementSettings)))
     {
         SolutionItemIncrementSettings solutionItemIncrementSettings = (SolutionItemIncrementSettings)source;
         this.AssemblyInfoFilename = solutionItemIncrementSettings.AssemblyInfoFilename;
         this.ConfigurationName = solutionItemIncrementSettings.ConfigurationName;
         this.UseGlobalSettings = solutionItemIncrementSettings.UseGlobalSettings;
     }
 }