Changeset 391 for trunk/Include/Classes/System/Exception.ab
- Timestamp:
- Dec 7, 2007, 12:21:58 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Include/Classes/System/Exception.ab
r385 r391 3 3 #require <Classes/ActiveBasic/misc.ab> 4 4 5 Namespace ActiveBasic 5 6 '右のコメントは対応するCOR_E_ナントカのコード 6 7 Const AB_E_EXCEPTION = &h80041500 '80131500 … … 12 13 Const AB_E_NOTSUPPORTED = &h80041515 '80131515 13 14 Const AB_E_PLATFORMNOTSUPPORTED = &h80041539 '80131539 15 16 End Namespace 14 17 15 18 /* … … 57 60 Sub Exception() 58 61 init(GetType().FullName, Nothing) 59 hr = A B_E_EXCEPTION62 hr = ActiveBasic.AB_E_EXCEPTION 60 63 End Sub 61 64 /*! … … 65 68 Sub Exception(message As String) 66 69 init(message, Nothing) 67 hr = A B_E_EXCEPTION70 hr = ActiveBasic.AB_E_EXCEPTION 68 71 End Sub 69 72 /*! … … 74 77 Sub Exception(message As String, innerException As Exception) 75 78 init(message, innerException) 76 hr = A B_E_EXCEPTION79 hr = ActiveBasic.AB_E_EXCEPTION 77 80 End Sub 78 81 … … 190 193 Sub SystemException() 191 194 Exception(GetType().FullName, Nothing) 192 HResult = A B_E_SYSTEM195 HResult = ActiveBasic.AB_E_SYSTEM 193 196 End Sub 194 197 /*! … … 198 201 Sub SystemException(message As String) 199 202 Exception(message, Nothing) 200 HResult = A B_E_SYSTEM203 HResult = ActiveBasic.AB_E_SYSTEM 201 204 End Sub 202 205 /*! … … 207 210 Sub SystemException(message As String, innerException As Exception) 208 211 Exception(message, innerException) 209 HResult = A B_E_SYSTEM212 HResult = ActiveBasic.AB_E_SYSTEM 210 213 End Sub 211 214 End Class … … 224 227 Sub ArgumentException() 225 228 SystemException("One or more arguments have invalid value.", Nothing) 226 HResult = A B_E_ARGUMENT229 HResult = ActiveBasic.AB_E_ARGUMENT 227 230 End Sub 228 231 /*! … … 232 235 Sub ArgumentException(message As String) 233 236 SystemException(message, Nothing) 234 HResult = A B_E_ARGUMENT237 HResult = ActiveBasic.AB_E_ARGUMENT 235 238 End Sub 236 239 /*! … … 241 244 Sub ArgumentException(message As String, innerException As Exception) 242 245 SystemException(message, innerException) 243 HResult = A B_E_ARGUMENT246 HResult = ActiveBasic.AB_E_ARGUMENT 244 247 End Sub 245 248 /*! … … 251 254 SystemException(message, Nothing) 252 255 param = paramName 253 HResult = A B_E_ARGUMENT256 HResult = ActiveBasic.AB_E_ARGUMENT 254 257 End Sub 255 258 /*! … … 262 265 SystemException(message, innerException) 263 266 param = paramName 264 HResult = A B_E_ARGUMENT267 HResult = ActiveBasic.AB_E_ARGUMENT 265 268 End Sub 266 269 … … 337 340 Sub ArgumentOutOfRangeException() 338 341 ArgumentException("One or more arguments ware out of range value.", "", Nothing) 339 HResult = A B_E_ARGUMENTOUTOFRANGE342 HResult = ActiveBasic.AB_E_ARGUMENTOUTOFRANGE 340 343 End Sub 341 344 /*! … … 345 348 Sub ArgumentOutOfRangeException(message As String) 346 349 ArgumentException(message, "", Nothing) 347 HResult = A B_E_ARGUMENTOUTOFRANGE350 HResult = ActiveBasic.AB_E_ARGUMENTOUTOFRANGE 348 351 End Sub 349 352 /*! … … 354 357 Sub ArgumentOutOfRangeException(message As String, innerException As Exception) 355 358 ArgumentException(message, "", innerException) 356 HResult = A B_E_ARGUMENTOUTOFRANGE359 HResult = ActiveBasic.AB_E_ARGUMENTOUTOFRANGE 357 360 End Sub 358 361 /*! … … 363 366 Sub ArgumentOutOfRangeException(message As String, paramName As String) 364 367 ArgumentException(message, paramName, Nothing) 365 HResult = A B_E_ARGUMENTOUTOFRANGE368 HResult = ActiveBasic.AB_E_ARGUMENTOUTOFRANGE 366 369 End Sub 367 370 /*! … … 374 377 ArgumentException(message, paramName, Nothing) 375 378 actualValueObject = actualValue 376 HResult = A B_E_ARGUMENTOUTOFRANGE379 HResult = ActiveBasic.AB_E_ARGUMENTOUTOFRANGE 377 380 End Sub 378 381 … … 411 414 Sub IndexOutOfRangeException() 412 415 SystemException("The index was out of range value.", Nothing) 413 HResult = A B_E_INDEXOUTOFRANGE416 HResult = ActiveBasic.AB_E_INDEXOUTOFRANGE 414 417 End Sub 415 418 /*! … … 419 422 Sub IndexOutOfRangeException(message As String) 420 423 SystemException(message, Nothing) 421 HResult = A B_E_INDEXOUTOFRANGE424 HResult = ActiveBasic.AB_E_INDEXOUTOFRANGE 422 425 End Sub 423 426 /*! … … 428 431 Sub IndexOutOfRangeException(message As String, innerException As Exception) 429 432 SystemException(message, innerException) 430 HResult = A B_E_INDEXOUTOFRANGE433 HResult = ActiveBasic.AB_E_INDEXOUTOFRANGE 431 434 End Sub 432 435 End Class … … 445 448 Sub InvalidOperationException() 446 449 SystemException("The operation is invalid.", Nothing) 447 HResult = A B_E_INVALIDOPERATION450 HResult = ActiveBasic.AB_E_INVALIDOPERATION 448 451 End Sub 449 452 /*! … … 453 456 Sub InvalidOperationException(message As String) 454 457 SystemException(message, Nothing) 455 HResult = A B_E_INVALIDOPERATION458 HResult = ActiveBasic.AB_E_INVALIDOPERATION 456 459 End Sub 457 460 /*! … … 462 465 Sub InvalidOperationException(message As String, innerException As Exception) 463 466 SystemException(message, innerException) 464 HResult = AB_E_INVALIDOPERATION 465 End Sub 467 HResult = ActiveBasic.AB_E_INVALIDOPERATION 468 End Sub 469 End Class 470 471 /*! 472 @brief 博されたオブジェクトを操作しようとしたことを表す例外 473 @author Egtra 474 @date 2007/12/06 475 */ 476 Class ObjectDisposedException 477 Inherits InvalidOperationException 478 Public 479 /*! 480 @biref コンストラクタ 481 */ 482 Sub ObjectDisposedException() 483 InvalidOperationException("The object has been disposed.", Nothing) 484 HResult = ActiveBasic.AB_E_INVALIDOPERATION 485 End Sub 486 /*! 487 @biref コンストラクタ 488 @param[in] message エラーメッセージ 489 */ 490 Sub ObjectDisposedException(message As String) 491 InvalidOperationException(message, Nothing) 492 HResult = ActiveBasic.AB_E_INVALIDOPERATION 493 End Sub 494 /*! 495 @biref コンストラクタ 496 @param[in] message エラーメッセージ 497 @param[in] innerException 内部例外 498 */ 499 Sub ObjectDisposedException(message As String, innerException As Exception) 500 InvalidOperationException(message, innerException) 501 HResult = ActiveBasic.AB_E_INVALIDOPERATION 502 End Sub 503 /*! 504 @biref コンストラクタ 505 @param[in] objectName 操作しようとしたオブジェクトの名前 506 @param[in] message エラーメッセージ 507 */ 508 Sub ObjectDisposedException(objectName As String, message As String) 509 InvalidOperationException(message, Nothing) 510 HResult = ActiveBasic.AB_E_INVALIDOPERATION 511 objName = " object: " + objectName 512 End Sub 513 /*! 514 @brief この例外が発生したとき、操作しようとしていたオブジェクトの名前を返す。 515 */ 516 Function ObjectName() As String 517 Return objName 518 End Function 519 520 Override Function ToString() As String 521 ToString = Super.ToString() 522 If Not ActiveBasic.IsNothing(objName) Then 523 ToString += objName 524 End If 525 End Function 526 Private 527 objName As String 466 528 End Class 467 529 … … 513 575 Sub NotSupportedException() 514 576 SystemException("This operation is not supported,", Nothing) 515 HResult = A B_E_NOTSUPPORTED577 HResult = ActiveBasic.AB_E_NOTSUPPORTED 516 578 End Sub 517 579 /*! … … 521 583 Sub NotSupportedException(message As String) 522 584 SystemException(message, Nothing) 523 HResult = A B_E_NOTSUPPORTED585 HResult = ActiveBasic.AB_E_NOTSUPPORTED 524 586 End Sub 525 587 /*! … … 530 592 Sub NotSupportedException(message As String, innerException As Exception) 531 593 SystemException(message, innerException) 532 HResult = A B_E_NOTSUPPORTED594 HResult = ActiveBasic.AB_E_NOTSUPPORTED 533 595 End Sub 534 596 End Class … … 547 609 Sub PlatformNotSupportedException() 548 610 NotSupportedException("This operation is not supported in this platform.", Nothing) 549 HResult = A B_E_PLATFORMNOTSUPPORTED611 HResult = ActiveBasic.AB_E_PLATFORMNOTSUPPORTED 550 612 End Sub 551 613 /*! … … 555 617 Sub PlatformNotSupportedException(message As String) 556 618 NotSupportedException(message, Nothing) 557 HResult = A B_E_PLATFORMNOTSUPPORTED619 HResult = ActiveBasic.AB_E_PLATFORMNOTSUPPORTED 558 620 End Sub 559 621 /*! … … 564 626 Sub PlatformNotSupportedException(message As String, innerException As Exception) 565 627 NotSupportedException(message, innerException) 566 HResult = A B_E_PLATFORMNOTSUPPORTED628 HResult = ActiveBasic.AB_E_PLATFORMNOTSUPPORTED 567 629 End Sub 568 630 End Class
Note:
See TracChangeset
for help on using the changeset viewer.