MyClass
Namespace: MyClassLib
My class.
public class MyClass : IMyInterface
Inheritance Object → MyClass
Implements IMyInterface
Remarks:
A remark.
Fields
myField
My field.
public int myField;
myProtectedField
My field.
protected int myProtectedField;
Properties
MyProperty
My property.
public string MyProperty { get; protected set; }
Property Value
String
The property value. Used by MyClass.DoGeneric<T>(T).
Example
This example assign "foo"
to MyProperty.
foo.MyProperty = "foo";
MyNullableProperty
My nullable property
public Nullable<int> MyNullableProperty { get; set; }
Property Value
Nullable<Int32>
The nullable property value.
MyEnum
My enum
public MyEnum MyEnum { get; set; }
Property Value
MyEnum
The enum value
MyProtectedProperty
My property.
protected string MyProtectedProperty { get; set; }
Property Value
String
The property value. Used by .
MyProtectedEnum
My enum
protected MyEnum MyProtectedEnum { get; set; }
Property Value
MyEnum
The enum value
Constructors
MyClass()
Initializes a new instance of the MyClass class.
public MyClass()
Remarks:
See also MyClass.MyClass(String, Int32).
if (true)
{
var foo = new MyClass("foo", 1);
Console.WriteLine(foo.ToString());
}
- item 1 - The first item.
1
- item 2 - The second item.
2
MyClass(String, Int32)
Initializes a new instance of the MyClass class.
Use firstParam
and secondParam
.
public MyClass(string firstParam, int secondParam)
Parameters
firstParam
String
The first param.
secondParam
Int32
The second param.
MyClass(Int32)
Initializes a new instance of the MyClass class.
protected MyClass(int int)
Parameters
int
Int32
Methods
Do(String, Int32)
Do some thing.
public void Do(string firstParam, int secondParam)
Parameters
firstParam
String
The first param.
secondParam
Int32
The second param.
Exceptions
Exception
Thrown when…
DoGeneric<T>(T)
Do some thing.
public int DoGeneric<T>(T value)
Type Parameters
T
The type argument. Used by MyClass.DoGeneric<T>(T).
Parameters
value
T
The param. Used by MyClass.DoGeneric<T>(T).
Returns
Exceptions
ArgumentException
Thrown instead of Exception.
Get(List<String>)
Gets some thing.
public string Get(List<string> param)
Parameters
param
List<String>
The param.
Returns
String
An empty string.
Exceptions
Exception
Thrown when…
Example
This example call the Get
method.
var bar = foo.Get("bar");
StaticMethod()
A static method.
public static void StaticMethod()
ProtectedDo(String, Int32)
Do some thing.
protected void ProtectedDo(string firstParam, int secondParam)
Parameters
firstParam
String
The first param.
secondParam
Int32
The second param.
Exceptions
Exception
Thrown when…
ProtectedDoGeneric<T>(T)
Do some thing.
protected int ProtectedDoGeneric<T>(T value)
Type Parameters
T
The type argument. Used by .
Parameters
value
T
The param. Used by .
Returns
Exceptions
ArgumentException
Thrown instead of Exception.
ProtectedGet(List<String>)
Gets some thing.
protected string ProtectedGet(List<string> param)
Parameters
param
List<String>
The param.
Returns
String
An empty string.
Exceptions
Exception
Thrown when…
ProtectedStaticMethod()
A static method.
protected static void ProtectedStaticMethod()
Events
MyEvent
My event.
public event EventHandler<EventArgs> MyEvent;
MyProtectedEvent
My event.
protected event EventHandler<EventArgs> MyProtectedEvent;
Example
var foo = new MyClass("one", 2);
foo.Do("one", 2);