Changeset 1772
- Timestamp:
- 2/8/2010 8:25:51 AM (2 years ago)
- Location:
- branches/eraser6/CodeReview
- Files:
-
- 9 edited
-
Eraser.Manager/DirectExecutor.cs (modified) (2 diffs)
-
Eraser.Manager/ManagerLibrary.cs (modified) (1 diff)
-
Eraser.Manager/Plugins.cs (modified) (2 diffs)
-
Eraser.Manager/RemoteExecutor.cs (modified) (4 diffs)
-
Eraser.Util/Security.cs (modified) (1 diff)
-
Eraser.Util/VolumeInfo.cs (modified) (2 diffs)
-
Eraser/Program.ConsoleProgram.cs (modified) (2 diffs)
-
Eraser/Program.GuiProgram.cs (modified) (1 diff)
-
Eraser/Settings.cs (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eraser6/CodeReview/Eraser.Manager/DirectExecutor.cs
r1771 r1772 51 51 protected override void Dispose(bool disposing) 52 52 { 53 if (thread == null || schedulerInterrupt == null) 54 return; 55 53 56 if (disposing) 54 57 { … … 73 76 } 74 77 78 thread = null; 79 schedulerInterrupt = null; 75 80 base.Dispose(disposing); 76 81 } -
branches/eraser6/CodeReview/Eraser.Manager/ManagerLibrary.cs
r1681 r1772 57 57 protected virtual void Dispose(bool disposing) 58 58 { 59 if (SettingsManager == null) 60 return; 61 59 62 if (disposing) 60 63 { -
branches/eraser6/CodeReview/Eraser.Manager/Plugins.cs
r1681 r1772 160 160 protected override void Dispose(bool disposing) 161 161 { 162 if (plugins == null) 163 return; 164 162 165 if (disposing) 163 166 { … … 168 171 plugin.Plugin.Dispose(); 169 172 } 173 174 plugins = null; 170 175 } 171 176 -
branches/eraser6/CodeReview/Eraser.Manager/RemoteExecutor.cs
r1745 r1772 104 104 protected override void Dispose(bool disposing) 105 105 { 106 if (thread == null || serverLock == null) 107 return; 108 106 109 if (disposing) 107 110 { 108 111 //Close the polling thread that creates new server instances 109 112 thread.Abort(); 113 thread.Join(); 110 114 111 115 //Close all waiting streams … … 121 125 } 122 126 127 thread = null; 128 serverLock = null; 123 129 base.Dispose(disposing); 124 130 } … … 315 321 protected override void Dispose(bool disposing) 316 322 { 323 if (client == null) 324 return; 325 317 326 if (disposing) 318 327 { … … 320 329 } 321 330 331 client = null; 322 332 base.Dispose(disposing); 323 333 } -
branches/eraser6/CodeReview/Eraser.Util/Security.cs
r1770 r1772 148 148 private void Dispose(bool disposing) 149 149 { 150 //If we already have run Dispose, then handle will be null. 151 if (handle == null) 152 return; 153 150 154 if (disposing) 151 155 handle.Close(); 156 157 //Don't run Dispose again. 158 handle = null; 152 159 } 153 160 -
branches/eraser6/CodeReview/Eraser.Util/VolumeInfo.cs
r1770 r1772 747 747 private void Dispose(bool disposing) 748 748 { 749 if (Stream == null) 750 return; 751 749 752 //Flush the contents of the buffer to disk since after we unlock the volume 750 753 //we can no longer write to the volume. … … 758 761 throw new IOException("Could not unlock volume."); 759 762 } 763 764 //Set the stream to null so that we won't run this function again. 765 Stream = null; 760 766 } 761 767 -
branches/eraser6/CodeReview/Eraser/Program.ConsoleProgram.cs
r1770 r1772 74 74 protected virtual void Dispose(bool disposing) 75 75 { 76 if (ConsoleWindow == null) 77 return; 78 76 79 //Flush the buffered output to the console 77 80 Console.Out.Flush(); … … 87 90 ConsoleWindow.Dispose(); 88 91 } 92 93 ConsoleWindow = null; 89 94 } 90 95 #endregion -
branches/eraser6/CodeReview/Eraser/Program.GuiProgram.cs
r1769 r1772 72 72 protected virtual void Dispose(bool disposing) 73 73 { 74 if (GlobalMutex == null) 75 return; 76 74 77 if (disposing) 75 78 GlobalMutex.Close(); 79 GlobalMutex = null; 76 80 } 77 81 -
branches/eraser6/CodeReview/Eraser/Settings.cs
r1770 r1772 49 49 public RegistrySettings(Guid pluginId, RegistryKey key) 50 50 { 51 this. pluginID = pluginId;52 this. key = key;51 this.PluginID = pluginId; 52 this.Key = key; 53 53 } 54 54 … … 68 68 private void Dispose(bool disposing) 69 69 { 70 if (Key == null) 71 return; 72 70 73 if (disposing) 71 key.Close(); 74 Key.Close(); 75 Key = null; 72 76 } 73 77 … … 79 83 { 80 84 //Get the raw registry value 81 object rawResult = key.GetValue(setting, null);85 object rawResult = Key.GetValue(setting, null); 82 86 83 87 //Check if it is a serialised object … … 92 96 catch (SerializationException) 93 97 { 94 key.DeleteValue(setting);98 Key.DeleteValue(setting); 95 99 MessageBox.Show(S._("Could not load the setting {0}\\{1} for " + 96 "plugin {2}. The setting has been lost.", key, setting,97 pluginID.ToString()),100 "plugin {2}. The setting has been lost.", Key, setting, 101 PluginID.ToString()), 98 102 S._("Eraser"), MessageBoxButtons.OK, MessageBoxIcon.Error, 99 103 MessageBoxDefaultButton.Button1, … … 113 117 if (value == null) 114 118 { 115 key.DeleteValue(setting);119 Key.DeleteValue(setting); 116 120 } 117 121 else 118 122 { 119 123 if (value is bool) 120 key.SetValue(setting, value, RegistryValueKind.DWord);124 Key.SetValue(setting, value, RegistryValueKind.DWord); 121 125 else if ((value is int) || (value is uint)) 122 key.SetValue(setting, value, RegistryValueKind.DWord);126 Key.SetValue(setting, value, RegistryValueKind.DWord); 123 127 else if ((value is long) || (value is ulong)) 124 key.SetValue(setting, value, RegistryValueKind.QWord);128 Key.SetValue(setting, value, RegistryValueKind.QWord); 125 129 else if (value is string) 126 key.SetValue(setting, value, RegistryValueKind.String);130 Key.SetValue(setting, value, RegistryValueKind.String); 127 131 else 128 132 using (MemoryStream stream = new MemoryStream()) 129 133 { 130 134 new BinaryFormatter().Serialize(stream, value); 131 key.SetValue(setting, stream.ToArray(), RegistryValueKind.Binary);135 Key.SetValue(setting, stream.ToArray(), RegistryValueKind.Binary); 132 136 } 133 137 } … … 138 142 /// The GUID of the plugin whose settings this object is storing. 139 143 /// </summary> 140 private Guid pluginID;144 private Guid PluginID; 141 145 142 146 /// <summary> 143 147 /// The registry key where the data is stored. 144 148 /// </summary> 145 private RegistryKey key;149 private RegistryKey Key; 146 150 } 147 151
Note: See TracChangeset
for help on using the changeset viewer.
