Skip to content

Commit b7f5170

Browse files
committed
Update README.md
1 parent 9814725 commit b7f5170

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ numbers.ForEach(num => results.Add(num * 2)); // 將每個數字乘以 2 並加
127127

128128
1. **Register**
129129
```csharp
130-
public static TSource Register<TSource>(this TSource source, TSource toRegister, bool isEnable)
130+
public static TSource Register<TSource>(this TSource source, TSource toRegister, bool isEnable) where TSource : Delegate
131131
```
132132
```csharp
133133
Action<int> action = x => results.Add(x * 2);
@@ -192,7 +192,7 @@ public static void SetPropertyValue(this object obj, string name, object value)
192192
```csharp
193193
class Sample
194194
{
195-
public string Name { get; set; }
195+
public string Name { get; private set; }
196196
}
197197

198198
var sample = new Sample();
@@ -203,7 +203,7 @@ sample.SetPropertyValue("Name", "New Value"); // 設定屬性值為 "New Value"
203203

204204
1. **GetName**
205205
```csharp
206-
public static string GetName<TEnum>(this TEnum source)
206+
public static string GetName<TEnum>(this TEnum source) where TEnum : Enum
207207
```
208208
```csharp
209209
enum Colors { Red, Green, Blue }

0 commit comments

Comments
 (0)