Changeset 904


Ignore:
Timestamp:
4/28/2009 10:38:12 AM (5 years ago)
Author:
lowjoel
Message:

Ran Static code analysis on the Eraser project and implemented a few recommendations.

-Variable references should not use abbreviations of things: lbl should be expanded to Label
-Fixed "minimise" to "minimised"
-Enumeration constants should be in CamelCase

Location:
branches/eraser6/Eraser
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/eraser6/Eraser/BasePanel.Designer.cs

    r388 r904  
    5151        { 
    5252            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(BasePanel)); 
    53             this.titleLbl = new System.Windows.Forms.Label(); 
     53            this.titleLabel = new System.Windows.Forms.Label(); 
    5454            this.content = new System.Windows.Forms.Panel(); 
    5555            this.titleIcon = new System.Windows.Forms.PictureBox(); 
     
    5757            this.SuspendLayout(); 
    5858            //  
    59             // titleLbl 
     59            // titleLabel 
    6060            //  
    61             resources.ApplyResources(this.titleLbl, "titleLbl"); 
    62             this.titleLbl.Name = "titleLbl"; 
     61            resources.ApplyResources(this.titleLabel, "titleLabel"); 
     62            this.titleLabel.Name = "titleLabel"; 
    6363            //  
    6464            // content 
     
    7878            this.Controls.Add(this.content); 
    7979            this.Controls.Add(this.titleIcon); 
    80             this.Controls.Add(this.titleLbl); 
     80            this.Controls.Add(this.titleLabel); 
    8181            this.Name = "BasePanel"; 
    8282            resources.ApplyResources(this, "$this"); 
     
    8989        #endregion 
    9090 
    91         protected System.Windows.Forms.Label titleLbl; 
     91        protected System.Windows.Forms.Label titleLabel; 
    9292        protected System.Windows.Forms.PictureBox titleIcon; 
    9393        protected System.Windows.Forms.Panel content; 
  • branches/eraser6/Eraser/BasePanel.resx

    r467 r904  
    118118    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 
    119119  </resheader> 
     120  <assembly alias="mscorlib" name="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> 
     121  <data name="titleLabel.AutoSize" type="System.Boolean, mscorlib"> 
     122    <value>True</value> 
     123  </data> 
    120124  <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> 
    121   <data name="titleIcon.Location" type="System.Drawing.Point, System.Drawing"> 
    122     <value>20, 21</value> 
    123   </data> 
    124   <assembly alias="mscorlib" name="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> 
    125   <data name="content.TabIndex" type="System.Int32, mscorlib"> 
    126     <value>3</value> 
    127   </data> 
    128   <data name="titleLbl.TabIndex" type="System.Int32, mscorlib"> 
     125  <data name="titleLabel.Font" type="System.Drawing.Font, System.Drawing"> 
     126    <value>Segoe UI, 18pt</value> 
     127  </data> 
     128  <data name="titleLabel.Location" type="System.Drawing.Point, System.Drawing"> 
     129    <value>50, 17</value> 
     130  </data> 
     131  <data name="titleLabel.Size" type="System.Drawing.Size, System.Drawing"> 
     132    <value>119, 32</value> 
     133  </data> 
     134  <data name="titleLabel.TabIndex" type="System.Int32, mscorlib"> 
    129135    <value>0</value> 
    130136  </data> 
    131   <data name="&gt;&gt;titleLbl.ZOrder" xml:space="preserve"> 
     137  <data name="titleLabel.Text" xml:space="preserve"> 
     138    <value>PanelTitle</value> 
     139  </data> 
     140  <data name="&gt;&gt;titleLabel.Name" xml:space="preserve"> 
     141    <value>titleLabel</value> 
     142  </data> 
     143  <data name="&gt;&gt;titleLabel.Type" xml:space="preserve"> 
     144    <value>System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 
     145  </data> 
     146  <data name="&gt;&gt;titleLabel.Parent" xml:space="preserve"> 
     147    <value>$this</value> 
     148  </data> 
     149  <data name="&gt;&gt;titleLabel.ZOrder" xml:space="preserve"> 
    132150    <value>2</value> 
    133   </data> 
    134   <data name="titleLbl.AutoSize" type="System.Boolean, mscorlib"> 
    135     <value>True</value> 
    136   </data> 
    137   <data name="&gt;&gt;content.ZOrder" xml:space="preserve"> 
    138     <value>0</value> 
    139   </data> 
    140   <data name="&gt;&gt;titleLbl.Type" xml:space="preserve"> 
    141     <value>System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 
    142   </data> 
    143   <data name="titleLbl.Location" type="System.Drawing.Point, System.Drawing"> 
    144     <value>50, 17</value> 
    145   </data> 
    146   <data name="$this.Size" type="System.Drawing.Size, System.Drawing"> 
    147     <value>752, 449</value> 
    148   </data> 
    149   <data name="titleLbl.Text" xml:space="preserve"> 
    150     <value>PanelTitle</value> 
    151   </data> 
    152   <data name="&gt;&gt;content.Type" xml:space="preserve"> 
    153     <value>System.Windows.Forms.Panel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 
    154   </data> 
    155   <data name="titleIcon.TabIndex" type="System.Int32, mscorlib"> 
    156     <value>1</value> 
    157   </data> 
    158   <data name="&gt;&gt;titleIcon.ZOrder" xml:space="preserve"> 
    159     <value>1</value> 
    160   </data> 
    161   <data name="&gt;&gt;$this.Type" xml:space="preserve"> 
    162     <value>System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 
    163   </data> 
    164   <data name="&gt;&gt;$this.Name" xml:space="preserve"> 
    165     <value>BasePanel</value> 
    166   </data> 
    167   <data name="&gt;&gt;titleLbl.Name" xml:space="preserve"> 
    168     <value>titleLbl</value> 
    169151  </data> 
    170152  <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> 
     
    172154    <value>Top, Bottom, Left, Right</value> 
    173155  </data> 
    174   <data name="titleLbl.Size" type="System.Drawing.Size, System.Drawing"> 
    175     <value>119, 32</value> 
     156  <data name="content.Location" type="System.Drawing.Point, System.Drawing"> 
     157    <value>20, 52</value> 
     158  </data> 
     159  <data name="content.Size" type="System.Drawing.Size, System.Drawing"> 
     160    <value>712, 377</value> 
     161  </data> 
     162  <data name="content.TabIndex" type="System.Int32, mscorlib"> 
     163    <value>3</value> 
     164  </data> 
     165  <data name="&gt;&gt;content.Name" xml:space="preserve"> 
     166    <value>content</value> 
     167  </data> 
     168  <data name="&gt;&gt;content.Type" xml:space="preserve"> 
     169    <value>System.Windows.Forms.Panel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 
     170  </data> 
     171  <data name="&gt;&gt;content.Parent" xml:space="preserve"> 
     172    <value>$this</value> 
     173  </data> 
     174  <data name="&gt;&gt;content.ZOrder" xml:space="preserve"> 
     175    <value>0</value> 
     176  </data> 
     177  <data name="titleIcon.Location" type="System.Drawing.Point, System.Drawing"> 
     178    <value>20, 21</value> 
    176179  </data> 
    177180  <data name="titleIcon.Size" type="System.Drawing.Size, System.Drawing"> 
    178181    <value>24, 24</value> 
    179182  </data> 
     183  <data name="titleIcon.TabIndex" type="System.Int32, mscorlib"> 
     184    <value>1</value> 
     185  </data> 
     186  <data name="&gt;&gt;titleIcon.Name" xml:space="preserve"> 
     187    <value>titleIcon</value> 
     188  </data> 
    180189  <data name="&gt;&gt;titleIcon.Type" xml:space="preserve"> 
    181190    <value>System.Windows.Forms.PictureBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 
    182191  </data> 
    183   <data name="&gt;&gt;content.Parent" xml:space="preserve"> 
    184     <value>$this</value> 
    185   </data> 
    186192  <data name="&gt;&gt;titleIcon.Parent" xml:space="preserve"> 
    187193    <value>$this</value> 
    188194  </data> 
    189   <data name="$this.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms"> 
    190     <value>17, 17, 17, 17</value> 
    191   </data> 
    192   <data name="content.Location" type="System.Drawing.Point, System.Drawing"> 
    193     <value>20, 52</value> 
    194   </data> 
    195   <data name="content.Size" type="System.Drawing.Size, System.Drawing"> 
    196     <value>712, 377</value> 
    197   </data> 
    198   <data name="&gt;&gt;titleLbl.Parent" xml:space="preserve"> 
    199     <value>$this</value> 
    200   </data> 
    201   <data name="titleLbl.Font" type="System.Drawing.Font, System.Drawing"> 
    202     <value>Segoe UI, 18pt</value> 
    203   </data> 
    204   <data name="&gt;&gt;titleIcon.Name" xml:space="preserve"> 
    205     <value>titleIcon</value> 
    206   </data> 
    207   <data name="&gt;&gt;content.Name" xml:space="preserve"> 
    208     <value>content</value> 
     195  <data name="&gt;&gt;titleIcon.ZOrder" xml:space="preserve"> 
     196    <value>1</value> 
    209197  </data> 
    210198  <metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> 
    211199    <value>True</value> 
    212200  </metadata> 
     201  <data name="$this.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms"> 
     202    <value>17, 17, 17, 17</value> 
     203  </data> 
     204  <data name="$this.Size" type="System.Drawing.Size, System.Drawing"> 
     205    <value>752, 449</value> 
     206  </data> 
     207  <data name="&gt;&gt;$this.Name" xml:space="preserve"> 
     208    <value>BasePanel</value> 
     209  </data> 
     210  <data name="&gt;&gt;$this.Type" xml:space="preserve"> 
     211    <value>System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 
     212  </data> 
    213213</root> 
  • branches/eraser6/Eraser/MainForm.Designer.cs

    r854 r904  
    6262            this.openEraserToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 
    6363            this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator(); 
    64             this.hideWhenMinimiseToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 
     64            this.hideWhenMinimisedToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 
    6565            this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 
    6666            this.notificationIconTimer = new System.Windows.Forms.Timer(this.components); 
     
    120120            this.openEraserToolStripMenuItem, 
    121121            this.toolStripMenuItem1, 
    122             this.hideWhenMinimiseToolStripMenuItem, 
     122            this.hideWhenMinimisedToolStripMenuItem, 
    123123            this.exitToolStripMenuItem}); 
    124124            this.notificationMenu.Name = "notificationMenu"; 
     
    136136            resources.ApplyResources(this.toolStripMenuItem1, "toolStripMenuItem1"); 
    137137            //  
    138             // hideWhenMinimiseToolStripMenuItem 
     138            // hideWhenMinimisedToolStripMenuItem 
    139139            //  
    140             this.hideWhenMinimiseToolStripMenuItem.CheckOnClick = true; 
    141             this.hideWhenMinimiseToolStripMenuItem.Name = "hideWhenMinimiseToolStripMenuItem"; 
    142             resources.ApplyResources(this.hideWhenMinimiseToolStripMenuItem, "hideWhenMinimiseToolStripMenuItem"); 
    143             this.hideWhenMinimiseToolStripMenuItem.Click += new System.EventHandler(this.hideWhenMinimiseToolStripMenuItem_Click); 
     140            this.hideWhenMinimisedToolStripMenuItem.CheckOnClick = true; 
     141            this.hideWhenMinimisedToolStripMenuItem.Name = "hideWhenMinimisedToolStripMenuItem"; 
     142            resources.ApplyResources(this.hideWhenMinimisedToolStripMenuItem, "hideWhenMinimisedToolStripMenuItem"); 
     143            this.hideWhenMinimisedToolStripMenuItem.Click += new System.EventHandler(this.hideWhenMinimiseToolStripMenuItem_Click); 
    144144            //  
    145145            // exitToolStripMenuItem 
     
    186186        private System.Windows.Forms.ToolStripSeparator toolStripMenuItem1; 
    187187        private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem; 
    188         private System.Windows.Forms.ToolStripMenuItem hideWhenMinimiseToolStripMenuItem; 
     188        private System.Windows.Forms.ToolStripMenuItem hideWhenMinimisedToolStripMenuItem; 
    189189 
    190190    } 
  • branches/eraser6/Eraser/MainForm.cs

    r854 r904  
    3636    public partial class MainForm : Form 
    3737    { 
    38         public enum Pages 
    39         { 
    40             SCHEDULER = 0, 
    41             SETTINGS 
    42         } 
    43  
    4438        private ToolBar ToolBar = new ToolBar(); 
    45         private BasePanel CurrPage = null; 
     39        private BasePanel CurrPage; 
    4640        private SchedulerPanel SchedulerPage = new SchedulerPanel(); 
    4741        private SettingsPanel SettingsPage = new SettingsPanel(); 
     
    6054 
    6155            //Check the notification area context menu's minimise to tray item. 
    62             hideWhenMinimiseToolStripMenuItem.Checked = EraserSettings.Get().HideWhenMinimised; 
     56            hideWhenMinimisedToolStripMenuItem.Checked = EraserSettings.Get().HideWhenMinimised; 
    6357 
    6458            //Create the toolbar control 
     
    7569            tbSchedule.ToolbarItemClicked += delegate(object sender, EventArgs args) 
    7670            { 
    77                 ChangePage(Pages.SCHEDULER); 
     71                ChangePage(MainFormPage.Scheduler); 
    7872            }; 
    7973            ToolBar.Items.Add(tbSchedule); 
     
    8478            tbSettings.ToolbarItemClicked += delegate(object sender, EventArgs args) 
    8579            { 
    86                 ChangePage(Pages.SETTINGS); 
     80                ChangePage(MainFormPage.Settings); 
    8781            }; 
    8882            ToolBar.Items.Add(tbSettings); 
     
    9892 
    9993            //Show the default page. 
    100             ChangePage(Pages.SCHEDULER); 
     94            ChangePage(MainFormPage.Scheduler); 
    10195        } 
    10296 
     
    120114        /// <param name="page">The new page to change to. No action is done when the 
    121115        /// current page is the same as the new page requested</param> 
    122         public void ChangePage(Pages page) 
     116        public void ChangePage(MainFormPage page) 
    123117        { 
    124118            BasePanel oldPage = CurrPage; 
    125119            switch (page) 
    126120            { 
    127                 case Pages.SCHEDULER: 
     121                case MainFormPage.Scheduler: 
    128122                    CurrPage = SchedulerPage; 
    129123                    break; 
    130                 case Pages.SETTINGS: 
     124                case MainFormPage.Settings: 
    131125                    CurrPage = SettingsPage; 
    132126                    break; 
     
    304298        } 
    305299 
    306         private int ProcessingAnimationFrame = 0; 
     300        private int ProcessingAnimationFrame; 
    307301        private Icon[] ProcessingAnimationFrames = new Icon[] { 
    308302            Resources.NotifyBusy1, 
     
    350344        { 
    351345            EraserSettings.Get().HideWhenMinimised = 
    352                 hideWhenMinimiseToolStripMenuItem.Checked; 
     346                hideWhenMinimisedToolStripMenuItem.Checked; 
    353347        } 
    354348        #endregion 
    355349    } 
     350 
     351    public enum MainFormPage 
     352    { 
     353        Scheduler = 0, 
     354        Settings 
     355    } 
    356356} 
  • branches/eraser6/Eraser/MainForm.resx

    r854 r904  
    152152  </metadata> 
    153153  <data name="newTaskToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing"> 
    154     <value>152, 22</value> 
     154    <value>125, 22</value> 
    155155  </data> 
    156156  <data name="newTaskToolStripMenuItem.Text" xml:space="preserve"> 
     
    158158  </data> 
    159159  <data name="toolbarScheduleMenu.Size" type="System.Drawing.Size, System.Drawing"> 
    160     <value>153, 48</value> 
     160    <value>126, 26</value> 
    161161  </data> 
    162162  <data name="&gt;&gt;toolbarScheduleMenu.Name" xml:space="preserve"> 
     
    205205    <value>189, 6</value> 
    206206  </data> 
    207   <data name="hideWhenMinimiseToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing"> 
     207  <data name="hideWhenMinimisedToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing"> 
    208208    <value>192, 22</value> 
    209209  </data> 
    210   <data name="hideWhenMinimiseToolStripMenuItem.Text" xml:space="preserve"> 
     210  <data name="hideWhenMinimisedToolStripMenuItem.Text" xml:space="preserve"> 
    211211    <value>Hide When Minimised</value> 
    212212  </data> 
     
    218218  </data> 
    219219  <data name="notificationMenu.Size" type="System.Drawing.Size, System.Drawing"> 
    220     <value>193, 76</value> 
     220    <value>193, 98</value> 
    221221  </data> 
    222222  <data name="&gt;&gt;notificationMenu.Name" xml:space="preserve"> 
     
    34093409    <value>System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 
    34103410  </data> 
    3411   <data name="&gt;&gt;hideWhenMinimiseToolStripMenuItem.Name" xml:space="preserve"> 
    3412     <value>hideWhenMinimiseToolStripMenuItem</value> 
    3413   </data> 
    3414   <data name="&gt;&gt;hideWhenMinimiseToolStripMenuItem.Type" xml:space="preserve"> 
     3411  <data name="&gt;&gt;hideWhenMinimisedToolStripMenuItem.Name" xml:space="preserve"> 
     3412    <value>hideWhenMinimisedToolStripMenuItem</value> 
     3413  </data> 
     3414  <data name="&gt;&gt;hideWhenMinimisedToolStripMenuItem.Type" xml:space="preserve"> 
    34153415    <value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 
    34163416  </data> 
  • branches/eraser6/Eraser/SchedulerPanel.Designer.cs

    r854 r904  
    7575            // titleLbl 
    7676            //  
    77             resources.ApplyResources(this.titleLbl, "titleLbl"); 
     77            resources.ApplyResources(this.titleLabel, "titleLbl"); 
    7878            //  
    7979            // titleIcon 
     
    197197            this.DoubleBuffered = true; 
    198198            this.Name = "SchedulerPanel"; 
    199             this.Controls.SetChildIndex(this.titleLbl, 0); 
     199            this.Controls.SetChildIndex(this.titleLabel, 0); 
    200200            this.Controls.SetChildIndex(this.titleIcon, 0); 
    201201            this.Controls.SetChildIndex(this.content, 0); 
  • branches/eraser6/Eraser/SettingsPanel.Designer.cs

    r858 r904  
    9797            // titleLbl 
    9898            //  
    99             this.errorProvider.SetIconAlignment(this.titleLbl, ((System.Windows.Forms.ErrorIconAlignment)(resources.GetObject("titleLbl.IconAlignment")))); 
    100             resources.ApplyResources(this.titleLbl, "titleLbl"); 
     99            this.errorProvider.SetIconAlignment(this.titleLabel, ((System.Windows.Forms.ErrorIconAlignment)(resources.GetObject("titleLbl.IconAlignment")))); 
     100            resources.ApplyResources(this.titleLabel, "titleLbl"); 
    101101            //  
    102102            // titleIcon 
     
    391391            resources.ApplyResources(this, "$this"); 
    392392            this.Controls.SetChildIndex(this.saveSettings, 0); 
    393             this.Controls.SetChildIndex(this.titleLbl, 0); 
     393            this.Controls.SetChildIndex(this.titleLabel, 0); 
    394394            this.Controls.SetChildIndex(this.titleIcon, 0); 
    395395            this.Controls.SetChildIndex(this.content, 0); 
Note: See TracChangeset for help on using the changeset viewer.