1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522
|
<Type Name="Delegate" FullName="System.Delegate" FullNameSP="System_Delegate" Maintainer="ecma">
<TypeSignature Language="ILASM" Value=".class public abstract serializable Delegate extends System.Object implements System.ICloneable" />
<TypeSignature Language="C#" Value="public abstract class Delegate : ICloneable, System.Runtime.Serialization.ISerializable" />
<MemberOfLibrary>BCL</MemberOfLibrary>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyPublicKey>[00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ]</AssemblyPublicKey>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Object</BaseTypeName>
</Base>
<Interfaces>
<Interface>
<InterfaceName>System.ICloneable</InterfaceName>
</Interface>
<Interface>
<InterfaceName>System.Runtime.Serialization.ISerializable</InterfaceName>
</Interface>
</Interfaces>
<Attributes>
<Attribute>
<AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDual)</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>
<para> A class used to create types that invoke methods.</para>
</summary>
<remarks>
<para>Delegate types derive from the <see cref="T:System.Delegate" /> class. The declaration of a delegate type
establishes a contract that specifies the signature of one or more methods. <block subset="none" type="note"> For an example of a delegate type
declaration, see the examples at the end of this topic.</block></para>
<para>Delegate types are implicitly sealed: it is not permissible to derive a new
type from a delegate type. <block subset="none" type="note"> The <see cref="T:System.Delegate" /> class is not
considered a delegate type; it is a class used to derive delegate
types.</block></para>
<para>
<block subset="none" type="note"> For information on subclassing the Delegate class,
see Partition II of the CLI Specification.</block>
</para>
<para>A delegate is an instance of a delegate type. A non-null
delegate references an <paramref name="invocation list" />, which is made up of one or more
entries. Each entry consists of a pair of values: a non-null method, and a
corresponding object, called the <paramref name="target" />. If the method is static, the
corresponding target is <see langword=" null" />
, otherwise the target is the instance
on which the method is to be called.</para>
<para>The signature of each method in the invocation list is required to exactly
match the signature specified by the delegate's type.</para>
<para>When a delegate is invoked, the methods in the corresponding invocation list
are invoked in the order in which they appear in that list. A delegate attempts
to invoke every method in its invocation list, with duplicate methods being
invoked once for each occurrence in that list.</para>
<para>Delegates are immutable; once created, the invocation list of a delegate does
not change. Combining operations, such as <see cref="M:System.Delegate.Combine(System.Delegate,System.Delegate)" /> and
<see cref="M:System.Delegate.Remove(System.Delegate,System.Delegate)" />, cannot alter existing delegates. Instead, such operations
result in the return of either a new delegate that contains the results
of the operation, an existing delegate, or the null value. <block subset="none" type="note"> A combining operation returns the null value when the
result of the operation is an empty invocation list. A combining operation
returns an existing delegate when the requested operation has no effect (for
example, if an attempt is made to remove a nonexistent entry).</block></para>
<para> If an invoked method throws an exception, the
method stops executing and the exception is passed back to the caller of the
delegate. The delegate does not continue invoking methods from its invocation
list. Catching the exception in the caller does not alter this behavior. It is
possible that non-standard methods that implement combining operations allow the
creation of delegates with different behavior. When this is the case, the
non-standard methods are required to specify the behavior.</para>
<para>When the signature of the methods invoked by a delegate includes a return value,
the delegate returns the return value of the last element in the invocation
list. When the signature includes a parameter that is passed by reference,
the final value of the parameter is the result of every method in the invocation
list executing sequentially and updating the parameter's value.
<block subset="none" type="note"> For an example that
demonstrates this behavior, see Example 2.</block></para>
</remarks>
<example>
<para>
<see langword="Example1: " />
</para>
<para>The following example creates two delegates. The first
delegate invokes a static method, and the second invokes an instance method on a target object.</para>
<code lang="C#">using System;
public delegate string DelegatedMethod(string s);
class MyClass {
public static string StaticMethod(string s) {
return ("Static method Arg=" + s);
}
public string InstanceMethod(string s) {
return ("Instance method Arg=" + s);
}
}
class TestClass {
public static void Main() {
MyClass myInstance = new MyClass();
//Create delegates from delegate type DelegatedMethod.
DelegatedMethod delStatic = new DelegatedMethod(MyClass.StaticMethod);
DelegatedMethod delInstance = new DelegatedMethod(myInstance.InstanceMethod);
//Invoke the methods referenced by the delegates.
Console.WriteLine (delStatic("Call 1"));
Console.WriteLine (delInstance ("Call 2"));
}
}
</code>
<para> The output is</para>
<c>
<para>Static method Arg=Call 1</para>
<para>Instance method Arg=Call 2</para>
</c>
<para>
<see langword="Example2:" />
</para>
<para>The following example shows the return value and the
final value of a parameter that is passed by reference to a delegate that invokes multiple methods.</para>
<code lang="C#">using System;
class MyClass {
public int Increment(ref int i) {
Console.WriteLine("Incrementing {0}",i);
return (i++);
}
public int Negate(ref int i) {
Console.WriteLine("Negating {0}",i);
i = i * -1;
return i;
}
}
public delegate int DelegatedMethod(ref int i);
class TestClass {
public static void Main() {
MyClass myInstance = new MyClass();
DelegatedMethod delIncrementer = new DelegatedMethod(myInstance.Increment);
DelegatedMethod delNegater = new DelegatedMethod(myInstance.Negate);
DelegatedMethod d = (DelegatedMethod) Delegate.Combine(delIncrementer, delNegater);
int i = 1;
Console.WriteLine("Invoking delegate using ref value {0}",i);
int retvalue = d(ref i);
Console.WriteLine("After Invoking delegate i = {0} return value is {1}",i, retvalue);
}
}
</code>
<para> The output is</para>
<c>
<para>Invoking delegate using ref value 1</para>
<para>Incrementing 1</para>
<para>Negating 2</para>
<para>After Invoking delegate i = -2 return value is -2</para>
</c>
</example>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="protected Delegate (object target, string method);" />
<MemberType>Constructor</MemberType>
<Parameters>
<Parameter Name="target" Type="System.Object" />
<Parameter Name="method" Type="System.String" />
</Parameters>
<Docs>
<param name="target">To be added.</param>
<param name="method">To be added.</param>
<summary>To be added.</summary>
<remarks>To be added.</remarks>
</Docs>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="protected Delegate (Type target, string method);" />
<MemberType>Constructor</MemberType>
<Parameters>
<Parameter Name="target" Type="System.Type" />
<Parameter Name="method" Type="System.String" />
</Parameters>
<Docs>
<param name="target">To be added.</param>
<param name="method">To be added.</param>
<summary>To be added.</summary>
<remarks>To be added.</remarks>
</Docs>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName="Clone">
<MemberSignature Language="ILASM" Value=".method public hidebysig virtual object Clone()" />
<MemberSignature Language="C#" Value="public virtual object Clone ();" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Object</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>
<para>Creates a copy of the current instance.</para>
</summary>
<returns>
<para>A <see cref="T:System.Object" /> that is a copy of the current instance.</para>
</returns>
<remarks>
<para>The <see cref="M:System.Delegate.Clone" /> method creates a new instance of the
same type as the current instance and then copies the contents of each of the current instance's non-static fields.</para>
<para>
<block subset="none" type="note"> This method is
implemented to support the <see cref="T:System.ICloneable" /> interface.</block>
</para>
<para>
<block subset="none" type="behaviors">The returned object must have the exact same type and invocation list as the current instance.</block>
</para>
<para>
<block subset="none" type="default">
The default implementation of the <see cref="M:System.Delegate.Clone" /> method creates a new instance, which is the
exact same type as the current instance, and then copies the contents of each of
the current instance's non-static fields. If the field is a value type, a
bit-by-bit copy of the field is performed. If the field is a reference type, the
object referenced by the field is not copied; instead, the returned object
contains a copy of the reference. This behavior is identical to <see cref="M:System.Object.MemberwiseClone" /> .
</block>
</para>
<para>
<block subset="none" type="overrides">
Subclasses of
<see cref="T:System.Delegate" /> should
override <see cref="M:System.Delegate.Clone" /> to customize the way in which copies of the subclass are constructed.
</block>
</para>
</remarks>
</Docs>
<Excluded>0</Excluded>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName="Combine">
<MemberSignature Language="ILASM" Value=".method public hidebysig static class System.Delegate Combine(class System.Delegate[] delegates)" />
<MemberSignature Language="C#" Value="public static Delegate Combine (Delegate[] delegates);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Delegate</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="delegates" Type="System.Delegate[]">
<Attributes>
<Attribute>
<AttributeName>System.ParamArray</AttributeName>
</Attribute>
</Attributes>
</Parameter>
</Parameters>
<Docs>
<param name="delegates">An array of delegates of the exact same type.</param>
<summary>
<para>Concatenates the invocation lists of the specified
delegates.</para>
</summary>
<returns>
<para>A new delegate, or <see langword="null" /> if <paramref name="delegates" /> is <see langword="null" /> or has only
<see langword="null" />
elements.</para>
</returns>
<remarks>
<para>The invocation list of the returned delegate is
constructed by concatenating the invocation lists of the delegates in
<paramref name="delegates" />, in increasing subscript order. For example, consider the
following situation, in which the elements of delegates have the following
invocation lists (where En represents an entry in an invocation list, and null
represents an empty invocation list): [0] = E1, [1] = null, [2] = E2 + E3, and
[3] = E4 + E5 + E6. When these elements are combined, the resulting delegate
contains the invocation list E1 + E2 + E3 + E4 + E5 + E6. </para>
<para>Null elements in <paramref name="delegates" /> are not included in the returned
delegate. </para>
<para>
<block subset="none" type="note"> The invocation list of the returned
delegate can contain duplicate methods.</block>
</para>
</remarks>
<exception cref="T:System.ArgumentException">
<para>The non-<see langword="null" /> delegates in <paramref name="delegates" /> are not of the same type.</para>
</exception>
</Docs>
<Excluded>0</Excluded>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName>
</Attribute>
</Attributes>
</Member>
<Member MemberName="Combine">
<MemberSignature Language="ILASM" Value=".method public hidebysig static class System.Delegate Combine(class System.Delegate a, class System.Delegate b)" />
<MemberSignature Language="C#" Value="public static Delegate Combine (Delegate a, Delegate b);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Delegate</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="a" Type="System.Delegate" />
<Parameter Name="b" Type="System.Delegate" />
</Parameters>
<Docs>
<param name="a">The delegate whose invocation list will be first in the invocation list of the new delegate.</param>
<param name="b">The delegate whose invocation list will be last in the invocation list of the new delegate.</param>
<summary>
<para>Concatenates the invocation lists of the specified
delegates.</para>
</summary>
<returns>
<para>A delegate, or <see langword="null" /> .</para>
<para>The following table describes the value returned
when <paramref name="a" /> or <paramref name="b" /> is
<see langword="null" />
.</para>
<list type="table">
<listheader>
<term>a</term>
<description>b</description>
<description>Return Value</description>
</listheader>
<item>
<term> null</term>
<description>null</description>
<description>null</description>
</item>
<item>
<term> null</term>
<description>non-null</description>
<description>
<paramref name="b" />
</description>
</item>
<item>
<term> non-null</term>
<description>null</description>
<description>
<paramref name="a" />
</description>
</item>
</list>
<para>When <paramref name="a" /> and <paramref name="b" /> are non-null, this method
returns a new delegate with the concatenated invocation lists of <paramref name="a" /> and
<paramref name="b" /> .</para>
</returns>
<remarks>
<para>Unless <paramref name="a" /> or <paramref name="b" /> is <see langword="null" /> , <paramref name="a" /> and
<paramref name="b" /> are required
to be the exact same type.</para>
<para>Consider the following situation, in which D1, D2, D3, D4, and D5 are
delegate instances of the same type, D1's invocation list has one entry, E1, and
D2's invocation list has one entry, E2.</para>
<para>Then, D3 = Combine(D1, D2) results in D3's having an invocation list of E1 +
E2.</para>
<para>Then, D4 = Combine(D2, D1) results in D4's having an invocation list of E2 +
E1.</para>
<para>Then, D5 = Combine(D3, D4) results in D5's having an invocation list of E1 +
E2 + E2 + E1.</para>
<block subset="none" type="note">
<para> The invocation list of the returned
delegate can contain duplicate methods.
</para>
<para>
<see cref="M:System.Delegate.Combine(System.Delegate,System.Delegate)" /> is useful for creating event handlers that call multiple
methods each time an event occurs.</para>
</block>
</remarks>
<exception cref="T:System.ArgumentException">
<para>
<paramref name="a" /> and <paramref name="b" /> are not <see langword="null" /> and not of the same type.</para>
</exception>
</Docs>
<Excluded>0</Excluded>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName="CombineImpl">
<MemberSignature Language="C#" Value="protected virtual Delegate CombineImpl (Delegate d);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Delegate</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="d" Type="System.Delegate" />
</Parameters>
<Docs>
<param name="d">To be added.</param>
<summary>To be added.</summary>
<returns>To be added.</returns>
<remarks>To be added.</remarks>
</Docs>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName="CreateDelegate">
<MemberSignature Language="ILASM" Value=".method public hidebysig static class System.Delegate CreateDelegate(class System.Type type, class System.Reflection.MethodInfo method)" />
<MemberSignature Language="C#" Value="public static Delegate CreateDelegate (Type type, System.Reflection.MethodInfo method);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Delegate</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="type" Type="System.Type" />
<Parameter Name="method" Type="System.Reflection.MethodInfo" />
</Parameters>
<Docs>
<param name="type">The <see cref="T:System.Type" /> of <see cref="T:System.Delegate" /> to return. This <see cref="T:System.Type" /> is required to derive from <see cref="T:System.Delegate" /> .</param>
<param name="method">A <see cref="T:System.Reflection.MethodInfo" /> that reflects a static method.</param>
<summary>
<para> Returns a new delegate with the specified static
method as its invocation list.</para>
</summary>
<returns>
<para>A <see cref="T:System.Delegate" /> of type <paramref name="type" /> that invokes <paramref name="method." /></para>
</returns>
<remarks>
<para>
<block subset="none" type="note">This method is used to dynamically
create delegates that invoke static methods. To create a delegate that invokes
instance methods, see <see cref="M:System.Delegate.CreateDelegate(System.Type,System.Object,System.String)" />(<see cref="T:System.Type" />, <see cref="T:System.Object" />, <see cref="T:System.String" />).</block>
</para>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="type" /> or <paramref name="method" /> is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentException">
<para>
<paramref name="type" /> does not derive from <see cref="T:System.Delegate" />.</para>
<para>-or-</para>
<para>
<paramref name="method" /> does not reflect a static method.</para>
</exception>
<exception cref="T:System.ExecutionEngineException">
<para>The <see langword="Invoke" /> method of the <paramref name="type" /> delegate was not found.</para>
</exception>
<exception cref="T:System.MethodAccessException">
<para>The caller does not have the required permission.</para>
</exception>
<permission cref="T:System.Security.Permissions.ReflectionPermission">Requires permission to access type information. See <see cref="F:System.Security.Permissions.ReflectionPermissionFlag.MemberAccess" /></permission>
<exception cref="T:System.InvalidProgramException">
<para>The <see langword="Invoke" /> method of the <paramref name="type" /> delegate was not found.</para>
</exception>
</Docs>
<Excluded>1</Excluded>
<ExcludedLibrary>Reflection</ExcludedLibrary>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName="CreateDelegate">
<MemberSignature Language="C#" Value="public static Delegate CreateDelegate (Type type, object target, System.Reflection.MethodInfo method);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Delegate</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="type" Type="System.Type" />
<Parameter Name="target" Type="System.Object" />
<Parameter Name="method" Type="System.Reflection.MethodInfo" />
</Parameters>
<Docs>
<param name="type">To be added.</param>
<param name="target">To be added.</param>
<param name="method">To be added.</param>
<summary>To be added.</summary>
<returns>To be added.</returns>
<remarks>To be added.</remarks>
<since version=".NET 2.0" />
</Docs>
<AssemblyInfo>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName="CreateDelegate">
<MemberSignature Language="ILASM" Value=".method public hidebysig static class System.Delegate CreateDelegate(class System.Type type, object target, string method)" />
<MemberSignature Language="C#" Value="public static Delegate CreateDelegate (Type type, object target, string method);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Delegate</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="type" Type="System.Type" />
<Parameter Name="target" Type="System.Object" />
<Parameter Name="method" Type="System.String" />
</Parameters>
<Docs>
<param name="type">The <see cref="T:System.Type" /> of the delegate to return. This <see cref="T:System.Type" /> is required to derive from <see cref="T:System.Delegate" /> .</param>
<param name="target">An instance of an object that implements <paramref name="method" /> .</param>
<param name="method">A <see cref="T:System.String" /> containing the name of the instance method to be invoke on <paramref name="target" /> .</param>
<summary>
<para> Returns a new delegate with the specified target
and instance method as its invocation list.</para>
</summary>
<returns>
<para>A <see cref="T:System.Delegate" /> of type
<paramref name="type" /> that invokes <paramref name="method" /> on <paramref name="target" />.</para>
</returns>
<remarks>
<para>
<block subset="none" type="note">This method is used to dynamically
create delegates that invoke instance methods. To create a delegate that invokes
static methods, see <see cref="M:System.Delegate.CreateDelegate(System.Type,System.Object,System.String)" />(<see cref="T:System.Type" />, <see cref="T:System.Type" />, <see cref="T:System.String" />).</block>
</para>
</remarks>
<exception cref="T:System.ArgumentNullException">
<para>
<paramref name="type, target, or method" /> is <see langword="null" />.</para>
</exception>
<exception cref="T:System.ArgumentException">
<para>
<paramref name="type" /> does not derive from <see cref="T:System.Delegate" />.</para>
<para>-or-</para>
<para>
<paramref name="method" /> is not an instance method.</para>
<para>-or-</para>
<para>
<paramref name="target" /> does not implement <paramref name="method" />.</para>
</exception>
<exception cref="T:System.MethodAccessException">
<para>The caller does not have the required permission.</para>
</exception>
<permission cref="T:System.Security.Permissions.ReflectionPermission">Requires permission to access type information. See <see cref="F:System.Security.Permissions.ReflectionPermissionFlag.MemberAccess" /></permission>
</Docs>
<Excluded>1</Excluded>
<ExcludedLibrary>Reflection</ExcludedLibrary>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName="CreateDelegate">
<MemberSignature Language="C#" Value="public static Delegate CreateDelegate (Type type, System.Reflection.MethodInfo method, bool throwOnBindFailure);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Delegate</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="type" Type="System.Type" />
<Parameter Name="method" Type="System.Reflection.MethodInfo" />
<Parameter Name="throwOnBindFailure" Type="System.Boolean" />
</Parameters>
<Docs>
<param name="type">To be added.</param>
<param name="method">To be added.</param>
<param name="throwOnBindFailure">To be added.</param>
<summary>To be added.</summary>
<returns>To be added.</returns>
<remarks>To be added.</remarks>
<since version=".NET 2.0" />
</Docs>
<AssemblyInfo>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName="CreateDelegate">
<MemberSignature Language="ILASM" Value=".method public hidebysig static class System.Delegate CreateDelegate(class System.Type type, class System.Type target, string method)" />
<MemberSignature Language="C#" Value="public static Delegate CreateDelegate (Type type, Type target, string method);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Delegate</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="type" Type="System.Type" />
<Parameter Name="target" Type="System.Type" />
<Parameter Name="method" Type="System.String" />
</Parameters>
<Docs>
<param name="type">The <see cref="T:System.Type" /> of delegate to return. This <see cref="T:System.Type" /> is required to derive from <see cref="T:System.Delegate" /> .</param>
<param name="target">A <see cref="T:System.Type" /> representing the class that implements <paramref name="method" /> .</param>
<param name="method">A <see cref="T:System.String" /> containing the name of the static method implemented by <paramref name="target" /> .</param>
<summary>
<para> Returns a new delegate with the specified
static method as its invocation list.</para>
</summary>
<returns>
<para>A <see cref="T:System.Delegate" /> of type <paramref name="type" /> that invokes <paramref name="method." /></para>
</returns>
<remarks>
<para>
<block subset="none" type="note">This method is used to dynamically
create delegates that invoke static methods. To create a delegate that invokes
instance methods, see <see cref="M:System.Delegate.CreateDelegate(System.Type,System.Object,System.String)" />(<see cref="T:System.Type" />, <see cref="T:System.Object" />, <see cref="T:System.String" />).</block>
</para>
</remarks>
<exception cref="T:System.ArgumentNullException">
<para>
<paramref name="type, target, or method" /> is <see langword="null" />.</para>
</exception>
<exception cref="T:System.ArgumentException">
<para>
<paramref name="type" /> does not derive from <see cref="T:System.Delegate" />.</para>
<para>-or-</para>
<para>
<paramref name="method" /> is not a static method.</para>
<para> -or-</para>
<para>
<paramref name="target" /> does not implement <paramref name="method" /> .</para>
</exception>
<exception cref="T:System.MethodAccessException">
<para>The caller does not have the required permission.</para>
</exception>
<permission cref="T:System.Security.Permissions.ReflectionPermission">Requires permission to access type information. See <see cref="F:System.Security.Permissions.ReflectionPermissionFlag.MemberAccess" /></permission>
</Docs>
<Excluded>1</Excluded>
<ExcludedLibrary>Reflection</ExcludedLibrary>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName="CreateDelegate">
<MemberSignature Language="C#" Value="public static Delegate CreateDelegate (Type type, object target, System.Reflection.MethodInfo method, bool throwOnBindFailure);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Delegate</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="type" Type="System.Type" />
<Parameter Name="target" Type="System.Object" />
<Parameter Name="method" Type="System.Reflection.MethodInfo" />
<Parameter Name="throwOnBindFailure" Type="System.Boolean" />
</Parameters>
<Docs>
<param name="type">To be added.</param>
<param name="target">To be added.</param>
<param name="method">To be added.</param>
<param name="throwOnBindFailure">To be added.</param>
<summary>To be added.</summary>
<returns>To be added.</returns>
<remarks>To be added.</remarks>
<since version=".NET 2.0" />
</Docs>
<AssemblyInfo>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName="CreateDelegate">
<MemberSignature Language="C#" Value="public static Delegate CreateDelegate (Type type, object target, string method, bool ignoreCase);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Delegate</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="type" Type="System.Type" />
<Parameter Name="target" Type="System.Object" />
<Parameter Name="method" Type="System.String" />
<Parameter Name="ignoreCase" Type="System.Boolean" />
</Parameters>
<Docs>
<param name="type">To be added.</param>
<param name="target">To be added.</param>
<param name="method">To be added.</param>
<param name="ignoreCase">To be added.</param>
<summary>To be added.</summary>
<returns>To be added.</returns>
<remarks>To be added.</remarks>
</Docs>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName="CreateDelegate">
<MemberSignature Language="C#" Value="public static Delegate CreateDelegate (Type type, Type target, string method, bool ignoreCase);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Delegate</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="type" Type="System.Type" />
<Parameter Name="target" Type="System.Type" />
<Parameter Name="method" Type="System.String" />
<Parameter Name="ignoreCase" Type="System.Boolean" />
</Parameters>
<Docs>
<param name="type">To be added.</param>
<param name="target">To be added.</param>
<param name="method">To be added.</param>
<param name="ignoreCase">To be added.</param>
<summary>To be added.</summary>
<returns>To be added.</returns>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="CreateDelegate">
<MemberSignature Language="C#" Value="public static Delegate CreateDelegate (Type type, object target, string method, bool ignoreCase, bool throwOnBindFailure);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Delegate</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="type" Type="System.Type" />
<Parameter Name="target" Type="System.Object" />
<Parameter Name="method" Type="System.String" />
<Parameter Name="ignoreCase" Type="System.Boolean" />
<Parameter Name="throwOnBindFailure" Type="System.Boolean" />
</Parameters>
<Docs>
<param name="type">To be added.</param>
<param name="target">To be added.</param>
<param name="method">To be added.</param>
<param name="ignoreCase">To be added.</param>
<param name="throwOnBindFailure">To be added.</param>
<summary>To be added.</summary>
<returns>To be added.</returns>
<remarks>To be added.</remarks>
<since version=".NET 2.0" />
</Docs>
<AssemblyInfo>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName="CreateDelegate">
<MemberSignature Language="C#" Value="public static Delegate CreateDelegate (Type type, Type target, string method, bool ignoreCase, bool throwOnBindFailure);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Delegate</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="type" Type="System.Type" />
<Parameter Name="target" Type="System.Type" />
<Parameter Name="method" Type="System.String" />
<Parameter Name="ignoreCase" Type="System.Boolean" />
<Parameter Name="throwOnBindFailure" Type="System.Boolean" />
</Parameters>
<Docs>
<param name="type">To be added.</param>
<param name="target">To be added.</param>
<param name="method">To be added.</param>
<param name="ignoreCase">To be added.</param>
<param name="throwOnBindFailure">To be added.</param>
<summary>To be added.</summary>
<returns>To be added.</returns>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="DynamicInvoke">
<MemberSignature Language="ILASM" Value=".method public hidebysig instance object DynamicInvoke(class System.Object[] args)" />
<MemberSignature Language="C#" Value="public object DynamicInvoke (object[] args);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Object</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="args" Type="System.Object[]">
<Attributes>
<Attribute>
<AttributeName>System.ParamArray</AttributeName>
</Attribute>
</Attributes>
</Parameter>
</Parameters>
<Docs>
<param name="args">
<para>An array of <see cref="T:System.Object" /> instances that are to be passed to the methods in the invocation list of the current instance. Specify <see langword="null" /> if the methods invoked by the current instance do not take arguments.</para>
</param>
<summary>
<para>Causes a delegate to invoke the methods in its invocation
list using the specified arguments.</para>
</summary>
<returns>
<para>The <see cref="T:System.Object" /> returned by the
last method in the invocation list of the current instance.</para>
</returns>
<remarks>To be added.</remarks>
<exception cref="T:System.ArgumentException">
<para>The type of one or more elements in <paramref name="args" /> is invalid as a parameter to the methods implemented by the current instance.</para>
</exception>
<exception cref="T:System.MethodAccessException">
<para>The caller does not have the required permissions.</para>
<para>-or-</para>
<para>The number, order or type of parameters listed in <paramref name="args" /> is invalid.</para>
</exception>
<exception cref="T:System.Reflection.TargetException">
<para>A method in the invocation list of the current instance is an instance method and its target object is <see langword="null" />.</para>
<para>-or-</para>
<para>A method in the invocation list of the current instance was invoked on a target object or a class that does not implement it.</para>
</exception>
<exception cref="!:System.Reflection.TargetParamterCountException">
<para> The number of elements in <paramref name="args" /> is not equal to the number of parameters required by the methods invoked by the current instance.</para>
</exception>
<exception cref="T:System.Reflection.TargetInvocationException">A method in the invocation list of the current instance threw an exception.</exception>
</Docs>
<Excluded>1</Excluded>
<ExcludedLibrary>Reflection</ExcludedLibrary>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName="DynamicInvokeImpl">
<MemberSignature Language="C#" Value="protected virtual object DynamicInvokeImpl (object[] args);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Object</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="args" Type="System.Object[]" />
</Parameters>
<Docs>
<param name="args">To be added.</param>
<summary>To be added.</summary>
<returns>To be added.</returns>
<remarks>To be added.</remarks>
</Docs>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName="Equals">
<MemberSignature Language="ILASM" Value=".method public hidebysig virtual bool Equals(object obj)" />
<MemberSignature Language="C#" Value="public override bool Equals (object obj);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="obj" Type="System.Object" />
</Parameters>
<Docs>
<param name="obj">The <see cref="T:System.Object" /> to compare with the current instance.</param>
<summary>
<para>Determines whether the
specified object is equal to the current instance.</para>
</summary>
<returns>
<para>
<see langword="true" /> if <paramref name="obj" /> is equal to the
current instance, otherwise <see langword="false" />.</para>
</returns>
<remarks>
<para>Two delegates are equal if they are not null and are of
the exact same type, their invocation lists contain the same number of elements,
and every element in the invocation list of the first delegate is equal to
the element in the corresponding position in the invocation list of the second delegate.</para>
<para> Two invocation list elements are equal if they invoke the same
instance method on the same target instance, or they invoke the same static method.</para>
<para>
<block subset="none" type="note"> This method
overrides <see cref="M:System.Object.Equals(System.Object)" />
.</block>
</para>
</remarks>
</Docs>
<Excluded>0</Excluded>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName="GetHashCode">
<MemberSignature Language="ILASM" Value=".method public hidebysig virtual int32 GetHashCode()" />
<MemberSignature Language="C#" Value="public override int GetHashCode ();" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>
<para>Generates a hash code for the current instance.</para>
</summary>
<returns>
<para>A <see cref="T:System.Int32" /> containing the hash code for this instance.</para>
</returns>
<remarks>
<para> The algorithm used to
generate the hash code is unspecified.</para>
<para>
<block subset="none" type="note"> This method
overrides <see cref="M:System.Object.GetHashCode" />
.</block>
</para>
</remarks>
</Docs>
<Excluded>0</Excluded>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName="GetInvocationList">
<MemberSignature Language="ILASM" Value=".method public hidebysig virtual class System.Delegate[] GetInvocationList()" />
<MemberSignature Language="C#" Value="public virtual Delegate[] GetInvocationList ();" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Delegate[]</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>
<para>Returns the invocation list of the current delegate.</para>
</summary>
<returns>
<para>An ordered set of <see cref="T:System.Delegate" /> instances whose invocation lists collectively match those of the current delegate.</para>
</returns>
<remarks>
<para>
<block subset="none" type="behaviors">
The
array contains a set of delegates, each having an invocation list of one
entry. Invoking these delegates sequentially, in the order in which they appear in the
array, produces the same results as invoking the current delegate.
</block>
</para>
<para>
<block subset="none" type="overrides">
Override <see cref="M:System.Delegate.GetInvocationList" />
when subclassing Delegate.</block>
</para>
</remarks>
</Docs>
<Excluded>0</Excluded>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName="GetMethodImpl">
<MemberSignature Language="C#" Value="protected virtual System.Reflection.MethodInfo GetMethodImpl ();" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Reflection.MethodInfo</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>To be added.</summary>
<returns>To be added.</returns>
<remarks>To be added.</remarks>
</Docs>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName="GetObjectData">
<MemberSignature Language="C#" Value="public virtual void GetObjectData (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="info" Type="System.Runtime.Serialization.SerializationInfo" />
<Parameter Name="context" Type="System.Runtime.Serialization.StreamingContext" />
</Parameters>
<Docs>
<param name="info">To be added.</param>
<param name="context">To be added.</param>
<summary>To be added.</summary>
<remarks>To be added.</remarks>
</Docs>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName="Method">
<MemberSignature Language="ILASM" Value=".property class System.Reflection.MethodInfo Method { public hidebysig specialname instance class System.Reflection.MethodInfo get_Method() }" />
<MemberSignature Language="C#" Value="public System.Reflection.MethodInfo Method { get; }" />
<MemberType>Property</MemberType>
<ReturnValue>
<ReturnType>System.Reflection.MethodInfo</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>
<para> Gets the last method in a delegate's invocation
list.</para>
</summary>
<value>
<para>A <see cref="T:System.Reflection.MethodInfo" />
.</para>
</value>
<remarks>
<para>This property is read-only.</para>
</remarks>
<exception cref="T:System.MemberAccessException">The caller does not have the required permissions.</exception>
<permission cref="T:System.Security.Permissions.ReflectionPermission">Requires permission to access type information. See <see cref="F:System.Security.Permissions.ReflectionPermissionFlag.TypeInformation" />.</permission>
</Docs>
<Excluded>1</Excluded>
<ExcludedLibrary>Reflection</ExcludedLibrary>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName="op_Equality">
<MemberSignature Language="ILASM" Value=".method public hidebysig static specialname bool op_Equality(class System.Delegate d1, class System.Delegate d2)" />
<MemberSignature Language="C#" Value="public static bool op_Equality (Delegate a, Delegate b);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="a" Type="System.Delegate" />
<Parameter Name="b" Type="System.Delegate" />
</Parameters>
<Docs>
<param name="d1">The first delegate to compare.</param>
<param name="d2">The second delegate to compare.</param>
<param name="a">To be added.</param>
<param name="b">To be added.</param>
<summary>
<para>Determines whether the specified delegates are equal.</para>
</summary>
<returns>
<para>
<see langword="true" /> if
<paramref name="d1" />.Equals(<paramref name="d2" />) returns <see langword="true" />;
otherwise, <see langword="false" />.</para>
</returns>
<remarks>
<para>
<block subset="none" type="note"> See <see cref="M:System.Delegate.Equals(System.Object)" />.</block>
</para>
</remarks>
</Docs>
<Excluded>0</Excluded>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName="op_Inequality">
<MemberSignature Language="ILASM" Value=".method public hidebysig static specialname bool op_Inequality(class System.Delegate d1, class System.Delegate d2)" />
<MemberSignature Language="C#" Value="public static bool op_Inequality (Delegate a, Delegate b);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="a" Type="System.Delegate" />
<Parameter Name="b" Type="System.Delegate" />
</Parameters>
<Docs>
<param name="d1">The first delegate to compare.</param>
<param name="d2">The second delegate to compare.</param>
<param name="a">To be added.</param>
<param name="b">To be added.</param>
<summary>
<para>Determines whether the specified Delegates are not equal.</para>
</summary>
<returns>
<para>
<see langword="true" /> if
<paramref name="d1" />.Equals(<paramref name="d2" />) returns
<see langword="false" />; otherwise, <see langword="false" />.</para>
</returns>
<remarks>
<para>
<block subset="none" type="note"> See <see cref="M:System.Delegate.Equals(System.Object)" />.</block>
</para>
</remarks>
</Docs>
<Excluded>0</Excluded>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName="Remove">
<MemberSignature Language="ILASM" Value=".method public hidebysig static class System.Delegate Remove(class System.Delegate source, class System.Delegate value)" />
<MemberSignature Language="C#" Value="public static Delegate Remove (Delegate source, Delegate value);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Delegate</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="source" Type="System.Delegate" />
<Parameter Name="value" Type="System.Delegate" />
</Parameters>
<Docs>
<param name="source">The delegate from which to remove the invocation list of <paramref name="value" />.</param>
<param name="value">The delegate that supplies the invocation list to remove from <paramref name="source" />.</param>
<summary>
<para>Removes the invocation list of a <see cref="T:System.Delegate" /> from the
invocation list of another delegate.</para>
</summary>
<returns>
<para>Returns a new delegate, <paramref name="source" />, or <see langword="null" /> . </para>
<para>If <paramref name="source" /> and <paramref name="value" /> are not <see langword="null" /> , are not equal, and the
invocation list of <paramref name="value" /> is contained in the invocation list of source,
returns a new delegate with the invocation list of <paramref name="value" /> removed from
the invocation list of <paramref name="source" />.</para>
<para>If the invocation lists of <paramref name="source" /> and <paramref name="value" /> are equal,
returns <see langword="null" />
.</para>
<para>If the invocation list of <paramref name="value" /> is not found in the invocation list
of <paramref name="source" />, returns <paramref name="source" />.</para>
<para>The following table describes the value returned when <paramref name="source" /> or
<paramref name="value" /> is
<see langword="null" /> .</para>
<list type="table">
<listheader>
<term>
<paramref name="source" />
</term>
<description>
<paramref name="value" />
</description>
<description>Return value</description>
</listheader>
<item>
<term> null</term>
<description>null</description>
<description>null</description>
</item>
<item>
<term> null</term>
<description>non-null</description>
<description>null</description>
</item>
<item>
<term> non-null</term>
<description>null</description>
<description>
<paramref name="source" />
</description>
</item>
</list>
</returns>
<remarks>
<para>The invocation list of <paramref name="value" /> is required to be
an exact match of a contiguous set of elements in the invocation list of
<paramref name="source" />. If the invocation list of <paramref name="value" /> occurs more than once
in the invocation list of <paramref name="source" />, the last occurrence is removed.</para>
</remarks>
<example>
<para>The following example demonstrates the <see cref="M:System.Delegate.Remove(System.Delegate,System.Delegate)" /> method.</para>
<code lang="C#">using System;
class MyClass {
public string InstanceMethod(string s) {
return ("Instance String " + s);
}
}
class MyClass2 {
public string InstanceMethod2(string s) {
return ("Instance String2 " + s);
}
}
public delegate string DelegatedMethod(string s);
class TestClass {
public static void WriteDelegate (string label, Delegate d) {
Console.WriteLine("Invocation list targets for {0}:",label);
foreach(Delegate x in d.GetInvocationList())
Console.WriteLine("{0}",x.Target);
}
public static void Main() {
MyClass myInstance = new MyClass();
DelegatedMethod delInstance = new DelegatedMethod(myInstance.InstanceMethod);
MyClass2 myInstance2 = new MyClass2();
DelegatedMethod delInstance2 = new DelegatedMethod(myInstance2.InstanceMethod2);
DelegatedMethod [] sourceArray = {delInstance, delInstance2, delInstance2, delInstance};
DelegatedMethod [] remove1 = {delInstance};
DelegatedMethod [] remove2 = {delInstance2, delInstance2};
DelegatedMethod [] remove3 = {delInstance2, delInstance};
DelegatedMethod [] remove4 = {delInstance, delInstance2};
DelegatedMethod [] remove5 = {delInstance, delInstance};
Delegate source = Delegate.Combine(sourceArray);
// Display invocation list of source
TestClass.WriteDelegate("source", source);
//Test 1: value occurs in source twice.
Delegate value1 = Delegate.Combine(remove1);
Delegate result1 = Delegate.Remove(source, value1);
TestClass.WriteDelegate("value1", value1);
if (result1==null) {
Console.WriteLine("removal test 1 result is null");
} else {
TestClass.WriteDelegate("result1", result1);
}
//Test 2: value matches the middle two elements of source.
Delegate value2 = Delegate.Combine(remove2);
Delegate result2 = Delegate.Remove(source, value2);
TestClass.WriteDelegate("value2", value2);
if (result2==null) {
Console.WriteLine("removal test 2 result2 is null");
} else {
TestClass.WriteDelegate("result2", result2);
}
//Test 3: value matches the last two elements of source.
Delegate value3 = Delegate.Combine(remove3);
Delegate result3 = Delegate.Remove(source, value3);
TestClass.WriteDelegate("value3", value3);
if (result3==null) {
Console.WriteLine("removal test 3 result3 is null");
} else {
TestClass.WriteDelegate("result3", result3);
}
//Test 4: value matches the first two elements of source.
Delegate value4 = Delegate.Combine(remove4);
Delegate result4 = Delegate.Remove(source, value4);
TestClass.WriteDelegate("value4", value4);
if (result4==null) {
Console.WriteLine("removal test 4 result4 is null");
} else {
TestClass.WriteDelegate("result4", result4);
}
//Test 5: value does not occur in source.
Delegate value5 = Delegate.Combine(remove5);
Delegate result5 = Delegate.Remove(source, value5);
TestClass.WriteDelegate("value5", value5);
if (result5==null) {
Console.WriteLine("removal test 5 result5 is null");
} else {
TestClass.WriteDelegate("result5", result5);
}
//Test 6: value exactly matches source.
Delegate result6 = Delegate.Remove(source, source);
TestClass.WriteDelegate("value=source", source);
if (result6==null) {
Console.WriteLine("removal test 6 result6 is null");
} else {
TestClass.WriteDelegate("result6", result6);
}
}
}
</code>
<para>The output is</para>
<c>
<para>Invocation list targets for source:</para>
<para>MyClass</para>
<para>MyClass2</para>
<para>MyClass2</para>
<para>MyClass</para>
<para>Invocation list targets for value1:</para>
<para>MyClass</para>
<para>Invocation list targets for result1:</para>
<para>MyClass</para>
<para>MyClass2</para>
<para>MyClass2</para>
<para>Invocation list targets for value2:</para>
<para>MyClass2</para>
<para>MyClass2</para>
<para>Invocation list targets for result2:</para>
<para>MyClass</para>
<para>MyClass</para>
<para>Invocation list targets for value3:</para>
<para>MyClass2</para>
<para>MyClass</para>
<para>Invocation list targets for result3:</para>
<para>MyClass</para>
<para>MyClass2</para>
<para>Invocation list targets for value4:</para>
<para>MyClass</para>
<para>MyClass2</para>
<para>Invocation list targets for result4:</para>
<para>MyClass2</para>
<para>MyClass</para>
<para>Invocation list targets for value5:</para>
<para>MyClass</para>
<para>MyClass</para>
<para>Invocation list targets for result5:</para>
<para>MyClass</para>
<para>MyClass2</para>
<para>MyClass2</para>
<para>MyClass</para>
<para>Invocation list targets for value=source:</para>
<para>MyClass</para>
<para>MyClass2</para>
<para>MyClass2</para>
<para>MyClass</para>
<para>removal test 6 result6 is null</para>
</c>
</example>
</Docs>
<Excluded>0</Excluded>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName="RemoveAll">
<MemberSignature Language="ILASM" Value=".method public hidebysig static class System.Delegate RemoveAll(class System.Delegate source, class System.Delegate value)" />
<MemberSignature Language="C#" Value="public static Delegate RemoveAll (Delegate source, Delegate value);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Delegate</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="source" Type="System.Delegate" />
<Parameter Name="value" Type="System.Delegate" />
</Parameters>
<Docs>
<param name="source">The delegate from which to remove all matching occurrences of the invocation list of <paramref name="value" />.</param>
<param name="value">The delegate that supplies the invocation list to remove from <paramref name="source" />.</param>
<summary>
<para>Removes all matching occurrences of the invocation list of a <see cref="T:System.Delegate" /> from the invocation list of another delegate.
</para>
</summary>
<returns>
<para>Returns a new delegate, <paramref name="source" />, or <see langword="null" />.</para>
<para>If <paramref name="source" /> and <paramref name="value" /> are not <see langword="null" /> , are not equal, and the invocation list of <paramref name="value" /> is contained in the invocation list of source, returns a new delegate with all matching occurrences of the invocation list of <paramref name="value" /> removed from the invocation list of <paramref name="source" />.
</para>
<para>If the invocation lists of <paramref name="source" /> and <paramref name="value" /> are equal, or if <paramref name="source" /> contains only a succession of invocation lists equal to <paramref name="value" />, returns <see langword="null" />.</para>
<para>If the invocation list of <paramref name="value" /> is not found in the invocation list of <paramref name="source" />, returns <paramref name="source" />.</para>
<para>The following table describes the value returned when <paramref name="source" /> or <paramref name="value" /> is <see langword="null" /> .</para>
<list type="table">
<listheader>
<term>
<paramref name="source" />
</term>
<description>
<paramref name="value" />
</description>
<description>Return value</description>
</listheader>
<item>
<term> null</term>
<description>null</description>
<description>null</description>
</item>
<item>
<term> null</term>
<description>non-null</description>
<description>null</description>
</item>
<item>
<term> non-null</term>
<description>null</description>
<description>
<paramref name="source" />
</description>
</item>
</list>
</returns>
<remarks>
<para>The invocation list of <paramref name="value" /> is required to be an exact match of a contiguous set of elements in the invocation list of<paramref name="source" />. If the invocation list of <paramref name="value" /> occurs more than once in the invocation list of <paramref name="source" />, all occurrences are removed.</para>
</remarks>
</Docs>
<Excluded>0</Excluded>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName="RemoveImpl">
<MemberSignature Language="C#" Value="protected virtual Delegate RemoveImpl (Delegate d);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Delegate</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="d" Type="System.Delegate" />
</Parameters>
<Docs>
<param name="d">To be added.</param>
<summary>To be added.</summary>
<returns>To be added.</returns>
<remarks>To be added.</remarks>
</Docs>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName="Target">
<MemberSignature Language="ILASM" Value=".property object Target { public hidebysig specialname instance object get_Target() }" />
<MemberSignature Language="C#" Value="public object Target { get; }" />
<MemberType>Property</MemberType>
<ReturnValue>
<ReturnType>System.Object</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>
<para>Gets the last object upon which a delegate invokes an
instance method.</para>
</summary>
<value>
<para>A <see cref="T:System.Object" /> instance, or
<see langword="null" /> if the delegate invokes only static methods.</para>
</value>
<remarks>
<para>This property is read-only.</para>
<para>If the delegate invokes only static methods, this
property returns <see langword="null" />
. If the delegate invokes one or more instance methods, this property returns the target of the last instance method/target pair in the invocation list.</para>
</remarks>
<example>
<para>Example 1:</para>
<para>The following example gets the <see cref="P:System.Delegate.Target" /> property values
for two delegates. The first delegate invokes a static method, and the second
invokes an instance method.</para>
<code lang="C#">using System;
public delegate string DelegatedMethod(string s);
class MyClass {
public static string StaticMethod(string s) {
return ("Static method Arg=" + s);
}
public string InstanceMethod(string s) {
return ("Instance method Arg=" + s);
}
}
class TestClass {
public static void Main() {
MyClass myInstance = new MyClass();
//Create delegates from delegate type DelegatedMethod.
DelegatedMethod delStatic = new DelegatedMethod(MyClass.StaticMethod);
DelegatedMethod delInstance = new DelegatedMethod(myInstance.InstanceMethod);
object t = delStatic.Target;
Console.WriteLine ("Static target is {0}", t==null ? "null":t);
t = delInstance.Target;
Console.WriteLine ("Instance target is {0}", t==null ? "null":t);
}
}
</code>
<para>The output is</para>
<c>
<para>Static target is null</para>
<para>Instance target is MyClass</para>
</c>
<para>Example 2: </para>
<para>The following example gets the <see cref="P:System.Delegate.Target" /> property value for three delegates
created using instance methods, static methods, and a combination of the two. </para>
<code lang="C#">using System;
class MyClass {
public static string StaticMethod(string s) {
return ("Static String " + s);
}
public string InstanceMethod(string s) {
return ("Instance String " + s);
}
}
class MyClass2 {
public static string StaticMethod2(string s) {
return ("Static String2 " + s);
}
public string InstanceMethod2(string s) {
return ("Instance String2 " + s);
}
}
public delegate string DelegatedMethod(string s);
class TestClass {
public static void Main() {
DelegatedMethod delStatic = new DelegatedMethod(MyClass.StaticMethod);
DelegatedMethod delStatic2 = new DelegatedMethod(MyClass2.StaticMethod2);
MyClass myInstance = new MyClass();
DelegatedMethod delInstance = new DelegatedMethod(myInstance.InstanceMethod);
MyClass2 myInstance2 = new MyClass2();
DelegatedMethod delInstance2 = new DelegatedMethod(myInstance2.InstanceMethod2);
Delegate d = Delegate.Combine(delStatic, delInstance );
Delegate e = Delegate.Combine(delInstance,delInstance2);
Delegate f = Delegate.Combine(delStatic, delStatic2 );
if (d!=null) {
Console.WriteLine("Combined 1 static, 1 instance, same class:");
Console.WriteLine("target...{0}", d.Target == null ? "null" : d.Target);
foreach(Delegate x in d.GetInvocationList())
Console.WriteLine("invoke element target: {0}",x.Target);
}
Console.WriteLine("");
if (e!=null) {
Console.WriteLine("Combined 2 instance methods, different classes:");
Console.WriteLine("target...{0}", e.Target == null ? "null" : e.Target);
foreach(Delegate x in e.GetInvocationList())
Console.WriteLine("invoke element target: {0}",x.Target);
}
Console.WriteLine("");
if (f!=null) {
Console.WriteLine("Combined 2 static methods, different classes:");
Console.WriteLine("target...{0}", f.Target == null ? "null" : f.Target);
foreach(Delegate x in f.GetInvocationList())
Console.WriteLine("invoke element target: {0}",x.Target);
}
}
}
</code>
<para>The output is</para>
<c>
<para>Combined 1 static, 1 instance, same class:</para>
<para>target...MyClass</para>
<para>invoke element target:</para>
<para>invoke element target: MyClass</para>
<para>Combined 2 instance methods, different classes:</para>
<para>target...MyClass2</para>
<para>invoke element target: MyClass</para>
<para>invoke element target: MyClass2</para>
<para>Combined 2 static methods, different classes:</para>
<para>target...null</para>
<para>invoke element target:</para>
<para>invoke element target:</para>
</c>
</example>
</Docs>
<Excluded>0</Excluded>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
</Member>
</Members>
<TypeExcluded>0</TypeExcluded>
</Type>
|