mirror of https://github.com/icsharpcode/ILSpy.git
3 changed files with 83 additions and 0 deletions
@ -0,0 +1,50 @@
@@ -0,0 +1,50 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
|
||||
|
||||
using System; |
||||
using System.Text; |
||||
|
||||
public class PropertiesAndEvents |
||||
{ |
||||
public int Getter(StringBuilder b) |
||||
{ |
||||
return b.Length; |
||||
} |
||||
|
||||
public void Setter(StringBuilder b) |
||||
{ |
||||
b.Capacity = 100; |
||||
} |
||||
|
||||
public char IndexerGetter(StringBuilder b) |
||||
{ |
||||
return b[50]; |
||||
} |
||||
|
||||
public void IndexerSetter(StringBuilder b) |
||||
{ |
||||
b[42] = 'b'; |
||||
} |
||||
|
||||
public int AutomaticProperty { get; set; } |
||||
|
||||
public int CustomProperty { |
||||
get { |
||||
return this.AutomaticProperty; |
||||
} |
||||
set { |
||||
this.AutomaticProperty = value; |
||||
} |
||||
} |
||||
|
||||
public event EventHandler AutomaticEvent; |
||||
|
||||
public event EventHandler CustomEvent { |
||||
add { |
||||
this.AutomaticEvent += value; |
||||
} |
||||
remove { |
||||
this.AutomaticEvent -= value; |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue