예제 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AddInSettings"/> class.
        /// </summary>
        public AddInSettingsForm()
        {
            InitializeComponent();

            Logger.WriteEvent += new EventHandler <Logger.WriteEventArgs>(Logger_WriteEvent);

            _iconListManager = new IconListManager(imageList, IconSize.Small);
            _globalSettings  = new GlobalIncrementSettings();

            // Added this to implement fix the sorting of "Versioning Style.
            propertyGrid.PropertySort = PropertySort.Categorized;
            propertyGridGlobalSettings.PropertySort = PropertySort.Categorized;

            try
            {
                string version = ReflectionHelper.GetAssemblyAttribute <AssemblyFileVersionAttribute>(Assembly.GetExecutingAssembly()).Version;
                string config  = ReflectionHelper.GetAssemblyAttribute <AssemblyConfigurationAttribute>(Assembly.GetExecutingAssembly()).Configuration;

                this.Text = string.Format("{0} v{1} [{2}]", this.Text, version, config);
            }
            catch
            {
                // swallow any exception
            }
        }
예제 #2
0
        /// <summary>
        /// Raises the <see cref="E:System.Windows.Forms.Form.Load"></see> event.
        /// </summary>
        /// <param name="e">An <see cref="T:System.EventArgs"></see> that contains the event data.</param>
        protected override void OnLoad(EventArgs e)
        {
            // Calculate the center of our parent IDE and position this window
            EnvDTE.Window parentIDE = Connect.ApplicationObject.MainWindow;
            Int32         newX      = parentIDE.Left + Convert.ToInt32(parentIDE.Width / 2) - Convert.ToInt32(this.Width / 2);
            Int32         newY      = parentIDE.Top + Convert.ToInt32(parentIDE.Height / 2) - Convert.ToInt32(this.Height / 2);

            this.Location = new Point(newX, newY);

            try
            {
                _globalSettings.Load();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error occured while loading the global settings:\n" + ex.ToString(),
                                "Global Settings Error", MessageBoxButtons.OK, MessageBoxIcon.Error);

                _globalSettings = new GlobalIncrementSettings(); // Discard
            }

            BuildTree();

            propertyGridGlobalSettings.SelectedObject = _globalSettings;

            textBoxLog.AppendText(Logger.Instance.Contents);

            base.OnLoad(e);
        }
예제 #3
0
        public void ApplyGlobalSettings()
        {
            GlobalIncrementSettings globalIncrementSettings = new GlobalIncrementSettings();

            try
            {
                globalIncrementSettings.Load();
            }
            catch (Exception innerException)
            {
                throw new ApplicationException("Exception occured while applying global settings to the solution item (" + this.UniqueName + ").", innerException);
            }
            this.IncrementSettings.CopyFrom(globalIncrementSettings);
        }
        /// <summary>
        /// Applies the global settings to this instance.
        /// </summary>
        public void ApplyGlobalSettings()
        {
            GlobalIncrementSettings globalSett = new GlobalIncrementSettings();

            try
            {
                globalSett.Load();
            }
            catch (Exception ex)
            {
                throw (new ApplicationException("Exception occured while applying global settings to the solution item (" + UniqueName + ").", ex));
            }

            IncrementSettings.CopyFrom(globalSett);
        }
예제 #5
0
 public AddInSettingsForm()
 {
     this.InitializeComponent();
     Logger.WriteEvent             += new EventHandler <Logger.WriteEventArgs>(this.Logger_WriteEvent);
     this._iconListManager          = new IconListManager(this.imageList, IconSize.Small);
     this._globalSettings           = new GlobalIncrementSettings();
     this.propertyGrid.PropertySort = PropertySort.Categorized;
     this.propertyGridGlobalSettings.PropertySort = PropertySort.Categorized;
     try
     {
         string version       = ReflectionHelper.GetAssemblyAttribute <AssemblyFileVersionAttribute>(Assembly.GetExecutingAssembly()).Version;
         string configuration = ReflectionHelper.GetAssemblyAttribute <AssemblyConfigurationAttribute>(Assembly.GetExecutingAssembly()).Configuration;
         this.Text = string.Format("{0} v{1} [{2}]", this.Text, version, configuration);
     }
     catch
     {
     }
 }
 public AddInSettingsForm()
 {
     this.InitializeComponent();
     Logger.WriteEvent += new EventHandler<Logger.WriteEventArgs>(this.Logger_WriteEvent);
     this._iconListManager = new IconListManager(this.imageList, IconSize.Small);
     this._globalSettings = new GlobalIncrementSettings();
     this.propertyGrid.PropertySort = PropertySort.Categorized;
     this.propertyGridGlobalSettings.PropertySort = PropertySort.Categorized;
     try
     {
         string version = ReflectionHelper.GetAssemblyAttribute<AssemblyFileVersionAttribute>(Assembly.GetExecutingAssembly()).Version;
         string configuration = ReflectionHelper.GetAssemblyAttribute<AssemblyConfigurationAttribute>(Assembly.GetExecutingAssembly()).Configuration;
         this.Text = string.Format("{0} v{1} [{2}]", this.Text, version, configuration);
     }
     catch
     {
     }
 }
예제 #7
0
        protected override void OnLoad(EventArgs e)
        {
            Window mainWindow = this.Connect.ApplicationObject.MainWindow;
            int    x          = mainWindow.Left + Convert.ToInt32(mainWindow.Width / 2) - Convert.ToInt32(base.Width / 2);
            int    y          = mainWindow.Top + Convert.ToInt32(mainWindow.Height / 2) - Convert.ToInt32(base.Height / 2);

            base.Location = new Point(x, y);
            try
            {
                this._globalSettings.Load();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error occured while loading the global settings:\n" + ex.ToString(), "Global Settings Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                this._globalSettings = new GlobalIncrementSettings();
            }
            this.BuildTree();
            this.propertyGridGlobalSettings.SelectedObject = this._globalSettings;
            this.textBoxLog.AppendText(Logger.Instance.Contents);
            base.OnLoad(e);
        }
 public void ApplyGlobalSettings()
 {
     GlobalIncrementSettings globalIncrementSettings = new GlobalIncrementSettings();
     try
     {
         globalIncrementSettings.Load();
     }
     catch (Exception innerException)
     {
         throw new ApplicationException("Exception occured while applying global settings to the solution item (" + this.UniqueName + ").", innerException);
     }
     this.IncrementSettings.CopyFrom(globalIncrementSettings);
 }
 protected override void OnLoad(EventArgs e)
 {
     Window mainWindow = this.Connect.ApplicationObject.MainWindow;
     int x = mainWindow.Left + Convert.ToInt32(mainWindow.Width / 2) - Convert.ToInt32(base.Width / 2);
     int y = mainWindow.Top + Convert.ToInt32(mainWindow.Height / 2) - Convert.ToInt32(base.Height / 2);
     base.Location = new Point(x, y);
     try
     {
         this._globalSettings.Load();
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error occured while loading the global settings:\n" + ex.ToString(), "Global Settings Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
         this._globalSettings = new GlobalIncrementSettings();
     }
     this.BuildTree();
     this.propertyGridGlobalSettings.SelectedObject = this._globalSettings;
     this.textBoxLog.AppendText(Logger.Instance.Contents);
     base.OnLoad(e);
 }