/
aprogrammer
/
dotnet-docs
Обзор
Документация
Войти
/
aprogrammer
/
dotnet-docs
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
samples/snippets/visualbasic/VS_Snippets_CLR/CodeDOM Class Sample/VB/SampleCode.vb
70 строк
2 KB
Andy De George
Move snippets from samples repo to this repo (#17296)
03 мар 2020, 19:23
Не верифицирован
03 мар 2020, 19:23
dbbeda1
Код
Авторство
О чём код?
'<Snippet99> '-------------------------------------------------------------------------- ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:2.0.50727.42 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '-------------------------------------------------------------------------- Option Strict Off Option Explicit On Namespace CodeDOMSample Public NotInheritable Class CodeDOMCreatedClass 'The width of the object. Private widthValue As Double 'The height of the object. Private heightValue As Double Public Sub New(ByVal width As Double, ByVal height As Double) MyBase.New Me.widthValue = width Me.heightValue = height End Sub 'The width property for the object. Public ReadOnly Property Width() As Double Get Return Me.widthValue End Get End Property 'The Height property for the object. Public ReadOnly Property Height() As Double Get Return Me.heightValue End Get End Property 'The Area property for the object. Public ReadOnly Property Area() As Double Get Return (Me.widthValue * Me.heightValue) End Get End Property Public Overrides Function ToString() As String Return String.Format("The object:"& _ Global.Microsoft.VisualBasic.ChrW(13)& _ Global.Microsoft.VisualBasic.ChrW(10)& _ " width = {0},"&Global.Microsoft.VisualBasic.ChrW(13)& _ Global.Microsoft.VisualBasic.ChrW(10)& _ " height = {1},"&Global.Microsoft.VisualBasic.ChrW(13)& _ Global.Microsoft.VisualBasic.ChrW(10)&" area = {2}", _ Me.Width, Me.Height, Me.Area) End Function Public Shared Sub Main() Dim testClass As CodeDOMCreatedClass = _ New CodeDOMCreatedClass(5.3, 6.9) System.Console.WriteLine(testClass.ToString) End Sub End Class End Namespace '</Snippet99>