Changeset 2703
- Timestamp:
- 5/25/2012 4:35:53 AM (12 months ago)
- File:
-
- 1 edited
-
trunk/eraser/Eraser.BlackBox/BlackBoxReport.cs (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/eraser/Eraser.BlackBox/BlackBoxReport.cs
r2697 r2703 184 184 185 185 /// <summary> 186 /// Gets or setswhether the given report has been uploaded to the server.186 /// Gets whether the given report has been uploaded to the server. 187 187 /// </summary> 188 188 public bool Submitted … … 190 190 get 191 191 { 192 return Status == 1; 193 } 194 set 195 { 196 Status = Convert.ToByte(value); 192 return Status[0] == 1; 193 } 194 internal set 195 { 196 byte[] status = Status; 197 status[0] = Convert.ToByte(value); 198 Status = status; 199 } 200 } 201 202 /// <summary> 203 /// Gets the ID of the current report returned by the server during upload. 204 /// This will be 0 if <see cref="Submitted"/> is false. 205 /// </summary> 206 public int ID 207 { 208 get 209 { 210 return BitConverter.ToInt32(Status, 1); 211 } 212 213 internal set 214 { 215 byte[] bytes = BitConverter.GetBytes(value); 216 byte[] status = Status; 217 Buffer.BlockCopy(bytes, 0, status, 1, bytes.Length); 218 Status = status; 197 219 } 198 220 } … … 201 223 /// Gets or sets the status of the report. 202 224 /// </summary> 203 private byte Status204 { 205 get 206 { 207 byte[] buffer = new byte[ 1];225 private byte[] Status 226 { 227 get 228 { 229 byte[] buffer = new byte[5]; 208 230 using (FileStream stream = new FileStream(System.IO.Path.Combine(Path, StatusFileName), 209 231 FileMode.OpenOrCreate, FileAccess.Read, FileShare.Read)) … … 212 234 } 213 235 214 return buffer [0];236 return buffer; 215 237 } 216 238 217 239 set 218 240 { 219 byte[] buffer = { value };220 241 using (FileStream stream = new FileStream(System.IO.Path.Combine(Path, StatusFileName), 221 242 FileMode.OpenOrCreate, FileAccess.Write, FileShare.Read)) 222 243 { 223 stream.Write( buffer, 0, buffer.Length);244 stream.Write(value, 0, Math.Min(value.Length, 5)); 224 245 } 225 246 }
Note: See TracChangeset
for help on using the changeset viewer.
