MainClass Class

The main class of SampleClassLibrary.
Public Class MainClass 
Implements IEnumerable(Of String), _ 
ISampleInterface
This language is not supported or no code example is available.
public class MainClass : IEnumerable<string>, 
ISampleInterface
This language is not supported or no code example is available.
type MainClass = class  
interface IEnumerable<string
interface ISampleInterface 
end
This language is not supported or no code example is available.
public ref class MainClass  : public IEnumerable<String^>^, 
public ISampleInterface^
This language is not supported or no code example is available.
JScript does not support generic types and methods.
This language is not supported or no code example is available.
Name Description
Public property Info Gets or sets information about this object.
Internal (Friend) property SelectedValue Gets the selected value.
Public property Text Our sample property.
Top
Methods
 
Name Description
Public method Static Equals(object, object) Determines whether the specified object instances are considered equal. (inherited from object).
Public method Equals(object) Determines whether the specified object is equal to the current object. (inherited from object).
Protected method ~Object() Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (inherited from object).
Public method GetEnumerator() Returns an enumerator that iterates through the collection.
Public method GetHashCode() Serves as the default hash function. (inherited from object).
Public method GetType() Gets the Type of the current instance. (inherited from object).
Protected method MemberwiseClone() Creates a shallow copy of the current object. (inherited from object).
Public method Method1(int) Our sample method.
Public method Method1(string) Sample method with one String argument.
Public method Method1<T>(int[], string) Sample generic method with two arguments.
Public method Static ReferenceEquals(object, object) Determines whether the specified object instances are the same instance. (inherited from object).
Public method ToString() Returns a string that represents the current object. (inherited from object).
Top
Name Description
Operator Static Addition Returns an instance whose Text property is a concatenation of Text properties of c1 and c2.
Top
Name Description
Public extension method AsPrettyString(this MainClass) An example of an extension method. Returns a human readable string representing an instance of MainClass. (Defined by HelperFunctions).
Top
Events
 
Name Description
Public event TextChanged Occurs when the Text property value has changed.
Top
Classes
 
Name Description
Public class NestedException Obsolete. This is our custom exception.
Top
Fields
 
Name Description
Public field CONSTANT_1 Sample constant #1.
Public field CONSTANT_2 Sample constant #2.
Public field Static EmptyInstance An instance with uninitialized property values.
Protected field InternalField An internal field with logical value.
Top
Remarks
 
Here we show how to use XML comments. As a thing of interest, this class has HelperFunctions.AsPrettyString extension method defined in HelperFunctions class.
SampleClassLibrary.MainClass

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Core

Supported in: 1.0, 1.1, 2.0

.NET Standard

Supported in: 2.0

Xamarin.Android

Supported in: 7.1

Portable Class Library

Supported in: Portable Class Library
Any static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

In this article

Definition