diff --git a/snippets/cpp/VS_Snippets_CLR/CodeArgumentReferenceExpressionExample/CPP/codeargumentreferenceexpressionexample.cpp b/snippets/cpp/VS_Snippets_CLR/CodeArgumentReferenceExpressionExample/CPP/codeargumentreferenceexpressionexample.cpp
deleted file mode 100644
index cafb9d2dab4..00000000000
--- a/snippets/cpp/VS_Snippets_CLR/CodeArgumentReferenceExpressionExample/CPP/codeargumentreferenceexpressionexample.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::CodeDom;
-
-namespace CodeDomSamples
-{
- public ref class CodeArgumentReferenceExpressionExample
- {
- public:
- CodeArgumentReferenceExpressionExample()
- {
-
- //
- // Declare a method that accepts a string parameter named text.
- CodeMemberMethod^ cmm = gcnew CodeMemberMethod;
- cmm->Parameters->Add( gcnew CodeParameterDeclarationExpression( "String","text" ) );
- cmm->Name = "WriteString";
- cmm->ReturnType = gcnew CodeTypeReference( "System::Void" );
- array^ce = {gcnew CodeArgumentReferenceExpression( "test1" )};
-
- // Create a method invoke statement to output the string passed to the method.
- CodeMethodInvokeExpression^ cmie = gcnew CodeMethodInvokeExpression( gcnew CodeTypeReferenceExpression( "Console" ),"WriteLine",ce );
-
- // Add the method invoke expression to the method's statements collection.
- cmm->Statements->Add( cmie );
-
- // A C++ code generator produces the following source code for the preceeding example code:
- // private:
- // void WriteString(String text) {
- // Console::WriteLine(text);
- // }
- //
- }
-
- };
-
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_CLR/CodeArrayCreateExpressionSnippet/CPP/codearraycreateexpressionsnippet.cpp b/snippets/cpp/VS_Snippets_CLR/CodeArrayCreateExpressionSnippet/CPP/codearraycreateexpressionsnippet.cpp
deleted file mode 100644
index ba586aa0cf3..00000000000
--- a/snippets/cpp/VS_Snippets_CLR/CodeArrayCreateExpressionSnippet/CPP/codearraycreateexpressionsnippet.cpp
+++ /dev/null
@@ -1,289 +0,0 @@
-//
-#using
-#using
-#using
-#using
-#using
-
-using namespace System;
-using namespace System::CodeDom;
-using namespace System::CodeDom::Compiler;
-using namespace System::Drawing;
-using namespace System::Collections;
-using namespace System::ComponentModel;
-using namespace System::Windows::Forms;
-using namespace System::Data;
-using namespace System::IO;
-using namespace Microsoft::CSharp;
-using namespace Microsoft::VisualBasic;
-using namespace Microsoft::JScript;
-
-///
-/// Provides a wrapper for CodeDOM samples.
-///
-public ref class Form1: public System::Windows::Forms::Form
-{
-private:
- System::CodeDom::CodeCompileUnit^ cu;
- System::Windows::Forms::TextBox^ textBox1;
- System::Windows::Forms::Button^ button1;
- System::Windows::Forms::Button^ button2;
- System::Windows::Forms::GroupBox^ groupBox1;
- System::Windows::Forms::RadioButton^ radioButton1;
- System::Windows::Forms::RadioButton^ radioButton2;
- System::Windows::Forms::RadioButton^ radioButton3;
- int language;
- System::ComponentModel::Container^ components;
-
-public:
- Form1()
- {
- language = 1; // 1 = Csharp 2 = VB 3 = JScript
- components = nullptr;
- InitializeComponent();
- cu = CreateGraph();
- }
-
- //
-public:
- CodeCompileUnit^ CreateGraph()
- {
- // Create a compile unit to contain a CodeDOM graph
- CodeCompileUnit^ cu = gcnew CodeCompileUnit;
-
- // Create a namespace named "TestSpace"
- CodeNamespace^ cn = gcnew CodeNamespace( "TestSpace" );
-
- // Create a new type named "TestClass"
- CodeTypeDeclaration^ cd = gcnew CodeTypeDeclaration( "TestClass" );
-
- // Create a new entry point method
- CodeEntryPointMethod^ cm = gcnew CodeEntryPointMethod;
-
- //
- // Create an initialization expression for a new array of type Int32 with 10 indices
- CodeArrayCreateExpression^ ca1 = gcnew CodeArrayCreateExpression( "System.Int32",10 );
-
- // Declare an array of type Int32, using the CodeArrayCreateExpression ca1 as the initialization expression
- CodeVariableDeclarationStatement^ cv1 = gcnew CodeVariableDeclarationStatement( "System.Int32[]","x",ca1 );
-
- // A C# code generator produces the following source code for the preceeding example code:
- // int[] x = new int[10];
- //
-
- // Add the variable declaration and initialization statement to the entry point method
- cm->Statements->Add( cv1 );
-
- // Add the entry point method to the "TestClass" type
- cd->Members->Add( cm );
-
- // Add the "TestClass" type to the namespace
- cn->Types->Add( cd );
-
- // Add the "TestSpace" namespace to the compile unit
- cu->Namespaces->Add( cn );
- return cu;
- }
- //
-
-private:
- void OutputGraph()
- {
- // Create string writer to output to textbox
- StringWriter^ sw = gcnew StringWriter;
-
- // Create appropriate CodeProvider
- System::CodeDom::Compiler::CodeDomProvider^ cp;
- switch ( language )
- {
- case 2:
- // VB
- cp = CodeDomProvider::CreateProvider("VisualBasic");
- break;
-
- case 3:
- // JScript
- cp = CodeDomProvider::CreateProvider("JScript");
- break;
-
- default:
- // CSharp
- cp = CodeDomProvider::CreateProvider("CSharp");
- break;
- }
-
- // Create a code generator that will output to the string writer
- ICodeGenerator^ cg = cp->CreateGenerator( sw );
-
- // Generate code from the compile unit and outputs it to the string writer
- cg->GenerateCodeFromCompileUnit( cu, sw, gcnew CodeGeneratorOptions );
-
- // Output the contents of the string writer to the textbox
- this->textBox1->Text = sw->ToString();
- }
-
-public:
- ~Form1()
- {
- if ( components != nullptr )
- {
- delete components;
- }
- }
-
-private:
-
- ///
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- ///
- void InitializeComponent()
- {
- this->textBox1 = gcnew System::Windows::Forms::TextBox;
- this->button1 = gcnew System::Windows::Forms::Button;
- this->button2 = gcnew System::Windows::Forms::Button;
- this->groupBox1 = gcnew System::Windows::Forms::GroupBox;
- this->radioButton1 = gcnew System::Windows::Forms::RadioButton;
- this->radioButton2 = gcnew System::Windows::Forms::RadioButton;
- this->radioButton3 = gcnew System::Windows::Forms::RadioButton;
- this->groupBox1->SuspendLayout();
- this->SuspendLayout();
-
- //
- // textBox1
- //
- this->textBox1->Location = System::Drawing::Point( 16, 112 );
- this->textBox1->Multiline = true;
- this->textBox1->Name = "textBox1";
- this->textBox1->ScrollBars = System::Windows::Forms::ScrollBars::Both;
- this->textBox1->Size = System::Drawing::Size( 664, 248 );
- this->textBox1->TabIndex = 0;
- this->textBox1->Text = "";
- this->textBox1->WordWrap = false;
-
- //
- // button1
- //
- this->button1->BackColor = System::Drawing::Color::Aquamarine;
- this->button1->Location = System::Drawing::Point( 16, 16 );
- this->button1->Name = "button1";
- this->button1->TabIndex = 1;
- this->button1->Text = "Generate";
- this->button1->Click += gcnew System::EventHandler( this, &Form1::button1_Click );
-
- //
- // button2
- //
- this->button2->BackColor = System::Drawing::Color::MediumTurquoise;
- this->button2->Location = System::Drawing::Point( 112, 16 );
- this->button2->Name = "button2";
- this->button2->TabIndex = 2;
- this->button2->Text = "Show Code";
- this->button2->Click += gcnew System::EventHandler( this, &Form1::button2_Click );
-
- //
- // groupBox1
- //
- array^temp0 = {this->radioButton3,this->radioButton2,this->radioButton1};
- this->groupBox1->Controls->AddRange( temp0 );
- this->groupBox1->Location = System::Drawing::Point( 16, 48 );
- this->groupBox1->Name = "groupBox1";
- this->groupBox1->Size = System::Drawing::Size( 384, 56 );
- this->groupBox1->TabIndex = 3;
- this->groupBox1->TabStop = false;
- this->groupBox1->Text = "Language selection";
-
- //
- // radioButton1
- //
- this->radioButton1->Checked = true;
- this->radioButton1->Location = System::Drawing::Point( 16, 24 );
- this->radioButton1->Name = "radioButton1";
- this->radioButton1->TabIndex = 0;
- this->radioButton1->TabStop = true;
- this->radioButton1->Text = "CSharp";
- this->radioButton1->Click += gcnew System::EventHandler( this, &Form1::radioButton1_CheckedChanged );
-
- //
- // radioButton2
- //
- this->radioButton2->Location = System::Drawing::Point( 144, 24 );
- this->radioButton2->Name = "radioButton2";
- this->radioButton2->TabIndex = 1;
- this->radioButton2->Text = "Visual Basic";
- this->radioButton2->Click += gcnew System::EventHandler( this, &Form1::radioButton2_CheckedChanged );
-
- //
- // radioButton3
- //
- this->radioButton3->Location = System::Drawing::Point( 272, 24 );
- this->radioButton3->Name = "radioButton3";
- this->radioButton3->TabIndex = 2;
- this->radioButton3->Text = "JScript";
- this->radioButton3->Click += gcnew System::EventHandler( this, &Form1::radioButton3_CheckedChanged );
-
- //
- // Form1
- //
- this->AutoScaleBaseSize = System::Drawing::Size( 5, 13 );
- this->ClientSize = System::Drawing::Size( 714, 367 );
- array^temp1 = {this->groupBox1,this->button2,this->button1,this->textBox1};
- this->Controls->AddRange( temp1 );
- this->Name = "Form1";
- this->Text = "CodeDOM Samples Framework";
- this->groupBox1->ResumeLayout( false );
- this->ResumeLayout( false );
- }
-
- void ShowCode()
- {
- this->textBox1->Text = "";
- }
-
- // Show code button
- void button2_Click( Object^ /*sender*/, System::EventArgs^ /*e*/ )
- {
- ShowCode();
- }
-
- // Generate and show code button
- void button1_Click( Object^ /*sender*/, System::EventArgs^ /*e*/ )
- {
- OutputGraph();
- }
-
- // Csharp language selection button
- void radioButton1_CheckedChanged( Object^ /*sender*/, System::EventArgs^ /*e*/ )
- {
- radioButton1->Checked = true;
- radioButton2->Checked = false;
- radioButton3->Checked = false;
- language = 1;
- }
-
- // Visual Basic language selection button
- void radioButton2_CheckedChanged( Object^ /*sender*/, System::EventArgs^ /*e*/ )
- {
- radioButton1->Checked = false;
- radioButton2->Checked = true;
- radioButton3->Checked = false;
- language = 2;
- }
-
- // JScript language selection button
- void radioButton3_CheckedChanged( Object^ /*sender*/, System::EventArgs^ /*e*/ )
- {
- radioButton1->Checked = false;
- radioButton2->Checked = false;
- radioButton3->Checked = true;
- language = 3;
- }
-
-};
-
-[STAThread]
-int main()
-{
- Application::Run( gcnew Form1 );
-}
-//
diff --git a/snippets/cpp/VS_Snippets_CLR/CodeArrayIndexerExpressionSnippet/CPP/codearrayindexerexpressionsnippet.cpp b/snippets/cpp/VS_Snippets_CLR/CodeArrayIndexerExpressionSnippet/CPP/codearrayindexerexpressionsnippet.cpp
deleted file mode 100644
index e565079d0a3..00000000000
--- a/snippets/cpp/VS_Snippets_CLR/CodeArrayIndexerExpressionSnippet/CPP/codearrayindexerexpressionsnippet.cpp
+++ /dev/null
@@ -1,301 +0,0 @@
-//
-#using
-#using
-#using
-#using
-#using
-
-using namespace System;
-using namespace System::CodeDom;
-using namespace System::CodeDom::Compiler;
-using namespace System::Drawing;
-using namespace System::Collections;
-using namespace System::ComponentModel;
-using namespace System::Windows::Forms;
-using namespace System::Data;
-using namespace System::IO;
-using namespace Microsoft::CSharp;
-using namespace Microsoft::VisualBasic;
-using namespace Microsoft::JScript;
-
-///
-/// Provides a wrapper for CodeDOM samples.
-///
-public ref class Form1: public System::Windows::Forms::Form
-{
-private:
- System::CodeDom::CodeCompileUnit^ cu;
- System::Windows::Forms::TextBox^ textBox1;
- System::Windows::Forms::Button^ button1;
- System::Windows::Forms::Button^ button2;
- System::Windows::Forms::GroupBox^ groupBox1;
- System::Windows::Forms::RadioButton^ radioButton1;
- System::Windows::Forms::RadioButton^ radioButton2;
- System::Windows::Forms::RadioButton^ radioButton3;
- int language;
- System::ComponentModel::Container^ components;
-
-public:
- Form1()
- {
- language = 1; // 1 = Csharp 2 = VB 3 = JScript
- components = nullptr;
- InitializeComponent();
- cu = CreateGraph();
- }
-
- //
-public:
- CodeCompileUnit^ CreateGraph()
- {
- // Create a compile unit to contain a CodeDOM graph
- CodeCompileUnit^ cu = gcnew CodeCompileUnit;
-
- // Create a namespace named "TestSpace"
- CodeNamespace^ cn = gcnew CodeNamespace( "TestSpace" );
-
- // Create a new type named "TestClass"
- CodeTypeDeclaration^ cd = gcnew CodeTypeDeclaration( "TestClass" );
-
- // Create an entry point method
- CodeEntryPointMethod^ cm = gcnew CodeEntryPointMethod;
-
- // Create the initialization expression for an array of type Int32 with 10 indices
- CodeArrayCreateExpression^ ca1 = gcnew CodeArrayCreateExpression( "System.Int32",10 );
-
- // Declare an array of type Int32, using the CodeArrayCreateExpression ca1 as the initialization expression
- CodeVariableDeclarationStatement^ cv1 = gcnew CodeVariableDeclarationStatement( "System.Int32[]","x",ca1 );
-
- // Add the array declaration and initialization statement to the entry point method class member
- cm->Statements->Add( cv1 );
- //
-
- // Create an array indexer expression that references index 5 of array "x"
- array^temp = {gcnew CodePrimitiveExpression( 5 )};
- CodeArrayIndexerExpression^ ci1 = gcnew CodeArrayIndexerExpression( gcnew CodeVariableReferenceExpression( "x" ),temp );
-
- // A C# code generator produces the following source code for the preceeding example code:
- // x[5]
- //
- // Declare a variable of type Int32 and adds it to the entry point method
- CodeVariableDeclarationStatement^ cv2 = gcnew CodeVariableDeclarationStatement( "System.Int32","y" );
- cm->Statements->Add( cv2 );
-
- // Assign the value of the array indexer ci1 to variable "y"
- CodeAssignStatement^ as1 = gcnew CodeAssignStatement( gcnew CodeVariableReferenceExpression( "y" ),ci1 );
-
- // Add the assignment statement to the entry point method
- cm->Statements->Add( as1 );
-
- // Add the entry point method to the "TestClass" type
- cd->Members->Add( cm );
-
- // Add the "TestClass" type to the namespace
- cn->Types->Add( cd );
-
- // Add the "TestSpace" namespace to the compile unit
- cu->Namespaces->Add( cn );
- return cu;
- }
- //
-
-private:
- void OutputGraph()
- {
- // Create string writer to output to textbox
- StringWriter^ sw = gcnew StringWriter;
-
- // Create appropriate CodeProvider
- System::CodeDom::Compiler::CodeDomProvider^ cp;
- switch ( language )
- {
- case 2:
- // VB
- cp = CodeDomProvider::CreateProvider("VisualBasic");
- break;
-
- case 3:
- // JScript
- cp = CodeDomProvider::CreateProvider("JScript");
- break;
-
- default:
- // CSharp
- cp = CodeDomProvider::CreateProvider("CSharp");
- break;
- }
-
- // Create a code generator that will output to the string writer
- ICodeGenerator^ cg = cp->CreateGenerator( sw );
-
- // Generate code from the compile unit and outputs it to the string writer
- cg->GenerateCodeFromCompileUnit( cu, sw, gcnew CodeGeneratorOptions );
-
- // Output the contents of the string writer to the textbox
- this->textBox1->Text = sw->ToString();
- }
-
-public:
- ~Form1()
- {
- if ( components != nullptr )
- {
- delete components;
- }
- }
-
-private:
-
- ///
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- ///
- void InitializeComponent()
- {
- this->textBox1 = gcnew System::Windows::Forms::TextBox;
- this->button1 = gcnew System::Windows::Forms::Button;
- this->button2 = gcnew System::Windows::Forms::Button;
- this->groupBox1 = gcnew System::Windows::Forms::GroupBox;
- this->radioButton1 = gcnew System::Windows::Forms::RadioButton;
- this->radioButton2 = gcnew System::Windows::Forms::RadioButton;
- this->radioButton3 = gcnew System::Windows::Forms::RadioButton;
- this->groupBox1->SuspendLayout();
- this->SuspendLayout();
-
- //
- // textBox1
- //
- this->textBox1->Location = System::Drawing::Point( 16, 112 );
- this->textBox1->Multiline = true;
- this->textBox1->Name = "textBox1";
- this->textBox1->ScrollBars = System::Windows::Forms::ScrollBars::Both;
- this->textBox1->Size = System::Drawing::Size( 664, 248 );
- this->textBox1->TabIndex = 0;
- this->textBox1->Text = "";
- this->textBox1->WordWrap = false;
-
- //
- // button1
- //
- this->button1->BackColor = System::Drawing::Color::Aquamarine;
- this->button1->Location = System::Drawing::Point( 16, 16 );
- this->button1->Name = "button1";
- this->button1->TabIndex = 1;
- this->button1->Text = "Generate";
- this->button1->Click += gcnew System::EventHandler( this, &Form1::button1_Click );
-
- //
- // button2
- //
- this->button2->BackColor = System::Drawing::Color::MediumTurquoise;
- this->button2->Location = System::Drawing::Point( 112, 16 );
- this->button2->Name = "button2";
- this->button2->TabIndex = 2;
- this->button2->Text = "Show Code";
- this->button2->Click += gcnew System::EventHandler( this, &Form1::button2_Click );
-
- //
- // groupBox1
- //
- array^temp2 = {this->radioButton3,this->radioButton2,this->radioButton1};
- this->groupBox1->Controls->AddRange( temp2 );
- this->groupBox1->Location = System::Drawing::Point( 16, 48 );
- this->groupBox1->Name = "groupBox1";
- this->groupBox1->Size = System::Drawing::Size( 384, 56 );
- this->groupBox1->TabIndex = 3;
- this->groupBox1->TabStop = false;
- this->groupBox1->Text = "Language selection";
-
- //
- // radioButton1
- //
- this->radioButton1->Checked = true;
- this->radioButton1->Location = System::Drawing::Point( 16, 24 );
- this->radioButton1->Name = "radioButton1";
- this->radioButton1->TabIndex = 0;
- this->radioButton1->TabStop = true;
- this->radioButton1->Text = "CSharp";
- this->radioButton1->Click += gcnew System::EventHandler( this, &Form1::radioButton1_CheckedChanged );
-
- //
- // radioButton2
- //
- this->radioButton2->Location = System::Drawing::Point( 144, 24 );
- this->radioButton2->Name = "radioButton2";
- this->radioButton2->TabIndex = 1;
- this->radioButton2->Text = "Visual Basic";
- this->radioButton2->Click += gcnew System::EventHandler( this, &Form1::radioButton2_CheckedChanged );
-
- //
- // radioButton3
- //
- this->radioButton3->Location = System::Drawing::Point( 272, 24 );
- this->radioButton3->Name = "radioButton3";
- this->radioButton3->TabIndex = 2;
- this->radioButton3->Text = "JScript";
- this->radioButton3->Click += gcnew System::EventHandler( this, &Form1::radioButton3_CheckedChanged );
-
- //
- // Form1
- //
- this->AutoScaleBaseSize = System::Drawing::Size( 5, 13 );
- this->ClientSize = System::Drawing::Size( 714, 367 );
- array^temp3 = {this->groupBox1,this->button2,this->button1,this->textBox1};
- this->Controls->AddRange( temp3 );
- this->Name = "Form1";
- this->Text = "CodeDOM Samples Framework";
- this->groupBox1->ResumeLayout( false );
- this->ResumeLayout( false );
- }
-
- void ShowCode()
- {
- this->textBox1->Text = "";
- }
-
- // Show code button
- void button2_Click( Object^ /*sender*/, System::EventArgs^ /*e*/ )
- {
- ShowCode();
- }
-
- // Generate and show code button
- void button1_Click( Object^ /*sender*/, System::EventArgs^ /*e*/ )
- {
- OutputGraph();
- }
-
- // Csharp language selection button
- void radioButton1_CheckedChanged( Object^ /*sender*/, System::EventArgs^ /*e*/ )
- {
- radioButton1->Checked = true;
- radioButton2->Checked = false;
- radioButton3->Checked = false;
- language = 1;
- }
-
- // Visual Basic language selection button
- void radioButton2_CheckedChanged( Object^ /*sender*/, System::EventArgs^ /*e*/ )
- {
- radioButton1->Checked = false;
- radioButton2->Checked = true;
- radioButton3->Checked = false;
- language = 2;
- }
-
- // JScript language selection button
- void radioButton3_CheckedChanged( Object^ /*sender*/, System::EventArgs^ /*e*/ )
- {
- radioButton1->Checked = false;
- radioButton2->Checked = false;
- radioButton3->Checked = true;
- language = 3;
- }
-};
-
-[STAThread]
-int main()
-{
- Application::Run( gcnew Form1 );
-}
-//
diff --git a/snippets/cpp/VS_Snippets_CLR/CodeAssignStatement/CPP/codeassignstatementsnippet.cpp b/snippets/cpp/VS_Snippets_CLR/CodeAssignStatement/CPP/codeassignstatementsnippet.cpp
deleted file mode 100644
index a94dc0b0c36..00000000000
--- a/snippets/cpp/VS_Snippets_CLR/CodeAssignStatement/CPP/codeassignstatementsnippet.cpp
+++ /dev/null
@@ -1,289 +0,0 @@
-//
-#using
-#using
-#using
-#using
-#using
-
-using namespace System;
-using namespace System::CodeDom;
-using namespace System::CodeDom::Compiler;
-using namespace System::Drawing;
-using namespace System::Collections;
-using namespace System::ComponentModel;
-using namespace System::Windows::Forms;
-using namespace System::Data;
-using namespace System::IO;
-using namespace Microsoft::CSharp;
-using namespace Microsoft::VisualBasic;
-using namespace Microsoft::JScript;
-
-///
-/// Provides a wrapper for CodeDOM samples.
-///
-public ref class Form1: public System::Windows::Forms::Form
-{
-private:
- System::CodeDom::CodeCompileUnit^ cu;
- System::Windows::Forms::TextBox^ textBox1;
- System::Windows::Forms::Button^ button1;
- System::Windows::Forms::Button^ button2;
- System::Windows::Forms::GroupBox^ groupBox1;
- System::Windows::Forms::RadioButton^ radioButton1;
- System::Windows::Forms::RadioButton^ radioButton2;
- System::Windows::Forms::RadioButton^ radioButton3;
- int language;
- System::ComponentModel::Container^ components;
-
-public:
- Form1()
- {
- language = 1; // 1 = Csharp 2 = VB 3 = JScript
- components = nullptr;
- InitializeComponent();
- cu = CreateGraph();
- }
-
- //
- CodeCompileUnit^ CreateGraph()
- {
- // Create a compile unit to contain a CodeDOM graph
- CodeCompileUnit^ cu = gcnew CodeCompileUnit;
-
- // Create a namespace named "TestSpace"
- CodeNamespace^ cn = gcnew CodeNamespace( "TestSpace" );
-
- // Create a new type named "TestClass"
- CodeTypeDeclaration^ cd = gcnew CodeTypeDeclaration( "TestClass" );
-
- // Create a new entry point method
- CodeEntryPointMethod^ cm = gcnew CodeEntryPointMethod;
-
- // Declare a variable of type Int32 named "i"
- CodeVariableDeclarationStatement^ cv1 = gcnew CodeVariableDeclarationStatement( "System.Int32","i" );
-
- // Add the variable declaration statement to the entry point method
- cm->Statements->Add( cv1 );
-
- //
- // Assigns the value of the 10 to the integer variable "i".
- CodeAssignStatement^ as1 = gcnew CodeAssignStatement( gcnew CodeVariableReferenceExpression( "i" ),gcnew CodePrimitiveExpression( 10 ) );
-
- // A C# code generator produces the following source code for the preceeding example code:
- // i=10;
- //
- // Add the assignment statement to the entry point method
- cm->Statements->Add( as1 );
-
- // Add the entry point method to the "TestClass" type
- cd->Members->Add( cm );
-
- // Add the "TestClass" type to the namespace
- cn->Types->Add( cd );
-
- // Add the "TestSpace" namespace to the compile unit
- cu->Namespaces->Add( cn );
- return cu;
- }
- //
-
-private:
- void OutputGraph()
- {
- // Create string writer to output to textbox
- StringWriter^ sw = gcnew StringWriter;
-
- // Create appropriate CodeProvider
- System::CodeDom::Compiler::CodeDomProvider^ cp;
- switch ( language )
- {
- case 2:
- // VB
- cp = CodeDomProvider::CreateProvider("VisualBasic");
- break;
-
- case 3:
- // JScript
- cp = CodeDomProvider::CreateProvider("JScript");
- break;
-
- default:
- // CSharp
- cp = CodeDomProvider::CreateProvider("CSharp");
- break;
- }
-
- // Create a code generator that will output to the string writer
- ICodeGenerator^ cg = cp->CreateGenerator( sw );
-
- // Generate code from the compile unit and outputs it to the string writer
- cg->GenerateCodeFromCompileUnit( cu, sw, gcnew CodeGeneratorOptions );
-
- // Output the contents of the string writer to the textbox
- this->textBox1->Text = sw->ToString();
- }
-
-public:
- ~Form1()
- {
- if ( components != nullptr )
- {
- delete components;
- }
- }
-
-private:
-
- ///
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- ///
- void InitializeComponent()
- {
- this->textBox1 = gcnew System::Windows::Forms::TextBox;
- this->button1 = gcnew System::Windows::Forms::Button;
- this->button2 = gcnew System::Windows::Forms::Button;
- this->groupBox1 = gcnew System::Windows::Forms::GroupBox;
- this->radioButton1 = gcnew System::Windows::Forms::RadioButton;
- this->radioButton2 = gcnew System::Windows::Forms::RadioButton;
- this->radioButton3 = gcnew System::Windows::Forms::RadioButton;
- this->groupBox1->SuspendLayout();
- this->SuspendLayout();
-
- //
- // textBox1
- //
- this->textBox1->Location = System::Drawing::Point( 16, 112 );
- this->textBox1->Multiline = true;
- this->textBox1->Name = "textBox1";
- this->textBox1->ScrollBars = System::Windows::Forms::ScrollBars::Both;
- this->textBox1->Size = System::Drawing::Size( 664, 248 );
- this->textBox1->TabIndex = 0;
- this->textBox1->Text = "";
- this->textBox1->WordWrap = false;
-
- //
- // button1
- //
- this->button1->BackColor = System::Drawing::Color::Aquamarine;
- this->button1->Location = System::Drawing::Point( 16, 16 );
- this->button1->Name = "button1";
- this->button1->TabIndex = 1;
- this->button1->Text = "Generate";
- this->button1->Click += gcnew System::EventHandler( this, &Form1::button1_Click );
-
- //
- // button2
- //
- this->button2->BackColor = System::Drawing::Color::MediumTurquoise;
- this->button2->Location = System::Drawing::Point( 112, 16 );
- this->button2->Name = "button2";
- this->button2->TabIndex = 2;
- this->button2->Text = "Show Code";
- this->button2->Click += gcnew System::EventHandler( this, &Form1::button2_Click );
-
- //
- // groupBox1
- //
- array^temp0 = {this->radioButton3,this->radioButton2,this->radioButton1};
- this->groupBox1->Controls->AddRange( temp0 );
- this->groupBox1->Location = System::Drawing::Point( 16, 48 );
- this->groupBox1->Name = "groupBox1";
- this->groupBox1->Size = System::Drawing::Size( 384, 56 );
- this->groupBox1->TabIndex = 3;
- this->groupBox1->TabStop = false;
- this->groupBox1->Text = "Language selection";
-
- //
- // radioButton1
- //
- this->radioButton1->Checked = true;
- this->radioButton1->Location = System::Drawing::Point( 16, 24 );
- this->radioButton1->Name = "radioButton1";
- this->radioButton1->TabIndex = 0;
- this->radioButton1->TabStop = true;
- this->radioButton1->Text = "CSharp";
- this->radioButton1->Click += gcnew System::EventHandler( this, &Form1::radioButton1_CheckedChanged );
-
- //
- // radioButton2
- //
- this->radioButton2->Location = System::Drawing::Point( 144, 24 );
- this->radioButton2->Name = "radioButton2";
- this->radioButton2->TabIndex = 1;
- this->radioButton2->Text = "Visual Basic";
- this->radioButton2->Click += gcnew System::EventHandler( this, &Form1::radioButton2_CheckedChanged );
-
- //
- // radioButton3
- //
- this->radioButton3->Location = System::Drawing::Point( 272, 24 );
- this->radioButton3->Name = "radioButton3";
- this->radioButton3->TabIndex = 2;
- this->radioButton3->Text = "JScript";
- this->radioButton3->Click += gcnew System::EventHandler( this, &Form1::radioButton3_CheckedChanged );
-
- //
- // Form1
- //
- this->AutoScaleBaseSize = System::Drawing::Size( 5, 13 );
- this->ClientSize = System::Drawing::Size( 714, 367 );
- array^temp1 = {this->groupBox1,this->button2,this->button1,this->textBox1};
- this->Controls->AddRange( temp1 );
- this->Name = "Form1";
- this->Text = "CodeDOM Samples Framework";
- this->groupBox1->ResumeLayout( false );
- this->ResumeLayout( false );
- }
-
- void ShowCode()
- {
- this->textBox1->Text = "";
- }
-
- // Show code button
- void button2_Click( Object^ /*sender*/, System::EventArgs^ /*e*/ )
- {
- ShowCode();
- }
-
- // Generate and show code button
- void button1_Click( Object^ /*sender*/, System::EventArgs^ /*e*/ )
- {
- OutputGraph();
- }
-
- // Csharp language selection button
- void radioButton1_CheckedChanged( Object^ /*sender*/, System::EventArgs^ /*e*/ )
- {
- radioButton1->Checked = true;
- radioButton2->Checked = false;
- radioButton3->Checked = false;
- language = 1;
- }
-
- // Visual Basic language selection button
- void radioButton2_CheckedChanged( Object^ /*sender*/, System::EventArgs^ /*e*/ )
- {
- radioButton1->Checked = false;
- radioButton2->Checked = true;
- radioButton3->Checked = false;
- language = 2;
- }
-
- // JScript language selection button
- void radioButton3_CheckedChanged( Object^ /*sender*/, System::EventArgs^ /*e*/ )
- {
- radioButton1->Checked = false;
- radioButton2->Checked = false;
- radioButton3->Checked = true;
- language = 3;
- }
-};
-
-[STAThread]
-int main()
-{
- Application::Run( gcnew Form1 );
-}
-//
diff --git a/snippets/cpp/VS_Snippets_CLR/CodeAttachEventStatementExample/CPP/codeattacheventstatementexample.cpp b/snippets/cpp/VS_Snippets_CLR/CodeAttachEventStatementExample/CPP/codeattacheventstatementexample.cpp
deleted file mode 100644
index bf0e69c601b..00000000000
--- a/snippets/cpp/VS_Snippets_CLR/CodeAttachEventStatementExample/CPP/codeattacheventstatementexample.cpp
+++ /dev/null
@@ -1,81 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::CodeDom;
-
-namespace CodeDomSamples
-{
- public ref class CodeAttachEventStatementExample
- {
- public:
- CodeAttachEventStatementExample()
- {
-
- //
- // Declares a type to contain the delegate and constructor method.
- CodeTypeDeclaration^ type1 = gcnew CodeTypeDeclaration( "AttachEventTest" );
-
- // Declares an event that needs no custom event arguments class.
- CodeMemberEvent^ event1 = gcnew CodeMemberEvent;
- event1->Name = "TestEvent";
- event1->Type = gcnew CodeTypeReference( "System.EventHandler" );
-
- // Adds the event to the type members.
- type1->Members->Add( event1 );
-
- // Declares a method that matches the System.EventHandler method signature.
- CodeMemberMethod^ method1 = gcnew CodeMemberMethod;
- method1->Name = "TestMethod";
- method1->Parameters->Add( gcnew CodeParameterDeclarationExpression( "System.Object","sender" ) );
- method1->Parameters->Add( gcnew CodeParameterDeclarationExpression( "System.EventArgs","e" ) );
-
- // Adds the method to the type members.
- type1->Members->Add( method1 );
-
- // Defines a constructor that attaches a TestDelegate delegate pointing to
- // the TestMethod method to the TestEvent event.
- CodeConstructor^ constructor1 = gcnew CodeConstructor;
- constructor1->Attributes = MemberAttributes::Public;
-
- //
- // Defines a delegate creation expression that creates an EventHandler delegate pointing to a method named TestMethod.
- CodeDelegateCreateExpression^ createDelegate1 = gcnew CodeDelegateCreateExpression( gcnew CodeTypeReference( "System.EventHandler" ),gcnew CodeThisReferenceExpression,"TestMethod" );
-
- // Attaches an EventHandler delegate pointing to TestMethod to the TestEvent event.
- CodeAttachEventStatement^ attachStatement1 = gcnew CodeAttachEventStatement( gcnew CodeThisReferenceExpression,"TestEvent",createDelegate1 );
-
- // A C# code generator produces the following source code for the preceeding example code:
- // this.TestEvent += new System.EventHandler(this.TestMethod);
- //
- // Adds the constructor statements to the construtor.
- constructor1->Statements->Add( attachStatement1 );
-
- // Adds the construtor to the type members.
- type1->Members->Add( constructor1 );
-
- // A C# code generator produces the following source code for the preceeding example code:
- // public class AttachEventTest
- // {
- //
- // public AttachEventTest()
- // {
- // this.TestEvent += new System.EventHandler(this.TestMethod);
- // }
- //
- // private event System.EventHandler TestEvent;
- //
- // private void TestMethod(object sender, System.EventArgs e)
- // {
- // }
- // }
- //
- }
-
- };
-
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_CLR/CodeAttributeArgumentCollectionExample/CPP/class1.cpp b/snippets/cpp/VS_Snippets_CLR/CodeAttributeArgumentCollectionExample/CPP/class1.cpp
deleted file mode 100644
index 0e04788981c..00000000000
--- a/snippets/cpp/VS_Snippets_CLR/CodeAttributeArgumentCollectionExample/CPP/class1.cpp
+++ /dev/null
@@ -1,82 +0,0 @@
-#using
-
-using namespace System;
-using namespace System::CodeDom;
-using namespace System::CodeDom::Compiler;
-
-namespace CodeAttributeArgumentCollectionExample
-{
- public ref class Class1
- {
- public:
- Class1(){}
-
-
- // CodeAttributeArgumentCollection
- void CodeAttributeArgumentCollectionExample()
- {
-
- //
- //
- // Creates an empty CodeAttributeArgumentCollection.
- CodeAttributeArgumentCollection^ collection = gcnew CodeAttributeArgumentCollection;
- //
-
- //
- // Adds a CodeAttributeArgument to the collection.
- collection->Add( gcnew CodeAttributeArgument( "Test Boolean Argument",gcnew CodePrimitiveExpression( true ) ) );
- //
-
- //
- // Adds an array of CodeAttributeArgument objects to the collection.
- array^arguments = {gcnew CodeAttributeArgument,gcnew CodeAttributeArgument};
- collection->AddRange( arguments );
-
- // Adds a collection of CodeAttributeArgument objects to
- // the collection.
- CodeAttributeArgumentCollection^ argumentsCollection = gcnew CodeAttributeArgumentCollection;
- argumentsCollection->Add( gcnew CodeAttributeArgument( "TestBooleanArgument",gcnew CodePrimitiveExpression( true ) ) );
- argumentsCollection->Add( gcnew CodeAttributeArgument( "TestIntArgument",gcnew CodePrimitiveExpression( 1 ) ) );
- collection->AddRange( argumentsCollection );
- //
-
- //
- // Tests for the presence of a CodeAttributeArgument
- // within the collection, and retrieves its index if it is found.
- CodeAttributeArgument^ testArgument = gcnew CodeAttributeArgument( "Test Boolean Argument",gcnew CodePrimitiveExpression( true ) );
- int itemIndex = -1;
- if ( collection->Contains( testArgument ) )
- itemIndex = collection->IndexOf( testArgument );
- //
-
- //
- // Copies the contents of the collection beginning at index 0,
- // to the specified CodeAttributeArgument array.
- // 'arguments' is a CodeAttributeArgument array.
- collection->CopyTo( arguments, 0 );
- //
-
- //
- // Retrieves the count of the items in the collection.
- int collectionCount = collection->Count;
- //
-
- //
- // Inserts a CodeAttributeArgument at index 0 of the collection.
- collection->Insert( 0, gcnew CodeAttributeArgument( "Test Boolean Argument",gcnew CodePrimitiveExpression( true ) ) );
- //
-
- //
- // Removes the specified CodeAttributeArgument from the collection.
- CodeAttributeArgument^ argument = gcnew CodeAttributeArgument( "Test Boolean Argument",gcnew CodePrimitiveExpression( true ) );
- collection->Remove( argument );
- //
-
- //
- // Removes the CodeAttributeArgument at index 0.
- collection->RemoveAt( 0 );
- //
- //
- }
- };
-}
diff --git a/snippets/cpp/VS_Snippets_CLR/CodeAttributeDeclarationCollectionExample/CPP/class1.cpp b/snippets/cpp/VS_Snippets_CLR/CodeAttributeDeclarationCollectionExample/CPP/class1.cpp
deleted file mode 100644
index cfcbb80230e..00000000000
--- a/snippets/cpp/VS_Snippets_CLR/CodeAttributeDeclarationCollectionExample/CPP/class1.cpp
+++ /dev/null
@@ -1,90 +0,0 @@
-#using
-
-using namespace System;
-using namespace System::CodeDom;
-using namespace System::CodeDom::Compiler;
-using namespace System::Collections;
-
-namespace CodeAttributeDeclarationCollectionExample
-{
- public ref class Class1
- {
- public:
- Class1(){}
-
- // CodeAttributeDeclarationCollection
- void CodeAttributeDeclarationCollectionExample()
- {
-
- //
- //
- // Creates an empty CodeAttributeDeclarationCollection.
- CodeAttributeDeclarationCollection^ collection = gcnew CodeAttributeDeclarationCollection;
- //
-
- //
- // Adds a CodeAttributeDeclaration to the collection.
- array^temp = {gcnew CodeAttributeArgument( gcnew CodePrimitiveExpression( "Test Description" ) )};
- collection->Add( gcnew CodeAttributeDeclaration( "DescriptionAttribute",temp ) );
- //
-
- //
- // Adds an array of CodeAttributeDeclaration objects
- // to the collection.
- array^declarations = {gcnew CodeAttributeDeclaration,gcnew CodeAttributeDeclaration};
- collection->AddRange( declarations );
-
- // Adds a collection of CodeAttributeDeclaration objects
- // to the collection.
- CodeAttributeDeclarationCollection^ declarationsCollection = gcnew CodeAttributeDeclarationCollection;
- array^temp1 = {gcnew CodeAttributeArgument( gcnew CodePrimitiveExpression( "Test Description" ) )};
- declarationsCollection->Add( gcnew CodeAttributeDeclaration( "DescriptionAttribute",temp1 ) );
- array^temp2 = {gcnew CodeAttributeArgument( gcnew CodePrimitiveExpression( true ) )};
- declarationsCollection->Add( gcnew CodeAttributeDeclaration( "BrowsableAttribute",temp2 ) );
- collection->AddRange( declarationsCollection );
- //
-
- //
- // Tests for the presence of a CodeAttributeDeclaration in
- // the collection, and retrieves its index if it is found.
- array^temp3 = {gcnew CodeAttributeArgument( gcnew CodePrimitiveExpression( "Test Description" ) )};
- CodeAttributeDeclaration^ testdeclaration = gcnew CodeAttributeDeclaration( "DescriptionAttribute",temp3 );
- int itemIndex = -1;
- if ( collection->Contains( testdeclaration ) )
- itemIndex = collection->IndexOf( testdeclaration );
- //
-
- //
- // Copies the contents of the collection, beginning at index 0,
- // to the specified CodeAttributeDeclaration array.
- // 'declarations' is a CodeAttributeDeclaration array.
- collection->CopyTo( declarations, 0 );
- //
-
- //
- // Retrieves the count of the items in the collection.
- int collectionCount = collection->Count;
- //
-
- //
- // Inserts a CodeAttributeDeclaration at index 0 of the collection.
- array^temp4 = {gcnew CodeAttributeArgument( gcnew CodePrimitiveExpression( "Test Description" ) )};
- collection->Insert( 0, gcnew CodeAttributeDeclaration( "DescriptionAttribute",temp4 ) );
- //
-
- //
- // Removes the specified CodeAttributeDeclaration from
- // the collection.
- array^temp5 = {gcnew CodeAttributeArgument( gcnew CodePrimitiveExpression( "Test Description" ) )};
- CodeAttributeDeclaration^ declaration = gcnew CodeAttributeDeclaration( "DescriptionAttribute",temp5 );
- collection->Remove( declaration );
- //
-
- //
- // Removes the CodeAttributeDeclaration at index 0.
- collection->RemoveAt( 0 );
- //
- //
- }
- };
-}
diff --git a/snippets/cpp/VS_Snippets_CLR/CodeBaseReferenceExpressionExample/CPP/codebasereferenceexpressionexample.cpp b/snippets/cpp/VS_Snippets_CLR/CodeBaseReferenceExpressionExample/CPP/codebasereferenceexpressionexample.cpp
deleted file mode 100644
index 636d5881825..00000000000
--- a/snippets/cpp/VS_Snippets_CLR/CodeBaseReferenceExpressionExample/CPP/codebasereferenceexpressionexample.cpp
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::CodeDom;
-public ref class CodeBaseReferenceExpressionExample
-{
-public:
- CodeBaseReferenceExpressionExample()
- {
-
- //
- // Example method invoke expression uses CodeBaseReferenceExpression to produce
- // a base.Dispose method call
- CodeMethodInvokeExpression^ methodInvokeExpression =
- gcnew CodeMethodInvokeExpression( // Creates a method invoke expression
- gcnew CodeBaseReferenceExpression, // targetObjectparameter can be a base class reference
- "Dispose",gcnew array{} ); // Method name and method parameter arguments
-
- // A C# code generator produces the following source code for the preceeding example code:
- // base.Dispose();
- //
- }
-
-};
-
-//
diff --git a/snippets/cpp/VS_Snippets_CLR/CodeBinaryOperatorExpression/CPP/codebinaryoperatorexpressionexample.cpp b/snippets/cpp/VS_Snippets_CLR/CodeBinaryOperatorExpression/CPP/codebinaryoperatorexpressionexample.cpp
deleted file mode 100644
index 5acadb676c2..00000000000
--- a/snippets/cpp/VS_Snippets_CLR/CodeBinaryOperatorExpression/CPP/codebinaryoperatorexpressionexample.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::CodeDom;
-
-namespace CodeDomSamples
-{
- public ref class CodeBinaryOperatorExpressionExample
- {
- public:
- CodeBinaryOperatorExpressionExample()
- {
-
- //
- // This CodeBinaryOperatorExpression represents the addition of 1 and 2.
-
- // Right operand.
- CodeBinaryOperatorExpression^ addMethod = gcnew CodeBinaryOperatorExpression( gcnew CodePrimitiveExpression( 1 ),CodeBinaryOperatorType::Add,gcnew CodePrimitiveExpression( 2 ) );
-
- // A C# code generator produces the following source code for the preceeding example code:
- // (1 + 2)
- //
- }
-
- };
-
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_CLR/CodeCastExpressionExample/CPP/codecastexpressionexample.cpp b/snippets/cpp/VS_Snippets_CLR/CodeCastExpressionExample/CPP/codecastexpressionexample.cpp
deleted file mode 100644
index 6bcd05541f1..00000000000
--- a/snippets/cpp/VS_Snippets_CLR/CodeCastExpressionExample/CPP/codecastexpressionexample.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::CodeDom;
-
-namespace CodeDomSamples
-{
- public ref class CodeCastExpressionExample
- {
- public:
- CodeCastExpressionExample()
- {
-
- //
- // This CodeCastExpression casts an Int32 of 1000 to an Int64.
-
- // targetType parameter indicating the target type of the cast.
- // The CodeExpression to cast, here an Int32 value of 1000.
- CodeCastExpression^ castExpression = gcnew CodeCastExpression( "System.Int64",gcnew CodePrimitiveExpression( 1000 ) );
-
- // A C# code generator produces the following source code for the preceeding example code:
- // ((long)(1000));
- //
- }
-
- };
-
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_CLR/CodeCatchClauseCollectionExample/CPP/class1.cpp b/snippets/cpp/VS_Snippets_CLR/CodeCatchClauseCollectionExample/CPP/class1.cpp
deleted file mode 100644
index b1f1d3cb90e..00000000000
--- a/snippets/cpp/VS_Snippets_CLR/CodeCatchClauseCollectionExample/CPP/class1.cpp
+++ /dev/null
@@ -1,78 +0,0 @@
-#using
-
-using namespace System;
-using namespace System::CodeDom;
-using namespace System::CodeDom::Compiler;
-
-namespace CodeCatchClauseCollectionExample
-{
- public ref class Class1
- {
- public:
- Class1(){}
-
- // CodeCatchClauseCollection
- void CodeCatchClauseCollectionExample()
- {
- //
- //
- // Creates an empty CodeCatchClauseCollection.
- CodeCatchClauseCollection^ collection = gcnew CodeCatchClauseCollection;
- //
-
- //
- // Adds a CodeCatchClause to the collection.
- collection->Add( gcnew CodeCatchClause( "e" ) );
- //
-
- //
- // Adds an array of CodeCatchClause objects to the collection.
- array^clauses = {gcnew CodeCatchClause,gcnew CodeCatchClause};
- collection->AddRange( clauses );
-
- // Adds a collection of CodeCatchClause objects to the collection.
- CodeCatchClauseCollection^ clausesCollection = gcnew CodeCatchClauseCollection;
- clausesCollection->Add( gcnew CodeCatchClause( "e",gcnew CodeTypeReference( System::ArgumentOutOfRangeException::typeid ) ) );
- clausesCollection->Add( gcnew CodeCatchClause( "e" ) );
- collection->AddRange( clausesCollection );
- //
-
- //
- // Tests for the presence of a CodeCatchClause in the
- // collection, and retrieves its index if it is found.
- CodeCatchClause^ testClause = gcnew CodeCatchClause( "e" );
- int itemIndex = -1;
- if ( collection->Contains( testClause ) )
- itemIndex = collection->IndexOf( testClause );
- //
-
- //
- // Copies the contents of the collection beginning at index 0 to the specified CodeCatchClause array.
- // 'clauses' is a CodeCatchClause array.
- collection->CopyTo( clauses, 0 );
- //
-
- //
- // Retrieves the count of the items in the collection.
- int collectionCount = collection->Count;
- //
-
- //
- // Inserts a CodeCatchClause at index 0 of the collection.
- collection->Insert( 0, gcnew CodeCatchClause( "e" ) );
- //
-
- //
- // Removes the specified CodeCatchClause from the collection.
- CodeCatchClause^ clause = gcnew CodeCatchClause( "e" );
- collection->Remove( clause );
- //
-
- //
- // Removes the CodeCatchClause at index 0.
- collection->RemoveAt( 0 );
- //
- //
- }
- };
-}
diff --git a/snippets/cpp/VS_Snippets_CLR/CodeCommentExample/CPP/codecommentexample.cpp b/snippets/cpp/VS_Snippets_CLR/CodeCommentExample/CPP/codecommentexample.cpp
deleted file mode 100644
index f4f7099d6a3..00000000000
--- a/snippets/cpp/VS_Snippets_CLR/CodeCommentExample/CPP/codecommentexample.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::CodeDom;
-
-namespace CodeDomSamples
-{
- public ref class CodeCommentExample
- {
- public:
- CodeCommentExample()
- {
-
- //
- // Create a CodeComment with some example comment text.
-
- // The text of the comment.
- // Whether the comment is a comment intended for documentation purposes.
- CodeComment^ comment = gcnew CodeComment( "This comment was generated from a System.CodeDom.CodeComment",false );
-
- // Create a CodeCommentStatement that contains the comment, in order
- // to add the comment to a CodeTypeDeclaration Members collection.
- CodeCommentStatement^ commentStatement = gcnew CodeCommentStatement( comment );
-
- // A C# code generator produces the following source code for the preceeding example code:
- // // This comment was generated from a System.CodeDom.CodeComment
- //
- }
-
- };
-
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_CLR/CodeCommentStatementCollectionExample/CPP/class1.cpp b/snippets/cpp/VS_Snippets_CLR/CodeCommentStatementCollectionExample/CPP/class1.cpp
deleted file mode 100644
index c779ba5e491..00000000000
--- a/snippets/cpp/VS_Snippets_CLR/CodeCommentStatementCollectionExample/CPP/class1.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-#using
-
-using namespace System;
-using namespace System::CodeDom;
-using namespace System::CodeDom::Compiler;
-
-namespace CodeCommentStatementCollectionExample
-{
- public ref class Class1
- {
- public:
- Class1(){}
-
- // CodeCommentStatementCollection
- void CodeCommentStatementCollectionExample()
- {
-
- //
- //
- // Creates an empty CodeCommentStatementCollection.
- CodeCommentStatementCollection^ collection = gcnew CodeCommentStatementCollection;
- //
-
- //
- // Adds a CodeCommentStatement to the collection.
- collection->Add( gcnew CodeCommentStatement( "Test comment" ) );
- //
-
- //
- // Adds an array of CodeCommentStatement objects to the collection.
- array^comments = {gcnew CodeCommentStatement( "Test comment" ),gcnew CodeCommentStatement( "Another test comment" )};
- collection->AddRange( comments );
-
- // Adds a collection of CodeCommentStatement objects to the collection.
- CodeCommentStatementCollection^ commentsCollection = gcnew CodeCommentStatementCollection;
- commentsCollection->Add( gcnew CodeCommentStatement( "Test comment" ) );
- commentsCollection->Add( gcnew CodeCommentStatement( "Another test comment" ) );
- collection->AddRange( commentsCollection );
- //
-
- //
- // Tests for the presence of a CodeCommentStatement in the
- // collection, and retrieves its index if it is found.
- CodeCommentStatement^ testComment = gcnew CodeCommentStatement( "Test comment" );
- int itemIndex = -1;
- if ( collection->Contains( testComment ) )
- itemIndex = collection->IndexOf( testComment );
- //
-
- //
- // Copies the contents of the collection, beginning at index 0,
- // to the specified CodeCommentStatement array.
- // 'comments' is a CodeCommentStatement array.
- collection->CopyTo( comments, 0 );
- //
-
- //
- // Retrieves the count of the items in the collection.
- int collectionCount = collection->Count;
- //
-
- //
- // Inserts a CodeCommentStatement at index 0 of the collection.
- collection->Insert( 0, gcnew CodeCommentStatement( "Test comment" ) );
- //
-
- //
- // Removes the specified CodeCommentStatement from the collection.
- CodeCommentStatement^ comment = gcnew CodeCommentStatement( "Test comment" );
- collection->Remove( comment );
- //
-
- //
- // Removes the CodeCommentStatement at index 0.
- collection->RemoveAt( 0 );
- //
- //
- }
- };
-}
diff --git a/snippets/cpp/VS_Snippets_CLR/CodeConditionStatementExample/CPP/codeconditionstatementexample.cpp b/snippets/cpp/VS_Snippets_CLR/CodeConditionStatementExample/CPP/codeconditionstatementexample.cpp
deleted file mode 100644
index 9209d6fd754..00000000000
--- a/snippets/cpp/VS_Snippets_CLR/CodeConditionStatementExample/CPP/codeconditionstatementexample.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::CodeDom;
-
-namespace CodeDomSamples
-{
- public ref class CodeConditionStatementExample
- {
- public:
- CodeConditionStatementExample()
- {
-
- //
- // Create a CodeConditionStatement that tests a boolean value named boolean.
- array^temp0 = {gcnew CodeCommentStatement( "If condition is true, execute these statements." )};
- array^temp1 = {gcnew CodeCommentStatement( "Else block. If condition is false, execute these statements." )};
-
- // The statements to execute if the condition evalues to false.
- CodeConditionStatement^ conditionalStatement = gcnew CodeConditionStatement( gcnew CodeVariableReferenceExpression( "boolean" ),temp0,temp1 );
-
- // A C# code generator produces the following source code for the preceeding example code:
- // if (boolean)
- // {
- // // If condition is true, execute these statements.
- // }
- // else {
- // // Else block. If condition is false, execute these statements.
- // }
- //
- }
-
- };
-
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_CLR/CodeConstructorExample/CPP/codeconstructorexample.cpp b/snippets/cpp/VS_Snippets_CLR/CodeConstructorExample/CPP/codeconstructorexample.cpp
deleted file mode 100644
index f222b742baf..00000000000
--- a/snippets/cpp/VS_Snippets_CLR/CodeConstructorExample/CPP/codeconstructorexample.cpp
+++ /dev/null
@@ -1,130 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::CodeDom;
-using namespace System::Reflection;
-
-namespace CodeDomSamples
-{
- public ref class CodeConstructorExample
- {
- public:
- CodeConstructorExample()
- {
-
- //
- // This example declares two types, one of which inherits from another,
- // and creates a set of different styles of constructors using CodeConstructor.
- // Creates a new CodeCompileUnit to contain the program graph.
- CodeCompileUnit^ CompileUnit = gcnew CodeCompileUnit;
-
- // Declares a new namespace object and names it.
- CodeNamespace^ Samples = gcnew CodeNamespace( "Samples" );
-
- // Adds the namespace object to the compile unit.
- CompileUnit->Namespaces->Add( Samples );
-
- // Adds a new namespace import for the System namespace.
- Samples->Imports->Add( gcnew CodeNamespaceImport( "System" ) );
-
- // Declares a new type and names it.
- CodeTypeDeclaration^ BaseType = gcnew CodeTypeDeclaration( "BaseType" );
-
- // Adds the new type to the namespace object's type collection.
- Samples->Types->Add( BaseType );
-
- // Declares a default constructor that takes no arguments.
- CodeConstructor^ defaultConstructor = gcnew CodeConstructor;
- defaultConstructor->Attributes = MemberAttributes::Public;
-
- // Adds the constructor to the Members collection of the BaseType.
- BaseType->Members->Add( defaultConstructor );
-
- // Declares a constructor that takes a string argument.
- CodeConstructor^ stringConstructor = gcnew CodeConstructor;
- stringConstructor->Attributes = MemberAttributes::Public;
-
- // Declares a parameter of type string named "TestStringParameter".
- stringConstructor->Parameters->Add( gcnew CodeParameterDeclarationExpression( "System.String","TestStringParameter" ) );
-
- // Adds the constructor to the Members collection of the BaseType.
- BaseType->Members->Add( stringConstructor );
-
- // Declares a type that derives from BaseType and names it.
- CodeTypeDeclaration^ DerivedType = gcnew CodeTypeDeclaration( "DerivedType" );
-
- // The DerivedType class inherits from the BaseType class.
- DerivedType->BaseTypes->Add( gcnew CodeTypeReference( "BaseType" ) );
-
- // Adds the new type to the namespace object's type collection.
- Samples->Types->Add( DerivedType );
-
- // Declare a constructor that takes a string argument and calls the base class constructor with it.
- CodeConstructor^ baseStringConstructor = gcnew CodeConstructor;
- baseStringConstructor->Attributes = MemberAttributes::Public;
-
- // Declares a parameter of type string named "TestStringParameter".
- baseStringConstructor->Parameters->Add( gcnew CodeParameterDeclarationExpression( "System.String","TestStringParameter" ) );
-
- // Calls a base class constructor with the TestStringParameter parameter.
- baseStringConstructor->BaseConstructorArgs->Add( gcnew CodeVariableReferenceExpression( "TestStringParameter" ) );
-
- // Adds the constructor to the Members collection of the DerivedType.
- DerivedType->Members->Add( baseStringConstructor );
-
- // Declares a constructor overload that calls another constructor for the type with a predefined argument.
- CodeConstructor^ overloadConstructor = gcnew CodeConstructor;
- overloadConstructor->Attributes = MemberAttributes::Public;
-
- // Sets the argument to pass to a base constructor method.
- overloadConstructor->ChainedConstructorArgs->Add( gcnew CodePrimitiveExpression( "Test" ) );
-
- // Adds the constructor to the Members collection of the DerivedType.
- DerivedType->Members->Add( overloadConstructor );
-
- // Declares a constructor overload that calls the default constructor for the type.
- CodeConstructor^ overloadConstructor2 = gcnew CodeConstructor;
- overloadConstructor2->Attributes = MemberAttributes::Public;
- overloadConstructor2->Parameters->Add( gcnew CodeParameterDeclarationExpression( "System.Int32","TestIntParameter" ) );
-
- // Sets the argument to pass to a base constructor method.
- overloadConstructor2->ChainedConstructorArgs->Add( gcnew CodeSnippetExpression( "" ) );
-
- // Adds the constructor to the Members collection of the DerivedType.
- DerivedType->Members->Add( overloadConstructor2 );
-
- // A C# code generator produces the following source code for the preceeding example code:
- // public class BaseType {
- //
- // public BaseType() {
- // }
- //
- // public BaseType(string TestStringParameter) {
- // }
- // }
- //
- // public class DerivedType : BaseType {
- //
- // public DerivedType(string TestStringParameter) :
- // base(TestStringParameter) {
- // }
- //
- // public DerivedType() :
- // this("Test") {
- // }
- //
- // public DerivedType(int TestIntParameter) :
- // this() {
- // }
- // }
- //
- }
-
- };
-
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_CLR/CodeDelegateInvokeExpressionExample/CPP/codedelegateinvokeexpressionexample.cpp b/snippets/cpp/VS_Snippets_CLR/CodeDelegateInvokeExpressionExample/CPP/codedelegateinvokeexpressionexample.cpp
deleted file mode 100644
index 7e7167c2f2c..00000000000
--- a/snippets/cpp/VS_Snippets_CLR/CodeDelegateInvokeExpressionExample/CPP/codedelegateinvokeexpressionexample.cpp
+++ /dev/null
@@ -1,98 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::CodeDom;
-
-namespace CodeDomSamples
-{
- public ref class CodeDelegateInvokeExpressionExample
- {
- public:
- CodeDelegateInvokeExpressionExample()
- {
-
- //
- // Declares a type to contain the delegate and constructor method.
- CodeTypeDeclaration^ type1 = gcnew CodeTypeDeclaration( "DelegateInvokeTest" );
-
- // Declares an event that accepts a custom delegate type of "TestDelegate".
- CodeMemberEvent^ event1 = gcnew CodeMemberEvent;
- event1->Name = "TestEvent";
- event1->Type = gcnew CodeTypeReference( "DelegateInvokeTest.TestDelegate" );
- type1->Members->Add( event1 );
-
- // Declares a delegate type called TestDelegate with an EventArgs parameter.
- CodeTypeDelegate^ delegate1 = gcnew CodeTypeDelegate( "TestDelegate" );
- delegate1->Parameters->Add( gcnew CodeParameterDeclarationExpression( "System.Object","sender" ) );
- delegate1->Parameters->Add( gcnew CodeParameterDeclarationExpression( "System.EventArgs","e" ) );
- type1->Members->Add( delegate1 );
-
- // Declares a method that matches the "TestDelegate" method signature.
- CodeMemberMethod^ method1 = gcnew CodeMemberMethod;
- method1->Name = "TestMethod";
- method1->Parameters->Add( gcnew CodeParameterDeclarationExpression( "System.Object","sender" ) );
- method1->Parameters->Add( gcnew CodeParameterDeclarationExpression( "System.EventArgs","e" ) );
- type1->Members->Add( method1 );
-
- // Defines a constructor that attaches a TestDelegate delegate pointing to the TestMethod method
- // to the TestEvent event.
- CodeConstructor^ constructor1 = gcnew CodeConstructor;
- constructor1->Attributes = MemberAttributes::Public;
- constructor1->Statements->Add( gcnew CodeCommentStatement( "Attaches a delegate to the TestEvent event." ) );
-
- // Creates and attaches a delegate to the TestEvent.
- CodeDelegateCreateExpression^ createDelegate1 = gcnew CodeDelegateCreateExpression( gcnew CodeTypeReference( "DelegateInvokeTest.TestDelegate" ),gcnew CodeThisReferenceExpression,"TestMethod" );
- CodeAttachEventStatement^ attachStatement1 = gcnew CodeAttachEventStatement( gcnew CodeThisReferenceExpression,"TestEvent",createDelegate1 );
- constructor1->Statements->Add( attachStatement1 );
- constructor1->Statements->Add( gcnew CodeCommentStatement( "Invokes the TestEvent event." ) );
-
- // Invokes the TestEvent.
- array^temp0 = {gcnew CodeThisReferenceExpression,gcnew CodeObjectCreateExpression( "System.EventArgs", nullptr )};
- CodeDelegateInvokeExpression^ invoke1 = gcnew CodeDelegateInvokeExpression( gcnew CodeEventReferenceExpression( gcnew CodeThisReferenceExpression,"TestEvent" ),temp0 );
- constructor1->Statements->Add( invoke1 );
- type1->Members->Add( constructor1 );
-
- // A C# code generator produces the following source code for the preceeding example code:
- // public class DelegateInvokeTest
- // {
- //
- // public DelegateInvokeTest()
- // {
- // // Attaches a delegate to the TestEvent event.
- // this.TestEvent += new DelegateInvokeTest.TestDelegate(this.TestMethod);
- // // Invokes the TestEvent event.
- // this.TestEvent(this, new System.EventArgs());
- // }
- //
- // private event DelegateInvokeTest.TestDelegate TestEvent;
- //
- // private void TestMethod(object sender, System.EventArgs e)
- // {
- // }
- //
- // public delegate void TestDelegate(object sender, System.EventArgs e);
- // }
- //
- }
-
- void DelegateInvokeOnlyType()
- {
-
- //
- // Invokes the delegates for an event named TestEvent, passing a local object reference and a new System.EventArgs.
- array^temp1 = {gcnew CodeThisReferenceExpression,gcnew CodeObjectCreateExpression( "System.EventArgs", nullptr )};
- CodeDelegateInvokeExpression^ invoke1 = gcnew CodeDelegateInvokeExpression( gcnew CodeEventReferenceExpression( gcnew CodeThisReferenceExpression,"TestEvent" ),temp1 );
-
- // A C# code generator produces the following source code for the preceeding example code:
- // this.TestEvent(this, new System.EventArgs());
- //
- }
-
- };
-
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_CLR/CodeDomExample/CPP/source.cpp b/snippets/cpp/VS_Snippets_CLR/CodeDomExample/CPP/source.cpp
deleted file mode 100644
index 2f548be0a78..00000000000
--- a/snippets/cpp/VS_Snippets_CLR/CodeDomExample/CPP/source.cpp
+++ /dev/null
@@ -1,309 +0,0 @@
-/*
-// CodeDOMExample_CPP.cpp : main project file.
-
-#include "stdafx.h"
-
-using namespace System;
-
-int main(array ^args)
-{
- Console::WriteLine(L"Hello World");
- return 0;
-}
-*/
-
-//
-#using
-#using
-#using
-#using
-
-using namespace System;
-using namespace System::CodeDom;
-using namespace System::CodeDom::Compiler;
-using namespace System::Collections;
-using namespace System::ComponentModel;
-using namespace System::Diagnostics;
-using namespace System::Drawing;
-using namespace System::IO;
-using namespace System::Windows::Forms;
-using namespace Microsoft::CSharp;
-using namespace Microsoft::VisualBasic;
-using namespace Microsoft::JScript;
-using namespace System::Security::Permissions;
-
-// This example demonstrates building a Hello World program graph
-// using System.CodeDom elements. It calls code generator and
-// code compiler methods to build the program using CSharp, VB, or
-// JScript. A Windows Forms interface is included. Note: Code
-// must be compiled and linked with the Microsoft.JScript assembly.
-namespace CodeDOMExample
-{
- [PermissionSet(SecurityAction::Demand, Name="FullTrust")]
- public ref class CodeDomExample
- {
- public:
- //
- // Build a Hello World program graph using
- // System::CodeDom types.
- static CodeCompileUnit^ BuildHelloWorldGraph()
- {
- // Create a new CodeCompileUnit to contain
- // the program graph.
- CodeCompileUnit^ compileUnit = gcnew CodeCompileUnit;
-
- // Declare a new namespace called Samples.
- CodeNamespace^ samples = gcnew CodeNamespace( "Samples" );
-
- // Add the new namespace to the compile unit.
- compileUnit->Namespaces->Add( samples );
-
- // Add the new namespace import for the System namespace.
- samples->Imports->Add( gcnew CodeNamespaceImport( "System" ) );
-
- // Declare a new type called Class1.
- CodeTypeDeclaration^ class1 = gcnew CodeTypeDeclaration( "Class1" );
-
- // Add the new type to the namespace's type collection.
- samples->Types->Add( class1 );
-
- // Declare a new code entry point method.
- CodeEntryPointMethod^ start = gcnew CodeEntryPointMethod;
-
- // Create a type reference for the System::Console class.
- CodeTypeReferenceExpression^ csSystemConsoleType = gcnew CodeTypeReferenceExpression( "System.Console" );
-
- // Build a Console::WriteLine statement.
- CodeMethodInvokeExpression^ cs1 = gcnew CodeMethodInvokeExpression( csSystemConsoleType,"WriteLine", gcnew CodePrimitiveExpression("Hello World!") );
-
- // Add the WriteLine call to the statement collection.
- start->Statements->Add( cs1 );
-
- // Build another Console::WriteLine statement.
- CodeMethodInvokeExpression^ cs2 = gcnew CodeMethodInvokeExpression( csSystemConsoleType,"WriteLine", gcnew CodePrimitiveExpression( "Press the Enter key to continue." ) );
-
- // Add the WriteLine call to the statement collection.
- start->Statements->Add( cs2 );
-
- // Build a call to System::Console::ReadLine.
- CodeMethodReferenceExpression^ csReadLine = gcnew CodeMethodReferenceExpression( csSystemConsoleType, "ReadLine" );
- CodeMethodInvokeExpression^ cs3 = gcnew CodeMethodInvokeExpression( csReadLine, gcnew array(0) );
-
- // Add the ReadLine statement.
- start->Statements->Add( cs3 );
-
- // Add the code entry point method to
- // the Members collection of the type.
- class1->Members->Add( start );
- return compileUnit;
- }
- //
-
- //
- static void GenerateCode( CodeDomProvider^ provider, CodeCompileUnit^ compileunit )
- {
- // Build the source file name with the appropriate
- // language extension.
- String^ sourceFile;
- if ( provider->FileExtension->StartsWith( "." ) )
- {
- sourceFile = String::Concat( "TestGraph", provider->FileExtension );
- }
- else
- {
- sourceFile = String::Concat( "TestGraph.", provider->FileExtension );
- }
-
- // Create an IndentedTextWriter, constructed with
- // a StreamWriter to the source file.
- IndentedTextWriter^ tw = gcnew IndentedTextWriter( gcnew StreamWriter( sourceFile,false )," " );
-
- // Generate source code using the code generator.
- provider->GenerateCodeFromCompileUnit( compileunit, tw, gcnew CodeGeneratorOptions );
-
- // Close the output file.
- tw->Close();
- }
- //
-
- //
- static CompilerResults^ CompileCode( CodeDomProvider^ provider, String^ sourceFile, String^ exeFile )
- {
- // Configure a CompilerParameters that links System.dll
- // and produces the specified executable file.
- array^referenceAssemblies = {"System.dll"};
- CompilerParameters^ cp = gcnew CompilerParameters( referenceAssemblies,exeFile,false );
-
- // Generate an executable rather than a DLL file.
- cp->GenerateExecutable = true;
-
- // Invoke compilation.
- CompilerResults^ cr = provider->CompileAssemblyFromFile( cp, sourceFile );
-
- // Return the results of compilation.
- return cr;
- }
- //
- };
-
- public ref class CodeDomExampleForm: public System::Windows::Forms::Form
- {
- private:
- static System::Windows::Forms::Button^ run_button = gcnew System::Windows::Forms::Button;
- static System::Windows::Forms::Button^ compile_button = gcnew System::Windows::Forms::Button;
- static System::Windows::Forms::Button^ generate_button = gcnew System::Windows::Forms::Button;
- static System::Windows::Forms::TextBox^ textBox1 = gcnew System::Windows::Forms::TextBox;
- static System::Windows::Forms::ComboBox^ comboBox1 = gcnew System::Windows::Forms::ComboBox;
- static System::Windows::Forms::Label^ label1 = gcnew System::Windows::Forms::Label;
- void generate_button_Click( Object^ /*sender*/, System::EventArgs^ /*e*/ )
- {
- CodeDomProvider^ provider = GetCurrentProvider();
- CodeDomExample::GenerateCode( provider, CodeDomExample::BuildHelloWorldGraph() );
-
- // Build the source file name with the appropriate
- // language extension.
- String^ sourceFile;
- if ( provider->FileExtension->StartsWith( "." ) )
- {
- sourceFile = String::Concat( "TestGraph", provider->FileExtension );
- }
- else
- {
- sourceFile = String::Concat( "TestGraph.", provider->FileExtension );
- }
-
-
- // Read in the generated source file and
- // display the source text.
- StreamReader^ sr = gcnew StreamReader( sourceFile );
- textBox1->Text = sr->ReadToEnd();
- sr->Close();
- }
-
- CodeDomProvider^ GetCurrentProvider()
- {
- CodeDomProvider^ provider;
- if ( String::Compare( dynamic_cast(this->comboBox1->SelectedItem), "CSharp" ) == 0 )
- provider = CodeDomProvider::CreateProvider("CSharp");
- else
- if ( String::Compare( dynamic_cast(this->comboBox1->SelectedItem), "Visual Basic" ) == 0 )
- provider = CodeDomProvider::CreateProvider("VisualBasic");
- else
- if ( String::Compare( dynamic_cast(this->comboBox1->SelectedItem), "JScript" ) == 0 )
- provider = CodeDomProvider::CreateProvider("JScript");
- else
- provider = CodeDomProvider::CreateProvider("CSharp");
-
- return provider;
- }
-
- void compile_button_Click( Object^ /*sender*/, System::EventArgs^ /*e*/ )
- {
- CodeDomProvider^ provider = GetCurrentProvider();
-
- // Build the source file name with the appropriate
- // language extension.
- String^ sourceFile = String::Concat( "TestGraph.", provider->FileExtension );
-
- // Compile the source file into an executable output file.
- CompilerResults^ cr = CodeDomExample::CompileCode( provider, sourceFile, "TestGraph.exe" );
- if ( cr->Errors->Count > 0 )
- {
- // Display compilation errors.
- textBox1->Text = String::Concat( "Errors encountered while building ", sourceFile, " into ", cr->PathToAssembly, ": \r\n\n" );
- System::CodeDom::Compiler::CompilerError^ ce;
- for ( int i = 0; i < cr->Errors->Count; i++ )
- {
- ce = cr->Errors[i];
- textBox1->AppendText( String::Concat( ce->ToString(), "\r\n" ) );
-
- }
- run_button->Enabled = false;
- }
- else
- {
- textBox1->Text = String::Concat( "Source ", sourceFile, " built into ", cr->PathToAssembly, " with no errors." );
- run_button->Enabled = true;
- }
- }
-
- void run_button_Click( Object^ /*sender*/, System::EventArgs^ /*e*/ )
- {
- Process::Start( "TestGraph.exe" );
- }
-
- public:
- CodeDomExampleForm()
- {
- this->SuspendLayout();
-
- // Set properties for label1.
- this->label1->Location = System::Drawing::Point( 395, 20 );
- this->label1->Size = System::Drawing::Size( 180, 22 );
- this->label1->Text = "Select a programming language:";
-
- // Set properties for comboBox1.
- this->comboBox1->Location = System::Drawing::Point( 560, 16 );
- this->comboBox1->Size = System::Drawing::Size( 190, 23 );
- this->comboBox1->Name = "comboBox1";
- array^temp1 = {"CSharp","Visual Basic","JScript"};
- this->comboBox1->Items->AddRange( temp1 );
- this->comboBox1->Anchor = (System::Windows::Forms::AnchorStyles)(System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right | System::Windows::Forms::AnchorStyles::Top);
- this->comboBox1->SelectedIndex = 0;
-
- // Set properties for generate_button.
- this->generate_button->Location = System::Drawing::Point( 8, 16 );
- this->generate_button->Name = "generate_button";
- this->generate_button->Size = System::Drawing::Size( 120, 23 );
- this->generate_button->Text = "Generate Code";
- this->generate_button->Click += gcnew System::EventHandler( this, &CodeDomExampleForm::generate_button_Click );
-
- // Set properties for compile_button.
- this->compile_button->Location = System::Drawing::Point( 136, 16 );
- this->compile_button->Name = "compile_button";
- this->compile_button->Size = System::Drawing::Size( 120, 23 );
- this->compile_button->Text = "Compile";
- this->compile_button->Click += gcnew System::EventHandler( this, &CodeDomExampleForm::compile_button_Click );
-
- // Set properties for run_button.
- this->run_button->Enabled = false;
- this->run_button->Location = System::Drawing::Point( 264, 16 );
- this->run_button->Name = "run_button";
- this->run_button->Size = System::Drawing::Size( 120, 23 );
- this->run_button->Text = "Run";
- this->run_button->Click += gcnew System::EventHandler( this, &CodeDomExampleForm::run_button_Click );
-
- // Set properties for textBox1.
- this->textBox1->Anchor = (System::Windows::Forms::AnchorStyles)(System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Bottom | System::Windows::Forms::AnchorStyles::Left | System::Windows::Forms::AnchorStyles::Right);
- this->textBox1->Location = System::Drawing::Point( 8, 48 );
- this->textBox1->Multiline = true;
- this->textBox1->ScrollBars = System::Windows::Forms::ScrollBars::Vertical;
- this->textBox1->Name = "textBox1";
- this->textBox1->Size = System::Drawing::Size( 744, 280 );
- this->textBox1->Text = "";
-
- // Set properties for the CodeDomExampleForm.
- this->AutoScaleBaseSize = System::Drawing::Size( 5, 13 );
- this->ClientSize = System::Drawing::Size( 768, 340 );
- this->MinimumSize = System::Drawing::Size( 750, 340 );
- array^myControl = {this->textBox1,this->run_button,this->compile_button,this->generate_button,this->comboBox1,this->label1};
- this->Controls->AddRange( myControl );
- this->Name = "CodeDomExampleForm";
- this->Text = "CodeDom Hello World Example";
- this->ResumeLayout( false );
- }
-
- public:
- ~CodeDomExampleForm()
- {
- }
- };
-
-}
-
-[STAThread]
-int main()
-{
- Application::Run( gcnew CodeDOMExample::CodeDomExampleForm );
-}
-//
diff --git a/snippets/cpp/VS_Snippets_CLR/CodeDomPartialTypeExample/CPP/source.cpp b/snippets/cpp/VS_Snippets_CLR/CodeDomPartialTypeExample/CPP/source.cpp
deleted file mode 100644
index 080c30b3d2c..00000000000
--- a/snippets/cpp/VS_Snippets_CLR/CodeDomPartialTypeExample/CPP/source.cpp
+++ /dev/null
@@ -1,439 +0,0 @@
-
-// The following example builds a CodeDom source graph for a simple
-// class that represents document properties. The source for the
-// graph is generated, saved to a file, compiled into an executable,
-// and run.
-#using
-
-using namespace System;
-using namespace System::CodeDom;
-using namespace System::CodeDom::Compiler;
-using namespace System::Collections;
-using namespace System::ComponentModel;
-using namespace System::IO;
-using namespace System::Diagnostics;
-
-//
-// Build the source graph using System.CodeDom types.
-CodeCompileUnit^ DocumentPropertyGraphBase()
-{
- // Create a new CodeCompileUnit for the source graph.
- CodeCompileUnit^ docPropUnit = gcnew CodeCompileUnit;
-
- // Declare a new namespace called DocumentSamples.
- CodeNamespace^ sampleSpace = gcnew CodeNamespace( "DocumentSamples" );
-
- // Add the new namespace to the compile unit.
- docPropUnit->Namespaces->Add( sampleSpace );
-
- // Add an import statement for the System namespace.
- sampleSpace->Imports->Add( gcnew CodeNamespaceImport( "System" ) );
-
- // Declare a new class called DocumentProperties.
- //
- CodeTypeDeclaration^ baseClass = gcnew CodeTypeDeclaration( "DocumentProperties" );
- baseClass->IsPartial = true;
- baseClass->IsClass = true;
- baseClass->Attributes = MemberAttributes::Public;
- baseClass->BaseTypes->Add( gcnew CodeTypeReference( System::Object::typeid ) );
-
- // Add the DocumentProperties class to the namespace.
- sampleSpace->Types->Add( baseClass );
- //
-
- // ------Build the DocumentProperty.Main method------
- // Declare the Main method of the class.
- CodeEntryPointMethod^ mainMethod = gcnew CodeEntryPointMethod;
- mainMethod->Comments->Add( gcnew CodeCommentStatement( " Perform a simple test of the class methods." ) );
-
- // Add the code entry point method to the Members
- // collection of the type.
- baseClass->Members->Add( mainMethod );
- mainMethod->Statements->Add( gcnew CodeCommentStatement( "Initialize a class instance and display it." ) );
-
- //
- // Initialize a local DocumentProperty instance, named myDoc.
- // Use the DocumentProperty constructor to set the author,
- // title, and date. Set the publish date to DateTime.Now.
- CodePrimitiveExpression^ docTitlePrimitive = gcnew CodePrimitiveExpression( "Cubicle Survival Strategies" );
- CodePrimitiveExpression^ docAuthorPrimitive = gcnew CodePrimitiveExpression( "John Smith" );
-
- // Store the value of DateTime.Now in a local variable, to re-use
- // the same value later.
- CodeTypeReferenceExpression^ docDateClass = gcnew CodeTypeReferenceExpression( "DateTime" );
- CodePropertyReferenceExpression^ docDateNow = gcnew CodePropertyReferenceExpression( docDateClass,"Now" );
- CodeVariableDeclarationStatement^ publishNow = gcnew CodeVariableDeclarationStatement( DateTime::typeid,"publishNow",docDateNow );
- mainMethod->Statements->Add( publishNow );
- CodeVariableReferenceExpression^ publishNowRef = gcnew CodeVariableReferenceExpression( "publishNow" );
- array^ctorParams = {docTitlePrimitive,docAuthorPrimitive,publishNowRef};
- CodeObjectCreateExpression^ initDocConstruct = gcnew CodeObjectCreateExpression( "DocumentProperties",ctorParams );
- CodeVariableDeclarationStatement^ myDocDeclare = gcnew CodeVariableDeclarationStatement( "DocumentProperties","myDoc",initDocConstruct );
- mainMethod->Statements->Add( myDocDeclare );
- //
-
- // Create a variable reference for the myDoc instance.
- CodeVariableReferenceExpression^ myDocInstance = gcnew CodeVariableReferenceExpression( "myDoc" );
-
- // Create a type reference for the System.Console class.
- CodeTypeReferenceExpression^ csSystemConsoleType = gcnew CodeTypeReferenceExpression( "System.Console" );
-
- // Build Console.WriteLine statement.
- CodeMethodInvokeExpression^ consoleWriteLine0 = gcnew CodeMethodInvokeExpression( csSystemConsoleType,"WriteLine",gcnew CodePrimitiveExpression( "** Document properties test **" ) );
-
- // Add the WriteLine call to the statement collection.
- mainMethod->Statements->Add( consoleWriteLine0 );
-
- // Build Console.WriteLine("First document:").
- CodeMethodInvokeExpression^ consoleWriteLine1 = gcnew CodeMethodInvokeExpression( csSystemConsoleType,"WriteLine",gcnew CodePrimitiveExpression( "First document:" ) );
-
- // Add the WriteLine call to the statement collection.
- mainMethod->Statements->Add( consoleWriteLine1 );
-
- // Add a statement to display the myDoc instance properties.
- CodeMethodInvokeExpression^ myDocToString = gcnew CodeMethodInvokeExpression( myDocInstance,"ToString" );
- CodeMethodInvokeExpression^ consoleWriteLine2 = gcnew CodeMethodInvokeExpression( csSystemConsoleType,"WriteLine",myDocToString );
- mainMethod->Statements->Add( consoleWriteLine2 );
-
- // Add a statement to display the myDoc instance hashcode property.
- CodeMethodInvokeExpression^ myDocHashCode = gcnew CodeMethodInvokeExpression( myDocInstance,"GetHashCode" );
- array^writeHashCodeParams = {gcnew CodePrimitiveExpression( " Hash code: {0}" ),myDocHashCode};
- CodeMethodInvokeExpression^ consoleWriteLine3 = gcnew CodeMethodInvokeExpression( csSystemConsoleType,"WriteLine",writeHashCodeParams );
- mainMethod->Statements->Add( consoleWriteLine3 );
-
- // Add statements to create another instance.
- mainMethod->Statements->Add( gcnew CodeCommentStatement( "Create another instance." ) );
- CodeVariableDeclarationStatement^ myNewDocDeclare = gcnew CodeVariableDeclarationStatement( "DocumentProperties","myNewDoc",initDocConstruct );
- mainMethod->Statements->Add( myNewDocDeclare );
-
- // Create a variable reference for the myNewDoc instance.
- CodeVariableReferenceExpression^ myNewDocInstance = gcnew CodeVariableReferenceExpression( "myNewDoc" );
-
- // Build Console.WriteLine("Second document:").
- CodeMethodInvokeExpression^ consoleWriteLine5 = gcnew CodeMethodInvokeExpression( csSystemConsoleType,"WriteLine",gcnew CodePrimitiveExpression( "Second document:" ) );
-
- // Add the WriteLine call to the statement collection.
- mainMethod->Statements->Add( consoleWriteLine5 );
-
- // Add a statement to display the myNewDoc instance properties.
- CodeMethodInvokeExpression^ myNewDocToString = gcnew CodeMethodInvokeExpression( myNewDocInstance,"ToString" );
- CodeMethodInvokeExpression^ consoleWriteLine6 = gcnew CodeMethodInvokeExpression( csSystemConsoleType,"WriteLine",myNewDocToString );
- mainMethod->Statements->Add( consoleWriteLine6 );
-
- // Add a statement to display the myNewDoc instance hashcode property.
- CodeMethodInvokeExpression^ myNewDocHashCode = gcnew CodeMethodInvokeExpression( myNewDocInstance,"GetHashCode" );
- array^writeNewHashCodeParams = {gcnew CodePrimitiveExpression( " Hash code: {0}" ),myNewDocHashCode};
- CodeMethodInvokeExpression^ consoleWriteLine7 = gcnew CodeMethodInvokeExpression( csSystemConsoleType,"WriteLine",writeNewHashCodeParams );
- mainMethod->Statements->Add( consoleWriteLine7 );
-
- //
- // Build a compound statement to compare the two instances.
- mainMethod->Statements->Add( gcnew CodeCommentStatement( "Compare the two instances." ) );
- CodeMethodInvokeExpression^ myDocEquals = gcnew CodeMethodInvokeExpression( myDocInstance,"Equals",myNewDocInstance );
- CodePrimitiveExpression^ equalLine = gcnew CodePrimitiveExpression( "Second document is equal to the first." );
- CodePrimitiveExpression^ notEqualLine = gcnew CodePrimitiveExpression( "Second document is not equal to the first." );
- CodeMethodInvokeExpression^ equalWriteLine = gcnew CodeMethodInvokeExpression( csSystemConsoleType,"WriteLine",equalLine );
- CodeMethodInvokeExpression^ notEqualWriteLine = gcnew CodeMethodInvokeExpression( csSystemConsoleType,"WriteLine",notEqualLine );
- array^equalStatements = {gcnew CodeExpressionStatement( equalWriteLine )};
- array^notEqualStatements = {gcnew CodeExpressionStatement( notEqualWriteLine )};
- CodeConditionStatement^ docCompare = gcnew CodeConditionStatement( myDocEquals,equalStatements,notEqualStatements );
- mainMethod->Statements->Add( docCompare );
- //
-
- //
- // Add a statement to change the myDoc.Author property:
- mainMethod->Statements->Add( gcnew CodeCommentStatement( "Change the author of the original instance." ) );
- CodePropertyReferenceExpression^ myDocAuthor = gcnew CodePropertyReferenceExpression( myDocInstance,"Author" );
- CodePrimitiveExpression^ newDocAuthor = gcnew CodePrimitiveExpression( "Jane Doe" );
- CodeAssignStatement^ myDocAuthorAssign = gcnew CodeAssignStatement( myDocAuthor,newDocAuthor );
- mainMethod->Statements->Add( myDocAuthorAssign );
- //
-
- // Add a statement to display the modified instance.
- CodeMethodInvokeExpression^ consoleWriteLine8 = gcnew CodeMethodInvokeExpression( csSystemConsoleType,"WriteLine",gcnew CodePrimitiveExpression( "Modified original document:" ) );
- mainMethod->Statements->Add( consoleWriteLine8 );
-
- // Reuse the myDoc.ToString statement built earlier.
- mainMethod->Statements->Add( consoleWriteLine2 );
-
- // Reuse the comparison block built earlier.
- mainMethod->Statements->Add( gcnew CodeCommentStatement( "Compare the two instances again." ) );
- mainMethod->Statements->Add( docCompare );
-
- // Add a statement to prompt the user to hit a key.
-
- // Build another call to System.WriteLine.
- // Add string parameter to the WriteLine method.
- CodeMethodInvokeExpression^ consoleWriteLine9 = gcnew CodeMethodInvokeExpression( csSystemConsoleType,"WriteLine",gcnew CodePrimitiveExpression( "Press the Enter key to continue." ) );
- mainMethod->Statements->Add( consoleWriteLine9 );
-
- // Build a call to System.ReadLine.
- CodeMethodInvokeExpression^ consoleReadLine = gcnew CodeMethodInvokeExpression( csSystemConsoleType,"ReadLine" );
- mainMethod->Statements->Add( consoleReadLine );
-
- // Define a few common expressions for the class methods.
- CodePropertyReferenceExpression^ thisTitle = gcnew CodePropertyReferenceExpression( gcnew CodeThisReferenceExpression,"docTitle" );
- CodePropertyReferenceExpression^ thisAuthor = gcnew CodePropertyReferenceExpression( gcnew CodeThisReferenceExpression,"docAuthor" );
- CodePropertyReferenceExpression^ thisDate = gcnew CodePropertyReferenceExpression( gcnew CodeThisReferenceExpression,"docDate" );
- CodeTypeReferenceExpression^ stringType = gcnew CodeTypeReferenceExpression( String::typeid );
- CodePrimitiveExpression^ trueConst = gcnew CodePrimitiveExpression( true );
- CodePrimitiveExpression^ falseConst = gcnew CodePrimitiveExpression( false );
-
- // ------Build the DocumentProperty.Equals method------
- CodeMemberMethod^ baseEquals = gcnew CodeMemberMethod;
- baseEquals->Attributes = static_cast(MemberAttributes::Public | MemberAttributes::Override | MemberAttributes::Overloaded);
- baseEquals->ReturnType = gcnew CodeTypeReference( bool::typeid );
- baseEquals->Name = "Equals";
- baseEquals->Parameters->Add( gcnew CodeParameterDeclarationExpression( Object::typeid,"obj" ) );
- baseEquals->Statements->Add( gcnew CodeCommentStatement( "Override System.Object.Equals method." ) );
- CodeVariableReferenceExpression^ objVar = gcnew CodeVariableReferenceExpression( "obj" );
- CodeCastExpression^ objCast = gcnew CodeCastExpression( "DocumentProperties",objVar );
- CodePropertyReferenceExpression^ objTitle = gcnew CodePropertyReferenceExpression( objCast,"Title" );
- CodePropertyReferenceExpression^ objAuthor = gcnew CodePropertyReferenceExpression( objCast,"Author" );
- CodePropertyReferenceExpression^ objDate = gcnew CodePropertyReferenceExpression( objCast,"PublishDate" );
- CodeMethodInvokeExpression^ objTitleEquals = gcnew CodeMethodInvokeExpression( objTitle,"Equals",thisTitle );
- CodeMethodInvokeExpression^ objAuthorEquals = gcnew CodeMethodInvokeExpression( objAuthor,"Equals",thisAuthor );
- CodeMethodInvokeExpression^ objDateEquals = gcnew CodeMethodInvokeExpression( objDate,"Equals",thisDate );
- CodeBinaryOperatorExpression^ andEquals1 = gcnew CodeBinaryOperatorExpression( objTitleEquals,CodeBinaryOperatorType::BooleanAnd,objAuthorEquals );
- CodeBinaryOperatorExpression^ andEquals2 = gcnew CodeBinaryOperatorExpression( andEquals1,CodeBinaryOperatorType::BooleanAnd,objDateEquals );
- array^returnTrueStatements = {gcnew CodeMethodReturnStatement( trueConst )};
- array^returnFalseStatements = {gcnew CodeMethodReturnStatement( falseConst )};
- CodeConditionStatement^ objEquals = gcnew CodeConditionStatement( andEquals2,returnTrueStatements,returnFalseStatements );
- baseEquals->Statements->Add( objEquals );
- baseClass->Members->Add( baseEquals );
-
- // ------Build the DocumentProperty.GetHashCode method------
- CodeMemberMethod^ baseHash = gcnew CodeMemberMethod;
- baseHash->Attributes = static_cast(MemberAttributes::Public | MemberAttributes::Override);
- baseHash->ReturnType = gcnew CodeTypeReference( int::typeid );
- baseHash->Name = "GetHashCode";
- baseHash->Statements->Add( gcnew CodeCommentStatement( "Override System.Object.GetHashCode method." ) );
- CodeMethodInvokeExpression^ hashTitle = gcnew CodeMethodInvokeExpression( thisTitle,"GetHashCode" );
- CodeMethodInvokeExpression^ hashAuthor = gcnew CodeMethodInvokeExpression( thisAuthor,"GetHashCode" );
- CodeMethodInvokeExpression^ hashDate = gcnew CodeMethodInvokeExpression( thisDate,"GetHashCode" );
- CodeBinaryOperatorExpression^ orHash1 = gcnew CodeBinaryOperatorExpression( hashTitle,CodeBinaryOperatorType::BitwiseOr,hashAuthor );
- CodeBinaryOperatorExpression^ andHash = gcnew CodeBinaryOperatorExpression( orHash1,CodeBinaryOperatorType::BitwiseAnd,hashDate );
- baseHash->Statements->Add( gcnew CodeMethodReturnStatement( andHash ) );
- baseClass->Members->Add( baseHash );
-
- // ------Build the DocumentProperty.ToString method------
- CodeMemberMethod^ docToString = gcnew CodeMemberMethod;
- docToString->Attributes = static_cast(MemberAttributes::Public | MemberAttributes::Override);
- docToString->ReturnType = gcnew CodeTypeReference( String::typeid );
- docToString->Name = "ToString";
- docToString->Statements->Add( gcnew CodeCommentStatement( "Override System.Object.ToString method." ) );
- CodeMethodInvokeExpression^ baseToString = gcnew CodeMethodInvokeExpression( gcnew CodeBaseReferenceExpression,"ToString" );
- CodePrimitiveExpression^ formatString = gcnew CodePrimitiveExpression( "{0} ({1} by {2}, {3})" );
- array^formatParams = {formatString,baseToString,thisTitle,thisAuthor,thisDate};
- CodeMethodInvokeExpression^ stringFormat = gcnew CodeMethodInvokeExpression( stringType,"Format",formatParams );
- docToString->Statements->Add( gcnew CodeMethodReturnStatement( stringFormat ) );
- baseClass->Members->Add( docToString );
- return docPropUnit;
-}
-//
-
-void DocumentPropertyGraphExpand( interior_ptr docPropUnit )
-{
- // Expand on the DocumentProperties class,
- // adding the constructor and property implementation.
- //
- CodeTypeDeclaration^ baseClass = gcnew CodeTypeDeclaration( "DocumentProperties" );
- baseClass->IsPartial = true;
- baseClass->IsClass = true;
- baseClass->Attributes = MemberAttributes::Public;
-
- // Extend the DocumentProperties class in the unit namespace.
- ( *docPropUnit)->Namespaces[ 0 ]->Types->Add( baseClass );
- //
-
- // ------Declare the internal class fields------
- baseClass->Members->Add( gcnew CodeMemberField( "String","docTitle" ) );
- baseClass->Members->Add( gcnew CodeMemberField( "String","docAuthor" ) );
- baseClass->Members->Add( gcnew CodeMemberField( "DateTime","docDate" ) );
-
- // ------Build the DocumentProperty constructor------
- CodeConstructor^ docPropCtor = gcnew CodeConstructor;
- docPropCtor->Attributes = MemberAttributes::Public;
- docPropCtor->Parameters->Add( gcnew CodeParameterDeclarationExpression( "String","title" ) );
- docPropCtor->Parameters->Add( gcnew CodeParameterDeclarationExpression( "String","author" ) );
- docPropCtor->Parameters->Add( gcnew CodeParameterDeclarationExpression( "DateTime","publishDate" ) );
- CodeFieldReferenceExpression^ myTitle = gcnew CodeFieldReferenceExpression( gcnew CodeThisReferenceExpression,"docTitle" );
- CodeVariableReferenceExpression^ inTitle = gcnew CodeVariableReferenceExpression( "title" );
- CodeAssignStatement^ myDocTitleAssign = gcnew CodeAssignStatement( myTitle,inTitle );
- docPropCtor->Statements->Add( myDocTitleAssign );
- CodeFieldReferenceExpression^ myAuthor = gcnew CodeFieldReferenceExpression( gcnew CodeThisReferenceExpression,"docAuthor" );
- CodeVariableReferenceExpression^ inAuthor = gcnew CodeVariableReferenceExpression( "author" );
- CodeAssignStatement^ myDocAuthorAssign = gcnew CodeAssignStatement( myAuthor,inAuthor );
- docPropCtor->Statements->Add( myDocAuthorAssign );
- CodeFieldReferenceExpression^ myDate = gcnew CodeFieldReferenceExpression( gcnew CodeThisReferenceExpression,"docDate" );
- CodeVariableReferenceExpression^ inDate = gcnew CodeVariableReferenceExpression( "publishDate" );
- CodeAssignStatement^ myDocDateAssign = gcnew CodeAssignStatement( myDate,inDate );
- docPropCtor->Statements->Add( myDocDateAssign );
- baseClass->Members->Add( docPropCtor );
-
- // ------Build the DocumentProperty properties------
- CodeMemberProperty^ docTitleProp = gcnew CodeMemberProperty;
- docTitleProp->HasGet = true;
- docTitleProp->HasSet = true;
- docTitleProp->Name = "Title";
- docTitleProp->Type = gcnew CodeTypeReference( "String" );
- docTitleProp->Attributes = MemberAttributes::Public;
- docTitleProp->GetStatements->Add( gcnew CodeMethodReturnStatement( gcnew CodeFieldReferenceExpression( gcnew CodeThisReferenceExpression,"docTitle" ) ) );
- docTitleProp->SetStatements->Add( gcnew CodeAssignStatement( gcnew CodeFieldReferenceExpression( gcnew CodeThisReferenceExpression,"docTitle" ),gcnew CodePropertySetValueReferenceExpression ) );
- baseClass->Members->Add( docTitleProp );
- CodeMemberProperty^ docAuthorProp = gcnew CodeMemberProperty;
- docAuthorProp->HasGet = true;
- docAuthorProp->HasSet = true;
- docAuthorProp->Name = "Author";
- docAuthorProp->Type = gcnew CodeTypeReference( "String" );
- docAuthorProp->Attributes = MemberAttributes::Public;
- docAuthorProp->GetStatements->Add( gcnew CodeMethodReturnStatement( gcnew CodeFieldReferenceExpression( gcnew CodeThisReferenceExpression,"docAuthor" ) ) );
- docAuthorProp->SetStatements->Add( gcnew CodeAssignStatement( gcnew CodeFieldReferenceExpression( gcnew CodeThisReferenceExpression,"docAuthor" ),gcnew CodePropertySetValueReferenceExpression ) );
- baseClass->Members->Add( docAuthorProp );
- CodeMemberProperty^ docDateProp = gcnew CodeMemberProperty;
- docDateProp->HasGet = true;
- docDateProp->HasSet = true;
- docDateProp->Name = "PublishDate";
- docDateProp->Type = gcnew CodeTypeReference( "DateTime" );
- docDateProp->Attributes = MemberAttributes::Public;
- docDateProp->GetStatements->Add( gcnew CodeMethodReturnStatement( gcnew CodeFieldReferenceExpression( gcnew CodeThisReferenceExpression,"docDate" ) ) );
- docDateProp->SetStatements->Add( gcnew CodeAssignStatement( gcnew CodeFieldReferenceExpression( gcnew CodeThisReferenceExpression,"docDate" ),gcnew CodePropertySetValueReferenceExpression ) );
- baseClass->Members->Add( docDateProp );
-}
-
-String^ GenerateCode( CodeDomProvider^ provider, CodeCompileUnit^ compileUnit )
-{
- // Build the source file name with the language
- // extension (vb, cs, js).
- String^ sourceFile = "";
-
- // Write the source out in the selected language if
- // the code generator supports partial type declarations.
- if ( provider->Supports( GeneratorSupport::PartialTypes ) )
- {
- if ( provider->FileExtension[ 0 ] == '.' )
- {
- sourceFile = String::Format( "DocProp{0}", provider->FileExtension );
- }
- else
- {
- sourceFile = String::Format( "DocProp.{0}", provider->FileExtension );
- }
-
- // Create a TextWriter to a StreamWriter to an output file.
- IndentedTextWriter^ outWriter = gcnew IndentedTextWriter( gcnew StreamWriter( sourceFile,false )," " );
-
- // Generate source code using the code generator.
- provider->GenerateCodeFromCompileUnit( compileUnit, outWriter, nullptr );
-
- // Close the output file.
- outWriter->Close();
- }
-
- return sourceFile;
-}
-
-//
-bool CompileCode( CodeDomProvider^ provider, String^ sourceFile, String^ exeFile )
-{
- CompilerParameters^ cp = gcnew CompilerParameters;
-
- // Generate an executable instead of
- // a class library.
- cp->GenerateExecutable = true;
-
- // Set the assembly file name to generate.
- cp->OutputAssembly = exeFile;
-
- // Save the assembly as a physical file.
- cp->GenerateInMemory = false;
-
- // Generate debug information.
- cp->IncludeDebugInformation = true;
-
- // Add an assembly reference.
- cp->ReferencedAssemblies->Add( "System.dll" );
-
- // Set the warning level at which
- // the compiler should abort compilation
- // if a warning of this level occurs.
- cp->WarningLevel = 3;
-
- // Set whether to treat all warnings as errors.
- cp->TreatWarningsAsErrors = false;
- if ( provider->Supports( GeneratorSupport::EntryPointMethod ) )
- {
- // Specify the class that contains
- // the main method of the executable.
- cp->MainClass = "DocumentSamples.DocumentProperties";
- }
-
- // Invoke compilation.
- CompilerResults^ cr = provider->CompileAssemblyFromFile( cp, sourceFile );
- if ( cr->Errors->Count > 0 )
- {
- // Display compilation errors.
- Console::WriteLine( "Errors building {0} into {1}", sourceFile, cr->PathToAssembly );
- IEnumerator^ myEnum = cr->Errors->GetEnumerator();
- while ( myEnum->MoveNext() )
- {
- CompilerError^ ce = safe_cast(myEnum->Current);
- Console::WriteLine( " {0}", ce );
- Console::WriteLine();
- }
- }
- else
- {
- Console::WriteLine( "Source {0} built into {1} successfully.", sourceFile, cr->PathToAssembly );
- }
-
- // Return the results of compilation.
- if ( cr->Errors->Count > 0 )
- {
- return false;
- }
- else
- {
- return true;
- }
-}
-//
-
-[STAThread]
-int main()
-{
- CodeDomProvider^ provider = nullptr;
- String^ exeName = "DocProp.exe";
- Console::WriteLine( "Enter the source language for DocumentProperties class (cs, vb, etc):" );
- String^ inputLang = Console::ReadLine();
- Console::WriteLine();
- if ( CodeDomProvider::IsDefinedLanguage( inputLang ) )
- {
- provider = CodeDomProvider::CreateProvider( inputLang );
- }
-
- if ( provider == nullptr )
- {
- Console::WriteLine( "There is no CodeDomProvider for the input language." );
- }
- else
- {
- CodeCompileUnit^ docPropertyUnit = DocumentPropertyGraphBase();
- DocumentPropertyGraphExpand( &docPropertyUnit );
- String^ sourceFile = GenerateCode( provider, docPropertyUnit );
- if ( !String::IsNullOrEmpty( sourceFile ) )
- {
- Console::WriteLine( "Document property class code generated." );
- if ( CompileCode( provider, sourceFile, exeName ) )
- {
- Console::WriteLine( "Starting DocProp executable." );
- Process::Start( exeName );
- }
- }
- else
- {
- Console::WriteLine( "Could not generate source file." );
- Console::WriteLine( "Target language code generator might not support partial type declarations." );
- }
- }
-}
-
diff --git a/snippets/cpp/VS_Snippets_CLR/CodeDomSampleBatch/CPP/class1.cpp b/snippets/cpp/VS_Snippets_CLR/CodeDomSampleBatch/CPP/class1.cpp
deleted file mode 100644
index 1cc24bf7789..00000000000
--- a/snippets/cpp/VS_Snippets_CLR/CodeDomSampleBatch/CPP/class1.cpp
+++ /dev/null
@@ -1,100 +0,0 @@
-#using
-
-using namespace System;
-using namespace System::CodeDom;
-
-namespace CodeDomSampleBatch
-{
- public ref class Class1
- {
- public:
- Class1(){}
-
- static CodeCompileUnit^ CreateCompileUnit()
- {
- CodeCompileUnit^ cu = gcnew CodeCompileUnit;
-
- //
- // Creates a code expression for a CodeExpressionStatement to contain.
- array^ temp = {gcnew CodePrimitiveExpression( "Example string" )};
- CodeExpression^ invokeExpression = gcnew CodeMethodInvokeExpression(
- gcnew CodeTypeReferenceExpression( "Console" ),"Write",temp );
-
- // Creates a statement using a code expression.
- CodeExpressionStatement^ expressionStatement;
- expressionStatement = gcnew CodeExpressionStatement( invokeExpression );
-
- // A C++ code generator produces the following source code for the preceeding example code:
-
- // Console::Write( "Example string" );
- //
-
- //
- // Creates a CodeLinePragma that references line 100 of the file "example.cs".
- CodeLinePragma^ pragma = gcnew CodeLinePragma( "example.cs",100 );
- //
-
- //
- // Creates a CodeSnippetExpression that represents a literal string that
- // can be used as an expression in a CodeDOM graph.
- CodeSnippetExpression^ literalExpression =
- gcnew CodeSnippetExpression( "Literal expression" );
- //
-
- //
- // Creates a statement using a literal string.
- CodeSnippetStatement^ literalStatement =
- gcnew CodeSnippetStatement( "Console.Write(\"Test literal statement output\")" );
- //
-
- //
- // Creates a type member using a literal string.
- CodeSnippetTypeMember^ literalMember =
- gcnew CodeSnippetTypeMember( "public static void TestMethod() {}" );
- //
- return cu;
- }
-
- static CodeCompileUnit^ CreateSnippetCompileUnit()
- {
- //
- // Creates a compile unit using a literal sring;
- String^ literalCode;
- literalCode = "using System; namespace TestLiteralCode " +
- "{ public class TestClass { public TestClass() {} } }";
- CodeSnippetCompileUnit^ csu = gcnew CodeSnippetCompileUnit( literalCode );
- //
- return csu;
- }
-
- // CodeNamespaceImportCollection
- void CodeNamespaceImportCollectionExample()
- {
- //
- //
- // Creates an empty CodeNamespaceImportCollection.
- CodeNamespaceImportCollection^ collection =
- gcnew CodeNamespaceImportCollection;
- //
-
- //
- // Adds a CodeNamespaceImport to the collection.
- collection->Add( gcnew CodeNamespaceImport( "System" ) );
- //
-
- //
- // Adds an array of CodeNamespaceImport objects to the collection.
- array^ Imports = {
- gcnew CodeNamespaceImport( "System" ),
- gcnew CodeNamespaceImport( "System.Drawing" )};
- collection->AddRange( Imports );
- //
-
- //
- // Retrieves the count of the items in the collection.
- int collectionCount = collection->Count;
- //
- //
- }
- };
-}
diff --git a/snippets/cpp/VS_Snippets_CLR/CodeDom_CompilerInfo/CPP/source.cpp b/snippets/cpp/VS_Snippets_CLR/CodeDom_CompilerInfo/CPP/source.cpp
deleted file mode 100644
index 6d0058c9957..00000000000
--- a/snippets/cpp/VS_Snippets_CLR/CodeDom_CompilerInfo/CPP/source.cpp
+++ /dev/null
@@ -1,327 +0,0 @@
-
-
-// System.CodeDom.Compiler.CompilerInfo
-//
-// Requires .NET Framework version 2.0 or higher.
-//
-// The following example displays compiler configuration settings.
-// Command-line arguments are used to specify a compiler language,
-// file extension, or provider type. For the given input, the
-// example determines the corresponding code compiler settings.
-//
-//
-// Command-line argument examples:
-//
-// - Displays Visual Basic, C#, and JScript compiler settings.
-// Language CSharp
-// - Displays the compiler settings for C#.
-// All
-// - Displays settings for all configured compilers.
-// Config Pascal
-// - Displays settings for configured Pascal language provider,
-// if one exists.
-// Extension .vb
-// - Displays settings for the compiler associated with the .vb
-// file extension.
-#using
-#using
-
-using namespace System;
-using namespace System::Globalization;
-using namespace System::CodeDom;
-using namespace System::CodeDom::Compiler;
-using namespace Microsoft::CSharp;
-using namespace Microsoft::VisualBasic;
-using namespace System::Configuration;
-using namespace System::Security::Permissions;
-
-namespace CodeDomCompilerInfoSample
-{
- [PermissionSet(SecurityAction::Demand, Name="FullTrust")]
- public ref class CompilerInfoSample
- {
- public:
- static void Main( array^args )
- {
- String^ queryCommand = "";
- String^ queryArg = "";
- int iNumArguments = args->Length;
-
- // Get input command-line arguments.
- if ( iNumArguments > 0 )
- {
- queryCommand = args[ 0 ]->ToUpper( CultureInfo::InvariantCulture );
- if ( iNumArguments > 1 )
- queryArg = args[ 1 ];
- }
-
- // Determine which method to call.
- Console::WriteLine();
- if ( queryCommand->Equals( "LANGUAGE" ) )
- DisplayCompilerInfoForLanguage( queryArg ); // Display compiler information for input language.
- else if ( queryCommand->Equals( "EXTENSION" ) )
- DisplayCompilerInfoUsingExtension( queryArg ); // Display compiler information for input file extension.
- else if ( queryCommand->Equals( "CONFIG" ) )
- DisplayCompilerInfoForConfigLanguage( queryArg ); // Display settings for the configured language provider.
- else if ( queryCommand->Equals( "ALL" ) )
- DisplayAllCompilerInfo(); // Display compiler information for all configured language providers.
- else
- {
- // There was no command-line argument, or the
- // command-line argument was not recognized.
- // Display the C#, Visual Basic and JScript
- // compiler information.
- DisplayCSharpCompilerInfo();
- DisplayVBCompilerInfo();
- DisplayJScriptCompilerInfo();
- }
- }
-
-
- private:
- static void DisplayCSharpCompilerInfo()
- {
- //
- // Get the provider for Microsoft.CSharp
-// CodeDomProvider^ provider = CodeDomProvider.CreateProvider("CSharp");
- CodeDomProvider^ provider = CodeDomProvider::CreateProvider("CSharp");
-
- if ( provider )
- {
- // Display the C# language provider information.
- Console::WriteLine( "CSharp provider is {0}", provider->ToString() );
- Console::WriteLine( " Provider hash code: {0}", provider->GetHashCode().ToString() );
- Console::WriteLine( " Default file extension: {0}", provider->FileExtension );
- }
-
- //
- Console::WriteLine();
- }
-
- static void DisplayVBCompilerInfo()
- {
- //
- // Get the provider for Microsoft.VisualBasic
-// CodeDomProvider^ provider = CodeDomProvider.CreateProvider("VisualBasic");
- CodeDomProvider^ provider = CodeDomProvider::CreateProvider("VisualBasic");
- if ( provider ) // Display the Visual Basic language provider information.
- {
- Console::WriteLine( "Visual Basic provider is {0}", provider->ToString() );
- Console::WriteLine( " Provider hash code: {0}", provider->GetHashCode().ToString() );
- Console::WriteLine( " Default file extension: {0}", provider->FileExtension );
- }
-
- //
- Console::WriteLine();
- }
-
- static void DisplayJScriptCompilerInfo()
- {
- //
- // Get the provider for JScript.
- CodeDomProvider^ provider;
- try
- {
-// provider = CodeDomProvider.CreateProvider("JScript");
- provider = CodeDomProvider::CreateProvider("JScript");
- if ( provider )
- {
- // Display the JScript language provider information.
- Console::WriteLine( "JScript language provider is {0}", provider->ToString() );
- Console::WriteLine( " Provider hash code: {0}", provider->GetHashCode().ToString() );
- Console::WriteLine( " Default file extension: {0}", provider->FileExtension );
- Console::WriteLine();
- }
- }
- catch ( ConfigurationException^ e )
- {
- // The JScript language provider was not found.
- Console::WriteLine( "There is no configured JScript language provider." );
- }
-
- //
- }
-
- static void DisplayCompilerInfoUsingExtension( String^ fileExtension )
- {
- //
- if ( !fileExtension->StartsWith( "." ) )
- fileExtension = String::Concat( ".", fileExtension );
-
- // Get the language associated with the file extension.
- CodeDomProvider^ provider = nullptr;
- if ( CodeDomProvider::IsDefinedExtension( fileExtension ) )
- {
- String^ language = CodeDomProvider::GetLanguageFromExtension( fileExtension );
- if ( language )
- Console::WriteLine( "The language \"{0}\" is associated with file extension \"{1}\"\n",
- language, fileExtension );
-
- // Check for a corresponding language provider.
- if ( language && CodeDomProvider::IsDefinedLanguage( language ) )
- {
- provider = CodeDomProvider::CreateProvider( language );
- if ( provider )
- {
- // Display information about this language provider.
- Console::WriteLine( "Language provider: {0}\n", provider->ToString() );
-
- // Get the compiler settings for this language.
- CompilerInfo^ langCompilerInfo = CodeDomProvider::GetCompilerInfo( language );
- if ( langCompilerInfo )
- {
- CompilerParameters^ langCompilerConfig = langCompilerInfo->CreateDefaultCompilerParameters();
- if ( langCompilerConfig )
- {
- Console::WriteLine( " Compiler options: {0}", langCompilerConfig->CompilerOptions );
- Console::WriteLine( " Compiler warning level: {0}", langCompilerConfig->WarningLevel.ToString() );
- }
- }
- }
- }
- }
-
- if ( provider == nullptr ) // Tell the user that the language provider was not found.
- Console::WriteLine( "There is no language provider associated with input file extension \"{0}\".", fileExtension );
-
- //
- }
-
- static void DisplayCompilerInfoForLanguage( String^ language )
- {
- //
- CodeDomProvider^ provider = nullptr;
-
- // Check for a provider corresponding to the input language.
- if ( CodeDomProvider::IsDefinedLanguage( language ) )
- {
- provider = CodeDomProvider::CreateProvider( language );
- if ( provider )
- {
- // Display information about this language provider.
- Console::WriteLine( "Language provider: {0}", provider->ToString() );
- Console::WriteLine();
- Console::WriteLine( " Default file extension: {0}", provider->FileExtension );
- Console::WriteLine();
-
- // Get the compiler settings for this language.
- CompilerInfo^ langCompilerInfo = CodeDomProvider::GetCompilerInfo( language );
- if ( langCompilerInfo )
- {
- CompilerParameters^ langCompilerConfig = langCompilerInfo->CreateDefaultCompilerParameters();
- if ( langCompilerConfig )
- {
- Console::WriteLine( " Compiler options: {0}", langCompilerConfig->CompilerOptions );
- Console::WriteLine( " Compiler warning level: {0}", langCompilerConfig->WarningLevel.ToString() );
- }
- }
- }
- }
-
- if ( provider == nullptr ) // Tell the user that the language provider was not found.
- Console::WriteLine( "There is no provider configured for input language \"{0}\".", language );
-
- //
- }
-
- static void DisplayCompilerInfoForConfigLanguage( String^ configLanguage )
- {
- //
- CodeDomProvider^ provider = nullptr;
- CompilerInfo^ info = CodeDomProvider::GetCompilerInfo( configLanguage );
-
- // Check whether there is a provider configured for this language.
- if ( info->IsCodeDomProviderTypeValid )
- {
- // Get a provider instance using the configured type information.
- provider = dynamic_cast(Activator::CreateInstance( info->CodeDomProviderType ));
- if ( provider )
- {
- // Display information about this language provider.
- Console::WriteLine( "Language provider: {0}", provider->ToString() );
- Console::WriteLine();
- Console::WriteLine( " Default file extension: {0}", provider->FileExtension );
- Console::WriteLine();
-
- // Get the compiler settings for this language.
- CompilerParameters^ langCompilerConfig = info->CreateDefaultCompilerParameters();
- if ( langCompilerConfig )
- {
- Console::WriteLine( " Compiler options: {0}", langCompilerConfig->CompilerOptions );
- Console::WriteLine( " Compiler warning level: {0}", langCompilerConfig->WarningLevel.ToString() );
- }
- }
- }
-
- if ( provider == nullptr ) // Tell the user that the language provider was not found.
- Console::WriteLine( "There is no provider configured for input language \"{0}\".", configLanguage );
-
- //
- }
-
- static void DisplayAllCompilerInfo()
- {
- //
- array^allCompilerInfo = CodeDomProvider::GetAllCompilerInfo();
- for ( int i = 0; i < allCompilerInfo->Length; i++ )
- {
- String^ defaultLanguage;
- String^ defaultExtension;
- CompilerInfo^ info = allCompilerInfo[ i ];
- CodeDomProvider^ provider = nullptr;
- if ( info )
- provider = info->CreateProvider();
-
- if ( provider )
- {
- // Display information about this configured provider.
- Console::WriteLine( "Language provider: {0}", provider->ToString() );
- Console::WriteLine();
- Console::WriteLine( " Supported file extension(s):" );
- array^extensions = info->GetExtensions();
- for ( int i = 0; i < extensions->Length; i++ )
- Console::WriteLine( " {0}", extensions[ i ] );
-
- defaultExtension = provider->FileExtension;
- if ( !defaultExtension->StartsWith( "." ) )
- defaultExtension = String::Concat( ".", defaultExtension );
-
- Console::WriteLine( " Default file extension: {0}\n", defaultExtension );
- Console::WriteLine( " Supported language(s):" );
- array^languages = info->GetLanguages();
- for ( int i = 0; i < languages->Length; i++ )
- Console::WriteLine( " {0}", languages[ i ] );
-
- defaultLanguage = CodeDomProvider::GetLanguageFromExtension( defaultExtension );
- Console::WriteLine( " Default language: {0}", defaultLanguage );
- Console::WriteLine();
-
- // Get the compiler settings for this provider.
- CompilerParameters^ langCompilerConfig = info->CreateDefaultCompilerParameters();
- if ( langCompilerConfig )
- {
- Console::WriteLine( " Compiler options: {0}", langCompilerConfig->CompilerOptions );
- Console::WriteLine( " Compiler warning level: {0}", langCompilerConfig->WarningLevel.ToString() );
- }
- }
-
- }
- //
- }
-
- };
-
-}
-
-
-// The main entry point for the application.
-
-[STAThread]
-int main( int argc, char *argv[] )
-{
- CodeDomCompilerInfoSample::CompilerInfoSample::Main( Environment::GetCommandLineArgs() );
- Console::WriteLine("\n\nPress ENTER to return");
- Console::ReadLine();
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_CLR/CodeEntryPointMethod/CPP/codeentrypointmethodexample.cpp b/snippets/cpp/VS_Snippets_CLR/CodeEntryPointMethod/CPP/codeentrypointmethodexample.cpp
deleted file mode 100644
index 98d30708b47..00000000000
--- a/snippets/cpp/VS_Snippets_CLR/CodeEntryPointMethod/CPP/codeentrypointmethodexample.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::CodeDom;
-
-namespace CodeDomSamples
-{
- public ref class CodeEntryPointMethodExample
- {
- public:
-
- //
- // Builds a Hello World Program Graph using System.CodeDom objects
- static CodeCompileUnit^ BuildHelloWorldGraph()
- {
-
- // Create a new CodeCompileUnit to contain the program graph
- CodeCompileUnit^ CompileUnit = gcnew CodeCompileUnit;
-
- // Declare a new namespace object and name it
- CodeNamespace^ Samples = gcnew CodeNamespace( "Samples" );
-
- // Add the namespace object to the compile unit
- CompileUnit->Namespaces->Add( Samples );
-
- // Add a new namespace import for the System namespace
- Samples->Imports->Add( gcnew CodeNamespaceImport( "System" ) );
-
- // Declare a new type object and name it
- CodeTypeDeclaration^ Class1 = gcnew CodeTypeDeclaration( "Class1" );
-
- // Add the new type to the namespace object's type collection
- Samples->Types->Add( Class1 );
-
- // Declare a new code entry point method
- CodeEntryPointMethod^ Start = gcnew CodeEntryPointMethod;
-
- // Create a new method invoke expression
- array^temp = {gcnew CodePrimitiveExpression( "Hello World!" )};
- CodeMethodInvokeExpression^ cs1 = gcnew CodeMethodInvokeExpression( gcnew CodeTypeReferenceExpression( "System.Console" ),"WriteLine",temp );
-
- // Add the new method code statement
- Start->Statements->Add( gcnew CodeExpressionStatement( cs1 ) );
-
- // Add the code entry point method to the type's members collection
- Class1->Members->Add( Start );
- return CompileUnit;
-
- //
- }
-
- };
-
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_CLR/CodeExpressionCollectionExample/CPP/class1.cpp b/snippets/cpp/VS_Snippets_CLR/CodeExpressionCollectionExample/CPP/class1.cpp
deleted file mode 100644
index 8a1f531f50a..00000000000
--- a/snippets/cpp/VS_Snippets_CLR/CodeExpressionCollectionExample/CPP/class1.cpp
+++ /dev/null
@@ -1,77 +0,0 @@
-#using
-
-using namespace System;
-using namespace System::CodeDom;
-
-namespace CodeExpressionCollectionExample
-{
- public ref class Class1
- {
- public:
- Class1(){}
-
- // CodeExpressionCollection
- void CodeExpressionCollectionExample()
- {
- //
- //
- // Creates an empty CodeExpressionCollection.
- CodeExpressionCollection^ collection = gcnew CodeExpressionCollection;
- //
-
- //
- // Adds a CodeExpression to the collection.
- collection->Add( gcnew CodePrimitiveExpression( true ) );
- //
-
- //
- // Adds an array of CodeExpression objects to the collection.
- array^expressions = {gcnew CodePrimitiveExpression( true ),gcnew CodePrimitiveExpression( true )};
- collection->AddRange( expressions );
-
- // Adds a collection of CodeExpression objects to the collection.
- CodeExpressionCollection^ expressionsCollection = gcnew CodeExpressionCollection;
- expressionsCollection->Add( gcnew CodePrimitiveExpression( true ) );
- expressionsCollection->Add( gcnew CodePrimitiveExpression( true ) );
- collection->AddRange( expressionsCollection );
- //
-
- //
- // Tests for the presence of a CodeExpression in the
- // collection, and retrieves its index if it is found.
- CodeExpression^ testComment = gcnew CodePrimitiveExpression( true );
- int itemIndex = -1;
- if ( collection->Contains( testComment ) )
- itemIndex = collection->IndexOf( testComment );
- //
-
- //
- // Copies the contents of the collection beginning at index 0 to the specified CodeExpression array.
- // 'expressions' is a CodeExpression array.
- collection->CopyTo( expressions, 0 );
- //
-
- //
- // Retrieves the count of the items in the collection.
- int collectionCount = collection->Count;
- //
-
- //
- // Inserts a CodeExpression at index 0 of the collection.
- collection->Insert( 0, gcnew CodePrimitiveExpression( true ) );
- //
-
- //
- // Removes the specified CodeExpression from the collection.
- CodeExpression^ expression = gcnew CodePrimitiveExpression( true );
- collection->Remove( expression );
- //
-
- //
- // Removes the CodeExpression at index 0.
- collection->RemoveAt( 0 );
- //
- //
- }
- };
-}
diff --git a/snippets/cpp/VS_Snippets_CLR/CodeGeneratorOptionsExample/CPP/class1.cpp b/snippets/cpp/VS_Snippets_CLR/CodeGeneratorOptionsExample/CPP/class1.cpp
deleted file mode 100644
index be4a228d29c..00000000000
--- a/snippets/cpp/VS_Snippets_CLR/CodeGeneratorOptionsExample/CPP/class1.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-#using
-
-using namespace System;
-using namespace System::CodeDom;
-using namespace System::CodeDom::Compiler;
-
-[STAThread]
-int main()
-{
- //
- // Creates a new CodeGeneratorOptions.
- CodeGeneratorOptions^ genOptions = gcnew CodeGeneratorOptions;
-
- // Sets a value indicating that the code generator should insert blank lines between type members.
- genOptions->BlankLinesBetweenMembers = true;
-
- // Sets the style of bracing format to use: either S"Block" to start a
- // bracing block on the same line as the declaration of its container, or
- // S"C" to start the bracing for the block on the following line.
- genOptions->BracingStyle = "C";
-
- // Sets a value indicating that the code generator should not append an else,
- // catch or finally block, including brackets, at the closing line of a preceeding if or try block.
- genOptions->ElseOnClosing = false;
-
- // Sets the String* to indent each line with.
- genOptions->IndentString = " ";
-
- // Uses the CodeGeneratorOptions indexer property to set an
- // example Object* to the type's String*-keyed ListDictionary.
- // Custom ICodeGenerator* implementations can use objects
- // in this dictionary to customize process behavior.
- genOptions[ "CustomGeneratorOptionStringExampleID" ] = "BuildFlags: /A /B /C /D /E";
- //
-
- Console::WriteLine( genOptions );
-}
diff --git a/snippets/cpp/VS_Snippets_CLR/CodeGotoStatementExample/CPP/codegotostatementexample.cpp b/snippets/cpp/VS_Snippets_CLR/CodeGotoStatementExample/CPP/codegotostatementexample.cpp
deleted file mode 100644
index cab34001736..00000000000
--- a/snippets/cpp/VS_Snippets_CLR/CodeGotoStatementExample/CPP/codegotostatementexample.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::CodeDom;
-
-namespace CodeDomSamples
-{
- public ref class CodeGotoStatementExample
- {
- public:
- CodeGotoStatementExample()
- {
-
- //
- // Declares a type to contain the example code.
- CodeTypeDeclaration^ type1 = gcnew CodeTypeDeclaration( "Type1" );
-
- // Declares an entry point method.
- CodeEntryPointMethod^ entry1 = gcnew CodeEntryPointMethod;
- type1->Members->Add( entry1 );
-
- // Adds a goto statement to continue program flow at the "JumpToLabel" label.
- CodeGotoStatement^ goto1 = gcnew CodeGotoStatement( "JumpToLabel" );
- entry1->Statements->Add( goto1 );
-
- // Invokes Console.WriteLine to print "Test Output", which is skipped by the goto statement.
- array^temp = {gcnew CodePrimitiveExpression( "Test Output." )};
- CodeMethodInvokeExpression^ method1 = gcnew CodeMethodInvokeExpression( gcnew CodeTypeReferenceExpression( "System.Console" ),"WriteLine",temp );
- entry1->Statements->Add( method1 );
-
- // Declares a label named "JumpToLabel" associated with a method to output a test string using Console.WriteLine.
- array^temp2 = {gcnew CodePrimitiveExpression( "Output from labeled statement." )};
- CodeMethodInvokeExpression^ method2 = gcnew CodeMethodInvokeExpression( gcnew CodeTypeReferenceExpression( "System.Console" ),"WriteLine",temp2 );
- CodeLabeledStatement^ label1 = gcnew CodeLabeledStatement( "JumpToLabel",gcnew CodeExpressionStatement( method2 ) );
- entry1->Statements->Add( label1 );
-
- // A C# code generator produces the following source code for the preceeding example code:
- // public class Type1
- // {
- //
- // public static void Main()
- // {
- // goto JumpToLabel;
- // System.Console.WriteLine("Test Output");
- // JumpToLabel:
- // System.Console.WriteLine("Output from labeled statement.");
- // }
- // }
- //
- }
-
- };
-
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_CLR/CodeIterationStatementExample/CPP/codeiterationstatementexample.cpp b/snippets/cpp/VS_Snippets_CLR/CodeIterationStatementExample/CPP/codeiterationstatementexample.cpp
deleted file mode 100644
index c3a1463a6e3..00000000000
--- a/snippets/cpp/VS_Snippets_CLR/CodeIterationStatementExample/CPP/codeiterationstatementexample.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::CodeDom;
-
-namespace CodeDomSamples
-{
- public ref class CodeIterationStatementExample
- {
- public:
- CodeIterationStatementExample()
- {
- //
- // Declares and initializes an integer variable named testInt.
- CodeVariableDeclarationStatement^ testInt = gcnew CodeVariableDeclarationStatement( int::typeid,"testInt",gcnew CodePrimitiveExpression( (int^)0 ) );
- array^writelineparams = {gcnew CodeMethodInvokeExpression( gcnew CodeVariableReferenceExpression( "testInt" ),"ToString",nullptr )};
- array^codestatements = {gcnew CodeExpressionStatement( gcnew CodeMethodInvokeExpression( gcnew CodeMethodReferenceExpression( gcnew CodeTypeReferenceExpression( "Console" ),"WriteLine" ),writelineparams ) )};
-
- // Creates a for loop that sets testInt to 0 and continues incrementing testInt by 1 each loop until testInt is not less than 10.
-
- // Each loop iteration the value of the integer is output using the Console.WriteLine method.
- CodeIterationStatement^ forLoop = gcnew CodeIterationStatement( gcnew CodeAssignStatement( gcnew CodeVariableReferenceExpression( "testInt" ),gcnew CodePrimitiveExpression( 1 ) ),gcnew CodeBinaryOperatorExpression( gcnew CodeVariableReferenceExpression( "testInt" ),CodeBinaryOperatorType::LessThan,gcnew CodePrimitiveExpression( 10 ) ),gcnew CodeAssignStatement( gcnew CodeVariableReferenceExpression( "testInt" ),gcnew CodeBinaryOperatorExpression( gcnew CodeVariableReferenceExpression( "testInt" ),CodeBinaryOperatorType::Add,gcnew CodePrimitiveExpression( 1 ) ) ),codestatements );
-
- // A C# code generator produces the following source code for the preceeding example code:
- // int testInt = 0;
- // for (testInt = 1; (testInt < 10); testInt = (testInt + 1)) {
- // Console.WriteLine(testInt.ToString());
- //
- }
- };
-}
-//
diff --git a/snippets/cpp/VS_Snippets_CLR/CodeMemberEventSample/CPP/codemembereventexample.cpp b/snippets/cpp/VS_Snippets_CLR/CodeMemberEventSample/CPP/codemembereventexample.cpp
deleted file mode 100644
index 26b6cf744fb..00000000000
--- a/snippets/cpp/VS_Snippets_CLR/CodeMemberEventSample/CPP/codemembereventexample.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::CodeDom;
-
-namespace CodeDomSamples
-{
- public ref class CodeMemberEventExample
- {
- public:
- CodeMemberEventExample()
- {
-
- //
- // Declares a type to contain an event and constructor method.
- CodeTypeDeclaration^ type1 = gcnew CodeTypeDeclaration( "EventTest" );
-
- //
- // Declares an event that accepts a delegate type of System.EventHandler.
- CodeMemberEvent^ event1 = gcnew CodeMemberEvent;
-
- // Sets a name for the event.
- event1->Name = "TestEvent";
-
- // Sets the type of event.
- event1->Type = gcnew CodeTypeReference( "System.EventHandler" );
-
- // A C# code generator produces the following source code for the preceeding example code:
- // private event System.EventHandler TestEvent;
- //
- // Adds the event to the type members collection.
- type1->Members->Add( event1 );
-
- // Declares an empty type constructor.
- CodeConstructor^ constructor1 = gcnew CodeConstructor;
- constructor1->Attributes = MemberAttributes::Public;
- type1->Members->Add( constructor1 );
-
- // A C# code generator produces the following source code for the preceeding example code:
- // public class EventTest
- // {
- //
- // public EventTest()
- // {
- // }
- //
- // private event System.EventHandler TestEvent;
- // }
- //
- }
-
- };
-
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_CLR/CodeMemberFieldExample/CPP/codememberfieldexample.cpp b/snippets/cpp/VS_Snippets_CLR/CodeMemberFieldExample/CPP/codememberfieldexample.cpp
deleted file mode 100644
index a6523e8e7f4..00000000000
--- a/snippets/cpp/VS_Snippets_CLR/CodeMemberFieldExample/CPP/codememberfieldexample.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::CodeDom;
-
-namespace CodeDomSamples
-{
- public ref class CodeMemberFieldExample
- {
- public:
- CodeMemberFieldExample()
- {
-
- //
- // Declares a type to contain a field and a constructor method.
- CodeTypeDeclaration^ type1 = gcnew CodeTypeDeclaration( "FieldTest" );
-
- // Declares a field of type String named testStringField.
- CodeMemberField^ field1 = gcnew CodeMemberField( "System.String","TestStringField" );
- type1->Members->Add( field1 );
-
- // Declares an empty type constructor.
- CodeConstructor^ constructor1 = gcnew CodeConstructor;
- constructor1->Attributes = MemberAttributes::Public;
- type1->Members->Add( constructor1 );
-
- // A C# code generator produces the following source code for the preceeding example code:
- // public class FieldTest
- // {
- // private string testStringField;
- //
- // public FieldTest()
- // {
- // }
- // }
- //
- }
-
- };
-
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_CLR/CodeMemberFieldPublicConstExample/CPP/class1.cpp b/snippets/cpp/VS_Snippets_CLR/CodeMemberFieldPublicConstExample/CPP/class1.cpp
deleted file mode 100644
index 85f2cca6311..00000000000
--- a/snippets/cpp/VS_Snippets_CLR/CodeMemberFieldPublicConstExample/CPP/class1.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-#using
-
-using namespace System;
-using namespace System::CodeDom;
-
-namespace CodeMemberField_PublicConst_Example
-{
- public ref class Class1
- {
- private:
- static CodeCompileUnit^ GetCompileUnit()
- {
- CodeCompileUnit^ cu = gcnew CodeCompileUnit;
- CodeNamespace^ nsp = gcnew CodeNamespace( "TestNamespace" );
- cu->Namespaces->Add( nsp );
- CodeTypeDeclaration^ testType = gcnew CodeTypeDeclaration( "testType" );
- nsp->Types->Add( testType );
-
- //
- // This example demonstrates declaring a public constant type member field.
-
- // When declaring a public constant type member field, you must set a particular
- // access and scope mask to the member attributes of the field in order for the
- // code generator to properly generate the field as a constant field.
-
- // Declares an integer field using a CodeMemberField
- CodeMemberField^ constPublicField = gcnew CodeMemberField( int::typeid,"testConstPublicField" );
-
- // Resets the access and scope mask bit flags of the member attributes of the field
- // before setting the member attributes of the field to public and constant.
- constPublicField->Attributes = (MemberAttributes)((constPublicField->Attributes & ~MemberAttributes::AccessMask & ~MemberAttributes::ScopeMask) | MemberAttributes::Public | MemberAttributes::Const);
- //
-
- testType->Members->Add( constPublicField );
- return cu;
- }
- };
-}
diff --git a/snippets/cpp/VS_Snippets_CLR/CodeMemberMethodExample/CPP/codemembermethodexample.cpp b/snippets/cpp/VS_Snippets_CLR/CodeMemberMethodExample/CPP/codemembermethodexample.cpp
deleted file mode 100644
index 8175a5921e6..00000000000
--- a/snippets/cpp/VS_Snippets_CLR/CodeMemberMethodExample/CPP/codemembermethodexample.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::CodeDom;
-
-namespace CodeDomSamples
-{
- public ref class CodeMemberMethodExample
- {
- public:
- CodeMemberMethodExample()
- {
-
- //
- // Defines a method that returns a string passed to it.
- CodeMemberMethod^ method1 = gcnew CodeMemberMethod;
- method1->Name = "ReturnString";
- method1->ReturnType = gcnew CodeTypeReference( "System.String" );
- method1->Parameters->Add( gcnew CodeParameterDeclarationExpression( "System.String","text" ) );
- method1->Statements->Add( gcnew CodeMethodReturnStatement( gcnew CodeArgumentReferenceExpression( "text" ) ) );
-
- // A C# code generator produces the following source code for the preceeding example code:
- // private string ReturnString(string text)
- // {
- // return text;
- // }
- //
- }
-
- };
-
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_CLR/CodeMemberPropertyExample/CPP/codememberpropertyexample.cpp b/snippets/cpp/VS_Snippets_CLR/CodeMemberPropertyExample/CPP/codememberpropertyexample.cpp
deleted file mode 100644
index 7e2bc0cca2b..00000000000
--- a/snippets/cpp/VS_Snippets_CLR/CodeMemberPropertyExample/CPP/codememberpropertyexample.cpp
+++ /dev/null
@@ -1,95 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::CodeDom;
-
-namespace CodeDomSamples
-{
- public ref class CodeMemberPropertyExample
- {
- public:
- CodeMemberPropertyExample()
- {
-
- //
- // Declares a type to contain a field and a constructor method.
- CodeTypeDeclaration^ type1 = gcnew CodeTypeDeclaration( "PropertyTest" );
-
- // Declares a field of type String named testStringField.
- CodeMemberField^ field1 = gcnew CodeMemberField( "System.String","testStringField" );
- type1->Members->Add( field1 );
-
- // Declares a property of type String named StringProperty.
- CodeMemberProperty^ property1 = gcnew CodeMemberProperty;
- property1->Name = "StringProperty";
- property1->Type = gcnew CodeTypeReference( "System.String" );
- property1->Attributes = MemberAttributes::Public;
- property1->GetStatements->Add( gcnew CodeMethodReturnStatement( gcnew CodeFieldReferenceExpression( gcnew CodeThisReferenceExpression,"testStringField" ) ) );
- property1->SetStatements->Add( gcnew CodeAssignStatement( gcnew CodeFieldReferenceExpression( gcnew CodeThisReferenceExpression,"testStringField" ),gcnew CodePropertySetValueReferenceExpression ) );
- type1->Members->Add( property1 );
-
- // Declares an empty type constructor.
- CodeConstructor^ constructor1 = gcnew CodeConstructor;
- constructor1->Attributes = MemberAttributes::Public;
- type1->Members->Add( constructor1 );
-
- // A C# code generator produces the following source code for the preceeding example code:
- // public class PropertyTest
- // {
- //
- // private string testStringField;
- //
- // public PropertyTest()
- // {
- // }
- //
- // public virtual string StringProperty
- // {
- // get
- // {
- // return this.testStringField;
- // }
- // set
- // {
- // this.testStringField = value;
- // }
- // }
- // }
- //
- }
-
- void SpecificExample()
- {
-
- //
- // Declares a property of type String named StringProperty.
- CodeMemberProperty^ property1 = gcnew CodeMemberProperty;
- property1->Name = "StringProperty";
- property1->Type = gcnew CodeTypeReference( "System.String" );
- property1->Attributes = MemberAttributes::Public;
- property1->GetStatements->Add( gcnew CodeMethodReturnStatement( gcnew CodeFieldReferenceExpression( gcnew CodeThisReferenceExpression,"testStringField" ) ) );
- property1->SetStatements->Add( gcnew CodeAssignStatement( gcnew CodeFieldReferenceExpression( gcnew CodeThisReferenceExpression,"testStringField" ),gcnew CodePropertySetValueReferenceExpression ) );
-
- // A C# code generator produces the following source code for the preceeding example code:
- // public virtual string StringProperty
- // {
- // get
- // {
- // return this.testStringField;
- // }
- // set
- // {
- // this.testStringField = value;
- // }
- // }
- //
- }
-
- };
-
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_CLR/CodeMethodInvokeExpression/CPP/codemethodinvokeexpressionexample.cpp b/snippets/cpp/VS_Snippets_CLR/CodeMethodInvokeExpression/CPP/codemethodinvokeexpressionexample.cpp
deleted file mode 100644
index e6f645922d9..00000000000
--- a/snippets/cpp/VS_Snippets_CLR/CodeMethodInvokeExpression/CPP/codemethodinvokeexpressionexample.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::CodeDom;
-
-namespace CodeDomSamples
-{
- public ref class CodeMethodInvokeExpressionExample
- {
- public:
- CodeMethodInvokeExpressionExample()
- {
-
- //
- array^temp0 = {gcnew CodePrimitiveExpression( true )};
-
- // parameters array contains the parameters for the method.
- CodeMethodInvokeExpression^ methodInvoke = gcnew CodeMethodInvokeExpression( gcnew CodeThisReferenceExpression,"Dispose",temp0 );
-
- // A C# code generator produces the following source code for the preceeding example code:
- // this.Dispose(true);
- //
- }
-
- };
-
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_CLR/CodeMethodReferenceExample/CPP/codemethodreferenceexample.cpp b/snippets/cpp/VS_Snippets_CLR/CodeMethodReferenceExample/CPP/codemethodreferenceexample.cpp
deleted file mode 100644
index 5bb3d9a74c0..00000000000
--- a/snippets/cpp/VS_Snippets_CLR/CodeMethodReferenceExample/CPP/codemethodreferenceexample.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::CodeDom;
-public ref class CodeMethodReferenceExample
-{
-public:
- CodeMethodReferenceExample()
- {
-
- //
- // Declares a type to contain the example code.
- CodeTypeDeclaration^ type1 = gcnew CodeTypeDeclaration( "Type1" );
-
- // Declares a method.
- CodeMemberMethod^ method1 = gcnew CodeMemberMethod;
- method1->Name = "TestMethod";
- type1->Members->Add( method1 );
-
- // Declares a type constructor that calls a method.
- CodeConstructor^ constructor1 = gcnew CodeConstructor;
- constructor1->Attributes = MemberAttributes::Public;
- type1->Members->Add( constructor1 );
-
- // Invokes the TestMethod method of the current type object.
- CodeMethodReferenceExpression^ methodRef1 = gcnew CodeMethodReferenceExpression( gcnew CodeThisReferenceExpression,"TestMethod" );
- array^temp0;
- CodeMethodInvokeExpression^ invoke1 = gcnew CodeMethodInvokeExpression( methodRef1,temp0 );
- constructor1->Statements->Add( invoke1 );
-
- //
- }
-
- void InvokeExample()
- {
-
- //
- // Invokes the TestMethod method of the current type object.
- CodeMethodReferenceExpression^ methodRef1 = gcnew CodeMethodReferenceExpression( gcnew CodeThisReferenceExpression,"TestMethod" );
- array^temp1;
- CodeMethodInvokeExpression^ invoke1 = gcnew CodeMethodInvokeExpression( methodRef1,temp1 );
-
- // A C# code generator produces the following source code for the preceeding example code:
- // this.TestMethod();
- //
- }
-
-};
-
-//
diff --git a/snippets/cpp/VS_Snippets_CLR/CodeMultiExample/CPP/codemultiexample.cpp b/snippets/cpp/VS_Snippets_CLR/CodeMultiExample/CPP/codemultiexample.cpp
deleted file mode 100644
index 038d748adc7..00000000000
--- a/snippets/cpp/VS_Snippets_CLR/CodeMultiExample/CPP/codemultiexample.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::CodeDom;
-public ref class CodeMultiExample
-{
-public:
- CodeMultiExample(){}
-
- void CodeEventReferenceExample()
- {
-
- //
- // Represents a reference to an event.
- CodeEventReferenceExpression^ eventRef1 = gcnew CodeEventReferenceExpression( gcnew CodeThisReferenceExpression,"TestEvent" );
-
- // A C# code generator produces the following source code for the preceeding example code:
- // this.TestEvent
- //
- }
-
- void CodeIndexerExample()
- {
-
- //
- array^temp1 = {gcnew CodePrimitiveExpression( 1 )};
- System::CodeDom::CodeIndexerExpression^ indexerExpression = gcnew CodeIndexerExpression( gcnew CodeThisReferenceExpression,temp1 );
-
- // A C# code generator produces the following source code for the preceeding example code:
- // this[1];
- //
- }
-
- void CodeDirectionExample()
- {
-
- //
- // Declares a parameter passed by reference using a CodeDirectionExpression.
- array^param1 = {gcnew CodeDirectionExpression( FieldDirection::Ref,gcnew CodeFieldReferenceExpression( gcnew CodeThisReferenceExpression,"TestParameter" ) )};
-
- // Invokes a method on this named TestMethod using the direction expression as a parameter.
- CodeMethodInvokeExpression^ methodInvoke1 = gcnew CodeMethodInvokeExpression( gcnew CodeThisReferenceExpression,"TestMethod",param1 );
-
- // A C# code generator produces the following source code for the preceeding example code:
- // this.TestMethod(ref TestParameter);
- //
- }
-
- void CreateExpressionExample()
- {
-
- //
- array^temp0 = gcnew array(0);
- CodeObjectCreateExpression^ objectCreate1 = gcnew CodeObjectCreateExpression( "System.DateTime",temp0 );
-
- // A C# code generator produces the following source code for the preceeding example code:
- // new System.DateTime();
- //
- }
-
-};
-
-//
diff --git a/snippets/cpp/VS_Snippets_CLR/CodeNamespaceCollectionExample/CPP/class1.cpp b/snippets/cpp/VS_Snippets_CLR/CodeNamespaceCollectionExample/CPP/class1.cpp
deleted file mode 100644
index 1fa3cdbea7d..00000000000
--- a/snippets/cpp/VS_Snippets_CLR/CodeNamespaceCollectionExample/CPP/class1.cpp
+++ /dev/null
@@ -1,78 +0,0 @@
-#using
-
-using namespace System;
-using namespace System::CodeDom;
-
-namespace CodeNamespaceCollectionExample
-{
- public ref class Class1
- {
- public:
- Class1(){}
-
- // CodeNamespaceCollection
- void CodeNamespaceCollectionExample()
- {
- //
- //
- // Creates an empty CodeNamespaceCollection.
- CodeNamespaceCollection^ collection = gcnew CodeNamespaceCollection;
- //
-
- //
- // Adds a CodeNamespace to the collection.
- collection->Add( gcnew CodeNamespace( "TestNamespace" ) );
- //
-
- //
- // Adds an array of CodeNamespace objects to the collection.
- array^namespaces = {gcnew CodeNamespace( "TestNamespace1" ),gcnew CodeNamespace( "TestNamespace2" )};
- collection->AddRange( namespaces );
-
- // Adds a collection of CodeNamespace objects to the collection.
- CodeNamespaceCollection^ namespacesCollection = gcnew CodeNamespaceCollection;
- namespacesCollection->Add( gcnew CodeNamespace( "TestNamespace1" ) );
- namespacesCollection->Add( gcnew CodeNamespace( "TestNamespace2" ) );
- collection->AddRange( namespacesCollection );
- //
-
- //
- // Tests for the presence of a CodeNamespace in the collection,
- // and retrieves its index if it is found.
- CodeNamespace^ testNamespace = gcnew CodeNamespace( "TestNamespace" );
- int itemIndex = -1;
- if ( collection->Contains( testNamespace ) )
- itemIndex = collection->IndexOf( testNamespace );
- //
-
- //
- // Copies the contents of the collection beginning at index 0,
- // to the specified CodeNamespace array.
- // 'namespaces' is a CodeNamespace array.
- collection->CopyTo( namespaces, 0 );
- //
-
- //
- // Retrieves the count of the items in the collection.
- int collectionCount = collection->Count;
- //
-
- //
- // Inserts a CodeNamespace at index 0 of the collection.
- collection->Insert( 0, gcnew CodeNamespace( "TestNamespace" ) );
- //
-
- //
- // Removes the specified CodeNamespace from the collection.
- CodeNamespace^ namespace_ = gcnew CodeNamespace( "TestNamespace" );
- collection->Remove( namespace_ );
- //
-
- //
- // Removes the CodeNamespace at index 0.
- collection->RemoveAt( 0 );
- //
- //
- }
- };
-}
diff --git a/snippets/cpp/VS_Snippets_CLR/CodeNamespaceExample/CPP/codenamespaceexample.cpp b/snippets/cpp/VS_Snippets_CLR/CodeNamespaceExample/CPP/codenamespaceexample.cpp
deleted file mode 100644
index e2d0cf27fab..00000000000
--- a/snippets/cpp/VS_Snippets_CLR/CodeNamespaceExample/CPP/codenamespaceexample.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::CodeDom;
-
-namespace CodeDomSamples
-{
- public ref class CodeMemberEventExample
- {
- public:
- CodeMemberEventExample()
- {
-
- //
- CodeCompileUnit^ compileUnit = gcnew CodeCompileUnit;
- CodeNamespace^ namespace1 = gcnew CodeNamespace( "TestNamespace" );
- compileUnit->Namespaces->Add( namespace1 );
-
- // A C# code generator produces the following source code for the preceeding example code:
- // namespace TestNamespace {
- // }
- //
- }
-
- };
-
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_CLR/CodeNamespaceImportExample/CPP/codenamespaceimportexample.cpp b/snippets/cpp/VS_Snippets_CLR/CodeNamespaceImportExample/CPP/codenamespaceimportexample.cpp
deleted file mode 100644
index ac420b30839..00000000000
--- a/snippets/cpp/VS_Snippets_CLR/CodeNamespaceImportExample/CPP/codenamespaceimportexample.cpp
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::CodeDom;
-
-namespace CodeDomSamples
-{
- public ref class CodeNamespaceImportExample
- {
- public:
- CodeNamespaceImportExample()
- {
-
- //
- // Declares a compile unit to contain a namespace.
- CodeCompileUnit^ compileUnit = gcnew CodeCompileUnit;
-
- // Declares a namespace named TestNamespace.
- CodeNamespace^ testNamespace = gcnew CodeNamespace( "TestNamespace" );
-
- // Adds the namespace to the namespace collection of the compile unit.
- compileUnit->Namespaces->Add( testNamespace );
-
- // Declares a namespace import of the System namespace.
- CodeNamespaceImport^ import1 = gcnew CodeNamespaceImport( "System" );
-
- // Adds the namespace import to the namespace imports collection of the namespace.
- testNamespace->Imports->Add( import1 );
-
- // A C# code generator produces the following source code for the preceeding example code:
- // namespace TestNamespace {
- // using System;
- //
- // }
- //
- }
-
- };
-
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_CLR/CodeParameterDeclarationExample/CPP/codeparameterdeclarationexample.cpp b/snippets/cpp/VS_Snippets_CLR/CodeParameterDeclarationExample/CPP/codeparameterdeclarationexample.cpp
deleted file mode 100644
index 8e07b2222f8..00000000000
--- a/snippets/cpp/VS_Snippets_CLR/CodeParameterDeclarationExample/CPP/codeparameterdeclarationexample.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::CodeDom;
-
-namespace CodeDomSamples
-{
- public ref class CodeParameterDeclarationExample
- {
- public:
- CodeParameterDeclarationExample()
- {
-
- //
- // Declares a new type to contain the example methods.
- CodeTypeDeclaration^ type1 = gcnew CodeTypeDeclaration( "Type1" );
- CodeConstructor^ constructor1 = gcnew CodeConstructor;
- constructor1->Attributes = MemberAttributes::Public;
- type1->Members->Add( constructor1 );
-
- //
- // Declares a method.
- CodeMemberMethod^ method1 = gcnew CodeMemberMethod;
- method1->Name = "TestMethod";
-
- // Declares a string parameter passed by reference.
- CodeParameterDeclarationExpression^ param1 = gcnew CodeParameterDeclarationExpression( "System.String","stringParam" );
- param1->Direction = FieldDirection::Ref;
- method1->Parameters->Add( param1 );
-
- // Declares a Int32 parameter passed by incoming field.
- CodeParameterDeclarationExpression^ param2 = gcnew CodeParameterDeclarationExpression( "System.Int32","intParam" );
- param2->Direction = FieldDirection::Out;
- method1->Parameters->Add( param2 );
-
- // A C# code generator produces the following source code for the preceeding example code:
- // private void TestMethod(ref string stringParam, out int intParam) {
- // }
- //
- type1->Members->Add( method1 );
-
- //
- }
-
- };
-
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_CLR/CodeParameterDeclarationExpressionCollectionExample/CPP/class1.cpp b/snippets/cpp/VS_Snippets_CLR/CodeParameterDeclarationExpressionCollectionExample/CPP/class1.cpp
deleted file mode 100644
index 3b66a3fe5b6..00000000000
--- a/snippets/cpp/VS_Snippets_CLR/CodeParameterDeclarationExpressionCollectionExample/CPP/class1.cpp
+++ /dev/null
@@ -1,81 +0,0 @@
-#using
-
-using namespace System;
-using namespace System::CodeDom;
-
-namespace CodeParameterDeclarationExpressionCollectionExample
-{
- public ref class Class1
- {
- public:
- Class1(){}
-
- // CodeParameterDeclarationExpressionCollection
- void CodeParameterDeclarationExpressionCollectionExample()
- {
- //
- //
- // Creates an empty CodeParameterDeclarationExpressionCollection.
- CodeParameterDeclarationExpressionCollection^ collection = gcnew CodeParameterDeclarationExpressionCollection;
- //
-
- //
- // Adds a CodeParameterDeclarationExpression to the collection.
- collection->Add( gcnew CodeParameterDeclarationExpression( int::typeid,"testIntArgument" ) );
- //
-
- //
- // Adds an array of CodeParameterDeclarationExpression objects
- // to the collection.
- array^parameters = {gcnew CodeParameterDeclarationExpression( int::typeid,"testIntArgument" ),gcnew CodeParameterDeclarationExpression( bool::typeid,"testBoolArgument" )};
- collection->AddRange( parameters );
-
- // Adds a collection of CodeParameterDeclarationExpression objects
- // to the collection.
- CodeParameterDeclarationExpressionCollection^ parametersCollection = gcnew CodeParameterDeclarationExpressionCollection;
- parametersCollection->Add( gcnew CodeParameterDeclarationExpression( int::typeid,"testIntArgument" ) );
- parametersCollection->Add( gcnew CodeParameterDeclarationExpression( bool::typeid,"testBoolArgument" ) );
- collection->AddRange( parametersCollection );
- //
-
- //
- // Tests for the presence of a CodeParameterDeclarationExpression
- // in the collection, and retrieves its index if it is found.
- CodeParameterDeclarationExpression^ testParameter = gcnew CodeParameterDeclarationExpression( int::typeid,"testIntArgument" );
- int itemIndex = -1;
- if ( collection->Contains( testParameter ) )
- itemIndex = collection->IndexOf( testParameter );
- //
-
- //
- // Copies the contents of the collection beginning at index 0 to the specified CodeParameterDeclarationExpression array.
- // 'parameters' is a CodeParameterDeclarationExpression array.
- collection->CopyTo( parameters, 0 );
- //
-
- //
- // Retrieves the count of the items in the collection.
- int collectionCount = collection->Count;
- //
-
- //
- // Inserts a CodeParameterDeclarationExpression at index 0
- // of the collection.
- collection->Insert( 0, gcnew CodeParameterDeclarationExpression( int::typeid,"testIntArgument" ) );
- //
-
- //
- // Removes the specified CodeParameterDeclarationExpression
- // from the collection.
- CodeParameterDeclarationExpression^ parameter = gcnew CodeParameterDeclarationExpression( int::typeid,"testIntArgument" );
- collection->Remove( parameter );
- //
-
- //
- // Removes the CodeParameterDeclarationExpression at index 0.
- collection->RemoveAt( 0 );
- //
- //
- }
- };
-}
diff --git a/snippets/cpp/VS_Snippets_CLR/CodePrimitiveExpressionExample/CPP/codeprimitiveexpressionexample.cpp b/snippets/cpp/VS_Snippets_CLR/CodePrimitiveExpressionExample/CPP/codeprimitiveexpressionexample.cpp
deleted file mode 100644
index 9056a9d5683..00000000000
--- a/snippets/cpp/VS_Snippets_CLR/CodePrimitiveExpressionExample/CPP/codeprimitiveexpressionexample.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::CodeDom;
-
-namespace CodeDomSamples
-{
- public ref class CodePrimitiveExpressionExample
- {
- public:
- CodePrimitiveExpressionExample()
- {
-
- //
- // Represents a string.
- CodePrimitiveExpression^ stringPrimitive = gcnew CodePrimitiveExpression( "Test String" );
-
- // Represents an integer.
- CodePrimitiveExpression^ intPrimitive = gcnew CodePrimitiveExpression( 10 );
-
- // Represents a floating point number.
- CodePrimitiveExpression^ floatPrimitive = gcnew CodePrimitiveExpression( 1.03189 );
-
- // Represents a null value expression.
- CodePrimitiveExpression^ nullPrimitive = gcnew CodePrimitiveExpression( 0 );
-
- //
- }
-
- };
-
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_CLR/CodePropertySetValueExample/CPP/codepropertysetvalueexample.cpp b/snippets/cpp/VS_Snippets_CLR/CodePropertySetValueExample/CPP/codepropertysetvalueexample.cpp
deleted file mode 100644
index 6a937caac58..00000000000
--- a/snippets/cpp/VS_Snippets_CLR/CodePropertySetValueExample/CPP/codepropertysetvalueexample.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::CodeDom;
-
-namespace CodeDomSamples
-{
- public ref class CodePropertySetValueExample
- {
- public:
- CodePropertySetValueExample()
- {
-
- //
- // Declares a type.
- CodeTypeDeclaration^ type1 = gcnew CodeTypeDeclaration( "Type1" );
-
- // Declares a constructor.
- CodeConstructor^ constructor1 = gcnew CodeConstructor;
- constructor1->Attributes = MemberAttributes::Public;
- type1->Members->Add( constructor1 );
-
- // Declares an integer field.
- CodeMemberField^ field1 = gcnew CodeMemberField( "System.Int32","integerField" );
- type1->Members->Add( field1 );
-
- // Declares a property.
- CodeMemberProperty^ property1 = gcnew CodeMemberProperty;
-
- // Declares a property get statement to return the value of the integer field.
- property1->GetStatements->Add( gcnew CodeMethodReturnStatement( gcnew CodeFieldReferenceExpression( gcnew CodeThisReferenceExpression,"integerField" ) ) );
-
- // Declares a property set statement to set the value to the integer field.
- // The CodePropertySetValueReferenceExpression represents the value argument passed to the property set statement.
- property1->SetStatements->Add( gcnew CodeAssignStatement( gcnew CodeFieldReferenceExpression( gcnew CodeThisReferenceExpression,"integerField" ),gcnew CodePropertySetValueReferenceExpression ) );
- type1->Members->Add( property1 );
-
- // A C# code generator produces the following source code for the preceeding example code:
- // public class Type1
- // {
- //
- // private int integerField;
- //
- // public Type1()
- // {
- // }
- //
- // private int integerProperty
- // {
- // get
- // {
- // return this.integerField;
- // }
- // set
- // {
- // this.integerField = value;
- // }
- // }
- // }
- //
- }
-
- };
-
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_CLR/CodeReferenceExample/CPP/codereferenceexample.cpp b/snippets/cpp/VS_Snippets_CLR/CodeReferenceExample/CPP/codereferenceexample.cpp
deleted file mode 100644
index b6dcd099dd2..00000000000
--- a/snippets/cpp/VS_Snippets_CLR/CodeReferenceExample/CPP/codereferenceexample.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::CodeDom;
-
-namespace CodeDomSamples
-{
- public ref class CodeReferenceExample
- {
- public:
- CodeReferenceExample(){}
-
- void CodeFieldReferenceExample()
- {
-
- //
- CodeFieldReferenceExpression^ fieldRef1 = gcnew CodeFieldReferenceExpression( gcnew CodeThisReferenceExpression,"TestField" );
-
- // A C# code generator produces the following source code for the preceeding example code:
- // this.TestField
- //
- }
-
- void CodePropertyReferenceExample()
- {
-
- //
- CodePropertyReferenceExpression^ propertyRef1 = gcnew CodePropertyReferenceExpression( gcnew CodeThisReferenceExpression,"TestProperty" );
-
- // A C# code generator produces the following source code for the preceeding example code:
- // this.TestProperty
- //
- }
-
- void CodeVariableReferenceExample()
- {
-
- //
- CodeVariableReferenceExpression^ variableRef1 = gcnew CodeVariableReferenceExpression( "TestVariable" );
-
- // A C# code generator produces the following source code for the preceeding example code:
- // TestVariable
- //
- }
-
- };
-
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_CLR/CodeRemoveEventExample/CPP/coderemoveeventexample.cpp b/snippets/cpp/VS_Snippets_CLR/CodeRemoveEventExample/CPP/coderemoveeventexample.cpp
deleted file mode 100644
index 4f5f9c70446..00000000000
--- a/snippets/cpp/VS_Snippets_CLR/CodeRemoveEventExample/CPP/coderemoveeventexample.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::CodeDom;
-
-namespace CodeDomSamples
-{
- public ref class CodeRemoveEventExample
- {
- public:
- CodeRemoveEventExample()
- {
-
- //
- // Creates a delegate of type System.EventHandler pointing to a method named OnMouseEnter.
- CodeDelegateCreateExpression^ mouseEnterDelegate = gcnew CodeDelegateCreateExpression( gcnew CodeTypeReference( "System.EventHandler" ),gcnew CodeThisReferenceExpression,"OnMouseEnter" );
-
- // Creates a remove event statement that removes the delegate from the TestEvent event.
- CodeRemoveEventStatement^ removeEvent1 = gcnew CodeRemoveEventStatement( gcnew CodeThisReferenceExpression,"TestEvent",mouseEnterDelegate );
-
- // A C# code generator produces the following source code for the preceeding example code:
- // this.TestEvent -= new System.EventHandler(this.OnMouseEnter);
- //
- }
-
- };
-
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_CLR/CodeStatementCollectionExample/CPP/class1.cpp b/snippets/cpp/VS_Snippets_CLR/CodeStatementCollectionExample/CPP/class1.cpp
deleted file mode 100644
index 03265e75e7f..00000000000
--- a/snippets/cpp/VS_Snippets_CLR/CodeStatementCollectionExample/CPP/class1.cpp
+++ /dev/null
@@ -1,78 +0,0 @@
-#using
-
-using namespace System;
-using namespace System::CodeDom;
-
-namespace CodeStatementCollectionExample
-{
- public ref class Class1
- {
- public:
- Class1(){}
-
- // CodeStatementCollection
- void CodeStatementCollectionExample()
- {
-
- //
- //
- // Creates an empty CodeStatementCollection.
- CodeStatementCollection^ collection = gcnew CodeStatementCollection;
- //
-
- //
- // Adds a CodeStatement to the collection.
- collection->Add( gcnew CodeCommentStatement( "Test comment statement" ) );
- //
-
- //
- // Adds an array of CodeStatement objects to the collection.
- array^statements = {gcnew CodeCommentStatement( "Test comment statement" ),gcnew CodeCommentStatement( "Test comment statement" )};
- collection->AddRange( statements );
-
- // Adds a collection of CodeStatement objects to the collection.
- CodeStatement^ testStatement = gcnew CodeCommentStatement( "Test comment statement" );
- CodeStatementCollection^ statementsCollection = gcnew CodeStatementCollection;
- statementsCollection->Add( gcnew CodeCommentStatement( "Test comment statement" ) );
- statementsCollection->Add( gcnew CodeCommentStatement( "Test comment statement" ) );
- statementsCollection->Add( testStatement );
- collection->AddRange( statementsCollection );
- //
-
- //
- // Tests for the presence of a CodeStatement in the
- // collection, and retrieves its index if it is found.
- int itemIndex = -1;
- if ( collection->Contains( testStatement ) )
- itemIndex = collection->IndexOf( testStatement );
- //
-
- //
- // Copies the contents of the collection beginning at index 0 to the specified CodeStatement array.
- // 'statements' is a CodeStatement array.
- collection->CopyTo( statements, 0 );
- //
-
- //
- // Retrieves the count of the items in the collection.
- int collectionCount = collection->Count;
- //
-
- //
- // Inserts a CodeStatement at index 0 of the collection.
- collection->Insert( 0, gcnew CodeCommentStatement( "Test comment statement" ) );
- //
-
- //
- // Removes the specified CodeStatement from the collection.
- collection->Remove( testStatement );
- //
-
- //
- // Removes the CodeStatement at index 0.
- collection->RemoveAt( 0 );
- //
- //
- }
- };
-}
diff --git a/snippets/cpp/VS_Snippets_CLR/CodeThrowExceptionStatement/CPP/codethrowexceptionstatementexample.cpp b/snippets/cpp/VS_Snippets_CLR/CodeThrowExceptionStatement/CPP/codethrowexceptionstatementexample.cpp
deleted file mode 100644
index 54009857661..00000000000
--- a/snippets/cpp/VS_Snippets_CLR/CodeThrowExceptionStatement/CPP/codethrowexceptionstatementexample.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::CodeDom;
-
-public ref class CodeThrowExceptionStatementExample
-{
-public:
- CodeThrowExceptionStatementExample()
- {
- //
- // This CodeThrowExceptionStatement throws a new System.Exception.
- array^temp0;
- CodeThrowExceptionStatement^ throwException = gcnew CodeThrowExceptionStatement( gcnew CodeObjectCreateExpression( gcnew CodeTypeReference( System::Exception::typeid ),temp0 ) );
-
- // A C# code generator produces the following source code for the preceeding example code:
- // throw new System.Exception();
- //
- }
-};
-//
diff --git a/snippets/cpp/VS_Snippets_CLR/CodeTryCatchFinallyExample/CPP/codetrycatchfinallyexample.cpp b/snippets/cpp/VS_Snippets_CLR/CodeTryCatchFinallyExample/CPP/codetrycatchfinallyexample.cpp
deleted file mode 100644
index cb97225e885..00000000000
--- a/snippets/cpp/VS_Snippets_CLR/CodeTryCatchFinallyExample/CPP/codetrycatchfinallyexample.cpp
+++ /dev/null
@@ -1,81 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::CodeDom;
-public ref class CodeTryCatchFinallyExample
-{
-public:
- CodeTryCatchFinallyExample()
- {
-
- //
- // Declares a type to contain a try...catch block.
- CodeTypeDeclaration^ type1 = gcnew CodeTypeDeclaration( "TryCatchTest" );
-
- // Defines a method that throws an exception of type System.ApplicationException.
- CodeMemberMethod^ method1 = gcnew CodeMemberMethod;
- method1->Name = "ThrowApplicationException";
- array^temp = {gcnew CodePrimitiveExpression( "Test Application Exception" )};
- method1->Statements->Add( gcnew CodeThrowExceptionStatement( gcnew CodeObjectCreateExpression( "System.ApplicationException",temp ) ) );
- type1->Members->Add( method1 );
-
- // Defines a constructor that calls the ThrowApplicationException method from a try block.
- CodeConstructor^ constructor1 = gcnew CodeConstructor;
- constructor1->Attributes = MemberAttributes::Public;
- type1->Members->Add( constructor1 );
-
- // Defines a try statement that calls the ThrowApplicationException method.
- CodeTryCatchFinallyStatement^ try1 = gcnew CodeTryCatchFinallyStatement;
- try1->TryStatements->Add( gcnew CodeMethodInvokeExpression( gcnew CodeThisReferenceExpression,"ThrowApplicationException", nullptr ) );
- constructor1->Statements->Add( try1 );
-
- // Defines a catch clause for exceptions of type ApplicationException.
- CodeCatchClause^ catch1 = gcnew CodeCatchClause( "ex",gcnew CodeTypeReference( "System.ApplicationException" ) );
- catch1->Statements->Add( gcnew CodeCommentStatement( "Handle any System.ApplicationException here." ) );
- try1->CatchClauses->Add( catch1 );
-
- // Defines a catch clause for any remaining unhandled exception types.
- CodeCatchClause^ catch2 = gcnew CodeCatchClause( "ex" );
- catch2->Statements->Add( gcnew CodeCommentStatement( "Handle any other exception type here." ) );
- try1->CatchClauses->Add( catch2 );
-
- // Defines a finally block by adding to the FinallyStatements collection.
- try1->FinallyStatements->Add( gcnew CodeCommentStatement( "Handle any finally block statements." ) );
-
- // A C# code generator produces the following source code for the preceeding example code:
- // public class TryCatchTest
- // {
- //
- // public TryCatchTest()
- // {
- // try
- // {
- // this.ThrowApplicationException();
- // }
- // catch (System.ApplicationException ex)
- // {
- // // Handle any System.ApplicationException here.
- // }
- // catch (System.Exception ex)
- // {
- // // Handle any other exception type here.
- // }
- // finally {
- // // Handle any finally block statements.
- // }
- // }
- //
- // private void ThrowApplicationException()
- // {
- // throw new System.ApplicationException("Test Application Exception");
- // }
- // }
- //
- }
-
-};
-
-//
diff --git a/snippets/cpp/VS_Snippets_CLR/CodeTypeConstructorExample/CPP/codetypeconstructorexample.cpp b/snippets/cpp/VS_Snippets_CLR/CodeTypeConstructorExample/CPP/codetypeconstructorexample.cpp
deleted file mode 100644
index aefa0b83158..00000000000
--- a/snippets/cpp/VS_Snippets_CLR/CodeTypeConstructorExample/CPP/codetypeconstructorexample.cpp
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::CodeDom;
-
-namespace CodeDomSamples
-{
- public ref class CodeTypeConstructorExample
- {
- public:
- CodeTypeConstructorExample()
- {
-
- //
- // Declares a new type for a static constructor.
- CodeTypeDeclaration^ type1 = gcnew CodeTypeDeclaration( "Type1" );
-
- // Declares a static constructor.
- CodeTypeConstructor^ constructor2 = gcnew CodeTypeConstructor;
-
- // Adds the static constructor to the type.
- type1->Members->Add( constructor2 );
-
- // A C# code generator produces the following source code for the preceeding example code:
- // public class Type1
- // {
- //
- // static Type1()
- // {
- // }
- // }
- //
- }
-
- };
-
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_CLR/CodeTypeDeclarationCollectionExample/CPP/class1.cpp b/snippets/cpp/VS_Snippets_CLR/CodeTypeDeclarationCollectionExample/CPP/class1.cpp
deleted file mode 100644
index eb0a71bdaee..00000000000
--- a/snippets/cpp/VS_Snippets_CLR/CodeTypeDeclarationCollectionExample/CPP/class1.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-#using
-
-using namespace System;
-using namespace System::CodeDom;
-
-namespace CodeTypeDeclarationCollectionExample
-{
- public ref class Class1
- {
- public:
- Class1(){}
-
- // CodeTypeDeclarationCollection
- void CodeTypeDeclarationCollectionExample()
- {
-
- //
- //
- // Creates an empty CodeTypeDeclarationCollection.
- CodeTypeDeclarationCollection^ collection = gcnew CodeTypeDeclarationCollection;
- //
-
- //
- // Adds a CodeTypeDeclaration to the collection.
- collection->Add( gcnew CodeTypeDeclaration( "TestType" ) );
- //
-
- //
- // Adds an array of CodeTypeDeclaration objects to the collection.
- array^declarations = {gcnew CodeTypeDeclaration( "TestType1" ),gcnew CodeTypeDeclaration( "TestType2" )};
- collection->AddRange( declarations );
-
- // Adds a collection of CodeTypeDeclaration objects to the
- // collection.
- CodeTypeDeclarationCollection^ declarationsCollection = gcnew CodeTypeDeclarationCollection;
- declarationsCollection->Add( gcnew CodeTypeDeclaration( "TestType1" ) );
- declarationsCollection->Add( gcnew CodeTypeDeclaration( "TestType2" ) );
- collection->AddRange( declarationsCollection );
- //
-
- //
- // Tests for the presence of a CodeTypeDeclaration in the
- // collection, and retrieves its index if it is found.
- CodeTypeDeclaration^ testDeclaration = gcnew CodeTypeDeclaration( "TestType" );
- int itemIndex = -1;
- if ( collection->Contains( testDeclaration ) )
- itemIndex = collection->IndexOf( testDeclaration );
- //
-
- //
- // Copies the contents of the collection, beginning at index 0,
- // to the specified CodeTypeDeclaration array.
- // 'declarations' is a CodeTypeDeclaration array.
- collection->CopyTo( declarations, 0 );
- //
-
- //
- // Retrieves the count of the items in the collection.
- int collectionCount = collection->Count;
- //
-
- //
- // Inserts a CodeTypeDeclaration at index 0 of the collection.
- collection->Insert( 0, gcnew CodeTypeDeclaration( "TestType" ) );
- //
-
- //
- // Removes the specified CodeTypeDeclaration from the collection.
- CodeTypeDeclaration^ declaration = gcnew CodeTypeDeclaration( "TestType" );
- collection->Remove( declaration );
- //
-
- //
- // Removes the CodeTypeDeclaration at index 0.
- collection->RemoveAt( 0 );
- //
- //
- }
- };
-}
diff --git a/snippets/cpp/VS_Snippets_CLR/CodeTypeDeclarationExample/CPP/codetypedeclarationexample.cpp b/snippets/cpp/VS_Snippets_CLR/CodeTypeDeclarationExample/CPP/codetypedeclarationexample.cpp
deleted file mode 100644
index ac817d9918f..00000000000
--- a/snippets/cpp/VS_Snippets_CLR/CodeTypeDeclarationExample/CPP/codetypedeclarationexample.cpp
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::CodeDom;
-using namespace System::Reflection;
-
-namespace CodeDomSamples
-{
- public ref class CodeTypeDeclarationExample
- {
- public:
- CodeTypeDeclarationExample()
- {
-
- //
- // Creates a new type declaration.
-
- // name parameter indicates the name of the type.
- CodeTypeDeclaration^ newType = gcnew CodeTypeDeclaration( "TestType" );
-
- // Sets the member attributes for the type to private.
- newType->Attributes = MemberAttributes::Private;
-
- // Sets a base class which the type inherits from.
- newType->BaseTypes->Add( "BaseType" );
-
- // A C# code generator produces the following source code for the preceeding example code:
- // class TestType : BaseType
- // {
- // }
- //
- }
-
- };
-
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_CLR/CodeTypeDelegateExample/CPP/codetypedelegateexample.cpp b/snippets/cpp/VS_Snippets_CLR/CodeTypeDelegateExample/CPP/codetypedelegateexample.cpp
deleted file mode 100644
index 79266531f92..00000000000
--- a/snippets/cpp/VS_Snippets_CLR/CodeTypeDelegateExample/CPP/codetypedelegateexample.cpp
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::CodeDom;
-
-namespace CodeDomSamples
-{
- public ref class CodeTypeDelegateExample
- {
- public:
- CodeTypeDelegateExample()
- {
-
- //
- // Declares a type to contain the delegate and constructor method.
- CodeTypeDeclaration^ type1 = gcnew CodeTypeDeclaration( "DelegateTest" );
-
- // Declares an event that accepts a custom delegate type of "TestDelegate".
- CodeMemberEvent^ event1 = gcnew CodeMemberEvent;
- event1->Name = "TestEvent";
- event1->Type = gcnew CodeTypeReference( "DelegateTest.TestDelegate" );
- type1->Members->Add( event1 );
-
- //
- // Declares a delegate type called TestDelegate with an EventArgs parameter.
- CodeTypeDelegate^ delegate1 = gcnew CodeTypeDelegate( "TestDelegate" );
- delegate1->Parameters->Add( gcnew CodeParameterDeclarationExpression( "System.Object","sender" ) );
- delegate1->Parameters->Add( gcnew CodeParameterDeclarationExpression( "System.EventArgs","e" ) );
-
- // A C# code generator produces the following source code for the preceeding example code:
- // public delegate void TestDelegate(object sender, System.EventArgs e);
- //
- type1->Members->Add( delegate1 );
-
- // Declares a method that matches the "TestDelegate" method signature.
- CodeMemberMethod^ method1 = gcnew CodeMemberMethod;
- method1->Name = "TestMethod";
- method1->Parameters->Add( gcnew CodeParameterDeclarationExpression( "System.Object","sender" ) );
- method1->Parameters->Add( gcnew CodeParameterDeclarationExpression( "System.EventArgs","e" ) );
- type1->Members->Add( method1 );
-
- // Defines a constructor that attaches a TestDelegate delegate pointing to the TestMethod method
- // to the TestEvent event.
- CodeConstructor^ constructor1 = gcnew CodeConstructor;
- constructor1->Attributes = MemberAttributes::Public;
- CodeDelegateCreateExpression^ createDelegate1 = gcnew CodeDelegateCreateExpression( gcnew CodeTypeReference( "DelegateTest.TestDelegate" ),gcnew CodeThisReferenceExpression,"TestMethod" );
- CodeAttachEventStatement^ attachStatement1 = gcnew CodeAttachEventStatement( gcnew CodeThisReferenceExpression,"TestEvent",createDelegate1 );
- constructor1->Statements->Add( attachStatement1 );
- type1->Members->Add( constructor1 );
-
- // A C# code generator produces the following source code for the preceeding example code:
- // public class DelegateTest
- // {
- //
- // public DelegateTest()
- // {
- // this.TestEvent += new DelegateTest.TestDelegate(this.TestMethod);
- // }
- //
- // private event DelegateTest.TestDelegate TestEvent;
- //
- // private void TestMethod(object sender, System.EventArgs e)
- // {
- // }
- //
- // public delegate void TestDelegate(object sender, System.EventArgs e);
- // }
- //
- }
-
- };
-
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_CLR/CodeTypeMemberCollectionExample/CPP/class1.cpp b/snippets/cpp/VS_Snippets_CLR/CodeTypeMemberCollectionExample/CPP/class1.cpp
deleted file mode 100644
index 764de1a8a1d..00000000000
--- a/snippets/cpp/VS_Snippets_CLR/CodeTypeMemberCollectionExample/CPP/class1.cpp
+++ /dev/null
@@ -1,79 +0,0 @@
-#using
-
-using namespace System;
-using namespace System::CodeDom;
-
-namespace CodeTypeMemberCollectionExample
-{
- public ref class Class1
- {
- public:
- Class1(){}
-
- // CodeTypeMemberCollection
- void CodeTypeMemberCollectionExample()
- {
-
- //
- //
- // Creates an empty CodeTypeMemberCollection.
- CodeTypeMemberCollection^ collection = gcnew CodeTypeMemberCollection;
- //
-
- //
- // Adds a CodeTypeMember to the collection.
- collection->Add( gcnew CodeMemberField( "System.String","TestStringField" ) );
- //
-
- //
- // Adds an array of CodeTypeMember objects to the collection.
- array^members = {gcnew CodeMemberField( "System.String","TestStringField1" ),gcnew CodeMemberField( "System.String","TestStringField2" )};
- collection->AddRange( members );
-
- // Adds a collection of CodeTypeMember objects to the collection.
- CodeTypeMemberCollection^ membersCollection = gcnew CodeTypeMemberCollection;
- membersCollection->Add( gcnew CodeMemberField( "System.String","TestStringField1" ) );
- membersCollection->Add( gcnew CodeMemberField( "System.String","TestStringField2" ) );
- collection->AddRange( membersCollection );
- //
-
- //
- // Tests for the presence of a CodeTypeMember in the collection,
- // and retrieves its index if it is found.
- CodeTypeMember^ testMember = gcnew CodeMemberField( "System.String","TestStringField" );
- int itemIndex = -1;
- if ( collection->Contains( testMember ) )
- itemIndex = collection->IndexOf( testMember );
- //
-
- //
- // Copies the contents of the collection, beginning at index 0,
- // to the specified CodeTypeMember array.
- // 'members' is a CodeTypeMember array.
- collection->CopyTo( members, 0 );
- //
-
- //
- // Retrieves the count of the items in the collection.
- int collectionCount = collection->Count;
- //
-
- //
- // Inserts a CodeTypeMember at index 0 of the collection.
- collection->Insert( 0, gcnew CodeMemberField( "System.String","TestStringField" ) );
- //
-
- //
- // Removes the specified CodeTypeMember from the collection.
- CodeTypeMember^ member = gcnew CodeMemberField( "System.String","TestStringField" );
- collection->Remove( member );
- //
-
- //
- // Removes the CodeTypeMember at index 0.
- collection->RemoveAt( 0 );
- //
- //
- }
- };
-}
diff --git a/snippets/cpp/VS_Snippets_CLR/CodeTypeOfExample/CPP/codetypeofexample.cpp b/snippets/cpp/VS_Snippets_CLR/CodeTypeOfExample/CPP/codetypeofexample.cpp
deleted file mode 100644
index c1b459722a5..00000000000
--- a/snippets/cpp/VS_Snippets_CLR/CodeTypeOfExample/CPP/codetypeofexample.cpp
+++ /dev/null
@@ -1,63 +0,0 @@
-//
-#using
-
-using namespace System;
-using namespace System::CodeDom;
-using namespace System::CodeDom::Compiler;
-
-namespace CodeDomSamples
-{
- public ref class CodeTypeOfExample
- {
- public:
- static void Main()
- {
- ShowTypeReference();
- Console::WriteLine();
- ShowTypeReferenceExpression();
- }
-
- static void ShowTypeReference()
- {
- //
- // Creates a reference to the System.DateTime type.
- CodeTypeReference^ typeRef1 = gcnew CodeTypeReference("System.DateTime");
-
- // Creates a typeof expression for the specified type reference.
- CodeTypeOfExpression^ typeof1 = gcnew CodeTypeOfExpression(typeRef1);
-
- // Create a C# code provider
- CodeDomProvider^ provider = CodeDomProvider::CreateProvider("CSharp");
-
- // Generate code and send the output to the console
- provider->GenerateCodeFromExpression(typeof1, Console::Out, gcnew CodeGeneratorOptions());
- // The code generator produces the following source code for the preceeding example code:
- // typeof(System.DateTime)
- //
- }
-
- static void ShowTypeReferenceExpression()
- {
- //
- // Creates an expression referencing the System.DateTime type.
- CodeTypeReferenceExpression^ typeRef1 = gcnew CodeTypeReferenceExpression("System.DateTime");
-
- // Create a C# code provider
- CodeDomProvider^ provider = CodeDomProvider::CreateProvider("CSharp");
-
- // Generate code and send the output to the console
- provider->GenerateCodeFromExpression(typeRef1, Console::Out, gcnew CodeGeneratorOptions());
- // The code generator produces the following source code for the preceeding example code:
-
- // System.DateTime
-
- //
- }
- };
-}
-
-int main()
-{
- CodeDomSamples::CodeTypeOfExample::Main();
-}
-//
\ No newline at end of file
diff --git a/snippets/cpp/VS_Snippets_CLR/CodeTypeReferenceCollection/CPP/class1.cpp b/snippets/cpp/VS_Snippets_CLR/CodeTypeReferenceCollection/CPP/class1.cpp
deleted file mode 100644
index ab613ec0d11..00000000000
--- a/snippets/cpp/VS_Snippets_CLR/CodeTypeReferenceCollection/CPP/class1.cpp
+++ /dev/null
@@ -1,78 +0,0 @@
-#using
-
-using namespace System;
-using namespace System::CodeDom;
-
-namespace CodeTypeReferenceCollectionExample
-{
- public ref class Class1
- {
- public:
- Class1(){}
-
- // CodeTypeReferenceCollection
- void CodeTypeReferenceCollectionExample()
- {
- //
- //
- // Creates an empty CodeTypeReferenceCollection.
- CodeTypeReferenceCollection^ collection = gcnew CodeTypeReferenceCollection;
- //
-
- //
- // Adds a CodeTypeReference to the collection.
- collection->Add( gcnew CodeTypeReference( bool::typeid ) );
- //
-
- //
- // Adds an array of CodeTypeReference objects to the collection.
- array^references = {gcnew CodeTypeReference( bool::typeid ),gcnew CodeTypeReference( bool::typeid )};
- collection->AddRange( references );
-
- // Adds a collection of CodeTypeReference objects to the collection.
- CodeTypeReferenceCollection^ referencesCollection = gcnew CodeTypeReferenceCollection;
- referencesCollection->Add( gcnew CodeTypeReference( bool::typeid ) );
- referencesCollection->Add( gcnew CodeTypeReference( bool::typeid ) );
- collection->AddRange( referencesCollection );
- //
-
- //
- // Tests for the presence of a CodeTypeReference in the
- // collection, and retrieves its index if it is found.
- CodeTypeReference^ testReference = gcnew CodeTypeReference( bool::typeid );
- int itemIndex = -1;
- if ( collection->Contains( testReference ) )
- itemIndex = collection->IndexOf( testReference );
- //
-
- //
- // Copies the contents of the collection, beginning at index 0,
- // to the specified CodeTypeReference array.
- // 'references' is a CodeTypeReference array.
- collection->CopyTo( references, 0 );
- //
-
- //
- // Retrieves the count of the items in the collection.
- int collectionCount = collection->Count;
- //
-
- //
- // Inserts a CodeTypeReference at index 0 of the collection.
- collection->Insert( 0, gcnew CodeTypeReference( bool::typeid ) );
- //
-
- //
- // Removes the specified CodeTypeReference from the collection.
- CodeTypeReference^ reference = gcnew CodeTypeReference( bool::typeid );
- collection->Remove( reference );
- //
-
- //
- // Removes the CodeTypeReference at index 0.
- collection->RemoveAt( 0 );
- //
- //
- }
- };
-}
diff --git a/snippets/cpp/VS_Snippets_CLR/CodeVariableDeclarationStatementExample/CPP/codevariabledeclarationstatementexample.cpp b/snippets/cpp/VS_Snippets_CLR/CodeVariableDeclarationStatementExample/CPP/codevariabledeclarationstatementexample.cpp
deleted file mode 100644
index a97b2b691ab..00000000000
--- a/snippets/cpp/VS_Snippets_CLR/CodeVariableDeclarationStatementExample/CPP/codevariabledeclarationstatementexample.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::CodeDom;
-
-namespace CodeDomSamples
-{
- public ref class CodeVariableDeclarationStatementExample
- {
- public:
- CodeVariableDeclarationStatementExample()
- {
- //
- // Type of the variable to declare.
- // Name of the variable to declare.
- // Optional initExpression parameter initializes the variable.
- CodeVariableDeclarationStatement^ variableDeclaration = gcnew CodeVariableDeclarationStatement( String::typeid,"TestString",gcnew CodePrimitiveExpression( "Testing" ) );
-
- // A C# code generator produces the following source code for the preceeding example code:
- // string TestString = "Testing";
- //
- }
- };
-}
-//
diff --git a/snippets/cpp/VS_Snippets_CLR/CompilerErrorCollectionExample/CPP/class1.cpp b/snippets/cpp/VS_Snippets_CLR/CompilerErrorCollectionExample/CPP/class1.cpp
deleted file mode 100644
index 8a41cb9003d..00000000000
--- a/snippets/cpp/VS_Snippets_CLR/CompilerErrorCollectionExample/CPP/class1.cpp
+++ /dev/null
@@ -1,77 +0,0 @@
-#using
-
-using namespace System;
-using namespace System::CodeDom;
-using namespace System::CodeDom::Compiler;
-
-public ref class Class1
-{
-public:
- Class1(){}
-
- // CompilerErrorCollection
- void CompilerErrorCollectionExample()
- {
-
- //
- //
- // Creates an empty CompilerErrorCollection.
- CompilerErrorCollection^ collection = gcnew CompilerErrorCollection;
- //
-
- //
- // Adds a CompilerError to the collection.
- collection->Add( gcnew CompilerError( "Testfile::cs",5,10,"CS0001","Example error text" ) );
- //
-
- //
- // Adds an array of CompilerError objects to the collection.
- array^errors = {gcnew CompilerError( "Testfile.cs",5,10,"CS0001","Example error text" ),gcnew CompilerError( "Testfile::cs",5,10,"CS0001","Example error text" )};
- collection->AddRange( errors );
-
- // Adds a collection of CompilerError objects to the collection.
- CompilerErrorCollection^ errorsCollection = gcnew CompilerErrorCollection;
- errorsCollection->Add( gcnew CompilerError( "Testfile.cs",5,10,"CS0001","Example error text" ) );
- errorsCollection->Add( gcnew CompilerError( "Testfile.cs",5,10,"CS0001","Example error text" ) );
- collection->AddRange( errorsCollection );
- //
-
- //
- // Tests for the presence of a CompilerError in the
- // collection, and retrieves its index if it is found.
- CompilerError^ testError = gcnew CompilerError( "Testfile.cs",5,10,"CS0001","Example error text" );
- int itemIndex = -1;
- if ( collection->Contains( testError ) )
- itemIndex = collection->IndexOf( testError );
- //
-
- //
- // Copies the contents of the collection, beginning at index 0,
- // to the specified CompilerError array.
- // 'errors' is a CompilerError array.
- collection->CopyTo( errors, 0 );
- //
-
- //
- // Retrieves the count of the items in the collection.
- int collectionCount = collection->Count;
- //
-
- //
- // Inserts a CompilerError at index 0 of the collection.
- collection->Insert( 0, gcnew CompilerError( "Testfile.cs",5,10,"CS0001","Example error text" ) );
- //
-
- //
- // Removes the specified CompilerError from the collection.
- CompilerError^ error = gcnew CompilerError( "Testfile.cs",5,10,"CS0001","Example error text" );
- collection->Remove( error );
- //
-
- //
- // Removes the CompilerError at index 0.
- collection->RemoveAt( 0 );
- //
- //
- }
-};
diff --git a/snippets/cpp/VS_Snippets_CLR/CompilerParametersExample/CPP/source.cpp b/snippets/cpp/VS_Snippets_CLR/CompilerParametersExample/CPP/source.cpp
deleted file mode 100644
index 2ee1d38b759..00000000000
--- a/snippets/cpp/VS_Snippets_CLR/CompilerParametersExample/CPP/source.cpp
+++ /dev/null
@@ -1,234 +0,0 @@
-// The following example builds a CodeDom source graph for a simple
-// Hello World program. The source is then saved to a file,
-// compiled into an executable, and run.
-
-// This example is based loosely on the CodeDom example, but its
-// primary intent is to illustrate the CompilerParameters class.
-
-// Notice that the snippet is conditionally compiled for Everett vs.
-// Whidbey builds. Whidbey introduced new APIs that are not available
-// in Everett. Snippet IDs do not overlap between Whidbey and Everett;
-// Snippet #1 is Everett, Snippet #2 is Whidbey.
-#using
-//
-using namespace System;
-using namespace System::CodeDom;
-using namespace System::CodeDom::Compiler;
-using namespace System::Collections;
-using namespace System::ComponentModel;
-using namespace System::IO;
-using namespace System::Diagnostics;
-
-// Build a Hello World program graph using System.CodeDom types.
-static CodeCompileUnit^ BuildHelloWorldGraph()
-{
- // Create a new CodeCompileUnit to contain the program graph.
- CodeCompileUnit^ compileUnit = gcnew CodeCompileUnit;
-
- // Declare a new namespace called Samples.
- CodeNamespace^ samples = gcnew CodeNamespace( "Samples" );
- // Add the new namespace to the compile unit.
- compileUnit->Namespaces->Add( samples );
-
- // Add the new namespace import for the System namespace.
- samples->Imports->Add( gcnew CodeNamespaceImport( "System" ) );
-
- // Declare a new type called Class1.
- CodeTypeDeclaration^ class1 = gcnew CodeTypeDeclaration( "Class1" );
- // Add the new type to the namespace's type collection.
- samples->Types->Add( class1 );
-
- // Declare a new code entry point method
- CodeEntryPointMethod^ start = gcnew CodeEntryPointMethod;
-
- // Create a type reference for the System::Console class.
- CodeTypeReferenceExpression^ csSystemConsoleType =
- gcnew CodeTypeReferenceExpression( "System.Console" );
-
- // Build a Console::WriteLine statement.
- CodeMethodInvokeExpression^ cs1 = gcnew CodeMethodInvokeExpression(
- csSystemConsoleType, "WriteLine",
- gcnew CodePrimitiveExpression( "Hello World!" ) );
-
- // Add the WriteLine call to the statement collection.
- start->Statements->Add( cs1 );
-
- // Build another Console::WriteLine statement.
- CodeMethodInvokeExpression^ cs2 = gcnew CodeMethodInvokeExpression(
- csSystemConsoleType, "WriteLine",
- gcnew CodePrimitiveExpression( "Press the Enter key to continue." ) );
- // Add the WriteLine call to the statement collection.
- start->Statements->Add( cs2 );
-
- // Build a call to System::Console::ReadLine.
- CodeMethodReferenceExpression^ csReadLine = gcnew CodeMethodReferenceExpression(
- csSystemConsoleType, "ReadLine" );
- CodeMethodInvokeExpression^ cs3 = gcnew CodeMethodInvokeExpression(
- csReadLine,gcnew array(0) );
-
- // Add the ReadLine statement.
- start->Statements->Add( cs3 );
-
- // Add the code entry point method to the Members collection
- // of the type.
- class1->Members->Add( start );
-
- return compileUnit;
-}
-
-static String^ GenerateCode( CodeDomProvider^ provider, CodeCompileUnit^ compileunit )
-{
- // Build the source file name with the language extension (vb, cs, js).
- String^ sourceFile = String::Empty;
-
- if ( provider->FileExtension->StartsWith( "." ) )
- {
- sourceFile = String::Concat( "HelloWorld", provider->FileExtension );
- }
- else
- {
- sourceFile = String::Concat( "HelloWorld.", provider->FileExtension );
- }
-
- // Create a TextWriter to a StreamWriter to an output file.
- IndentedTextWriter^ tw = gcnew IndentedTextWriter(
- gcnew StreamWriter( sourceFile,false )," " );
- // Generate source code using the code generator.
- provider->GenerateCodeFromCompileUnit( compileunit, tw, gcnew CodeGeneratorOptions );
- // Close the output file.
- tw->Close();
- return sourceFile;
-}
-
-//
-static bool CompileCode( CodeDomProvider^ provider,
- String^ sourceFile,
- String^ exeFile )
-{
-
- CompilerParameters^ cp = gcnew CompilerParameters;
- if ( !cp)
- {
- return false;
- }
-
- // Generate an executable instead of
- // a class library.
- cp->GenerateExecutable = true;
-
- // Set the assembly file name to generate.
- cp->OutputAssembly = exeFile;
-
- // Generate debug information.
- cp->IncludeDebugInformation = true;
-
- // Add an assembly reference.
- cp->ReferencedAssemblies->Add( "System.dll" );
-
- // Save the assembly as a physical file.
- cp->GenerateInMemory = false;
-
- // Set the level at which the compiler
- // should start displaying warnings.
- cp->WarningLevel = 3;
-
- // Set whether to treat all warnings as errors.
- cp->TreatWarningsAsErrors = false;
-
- // Set compiler argument to optimize output.
- cp->CompilerOptions = "/optimize";
-
- // Set a temporary files collection.
- // The TempFileCollection stores the temporary files
- // generated during a build in the current directory,
- // and does not delete them after compilation.
- cp->TempFiles = gcnew TempFileCollection( ".",true );
-
- if ( provider->Supports( GeneratorSupport::EntryPointMethod ) )
- {
- // Specify the class that contains
- // the main method of the executable.
- cp->MainClass = "Samples.Class1";
- }
-
- if ( Directory::Exists( "Resources" ) )
- {
- if ( provider->Supports( GeneratorSupport::Resources ) )
- {
- // Set the embedded resource file of the assembly.
- // This is useful for culture-neutral resources,
- // or default (fallback) resources.
- cp->EmbeddedResources->Add( "Resources\\Default.resources" );
-
- // Set the linked resource reference files of the assembly.
- // These resources are included in separate assembly files,
- // typically localized for a specific language and culture.
- cp->LinkedResources->Add( "Resources\\nb-no.resources" );
- }
- }
-
- // Invoke compilation.
- CompilerResults^ cr = provider->CompileAssemblyFromFile( cp, sourceFile );
-
- if ( cr->Errors->Count > 0 )
- {
- // Display compilation errors.
- Console::WriteLine( "Errors building {0} into {1}",
- sourceFile, cr->PathToAssembly );
- for each ( CompilerError^ ce in cr->Errors )
- {
- Console::WriteLine( " {0}", ce->ToString() );
- Console::WriteLine();
- }
- }
- else
- {
- Console::WriteLine( "Source {0} built into {1} successfully.",
- sourceFile, cr->PathToAssembly );
- }
-
- // Return the results of compilation.
- if ( cr->Errors->Count > 0 )
- {
- return false;
- }
- else
- {
- return true;
- }
-}
-//
-
-[STAThread]
-void main()
-{
- String^ exeName = "HelloWorld.exe";
- CodeDomProvider^ provider = nullptr;
-
- Console::WriteLine( "Enter the source language for Hello World (cs, vb, etc):" );
- String^ inputLang = Console::ReadLine();
- Console::WriteLine();
-
- if ( CodeDomProvider::IsDefinedLanguage( inputLang ) )
- {
- CodeCompileUnit^ helloWorld = BuildHelloWorldGraph();
- provider = CodeDomProvider::CreateProvider( inputLang );
- if ( helloWorld && provider )
- {
- String^ sourceFile = GenerateCode( provider, helloWorld );
- Console::WriteLine( "HelloWorld source code generated." );
- if ( CompileCode( provider, sourceFile, exeName ) )
- {
- Console::WriteLine( "Starting HelloWorld executable." );
- Process::Start( exeName );
- }
- }
- }
-
- if ( provider == nullptr )
- {
- Console::WriteLine( "There is no CodeDomProvider for the input language." );
- }
-}
-//
-
diff --git a/snippets/cpp/VS_Snippets_CLR/CompilerResultsExample/CPP/class1.cpp b/snippets/cpp/VS_Snippets_CLR/CompilerResultsExample/CPP/class1.cpp
deleted file mode 100644
index 89f9230ed7d..00000000000
--- a/snippets/cpp/VS_Snippets_CLR/CompilerResultsExample/CPP/class1.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-#using
-
-using namespace System;
-using namespace System::CodeDom;
-using namespace System::CodeDom::Compiler;
-using namespace System::Collections;
-using namespace System::Security::Permissions;
-
-public ref class Class1
-{
-public:
- Class1(){}
-
- //
- // Displays information from a CompilerResults.
- [PermissionSet(SecurityAction::Demand, Name="FullTrust")]
- static void DisplayCompilerResults( System::CodeDom::Compiler::CompilerResults^ cr )
- {
-
- // If errors occurred during compilation, output the compiler output and errors.
- if ( cr->Errors->Count > 0 )
- {
- for ( int i = 0; i < cr->Output->Count; i++ )
- Console::WriteLine( cr->Output[ i ] );
- for ( int i = 0; i < cr->Errors->Count; i++ )
- Console::WriteLine( String::Concat( i, ": ", cr->Errors[ i ] ) );
- }
- else
- {
-
- // Display information ab->Item[Out] the* compiler's exit code and the generated assembly.
- Console::WriteLine( "Compiler returned with result code: {0}", cr->NativeCompilerReturnValue );
- Console::WriteLine( "Generated assembly name: {0}", cr->CompiledAssembly->FullName );
- if ( cr->PathToAssembly == nullptr )
- Console::WriteLine( "The assembly has been generated in memory." );
- else
- Console::WriteLine( "Path to assembly: {0}", cr->PathToAssembly );
-
- // Display temporary files information.
- if ( !cr->TempFiles->KeepFiles )
- Console::WriteLine( "Temporary build files were deleted." );
- else
- {
- Console::WriteLine( "Temporary build files were not deleted." );
-
- // Display a list of the temporary build files
- IEnumerator^ enu = cr->TempFiles->GetEnumerator();
- for ( int i = 0; enu->MoveNext(); i++ )
- Console::WriteLine("TempFile " + i.ToString() + ": " + (String^)(enu->Current) );
- }
- }
- }
- //
-};
diff --git a/xml/System.CodeDom.Compiler/CodeDomProvider.xml b/xml/System.CodeDom.Compiler/CodeDomProvider.xml
index 1684915751d..51531b65953 100644
--- a/xml/System.CodeDom.Compiler/CodeDomProvider.xml
+++ b/xml/System.CodeDom.Compiler/CodeDomProvider.xml
@@ -68,7 +68,6 @@
## Examples
The following example program can generate and compile source code based on a CodeDOM model of a program that prints "Hello World" using the class. A Windows Forms user interface is provided. The user can select the target programming language from several selections: C#, Visual Basic, and JScript.
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeDomExample/CPP/source.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeCompileUnit/Overview/source.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDomExample/VB/source.vb" id="Snippet1":::
@@ -716,7 +715,6 @@
## Examples
The following code example determines the implementation for an input language and displays the configured settings for the language provider. This code example is part of a larger example provided for the class.
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeDom_CompilerInfo/CPP/source.cpp" id="Snippet6":::
:::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CodeDomProvider/CreateProvider/source.cs" id="Snippet6":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDom_CompilerInfo/VB/source.vb" id="Snippet6":::
@@ -892,7 +890,6 @@
## Examples
The following code example creates an instance of . The example displays the provider name, hash code and default file name extension for the new provider instance.
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeDom_CompilerInfo/CPP/source.cpp" id="Snippet3":::
:::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CodeDomProvider/CreateProvider/source.cs" id="Snippet3":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDom_CompilerInfo/VB/source.vb" id="Snippet3":::
@@ -950,7 +947,6 @@
## Examples
The following code example shows the use of the method to generate code for a "Hello World" application from a . This example is part of a larger example provided for the class.
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeDomExample/CPP/source.cpp" id="Snippet3":::
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeCompileUnit/Overview/source.cs" id="Snippet3":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDomExample/VB/source.vb" id="Snippet3":::
@@ -1299,7 +1295,6 @@
## Examples
The following code example enumerates the language providers on the computer and displays the configuration and compiler settings for each language provider. This code example is part of a larger example provided for the class.
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeDom_CompilerInfo/CPP/source.cpp" id="Snippet8":::
:::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CodeDomProvider/CreateProvider/source.cs" id="Snippet8":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDom_CompilerInfo/VB/source.vb" id="Snippet8":::
@@ -1367,7 +1362,6 @@
## Examples
The following code example determines the implementation for an input language and displays the configured settings for the language provider. This code example is part of a larger example provided for the class.
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeDom_CompilerInfo/CPP/source.cpp" id="Snippet6":::
:::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CodeDomProvider/CreateProvider/source.cs" id="Snippet6":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDom_CompilerInfo/VB/source.vb" id="Snippet6":::
@@ -1484,7 +1478,6 @@
## Examples
The following code example determines the implementation for an input file name extension and displays the configured settings for the language provider. This code example is part of a larger example provided for the class.
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeDom_CompilerInfo/CPP/source.cpp" id="Snippet5":::
:::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CodeDomProvider/CreateProvider/source.cs" id="Snippet5":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDom_CompilerInfo/VB/source.vb" id="Snippet5":::
@@ -1602,7 +1595,6 @@
## Examples
The following code example determines the implementation for an input file name extension and displays the configured settings for the language provider. This code example is part of a larger example provided for the class.
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeDom_CompilerInfo/CPP/source.cpp" id="Snippet5":::
:::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CodeDomProvider/CreateProvider/source.cs" id="Snippet5":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDom_CompilerInfo/VB/source.vb" id="Snippet5":::
@@ -1669,7 +1661,6 @@
## Examples
The following code example determines the implementation for an input language and displays the configured settings for the language provider. This code example is part of a larger example provided for the class.
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeDom_CompilerInfo/CPP/source.cpp" id="Snippet6":::
:::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CodeDomProvider/CreateProvider/source.cs" id="Snippet6":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDom_CompilerInfo/VB/source.vb" id="Snippet6":::
diff --git a/xml/System.CodeDom.Compiler/CodeGeneratorOptions.xml b/xml/System.CodeDom.Compiler/CodeGeneratorOptions.xml
index 3b8bd817533..84147d69c04 100644
--- a/xml/System.CodeDom.Compiler/CodeGeneratorOptions.xml
+++ b/xml/System.CodeDom.Compiler/CodeGeneratorOptions.xml
@@ -33,25 +33,24 @@
Represents a set of options used by a code generator.
- is passed to the code generation methods of an implementation to specify options used during code generation.
-
- The property specifies the string to use for each spacing indentation. The property specifies the placement style for braces indicating the boundaries of code blocks. The property specifies whether to append an `else`, `catch`, or `finally` block, including brackets, at the closing line of each `if` or `try` block. The property specifies whether to insert blank lines between members.
-
- An implementation can provide custom code generation options which you can set or pass data to using the dictionary indexer, which a code generator can search through to locate additional code generation options.
-
+ is passed to the code generation methods of an implementation to specify options used during code generation.
+
+ The property specifies the string to use for each spacing indentation. The property specifies the placement style for braces indicating the boundaries of code blocks. The property specifies whether to append an `else`, `catch`, or `finally` block, including brackets, at the closing line of each `if` or `try` block. The property specifies whether to insert blank lines between members.
+
+ An implementation can provide custom code generation options which you can set or pass data to using the dictionary indexer, which a code generator can search through to locate additional code generation options.
+
> [!NOTE]
-> This class contains a link demand and an inheritance demand at the class level that applies to all members. A is thrown when either the immediate caller or the derived class does not have full-trust permission. For details about security demands, see [Link Demands](/dotnet/framework/misc/link-demands) and [Inheritance Demands](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/x4yx82e6(v=vs.100)).
-
-
-
-## Examples
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeGeneratorOptionsExample/CPP/class1.cpp" id="Snippet1":::
+> This class contains a link demand and an inheritance demand at the class level that applies to all members. A is thrown when either the immediate caller or the derived class does not have full-trust permission. For details about security demands, see [Link Demands](/dotnet/framework/misc/link-demands) and [Inheritance Demands](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/x4yx82e6(v=vs.100)).
+
+
+
+## Examples
:::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CodeGeneratorOptions/Overview/class1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeGeneratorOptionsExample/VB/class1.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeGeneratorOptionsExample/VB/class1.vb" id="Snippet1":::
+
]]>
@@ -153,11 +152,11 @@
Gets or sets the style to use for bracing.
A string containing the bracing style to use.
-
@@ -229,11 +228,11 @@
Gets or sets the string to use for indentations.
A string containing the characters to use for indentations.
-
@@ -274,11 +273,11 @@
Gets or sets the object at the specified index.
The object associated with the specified name. If no object associated with the specified name exists in the collection, .
-
@@ -321,11 +320,11 @@
to generate the members in the order in which they occur in the member collection; otherwise, . The default value of this property is .
- property to inject #region blocks into code, thus changing the order.
-
+ property to inject #region blocks into code, thus changing the order.
+
]]>
diff --git a/xml/System.CodeDom.Compiler/CompilerError.xml b/xml/System.CodeDom.Compiler/CompilerError.xml
index 689e6be3d65..3d071f378ad 100644
--- a/xml/System.CodeDom.Compiler/CompilerError.xml
+++ b/xml/System.CodeDom.Compiler/CompilerError.xml
@@ -53,7 +53,6 @@
## Examples
The following example compiles a CodeDOM program graph and provides an example of how to programmatically access CompilerError data.
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR_Classic/classic CompilerError Example/CPP/source.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CompilerError/Overview/source.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_Classic/classic CompilerError Example/VB/source.vb" id="Snippet1":::
diff --git a/xml/System.CodeDom.Compiler/CompilerErrorCollection.xml b/xml/System.CodeDom.Compiler/CompilerErrorCollection.xml
index 744a1d0b94f..d4d62d63c1e 100644
--- a/xml/System.CodeDom.Compiler/CompilerErrorCollection.xml
+++ b/xml/System.CodeDom.Compiler/CompilerErrorCollection.xml
@@ -53,7 +53,6 @@
## Examples
The following example demonstrates how to use the class. The example creates a new instance of the class and uses several methods to add statements to the collection, return their index, and add or remove attributes at a specific index point.
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CompilerErrorCollectionExample/CPP/class1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CompilerErrorCollection/Overview/class1.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CompilerErrorCollectionExample/VB/class1.vb" id="Snippet1":::
@@ -110,7 +109,6 @@
## Examples
The following example demonstrates how to create an empty instance of the class.
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CompilerErrorCollectionExample/CPP/class1.cpp" id="Snippet2":::
:::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CompilerErrorCollection/Overview/class1.cs" id="Snippet2":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CompilerErrorCollectionExample/VB/class1.vb" id="Snippet2":::
@@ -231,7 +229,6 @@
## Examples
The following example demonstrates how to use the method to add a object to a .
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CompilerErrorCollectionExample/CPP/class1.cpp" id="Snippet3":::
:::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CompilerErrorCollection/Overview/class1.cs" id="Snippet3":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CompilerErrorCollectionExample/VB/class1.vb" id="Snippet3":::
@@ -289,7 +286,6 @@
## Examples
The following example demonstrates how to use the method overload to add an array of objects to a .
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CompilerErrorCollectionExample/CPP/class1.cpp" id="Snippet4":::
:::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CompilerErrorCollection/Overview/class1.cs" id="Snippet4":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CompilerErrorCollectionExample/VB/class1.vb" id="Snippet4":::
@@ -340,7 +336,6 @@
## Examples
The following example demonstrates how to use the method overload to add objects from one to another .
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CompilerErrorCollectionExample/CPP/class1.cpp" id="Snippet4":::
:::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CompilerErrorCollection/Overview/class1.cs" id="Snippet4":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CompilerErrorCollectionExample/VB/class1.vb" id="Snippet4":::
@@ -393,7 +388,6 @@
## Examples
The following example uses the method to locate a specific object and determine the index value at which it was found.
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CompilerErrorCollectionExample/CPP/class1.cpp" id="Snippet5":::
:::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CompilerErrorCollection/Overview/class1.cs" id="Snippet5":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CompilerErrorCollectionExample/VB/class1.vb" id="Snippet5":::
@@ -444,7 +438,6 @@
## Examples
The following example demonstrates how to use the method to copy the contents of a to an array, starting at the specified index value.
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CompilerErrorCollectionExample/CPP/class1.cpp" id="Snippet6":::
:::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CompilerErrorCollection/Overview/class1.cs" id="Snippet6":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CompilerErrorCollectionExample/VB/class1.vb" id="Snippet6":::
@@ -571,7 +564,6 @@
## Examples
The following example searches for a specific object and uses the method to determine the index value at which it was found.
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CompilerErrorCollectionExample/CPP/class1.cpp" id="Snippet5":::
:::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CompilerErrorCollection/Overview/class1.cs" id="Snippet5":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CompilerErrorCollectionExample/VB/class1.vb" id="Snippet5":::
@@ -622,7 +614,6 @@
## Examples
The following example demonstrates how to use the method to insert a object into a .
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CompilerErrorCollectionExample/CPP/class1.cpp" id="Snippet8":::
:::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CompilerErrorCollection/Overview/class1.cs" id="Snippet8":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CompilerErrorCollectionExample/VB/class1.vb" id="Snippet8":::
@@ -710,7 +701,6 @@
## Examples
The following example demonstrates how to remove a item from a .
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CompilerErrorCollectionExample/CPP/class1.cpp" id="Snippet9":::
:::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CompilerErrorCollection/Overview/class1.cs" id="Snippet9":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CompilerErrorCollectionExample/VB/class1.vb" id="Snippet9":::
diff --git a/xml/System.CodeDom.Compiler/CompilerInfo.xml b/xml/System.CodeDom.Compiler/CompilerInfo.xml
index f28bec805e5..7e0e33d3ac4 100644
--- a/xml/System.CodeDom.Compiler/CompilerInfo.xml
+++ b/xml/System.CodeDom.Compiler/CompilerInfo.xml
@@ -32,31 +32,30 @@
Represents the configuration settings of a language provider. This class cannot be inherited.
- class to determine whether a implementation is configured on the computer, or to examine the configuration and compiler settings for a specific language provider.
-
- The [<system.codedom> Element](/dotnet/framework/configure-apps/file-schema/compiler/system-codedom-element) in the machine configuration file contains the language provider and compiler configuration settings. Each configured language provider has a corresponding compiler configuration element. Each element defines the implementation type, supported language names, supported file name extensions, and compiler parameters.
-
- The .NET Framework defines the initial compiler settings in the machine configuration file. Developers and compiler vendors can add configuration settings for a new implementation.
-
- The class provides read-only access to these settings in the machine configuration file. Use the , , and members to examine the corresponding configuration attributes for a language provider. Use the method to obtain the compiler options and warning level attribute values for a language provider.
-
- For more details on language provider settings in the configuration file, see [Compiler and Language Provider Settings Schema](/dotnet/framework/configure-apps/file-schema/compiler/).
-
+ class to determine whether a implementation is configured on the computer, or to examine the configuration and compiler settings for a specific language provider.
+
+ The [<system.codedom> Element](/dotnet/framework/configure-apps/file-schema/compiler/system-codedom-element) in the machine configuration file contains the language provider and compiler configuration settings. Each configured language provider has a corresponding compiler configuration element. Each element defines the implementation type, supported language names, supported file name extensions, and compiler parameters.
+
+ The .NET Framework defines the initial compiler settings in the machine configuration file. Developers and compiler vendors can add configuration settings for a new implementation.
+
+ The class provides read-only access to these settings in the machine configuration file. Use the , , and members to examine the corresponding configuration attributes for a language provider. Use the method to obtain the compiler options and warning level attribute values for a language provider.
+
+ For more details on language provider settings in the configuration file, see [Compiler and Language Provider Settings Schema](/dotnet/framework/configure-apps/file-schema/compiler/).
+
> [!NOTE]
-> This class contains a link demand at the class level that applies to all members. A is thrown when the immediate caller does not have full-trust permission. For details about link demands, see [Link Demands](/dotnet/framework/misc/link-demands).
-
-
-
-## Examples
- The following code example displays language provider configuration settings. Command-line arguments are used to specify a language, file name extension, or provider type. For the given input, the example determines the corresponding language provider and displays the configured language compiler settings.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeDom_CompilerInfo/CPP/source.cpp" id="Snippet1":::
+> This class contains a link demand at the class level that applies to all members. A is thrown when the immediate caller does not have full-trust permission. For details about link demands, see [Link Demands](/dotnet/framework/misc/link-demands).
+
+
+
+## Examples
+ The following code example displays language provider configuration settings. Command-line arguments are used to specify a language, file name extension, or provider type. For the given input, the example determines the corresponding language provider and displays the configured language compiler settings.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CodeDomProvider/CreateProvider/source.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDom_CompilerInfo/VB/source.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDom_CompilerInfo/VB/source.vb" id="Snippet1":::
+
]]>
@@ -95,27 +94,26 @@
Gets the type of the configured implementation.
A read-only instance that represents the configured language provider type.
- implementation on the computer. The property value is a instance that represents a configured language provider implementation.
-
-
-
-## Examples
- The following code example determines whether the input language has a configured implementation on the computer. If there is a provider configured for the specified language, the example displays the language provider configuration settings. This code example is part of a larger example provided for the class.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeDom_CompilerInfo/CPP/source.cpp" id="Snippet7":::
+ implementation on the computer. The property value is a instance that represents a configured language provider implementation.
+
+
+
+## Examples
+ The following code example determines whether the input language has a configured implementation on the computer. If there is a provider configured for the specified language, the example displays the language provider configuration settings. This code example is part of a larger example provided for the class.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CodeDomProvider/CreateProvider/source.cs" id="Snippet7":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDom_CompilerInfo/VB/source.vb" id="Snippet7":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDom_CompilerInfo/VB/source.vb" id="Snippet7":::
+
]]>
The language provider is not configured on this computer.
- Cannot locate the type because it is a or empty string.
-
- -or-
-
+ Cannot locate the type because it is a or empty string.
+
+ -or-
+
Cannot locate the type because the name for the cannot be found in the configuration file.
@@ -159,24 +157,23 @@
Gets the configured compiler settings for the language provider implementation.
A read-only instance that contains the compiler options and settings configured for the language provider.
- method to examine the compiler settings of the instances returned by the and methods.
-
- The [<system.codedom> Element](/dotnet/framework/configure-apps/file-schema/compiler/system-codedom-element) in the machine configuration file contains the language provider and compiler configuration settings for each implementation on the computer. Each language provider configuration element can contain optional `compilerOptions` and `warningLevel` attributes. These attributes define the default values for the and properties.
-
- If the language provider configuration element does not define the `compilerOptions` attribute, the property value is an empty string (""). If the language provider configuration element does not define the `warningLevel` attribute, the property value is -1.
-
-
-
-## Examples
- The following code example determines whether the input language has a configured implementation on the computer. If there is a provider configured for the specified language, the example displays the language provider configuration settings. This code example is part of a larger example provided for the class.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeDom_CompilerInfo/CPP/source.cpp" id="Snippet7":::
+ method to examine the compiler settings of the instances returned by the and methods.
+
+ The [<system.codedom> Element](/dotnet/framework/configure-apps/file-schema/compiler/system-codedom-element) in the machine configuration file contains the language provider and compiler configuration settings for each implementation on the computer. Each language provider configuration element can contain optional `compilerOptions` and `warningLevel` attributes. These attributes define the default values for the and properties.
+
+ If the language provider configuration element does not define the `compilerOptions` attribute, the property value is an empty string (""). If the language provider configuration element does not define the `warningLevel` attribute, the property value is -1.
+
+
+
+## Examples
+ The following code example determines whether the input language has a configured implementation on the computer. If there is a provider configured for the specified language, the example displays the language provider configuration settings. This code example is part of a larger example provided for the class.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CodeDomProvider/CreateProvider/source.cs" id="Snippet7":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDom_CompilerInfo/VB/source.vb" id="Snippet7":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDom_CompilerInfo/VB/source.vb" id="Snippet7":::
+
]]>
@@ -224,22 +221,21 @@
Returns a instance for the current language provider settings.
A CodeDOM provider associated with the language provider configuration.
- method returns a instance for the current language provider settings.
-
- Use the method to get a implementation for a instance returned by the or method.
-
-
-
-## Examples
- The following code example enumerates the language providers on the computer and displays the configuration and compiler settings for each language provider. This code example is part of a larger example provided for the class.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeDom_CompilerInfo/CPP/source.cpp" id="Snippet8":::
+ method returns a instance for the current language provider settings.
+
+ Use the method to get a implementation for a instance returned by the or method.
+
+
+
+## Examples
+ The following code example enumerates the language providers on the computer and displays the configuration and compiler settings for each language provider. This code example is part of a larger example provided for the class.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CodeDomProvider/CreateProvider/source.cs" id="Snippet8":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDom_CompilerInfo/VB/source.vb" id="Snippet8":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDom_CompilerInfo/VB/source.vb" id="Snippet8":::
+
]]>
@@ -280,13 +276,13 @@
Returns a instance for the current language provider settings and specified options.
A CodeDOM provider associated with the language provider configuration and specified options.
- method returns a instance for the current language provider settings and the specified provider options. For information about supported provider options, see the specific CodeDOM provider documentation.
-
- Use the method to get a implementation for a instance returned by the or method.
-
+ method returns a instance for the current language provider settings and the specified provider options. For information about supported provider options, see the specific CodeDOM provider documentation.
+
+ Use the method to get a implementation for a instance returned by the or method.
+
]]>
@@ -330,17 +326,17 @@
if is a object and its value is the same as this instance; otherwise, .
- method.
-
- The two instances are considered equal if the values of the following properties are equal:
-
-- The property.
-
-- The , , and properties of the instance returned by the method.
-
+ method.
+
+ The two instances are considered equal if the values of the following properties are equal:
+
+- The property.
+
+- The , , and properties of the instance returned by the method.
+
]]>
@@ -386,20 +382,19 @@
Returns the file name extensions supported by the language provider.
An array of file name extensions supported by the language provider.
- implementation on the computer. Each configured language provider supports one or more file name extensions. For example, a might support the file name extensions ".cs" and ".c#".
-
-
-
-## Examples
- The following code example enumerates the language providers on the computer and displays the configuration and compiler settings for each language provider. This code example is part of a larger example provided for the class.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeDom_CompilerInfo/CPP/source.cpp" id="Snippet8":::
+ implementation on the computer. Each configured language provider supports one or more file name extensions. For example, a might support the file name extensions ".cs" and ".c#".
+
+
+
+## Examples
+ The following code example enumerates the language providers on the computer and displays the configuration and compiler settings for each language provider. This code example is part of a larger example provided for the class.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CodeDomProvider/CreateProvider/source.cs" id="Snippet8":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDom_CompilerInfo/VB/source.vb" id="Snippet8":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDom_CompilerInfo/VB/source.vb" id="Snippet8":::
+
]]>
@@ -438,22 +433,21 @@
Returns the hash code for the current instance.
A 32-bit signed integer hash code for the current instance, suitable for use in hashing algorithms and data structures such as a hash table.
- method.
-
- This method generates the same hash code for two objects that are equal according to the method.
-
-
-
-## Examples
- The following code example creates an instance of the class. The example displays the provider name, hash code, and default file name extension for the new provider instance. This code example is part of a larger example provided for the class.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeDom_CompilerInfo/CPP/source.cpp" id="Snippet3":::
+ method.
+
+ This method generates the same hash code for two objects that are equal according to the method.
+
+
+
+## Examples
+ The following code example creates an instance of the class. The example displays the provider name, hash code, and default file name extension for the new provider instance. This code example is part of a larger example provided for the class.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CodeDomProvider/CreateProvider/source.cs" id="Snippet3":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDom_CompilerInfo/VB/source.vb" id="Snippet3":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDom_CompilerInfo/VB/source.vb" id="Snippet3":::
+
]]>
@@ -499,20 +493,19 @@
Gets the language names supported by the language provider.
An array of language names supported by the language provider.
- implementation on the computer. Each configured language provider supports one or more language names. For example, the object for a might return an array with the language names "c#", "cs", and "csharp".
-
-
-
-## Examples
- The following code example enumerates the language providers on the computer and displays the configuration and compiler settings for each language provider. This code example is part of a larger example provided for the class.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeDom_CompilerInfo/CPP/source.cpp" id="Snippet8":::
+ implementation on the computer. Each configured language provider supports one or more language names. For example, the object for a might return an array with the language names "c#", "cs", and "csharp".
+
+
+
+## Examples
+ The following code example enumerates the language providers on the computer and displays the configuration and compiler settings for each language provider. This code example is part of a larger example provided for the class.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CodeDomProvider/CreateProvider/source.cs" id="Snippet8":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDom_CompilerInfo/VB/source.vb" id="Snippet8":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDom_CompilerInfo/VB/source.vb" id="Snippet8":::
+
]]>
@@ -551,20 +544,19 @@
if the language provider implementation type is configured on the computer; otherwise, .
- property to check the implementation before accessing the provider properties or methods. For example, after you get the language provider settings from the method, use the property to verify the provider type implementation before calling the method or using the property.
-
-
-
-## Examples
- The following code example determines whether the input language has a configured implementation on the computer. If there is a provider configured for the specified language, the example displays the language provider configuration settings. This code example is part of a larger example provided for the class.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeDom_CompilerInfo/CPP/source.cpp" id="Snippet7":::
+ property to check the implementation before accessing the provider properties or methods. For example, after you get the language provider settings from the method, use the property to verify the provider type implementation before calling the method or using the property.
+
+
+
+## Examples
+ The following code example determines whether the input language has a configured implementation on the computer. If there is a provider configured for the specified language, the example displays the language provider configuration settings. This code example is part of a larger example provided for the class.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CodeDomProvider/CreateProvider/source.cs" id="Snippet7":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDom_CompilerInfo/VB/source.vb" id="Snippet7":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDom_CompilerInfo/VB/source.vb" id="Snippet7":::
+
]]>
diff --git a/xml/System.CodeDom.Compiler/CompilerParameters.xml b/xml/System.CodeDom.Compiler/CompilerParameters.xml
index b6cc8a9588f..1ceb20b2240 100644
--- a/xml/System.CodeDom.Compiler/CompilerParameters.xml
+++ b/xml/System.CodeDom.Compiler/CompilerParameters.xml
@@ -44,31 +44,30 @@
Represents the parameters used to invoke a compiler.
- object represents the settings and options for an interface.
-
- If you are compiling an executable program, you must set the property to `true`. When the is set to `false`, the compiler will generate a class library. By default, a new is initialized with its property set to `false`. If you are compiling an executable from a CodeDOM graph, a must be defined in the graph. If there are multiple code entry points, you can indicate the class that defines the entry point to use by setting the name of the class to the property.
-
- You can specify a file name for the output assembly in the property. Otherwise, a default output file name will be used. To include debug information in a generated assembly, set the property to `true`. If your project references any assemblies, you must specify the assembly names as items in a set to the property of the used when invoking compilation.
-
- You can compile an assembly that is written to memory rather than disk by setting the property to `true`. When an assembly is generated in memory, your code can obtain a reference to the generated assembly from the property of a . If an assembly is written to disk, you can obtain the path to the generated assembly from the property of a .
-
- To specify a warning level at which to halt compilation, set the property to an integer that represents the warning level at which to halt compilation. You can also configure the compiler to halt compilation if warnings are encountered by setting the property to `true`.
-
- To specify a custom command-line arguments string to use when invoking the compilation process, set the string in the property. If a Win32 security token is required to invoke the compiler process, specify the token in the property. To include .NET Framework resource files in the compiled assembly, add the names of the resource files to the property. To reference .NET Framework resources in another assembly, add the names of the resource files to the property. To include a Win32 resource file in the compiled assembly, specify the name of the Win32 resource file in the property.
-
+ object represents the settings and options for an interface.
+
+ If you are compiling an executable program, you must set the property to `true`. When the is set to `false`, the compiler will generate a class library. By default, a new is initialized with its property set to `false`. If you are compiling an executable from a CodeDOM graph, a must be defined in the graph. If there are multiple code entry points, you can indicate the class that defines the entry point to use by setting the name of the class to the property.
+
+ You can specify a file name for the output assembly in the property. Otherwise, a default output file name will be used. To include debug information in a generated assembly, set the property to `true`. If your project references any assemblies, you must specify the assembly names as items in a set to the property of the used when invoking compilation.
+
+ You can compile an assembly that is written to memory rather than disk by setting the property to `true`. When an assembly is generated in memory, your code can obtain a reference to the generated assembly from the property of a . If an assembly is written to disk, you can obtain the path to the generated assembly from the property of a .
+
+ To specify a warning level at which to halt compilation, set the property to an integer that represents the warning level at which to halt compilation. You can also configure the compiler to halt compilation if warnings are encountered by setting the property to `true`.
+
+ To specify a custom command-line arguments string to use when invoking the compilation process, set the string in the property. If a Win32 security token is required to invoke the compiler process, specify the token in the property. To include .NET Framework resource files in the compiled assembly, add the names of the resource files to the property. To reference .NET Framework resources in another assembly, add the names of the resource files to the property. To include a Win32 resource file in the compiled assembly, specify the name of the Win32 resource file in the property.
+
> [!NOTE]
> This class contains a link demand and an inheritance demand at the class level that applies to all members. A is thrown when either the immediate caller or the derived class does not have full-trust permission. For details about security demands, see [Link Demands](/dotnet/framework/misc/link-demands) and [Inheritance Demands](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/x4yx82e6(v=vs.100)).
-
-## Examples
- The following example builds a CodeDOM source graph for a simple Hello World program. The source is then saved to a file, compiled into an executable, and run. The `CompileCode` method illustrates how to use the class to specify various compiler settings and options.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CompilerParametersExample/CPP/source.cpp" id="Snippet1":::
+
+## Examples
+ The following example builds a CodeDOM source graph for a simple Hello World program. The source is then saved to a file, compiled into an executable, and run. The `CompileCode` method illustrates how to use the class to specify various compiler settings and options.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CompilerParameters/Overview/source.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CompilerParametersExample/VB/source.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CompilerParametersExample/VB/source.vb" id="Snippet1":::
+
]]>
@@ -116,15 +115,14 @@
Initializes a new instance of the class.
- to specify various compiler settings and options. This code example is part of a larger example provided for the class.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CompilerParametersExample/CPP/source.cpp" id="Snippet2":::
+ to specify various compiler settings and options. This code example is part of a larger example provided for the class.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CompilerParameters/Overview/source.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CompilerParametersExample/VB/source.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CompilerParametersExample/VB/source.vb" id="Snippet2":::
+
]]>
@@ -292,19 +290,18 @@
Gets or sets optional command-line arguments to use when invoking the compiler.
Any additional command-line arguments for the compiler.
- typically includes this string on the command line when invoking a command-line compiler. By default, this property contains an empty string.
-## Examples
- The following example illustrates using to specify various compiler settings and options. This code example is part of a larger example provided for the class.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CompilerParametersExample/CPP/source.cpp" id="Snippet2":::
+## Examples
+ The following example illustrates using to specify various compiler settings and options. This code example is part of a larger example provided for the class.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CompilerParameters/Overview/source.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CompilerParametersExample/VB/source.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CompilerParametersExample/VB/source.vb" id="Snippet2":::
+
]]>
C# compiler options
@@ -342,14 +339,14 @@ An typically includes this string o
Gets or sets the name of the core or standard assembly that contains basic types such as , , or .
The name of the core assembly that contains basic types.
- property.
-
+ property.
+
> [!NOTE]
-> An or implementation may choose to ignore this property.
-
+> An or implementation may choose to ignore this property.
+
]]>
@@ -395,24 +392,23 @@ An typically includes this string o
Gets the .NET resource files to include when compiling the assembly output.
A collection that contains the file paths of .NET resources to include in the generated assembly.
- method with the flag .
-
- Add one or more .NET resource file paths to the returned to embed the file resources in the compiled assembly. Adding a duplicate or invalid file path results in compilation errors; ensure that each string specifies a unique path to a valid .NET resource file.
-
+ method with the flag .
+
+ Add one or more .NET resource file paths to the returned to embed the file resources in the compiled assembly. Adding a duplicate or invalid file path results in compilation errors; ensure that each string specifies a unique path to a valid .NET resource file.
+
Use to include default or neutral culture .NET resources for an assembly; use the property to reference .NET resources in satellite assemblies.
-
-## Examples
- The following example illustrates using to specify various compiler settings and options. This code example is part of a larger example provided for the class.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CompilerParametersExample/CPP/source.cpp" id="Snippet2":::
+
+## Examples
+ The following example illustrates using to specify various compiler settings and options. This code example is part of a larger example provided for the class.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CompilerParameters/Overview/source.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CompilerParametersExample/VB/source.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CompilerParametersExample/VB/source.vb" id="Snippet2":::
+
]]>
@@ -496,20 +492,19 @@ An typically includes this string o
if an executable should be generated; otherwise, .
- to specify various compiler settings and options. This code example is part of a larger example provided for the class.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CompilerParametersExample/CPP/source.cpp" id="Snippet2":::
+ to specify various compiler settings and options. This code example is part of a larger example provided for the class.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CompilerParameters/Overview/source.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CompilerParametersExample/VB/source.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CompilerParametersExample/VB/source.vb" id="Snippet2":::
+
]]>
@@ -557,15 +552,14 @@ An typically includes this string o
if the compiler should generate the output in memory; otherwise, .
- to specify various compiler settings and options. This code example is part of a larger example provided for the class.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CompilerParametersExample/CPP/source.cpp" id="Snippet2":::
+ to specify various compiler settings and options. This code example is part of a larger example provided for the class.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CompilerParameters/Overview/source.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CompilerParametersExample/VB/source.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CompilerParametersExample/VB/source.vb" id="Snippet2":::
+
]]>
@@ -656,24 +650,23 @@ An typically includes this string o
Gets the .NET resource files that are referenced in the current source.
A collection that contains the file paths of .NET resources that are referenced by the source.
- method with the flag .
-
- Add one or more .NET resource file paths to the returned to create links for the resources in the compiled assembly. Adding a duplicate or invalid file path results in compilation errors; ensure that each string specifies a unique path to a valid .NET resource file.
-
+ method with the flag .
+
+ Add one or more .NET resource file paths to the returned to create links for the resources in the compiled assembly. Adding a duplicate or invalid file path results in compilation errors; ensure that each string specifies a unique path to a valid .NET resource file.
+
Use to reference .NET resources in satellite assemblies, localized for a particular culture; use the property to embed the resources into the compiled assembly.
-
-## Examples
- The following example illustrates using to specify various compiler settings and options. This code example is part of a larger example provided for the class.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CompilerParametersExample/CPP/source.cpp" id="Snippet2":::
+
+## Examples
+ The following example illustrates using to specify various compiler settings and options. This code example is part of a larger example provided for the class.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CompilerParameters/Overview/source.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CompilerParametersExample/VB/source.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CompilerParametersExample/VB/source.vb" id="Snippet2":::
+
]]>
@@ -723,20 +716,19 @@ An typically includes this string o
Gets or sets the name of the main class.
The name of the main class.
- to specify various compiler settings and options. This code example is part of a larger example provided for the class.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CompilerParametersExample/CPP/source.cpp" id="Snippet2":::
+ to specify various compiler settings and options. This code example is part of a larger example provided for the class.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CompilerParameters/Overview/source.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CompilerParametersExample/VB/source.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CompilerParametersExample/VB/source.vb" id="Snippet2":::
+
]]>
@@ -783,15 +775,14 @@ An typically includes this string o
Gets or sets the name of the output assembly.
The name of the output assembly.
- to specify various compiler settings and options. This code example is part of a larger example provided for the class.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CompilerParametersExample/CPP/source.cpp" id="Snippet2":::
+ to specify various compiler settings and options. This code example is part of a larger example provided for the class.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CompilerParameters/Overview/source.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CompilerParametersExample/VB/source.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CompilerParametersExample/VB/source.vb" id="Snippet2":::
+
]]>
@@ -834,20 +825,19 @@ An typically includes this string o
Gets the assemblies referenced by the current project.
A collection that contains the assembly names that are referenced by the source to compile.
- to import the assembly manifest and reference the assembly type information in the current project.
-
-
-
-## Examples
- The following example illustrates using to specify various compiler settings and options. This code example is part of a larger example provided for the class.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CompilerParametersExample/CPP/source.cpp" id="Snippet2":::
+ to import the assembly manifest and reference the assembly type information in the current project.
+
+
+
+## Examples
+ The following example illustrates using to specify various compiler settings and options. This code example is part of a larger example provided for the class.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CompilerParameters/Overview/source.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CompilerParametersExample/VB/source.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CompilerParametersExample/VB/source.vb" id="Snippet2":::
+
]]>
@@ -891,23 +881,22 @@ An typically includes this string o
Gets or sets the collection that contains the temporary files.
A collection that contains the temporary files.
- property in the collection. The property is set if the collection is created using the constructor with the `keepFiles` parameter set to `true`.
-
+ property in the collection. The property is set if the collection is created using the constructor with the `keepFiles` parameter set to `true`.
+
> [!NOTE]
-> This class contains a link demand and an inheritance demand at the class level that applies to all members. A is thrown when either the immediate caller or the derived class does not have full-trust permission. For details about security demands, see [Link Demands](/dotnet/framework/misc/link-demands) and [Inheritance Demands](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/x4yx82e6(v=vs.100)).
-
-
-
-## Examples
- The following example illustrates using to specify various compiler settings and options. This code example is part of a larger example provided for the class.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CompilerParametersExample/CPP/source.cpp" id="Snippet2":::
+> This class contains a link demand and an inheritance demand at the class level that applies to all members. A is thrown when either the immediate caller or the derived class does not have full-trust permission. For details about security demands, see [Link Demands](/dotnet/framework/misc/link-demands) and [Inheritance Demands](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/x4yx82e6(v=vs.100)).
+
+
+
+## Examples
+ The following example illustrates using to specify various compiler settings and options. This code example is part of a larger example provided for the class.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CompilerParameters/Overview/source.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CompilerParametersExample/VB/source.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CompilerParametersExample/VB/source.vb" id="Snippet2":::
+
]]>
@@ -955,15 +944,14 @@ An typically includes this string o
if warnings should be treated as errors; otherwise, .
- to specify various compiler settings and options. This code example is part of a larger example provided for the class.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CompilerParametersExample/CPP/source.cpp" id="Snippet2":::
+ to specify various compiler settings and options. This code example is part of a larger example provided for the class.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CompilerParameters/Overview/source.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CompilerParametersExample/VB/source.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CompilerParametersExample/VB/source.vb" id="Snippet2":::
+
]]>
@@ -1044,15 +1032,14 @@ An typically includes this string o
Gets or sets the warning level at which the compiler aborts compilation.
The warning level at which the compiler aborts compilation.
- to specify various compiler settings and options. This code example is part of a larger example provided for the class.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CompilerParametersExample/CPP/source.cpp" id="Snippet2":::
+ to specify various compiler settings and options. This code example is part of a larger example provided for the class.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CompilerParameters/Overview/source.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CompilerParametersExample/VB/source.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CompilerParametersExample/VB/source.vb" id="Snippet2":::
+
]]>
@@ -1099,15 +1086,15 @@ An typically includes this string o
Gets or sets the file name of a Win32 resource file to link into the compiled assembly.
A Win32 resource file that will be linked into the compiled assembly.
- to compile a Win32 resource file into the assembly. Use or to compile with .NET Framework resource files.
-
- Not all compilers support Win32 resource files, so you should test a code generator for this support before linking a resource file by calling the method with the flag .
-
+ to compile a Win32 resource file into the assembly. Use or to compile with .NET Framework resource files.
+
+ Not all compilers support Win32 resource files, so you should test a code generator for this support before linking a resource file by calling the method with the flag .
+
]]>
diff --git a/xml/System.CodeDom.Compiler/CompilerResults.xml b/xml/System.CodeDom.Compiler/CompilerResults.xml
index 54d9ef8d0fa..51fce4c6f9b 100644
--- a/xml/System.CodeDom.Compiler/CompilerResults.xml
+++ b/xml/System.CodeDom.Compiler/CompilerResults.xml
@@ -40,35 +40,34 @@
Represents the results of compilation that are returned from a compiler.
- interface implementation:
-
-- The property indicates the compiled assembly.
-
-- The property indicates the security evidence for the assembly.
-
-- The property indicates the path to the compiled assembly, if it was not generated only in memory.
-
-- The property indicates any compiler errors and warnings.
-
-- The property contains the compiler output messages.
-
-- The property indicates result code value returned by the compiler.
-
-- The property indicates the temporary files generated during compilation and linking.
-
+ interface implementation:
+
+- The property indicates the compiled assembly.
+
+- The property indicates the security evidence for the assembly.
+
+- The property indicates the path to the compiled assembly, if it was not generated only in memory.
+
+- The property indicates any compiler errors and warnings.
+
+- The property contains the compiler output messages.
+
+- The property indicates result code value returned by the compiler.
+
+- The property indicates the temporary files generated during compilation and linking.
+
> [!NOTE]
-> This class contains an inheritance demand at the class level that applies to all members. A is thrown when the derived class does not have full-trust permission. For details about inheritance demands, see [Inheritance Demands](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/x4yx82e6(v=vs.100)).
-
-
-
-## Examples
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CompilerResultsExample/CPP/class1.cpp" id="Snippet1":::
+> This class contains an inheritance demand at the class level that applies to all members. A is thrown when the derived class does not have full-trust permission. For details about inheritance demands, see [Inheritance Demands](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/x4yx82e6(v=vs.100)).
+
+
+
+## Examples
:::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CompilerResults/Overview/class1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CompilerResultsExample/VB/class1.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CompilerResultsExample/VB/class1.vb" id="Snippet1":::
+
]]>
@@ -147,13 +146,13 @@
Gets or sets the compiled assembly.
An that indicates the compiled assembly.
- [!NOTE]
-> The `get` accessor for the property calls the method to load the compiled assembly into the current application domain. After calling the `get` accessor, the compiled assembly cannot be deleted until the current is unloaded.
-
+> The `get` accessor for the property calls the method to load the compiled assembly into the current application domain. After calling the `get` accessor, the compiled assembly cannot be deleted until the current is unloaded.
+
]]>
@@ -197,11 +196,11 @@
Gets the collection of compiler errors and warnings.
A that indicates the errors and warnings resulting from compilation, if any.
- , so that user code to locate and display the code that generated an error or warning, where possible, can be implemented.
-
+ , so that user code to locate and display the code that generated an error or warning, where possible, can be implemented.
+
]]>
@@ -282,11 +281,11 @@
Gets or sets the compiler's return value.
The compiler's return value.
-
@@ -329,11 +328,11 @@
Gets the compiler output messages.
A that contains the output messages.
-
diff --git a/xml/System.CodeDom.Compiler/GeneratedCodeAttribute.xml b/xml/System.CodeDom.Compiler/GeneratedCodeAttribute.xml
index 9707254ac89..f343cff1dc2 100644
--- a/xml/System.CodeDom.Compiler/GeneratedCodeAttribute.xml
+++ b/xml/System.CodeDom.Compiler/GeneratedCodeAttribute.xml
@@ -64,20 +64,19 @@
Identifies code generated by a tool. This class cannot be inherited.
- class can be used by code analysis tools to identify computer-generated code, and to provide an analysis based on the tool and the version of the tool that generated the code.
-
-
-
-## Examples
- The following code example shows the use of the class to identify computer-generated code.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR_System/system.codedom.compiler.generatedcodeattribute/cpp/source.cpp" id="Snippet1":::
+ class can be used by code analysis tools to identify computer-generated code, and to provide an analysis based on the tool and the version of the tool that generated the code.
+
+
+
+## Examples
+ The following code example shows the use of the class to identify computer-generated code.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/GeneratedCodeAttribute/Overview/source.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.codedom.compiler.generatedcodeattribute/vb/source.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.codedom.compiler.generatedcodeattribute/vb/source.vb" id="Snippet1":::
+
]]>
diff --git a/xml/System.CodeDom.Compiler/GeneratorSupport.xml b/xml/System.CodeDom.Compiler/GeneratorSupport.xml
index 8a69ffb148e..a3ca344c7c3 100644
--- a/xml/System.CodeDom.Compiler/GeneratorSupport.xml
+++ b/xml/System.CodeDom.Compiler/GeneratorSupport.xml
@@ -43,20 +43,19 @@
Defines identifiers used to determine whether a code generator supports certain types of code elements.
- method of a code generator to determine whether the code generator supports generating certain types of code.
-
-
-
-## Examples
- The following example illustrates using to specify various compiler settings and options.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CompilerParametersExample/CPP/source.cpp" id="Snippet2":::
+ method of a code generator to determine whether the code generator supports generating certain types of code.
+
+
+
+## Examples
+ The following example illustrates using to specify various compiler settings and options.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CompilerParameters/Overview/source.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CompilerParametersExample/VB/source.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CompilerParametersExample/VB/source.vb" id="Snippet2":::
+
]]>
diff --git a/xml/System.CodeDom.Compiler/IndentedTextWriter.xml b/xml/System.CodeDom.Compiler/IndentedTextWriter.xml
index 11f61a19f4f..ce0e9982cd9 100644
--- a/xml/System.CodeDom.Compiler/IndentedTextWriter.xml
+++ b/xml/System.CodeDom.Compiler/IndentedTextWriter.xml
@@ -86,7 +86,6 @@
## Examples
The following code example demonstrates using an to write text at different levels of indentation.
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/IndentedTextWriterExample/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/IndentedTextWriter/Overview/form1.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/IndentedTextWriterExample/VB/form1.vb" id="Snippet1":::
@@ -210,7 +209,6 @@
## Examples
The following code example demonstrates creating an using a specified tab string.
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/IndentedTextWriterExample/CPP/form1.cpp" id="Snippet3":::
:::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/IndentedTextWriter/Overview/form1.cs" id="Snippet3":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/IndentedTextWriterExample/VB/form1.vb" id="Snippet3":::
@@ -583,7 +581,6 @@
## Examples
The following code example demonstrates setting the indentation level of an . The indentation level is the number of tab strings to prefix each line with.
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/IndentedTextWriterExample/CPP/form1.cpp" id="Snippet3":::
:::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/IndentedTextWriter/Overview/form1.cs" id="Snippet3":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/IndentedTextWriterExample/VB/form1.vb" id="Snippet3":::
@@ -2959,7 +2956,6 @@
## Examples
The following code example demonstrates writing a line without tab string indentations.
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/IndentedTextWriterExample/CPP/form1.cpp" id="Snippet6":::
:::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/IndentedTextWriter/Overview/form1.cs" id="Snippet6":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/IndentedTextWriterExample/VB/form1.vb" id="Snippet6":::
diff --git a/xml/System.CodeDom/CodeArgumentReferenceExpression.xml b/xml/System.CodeDom/CodeArgumentReferenceExpression.xml
index e626e9f7acb..15500fe28c6 100644
--- a/xml/System.CodeDom/CodeArgumentReferenceExpression.xml
+++ b/xml/System.CodeDom/CodeArgumentReferenceExpression.xml
@@ -48,22 +48,21 @@
Represents a reference to the value of an argument passed to a method.
- can be used in a method to reference the value of a parameter that has been passed to the method.
+
+ The property specifies the name of the parameter to reference.
+
+
+
+## Examples
+ The following example code defines a method that invokes `Console.WriteLine` to output the string parameter passed to the method. A references the argument passed to the method by method parameter name.
-## Remarks
- can be used in a method to reference the value of a parameter that has been passed to the method.
-
- The property specifies the name of the parameter to reference.
-
-
-
-## Examples
- The following example code defines a method that invokes `Console.WriteLine` to output the string parameter passed to the method. A references the argument passed to the method by method parameter name.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeArgumentReferenceExpressionExample/CPP/codeargumentreferenceexpressionexample.cpp" id="Snippet2":::
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeArgumentReferenceExpression/Overview/codeargumentreferenceexpressionexample.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeArgumentReferenceExpressionExample/VB/codeargumentreferenceexpressionexample.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeArgumentReferenceExpressionExample/VB/codeargumentreferenceexpressionexample.vb" id="Snippet2":::
+
]]>
diff --git a/xml/System.CodeDom/CodeArrayCreateExpression.xml b/xml/System.CodeDom/CodeArrayCreateExpression.xml
index 7b4e654286d..0a52d56a6f8 100644
--- a/xml/System.CodeDom/CodeArrayCreateExpression.xml
+++ b/xml/System.CodeDom/CodeArrayCreateExpression.xml
@@ -48,24 +48,23 @@
Represents an expression that creates an array.
- can be used to represent a code expression that creates an array. Expressions that create an array should specify either a number of elements, or a list of expressions to use to initialize the array.
+
+ Most arrays can be initialized immediately following declaration. The property can be set to the expression to use to initialize the array.
+
+ A only directly supports creating single-dimension arrays. If a language allows arrays of arrays, it is possible to create them by nesting a within a . Not all languages support arrays of arrays. You can check whether an for a language declares support for nested arrays by calling with the flag.
+
+
+
+## Examples
+ The following code uses a to create an array of integers with 10 indexes.
-## Remarks
- can be used to represent a code expression that creates an array. Expressions that create an array should specify either a number of elements, or a list of expressions to use to initialize the array.
-
- Most arrays can be initialized immediately following declaration. The property can be set to the expression to use to initialize the array.
-
- A only directly supports creating single-dimension arrays. If a language allows arrays of arrays, it is possible to create them by nesting a within a . Not all languages support arrays of arrays. You can check whether an for a language declares support for nested arrays by calling with the flag.
-
-
-
-## Examples
- The following code uses a to create an array of integers with 10 indexes.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeArrayCreateExpressionSnippet/CPP/codearraycreateexpressionsnippet.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeArrayCreateExpression/Overview/codearraycreateexpressionsnippet.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeArrayCreateExpressionSnippet/VB/codearraycreateexpressionsnippet.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeArrayCreateExpressionSnippet/VB/codearraycreateexpressionsnippet.vb" id="Snippet1":::
+
]]>
@@ -621,11 +620,11 @@
Gets or sets the expression that indicates the size of the array.
A that indicates the size of the array.
- .
-
+ .
+
]]>
diff --git a/xml/System.CodeDom/CodeArrayIndexerExpression.xml b/xml/System.CodeDom/CodeArrayIndexerExpression.xml
index b45e8d7716e..61f2989f303 100644
--- a/xml/System.CodeDom/CodeArrayIndexerExpression.xml
+++ b/xml/System.CodeDom/CodeArrayIndexerExpression.xml
@@ -48,20 +48,19 @@
Represents a reference to an index of an array.
- can be used to represent a reference to an index of an array of one or more dimensions. Use for representing a reference to an index of a code (non-array) indexer. The property indicates the indexer object. The property indicates either a single index within the target array, or a set of indexes that together specify a specific intersection of indexes across the dimensions of the array.
+
+
+
+## Examples
+ The following code creates a that references index 5 of an array of integers named `x` :
-## Remarks
- can be used to represent a reference to an index of an array of one or more dimensions. Use for representing a reference to an index of a code (non-array) indexer. The property indicates the indexer object. The property indicates either a single index within the target array, or a set of indexes that together specify a specific intersection of indexes across the dimensions of the array.
-
-
-
-## Examples
- The following code creates a that references index 5 of an array of integers named `x` :
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeArrayIndexerExpressionSnippet/CPP/codearrayindexerexpressionsnippet.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeArrayIndexerExpression/Overview/codearrayindexerexpressionsnippet.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeArrayIndexerExpressionSnippet/VB/codearrayindexerexpressionsnippet.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeArrayIndexerExpressionSnippet/VB/codearrayindexerexpressionsnippet.vb" id="Snippet1":::
+
]]>
@@ -186,11 +185,11 @@
Gets or sets the index or indexes of the indexer expression.
A that indicates the index or indexes of the indexer expression.
- can contain a that specifies a single index within the target array, or multiple objects that together specify a specific intersection of indexes across the dimensions of the array.
-
+ can contain a that specifies a single index within the target array, or multiple objects that together specify a specific intersection of indexes across the dimensions of the array.
+
]]>
@@ -237,11 +236,11 @@
Gets or sets the target object of the array indexer.
A that represents the array being indexed.
- , a , or a .
-
+ , a , or a .
+
]]>
diff --git a/xml/System.CodeDom/CodeAssignStatement.xml b/xml/System.CodeDom/CodeAssignStatement.xml
index 5f3778c87ec..2492271e274 100644
--- a/xml/System.CodeDom/CodeAssignStatement.xml
+++ b/xml/System.CodeDom/CodeAssignStatement.xml
@@ -48,20 +48,19 @@
Represents a simple assignment statement.
- can be used to represent a statement that assigns the value of an object to another object, or a reference to another reference. Simple assignment statements are usually of the form " `value1` = `value2` ", where `value1` is the object being assigned to, and `value2` is being assigned. The property indicates the object to assign to. The property indicates the object to assign.
-
-
-
-## Examples
- The following code creates a that assigns the value 10 to an integer variable named `i` :
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeAssignStatement/CPP/codeassignstatementsnippet.cpp" id="Snippet1":::
+ can be used to represent a statement that assigns the value of an object to another object, or a reference to another reference. Simple assignment statements are usually of the form " `value1` = `value2` ", where `value1` is the object being assigned to, and `value2` is being assigned. The property indicates the object to assign to. The property indicates the object to assign.
+
+
+
+## Examples
+ The following code creates a that assigns the value 10 to an integer variable named `i`:
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeAssignStatement/Overview/codeassignstatementsnippet.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeAssignStatement/VB/codeassignstatementsnippet.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeAssignStatement/VB/codeassignstatementsnippet.vb" id="Snippet1":::
+
]]>
diff --git a/xml/System.CodeDom/CodeAttachEventStatement.xml b/xml/System.CodeDom/CodeAttachEventStatement.xml
index 60f8b43b556..7b383e1dd96 100644
--- a/xml/System.CodeDom/CodeAttachEventStatement.xml
+++ b/xml/System.CodeDom/CodeAttachEventStatement.xml
@@ -48,20 +48,19 @@
Represents a statement that attaches an event-handler delegate to an event.
- can be used to represent a statement that adds an event-handler delegate for an event. The property indicates the event to attach the event handler to. The property indicates the event handler to attach.
+
+
+
+## Examples
+ The following example code demonstrates use of a to attach an event handler with an event.
-## Remarks
- can be used to represent a statement that adds an event-handler delegate for an event. The property indicates the event to attach the event handler to. The property indicates the event handler to attach.
-
-
-
-## Examples
- The following example code demonstrates use of a to attach an event handler with an event.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeAttachEventStatementExample/CPP/codeattacheventstatementexample.cpp" id="Snippet3":::
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeAttachEventStatement/Overview/codeattacheventstatementexample.cs" id="Snippet3":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeAttachEventStatementExample/VB/codeattacheventstatementexample.vb" id="Snippet3":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeAttachEventStatementExample/VB/codeattacheventstatementexample.vb" id="Snippet3":::
+
]]>
diff --git a/xml/System.CodeDom/CodeAttributeArgument.xml b/xml/System.CodeDom/CodeAttributeArgument.xml
index 80c49221838..9d92196d3fb 100644
--- a/xml/System.CodeDom/CodeAttributeArgument.xml
+++ b/xml/System.CodeDom/CodeAttributeArgument.xml
@@ -48,26 +48,25 @@
Represents an argument used in a metadata attribute declaration.
- can be used to represent either the value for a single argument of an attribute constructor, or a value with which to initialize a property of the attribute.
+
+ The property indicates the value of the argument. The property, when used, indicates the name of a property of the attribute to which to assign the value.
+
+ Attribute declarations are frequently initialized with a number of arguments that are passed into the constructor of the attribute at run time. To provide arguments to the constructor for an attribute, add a for each argument to the collection of a . Only the property of each needs to be initialized. The order of arguments within the collection must correspond to the order of arguments in the method signature of the constructor for the attribute.
+
+ You can also set properties of the attribute that are not available through the constructor by providing a that indicates the name of the property to set, along with the value to set.
+
+
+
+## Examples
+ The following code creates a class, and adds code attributes to declare that the class is serializable and obsolete.
-## Remarks
- can be used to represent either the value for a single argument of an attribute constructor, or a value with which to initialize a property of the attribute.
-
- The property indicates the value of the argument. The property, when used, indicates the name of a property of the attribute to which to assign the value.
-
- Attribute declarations are frequently initialized with a number of arguments that are passed into the constructor of the attribute at run time. To provide arguments to the constructor for an attribute, add a for each argument to the collection of a . Only the property of each needs to be initialized. The order of arguments within the collection must correspond to the order of arguments in the method signature of the constructor for the attribute.
-
- You can also set properties of the attribute that are not available through the constructor by providing a that indicates the name of the property to set, along with the value to set.
-
-
-
-## Examples
- The following code creates a class, and adds code attributes to declare that the class is serializable and obsolete.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR_System/system.codedom.codeattributeargument/cpp/source.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeAttributeArgument/Overview/source.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.codedom.codeattributeargument/vb/source.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.codedom.codeattributeargument/vb/source.vb" id="Snippet1":::
+
]]>
diff --git a/xml/System.CodeDom/CodeAttributeArgumentCollection.xml b/xml/System.CodeDom/CodeAttributeArgumentCollection.xml
index a7c14c70ef8..62d2a06ba15 100644
--- a/xml/System.CodeDom/CodeAttributeArgumentCollection.xml
+++ b/xml/System.CodeDom/CodeAttributeArgumentCollection.xml
@@ -48,20 +48,19 @@
Represents a collection of objects.
- class provides a simple collection object that can be used to store a set of objects.
-
-
-
-## Examples
- The following example demonstrates the use of the class methods. The example creates a new instance of the class and uses the methods to add statements to the collection, return their index, and add or remove attributes at a specific index point.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeAttributeArgumentCollectionExample/CPP/class1.cpp" id="Snippet1":::
+ class provides a simple collection object that can be used to store a set of objects.
+
+
+
+## Examples
+ The following example demonstrates the use of the class methods. The example creates a new instance of the class and uses the methods to add statements to the collection, return their index, and add or remove attributes at a specific index point.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeAttributeArgumentCollection/Overview/class1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeAttributeArgumentCollectionExample/VB/class1.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeAttributeArgumentCollectionExample/VB/class1.vb" id="Snippet1":::
+
]]>
@@ -219,15 +218,14 @@
Adds the specified object to the collection.
The index at which the new element was inserted.
- object to a instance.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeAttributeArgumentCollectionExample/CPP/class1.cpp" id="Snippet3":::
+ object to a instance.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeAttributeArgumentCollection/Overview/class1.cs" id="Snippet3":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeAttributeArgumentCollectionExample/VB/class1.vb" id="Snippet3":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeAttributeArgumentCollectionExample/VB/class1.vb" id="Snippet3":::
+
]]>
@@ -277,15 +275,14 @@
An array of type that contains the objects to add to the collection.
Copies the elements of the specified array to the end of the collection.
- method overload to add the members of a array to a .
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeAttributeArgumentCollectionExample/CPP/class1.cpp" id="Snippet4":::
+ method overload to add the members of a array to a .
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeAttributeArgumentCollection/Overview/class1.cs" id="Snippet4":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeAttributeArgumentCollectionExample/VB/class1.vb" id="Snippet4":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeAttributeArgumentCollectionExample/VB/class1.vb" id="Snippet4":::
+
]]>
@@ -328,15 +325,14 @@
A that contains the objects to add to the collection.
Copies the contents of another object to the end of the collection.
- method overload to add the members of one object to another .
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeAttributeArgumentCollectionExample/CPP/class1.cpp" id="Snippet4":::
+ method overload to add the members of one object to another .
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeAttributeArgumentCollection/Overview/class1.cs" id="Snippet4":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeAttributeArgumentCollectionExample/VB/class1.vb" id="Snippet4":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeAttributeArgumentCollectionExample/VB/class1.vb" id="Snippet4":::
+
]]>
@@ -381,15 +377,14 @@
if the collection contains the specified object; otherwise, .
- method to search for the presence of a specific object in a and gets the index value at which it was found.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeAttributeArgumentCollectionExample/CPP/class1.cpp" id="Snippet5":::
+ method to search for the presence of a specific object in a and gets the index value at which it was found.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeAttributeArgumentCollection/Overview/class1.cs" id="Snippet5":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeAttributeArgumentCollectionExample/VB/class1.vb" id="Snippet5":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeAttributeArgumentCollectionExample/VB/class1.vb" id="Snippet5":::
+
]]>
@@ -431,21 +426,20 @@
The index of the array at which to begin inserting.
Copies the collection objects to a one-dimensional instance beginning at the specified index.
- object to a array beginning at a specified index value.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeAttributeArgumentCollectionExample/CPP/class1.cpp" id="Snippet6":::
+ object to a array beginning at a specified index value.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeAttributeArgumentCollection/Overview/class1.cs" id="Snippet6":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeAttributeArgumentCollectionExample/VB/class1.vb" id="Snippet6":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeAttributeArgumentCollectionExample/VB/class1.vb" id="Snippet6":::
+
]]>
- The destination array is multidimensional.
-
- -or-
-
+ The destination array is multidimensional.
+
+ -or-
+
The number of elements in the is greater than the available space between the index of the target array specified by the parameter and the end of the target array.
The parameter is .
The parameter is less than the target array's minimum index.
@@ -487,15 +481,14 @@
Gets the index of the specified object in the collection, if it exists in the collection.
The index of the specified object, if found, in the collection; otherwise, -1.
- object and uses the method to get the index value at which it was found.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeAttributeArgumentCollectionExample/CPP/class1.cpp" id="Snippet5":::
+ object and uses the method to get the index value at which it was found.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeAttributeArgumentCollection/Overview/class1.cs" id="Snippet5":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeAttributeArgumentCollectionExample/VB/class1.vb" id="Snippet5":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeAttributeArgumentCollectionExample/VB/class1.vb" id="Snippet5":::
+
]]>
@@ -538,15 +531,14 @@
The object to insert.
Inserts the specified object into the collection at the specified index.
- method to add a object to a .
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeAttributeArgumentCollectionExample/CPP/class1.cpp" id="Snippet8":::
+ method to add a object to a .
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeAttributeArgumentCollection/Overview/class1.cs" id="Snippet8":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeAttributeArgumentCollectionExample/VB/class1.vb" id="Snippet8":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeAttributeArgumentCollectionExample/VB/class1.vb" id="Snippet8":::
+
]]>
@@ -587,11 +579,11 @@
Gets or sets the object at the specified index in the collection.
A at each valid index.
-
The parameter is outside the valid range of indexes for the collection.
@@ -632,15 +624,14 @@
The object to remove from the collection.
Removes the specified object from the collection.
- method to delete a object from a .
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeAttributeArgumentCollectionExample/CPP/class1.cpp" id="Snippet9":::
+ method to delete a object from a .
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeAttributeArgumentCollection/Overview/class1.cs" id="Snippet9":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeAttributeArgumentCollectionExample/VB/class1.vb" id="Snippet9":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeAttributeArgumentCollectionExample/VB/class1.vb" id="Snippet9":::
+
]]>
The specified object is not found in the collection.
diff --git a/xml/System.CodeDom/CodeAttributeDeclaration.xml b/xml/System.CodeDom/CodeAttributeDeclaration.xml
index ccc34ca63bd..fdd00a51158 100644
--- a/xml/System.CodeDom/CodeAttributeDeclaration.xml
+++ b/xml/System.CodeDom/CodeAttributeDeclaration.xml
@@ -48,20 +48,19 @@
Represents an attribute declaration.
- can be used to represent an expression that declares an attribute. The attribute name and the arguments for the attribute are stored as properties of the object. A can be used to represent each argument for the attribute.
+
+
+
+## Examples
+ The following code example creates a that declares a with an argument of `false`:
-## Remarks
- A can be used to represent an expression that declares an attribute. The attribute name and the arguments for the attribute are stored as properties of the object. A can be used to represent each argument for the attribute.
-
-
-
-## Examples
- The following code example creates a that declares a with an argument of `false`:
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR_System/system.codedom.codeattributedeclaration/cpp/source.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeAttributeDeclaration/Overview/source.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.codedom.codeattributedeclaration/vb/source.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.codedom.codeattributedeclaration/vb/source.vb" id="Snippet1":::
+
]]>
@@ -144,11 +143,11 @@
The that identifies the attribute.
Initializes a new instance of the class using the specified code type reference.
- and properties.
-
+ and properties.
+
]]>
@@ -228,11 +227,11 @@
An array of type that contains the arguments for the attribute.
Initializes a new instance of the class using the specified code type reference and arguments.
- and properties, and the `arguments` parameter is used to set the property for the .
-
+ and properties, and the `arguments` parameter is used to set the property for the .
+
]]>
diff --git a/xml/System.CodeDom/CodeAttributeDeclarationCollection.xml b/xml/System.CodeDom/CodeAttributeDeclarationCollection.xml
index fbc92db378c..9c20a0e4c0e 100644
--- a/xml/System.CodeDom/CodeAttributeDeclarationCollection.xml
+++ b/xml/System.CodeDom/CodeAttributeDeclarationCollection.xml
@@ -48,20 +48,19 @@
Represents a collection of objects.
- class provides a simple collection object that can be used to store a set of objects.
+
+
+
+## Examples
+ The following example demonstrates the use of the class methods.
-## Remarks
- The class provides a simple collection object that can be used to store a set of objects.
-
-
-
-## Examples
- The following example demonstrates the use of the class methods.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeAttributeDeclarationCollectionExample/CPP/class1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeAttributeDeclarationCollection/Overview/class1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeAttributeDeclarationCollectionExample/VB/class1.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeAttributeDeclarationCollectionExample/VB/class1.vb" id="Snippet1":::
+
]]>
@@ -219,15 +218,14 @@
Adds a object with the specified value to the collection.
The index at which the new element was inserted.
- object to a instance.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeAttributeDeclarationCollectionExample/CPP/class1.cpp" id="Snippet3":::
+ object to a instance.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeAttributeDeclarationCollection/Overview/class1.cs" id="Snippet3":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeAttributeDeclarationCollectionExample/VB/class1.vb" id="Snippet3":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeAttributeDeclarationCollectionExample/VB/class1.vb" id="Snippet3":::
+
]]>
@@ -277,15 +275,14 @@
An array of type that contains the objects to add to the collection.
Copies the elements of the specified array to the end of the collection.
- method overload to add an array of objects to a .
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeAttributeDeclarationCollectionExample/CPP/class1.cpp" id="Snippet4":::
+ method overload to add an array of objects to a .
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeAttributeDeclarationCollection/Overview/class1.cs" id="Snippet4":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeAttributeDeclarationCollectionExample/VB/class1.vb" id="Snippet4":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeAttributeDeclarationCollectionExample/VB/class1.vb" id="Snippet4":::
+
]]>
@@ -328,15 +325,14 @@
A that contains the objects to add to the collection.
Copies the contents of another object to the end of the collection.
- method overload to add the members of one to another.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeAttributeDeclarationCollectionExample/CPP/class1.cpp" id="Snippet4":::
+ method overload to add the members of one to another.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeAttributeDeclarationCollection/Overview/class1.cs" id="Snippet4":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeAttributeDeclarationCollectionExample/VB/class1.vb" id="Snippet4":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeAttributeDeclarationCollectionExample/VB/class1.vb" id="Snippet4":::
+
]]>
@@ -381,15 +377,14 @@
if the collection contains the specified object; otherwise, .
- method to search for the presence of a specific instance and gets the index value at which it was found.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeAttributeDeclarationCollectionExample/CPP/class1.cpp" id="Snippet5":::
+ method to search for the presence of a specific instance and gets the index value at which it was found.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeAttributeDeclarationCollection/Overview/class1.cs" id="Snippet5":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeAttributeDeclarationCollectionExample/VB/class1.vb" id="Snippet5":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeAttributeDeclarationCollectionExample/VB/class1.vb" id="Snippet5":::
+
]]>
@@ -432,21 +427,20 @@
The index of the array at which to begin inserting.
Copies the collection objects to a one-dimensional instance beginning at the specified index.
- to an array beginning at index 0.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeAttributeDeclarationCollectionExample/CPP/class1.cpp" id="Snippet6":::
+ to an array beginning at index 0.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeAttributeDeclarationCollection/Overview/class1.cs" id="Snippet6":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeAttributeDeclarationCollectionExample/VB/class1.vb" id="Snippet6":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeAttributeDeclarationCollectionExample/VB/class1.vb" id="Snippet6":::
+
]]>
- The destination array is multidimensional.
-
- -or-
-
+ The destination array is multidimensional.
+
+ -or-
+
The number of elements in the is greater than the available space between the index of the target array specified by the parameter and the end of the target array.
The parameter is .
The parameter is less than the target array's minimum index.
@@ -489,15 +483,14 @@
Gets the index of the specified object in the collection, if it exists in the collection.
The index in the collection of the specified object, if found; otherwise, -1.
- instance and uses the method to get the index value at which it was found.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeAttributeDeclarationCollectionExample/CPP/class1.cpp" id="Snippet5":::
+ instance and uses the method to get the index value at which it was found.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeAttributeDeclarationCollection/Overview/class1.cs" id="Snippet5":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeAttributeDeclarationCollectionExample/VB/class1.vb" id="Snippet5":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeAttributeDeclarationCollectionExample/VB/class1.vb" id="Snippet5":::
+
]]>
@@ -540,15 +533,14 @@
The object to insert.
Inserts the specified object into the collection at the specified index.
- method to add a object to the .
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeAttributeDeclarationCollectionExample/CPP/class1.cpp" id="Snippet8":::
+ method to add a object to the .
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeAttributeDeclarationCollection/Overview/class1.cs" id="Snippet8":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeAttributeDeclarationCollectionExample/VB/class1.vb" id="Snippet8":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeAttributeDeclarationCollectionExample/VB/class1.vb" id="Snippet8":::
+
]]>
@@ -590,11 +582,11 @@
Gets or sets the object at the specified index.
A at each valid index.
-
The parameter is outside the valid range of indexes for the collection.
@@ -636,15 +628,14 @@
The object to remove from the collection.
Removes the specified object from the collection.
- method to delete a object from the .
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeAttributeDeclarationCollectionExample/CPP/class1.cpp" id="Snippet9":::
+ method to delete a object from the .
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeAttributeDeclarationCollection/Overview/class1.cs" id="Snippet9":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeAttributeDeclarationCollectionExample/VB/class1.vb" id="Snippet9":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeAttributeDeclarationCollectionExample/VB/class1.vb" id="Snippet9":::
+
]]>
The specified object is not found in the collection.
diff --git a/xml/System.CodeDom/CodeBaseReferenceExpression.xml b/xml/System.CodeDom/CodeBaseReferenceExpression.xml
index e53b84e772d..1ce713d078e 100644
--- a/xml/System.CodeDom/CodeBaseReferenceExpression.xml
+++ b/xml/System.CodeDom/CodeBaseReferenceExpression.xml
@@ -48,20 +48,19 @@
Represents a reference to the base class.
- represents a reference to the base class of the current class. The base class is sometimes also known as the parent class or super class. References to the base class are commonly used when overriding a method or property in order to call the base class's implementation of that method or property. For example, an override of a ToString method that appends a string to the end of the base class's `ToString` method would call base.ToString() in C#.
+
+
+
+## Examples
+ This example demonstrates using a to reference a base class method.
-## Remarks
- represents a reference to the base class of the current class. The base class is sometimes also known as the parent class or super class. References to the base class are commonly used when overriding a method or property in order to call the base class's implementation of that method or property. For example, an override of a ToString method that appends a string to the end of the base class's `ToString` method would call base.ToString() in C#.
-
-
-
-## Examples
- This example demonstrates using a to reference a base class method.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeBaseReferenceExpressionExample/CPP/codebasereferenceexpressionexample.cpp" id="Snippet2":::
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeBaseReferenceExpression/Overview/codebasereferenceexpressionexample.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeBaseReferenceExpressionExample/VB/codebasereferenceexpressionexample.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeBaseReferenceExpressionExample/VB/codebasereferenceexpressionexample.vb" id="Snippet2":::
+
]]>
diff --git a/xml/System.CodeDom/CodeBinaryOperatorExpression.xml b/xml/System.CodeDom/CodeBinaryOperatorExpression.xml
index e3d8d6e593b..62829f920af 100644
--- a/xml/System.CodeDom/CodeBinaryOperatorExpression.xml
+++ b/xml/System.CodeDom/CodeBinaryOperatorExpression.xml
@@ -48,20 +48,19 @@
Represents an expression that consists of a binary operation between two expressions.
- can be used to represent code expressions that include a binary operator. Some examples of binary operators are equality (`==`), addition (`+`), and bitwise (`|`) operators. The enumeration represents a set of basic, commonly used binary operators that are supported in many languages.
+
+
+
+## Examples
+ This example demonstrates use of a to add two numbers together.
-## Remarks
- can be used to represent code expressions that include a binary operator. Some examples of binary operators are equality (`==`), addition (`+`), and bitwise (`|`) operators. The enumeration represents a set of basic, commonly used binary operators that are supported in many languages.
-
-
-
-## Examples
- This example demonstrates use of a to add two numbers together.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeBinaryOperatorExpression/CPP/codebinaryoperatorexpressionexample.cpp" id="Snippet2":::
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeBinaryOperatorExpression/Overview/codebinaryoperatorexpressionexample.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeBinaryOperatorExpression/VB/codebinaryoperatorexpressionexample.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeBinaryOperatorExpression/VB/codebinaryoperatorexpressionexample.vb" id="Snippet2":::
+
]]>
@@ -241,11 +240,11 @@
Gets or sets the operator in the binary operator expression.
A that indicates the type of operator in the expression.
- enumeration.
-
+ enumeration.
+
]]>
diff --git a/xml/System.CodeDom/CodeCastExpression.xml b/xml/System.CodeDom/CodeCastExpression.xml
index 053666ff78e..6d791e22f2a 100644
--- a/xml/System.CodeDom/CodeCastExpression.xml
+++ b/xml/System.CodeDom/CodeCastExpression.xml
@@ -48,22 +48,21 @@
Represents an expression cast to a data type or interface.
- can be used to represent an expression cast to a different data type or interface.
+
+ The property indicates the to cast. The property indicates the type to cast to.
+
+
+
+## Examples
+ This example demonstrates using a to cast a `System.Int32` value to a `System.Int64` data type.
-## Remarks
- can be used to represent an expression cast to a different data type or interface.
-
- The property indicates the to cast. The property indicates the type to cast to.
-
-
-
-## Examples
- This example demonstrates using a to cast a `System.Int32` value to a `System.Int64` data type.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeCastExpressionExample/CPP/codecastexpressionexample.cpp" id="Snippet2":::
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeCastExpression/Overview/codecastexpressionexample.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeCastExpressionExample/VB/codecastexpressionexample.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeCastExpressionExample/VB/codecastexpressionexample.vb" id="Snippet2":::
+
]]>
diff --git a/xml/System.CodeDom/CodeCatchClause.xml b/xml/System.CodeDom/CodeCatchClause.xml
index 610a0108bfc..db6cd56439f 100644
--- a/xml/System.CodeDom/CodeCatchClause.xml
+++ b/xml/System.CodeDom/CodeCatchClause.xml
@@ -48,22 +48,21 @@
Represents a exception block of a statement.
- can be used to represent a `catch` exception block of a `try/catch` statement.
+
+ The property specifies the type of exception to catch. The property specifies a name for the variable representing the exception that has been caught. The collection property contains the statements for the `catch` block.
+
+
+
+## Examples
+ The following example code demonstrates using objects to define exception handling clauses of a try...catch block.
-## Remarks
- can be used to represent a `catch` exception block of a `try/catch` statement.
-
- The property specifies the type of exception to catch. The property specifies a name for the variable representing the exception that has been caught. The collection property contains the statements for the `catch` block.
-
-
-
-## Examples
- The following example code demonstrates using objects to define exception handling clauses of a try...catch block.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeTryCatchFinallyExample/CPP/codetrycatchfinallyexample.cpp" id="Snippet2":::
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeCatchClause/Overview/codetrycatchfinallyexample.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTryCatchFinallyExample/VB/codetrycatchfinallyexample.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTryCatchFinallyExample/VB/codetrycatchfinallyexample.vb" id="Snippet2":::
+
]]>
@@ -282,11 +281,11 @@
Gets or sets the type of the exception to handle with the catch block.
A that indicates the type of the exception to handle.
- .
-
+ .
+
]]>
@@ -330,11 +329,11 @@
Gets or sets the variable name of the exception that the clause handles.
The name for the exception variable that the clause handles.
-
diff --git a/xml/System.CodeDom/CodeCatchClauseCollection.xml b/xml/System.CodeDom/CodeCatchClauseCollection.xml
index 6007880c596..515dcfdbcfd 100644
--- a/xml/System.CodeDom/CodeCatchClauseCollection.xml
+++ b/xml/System.CodeDom/CodeCatchClauseCollection.xml
@@ -48,20 +48,19 @@
Represents a collection of objects.
- class provides a simple collection object that can be used to store a set of objects.
+
+
+
+## Examples
+ The following example demonstrates the use of the class methods. The example creates a new instance of the class and uses the methods to add statements to the collection, return their index, and add or remove attributes at a specific index point.
-## Remarks
- The class provides a simple collection object that can be used to store a set of objects.
-
-
-
-## Examples
- The following example demonstrates the use of the class methods. The example creates a new instance of the class and uses the methods to add statements to the collection, return their index, and add or remove attributes at a specific index point.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeCatchClauseCollectionExample/CPP/class1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeCatchClauseCollection/Overview/class1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeCatchClauseCollectionExample/VB/class1.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeCatchClauseCollectionExample/VB/class1.vb" id="Snippet1":::
+
]]>
@@ -219,15 +218,14 @@
Adds the specified object to the collection.
The index at which the new element was inserted.
- object to the instance.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeCatchClauseCollectionExample/CPP/class1.cpp" id="Snippet3":::
+ object to the instance.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeCatchClauseCollection/Overview/class1.cs" id="Snippet3":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeCatchClauseCollectionExample/VB/class1.vb" id="Snippet3":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeCatchClauseCollectionExample/VB/class1.vb" id="Snippet3":::
+
]]>
@@ -277,15 +275,14 @@
An array of type that contains the objects to add to the collection.
Copies the elements of the specified array to the end of the collection.
- method overload to add the members of an array of objects to the .
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeCatchClauseCollectionExample/CPP/class1.cpp" id="Snippet4":::
+ method overload to add the members of an array of objects to the .
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeCatchClauseCollection/Overview/class1.cs" id="Snippet4":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeCatchClauseCollectionExample/VB/class1.vb" id="Snippet4":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeCatchClauseCollectionExample/VB/class1.vb" id="Snippet4":::
+
]]>
@@ -328,15 +325,14 @@
A that contains the objects to add to the collection.
Copies the contents of another object to the end of the collection.
- method overload to add the members of one object to another .
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeCatchClauseCollectionExample/CPP/class1.cpp" id="Snippet4":::
+ method overload to add the members of one object to another .
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeCatchClauseCollection/Overview/class1.cs" id="Snippet4":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeCatchClauseCollectionExample/VB/class1.vb" id="Snippet4":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeCatchClauseCollectionExample/VB/class1.vb" id="Snippet4":::
+
]]>
@@ -381,15 +377,14 @@
if the collection contains the specified object; otherwise, .
- method to search for the presence of a specific instance and gets the index value at which it was found.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeCatchClauseCollectionExample/CPP/class1.cpp" id="Snippet5":::
+ method to search for the presence of a specific instance and gets the index value at which it was found.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeCatchClauseCollection/Overview/class1.cs" id="Snippet5":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeCatchClauseCollectionExample/VB/class1.vb" id="Snippet5":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeCatchClauseCollectionExample/VB/class1.vb" id="Snippet5":::
+
]]>
@@ -432,21 +427,20 @@
The index of the array at which to begin inserting.
Copies the collection objects to a one-dimensional instance beginning at the specified index.
- to a array beginning at index value 0.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeCatchClauseCollectionExample/CPP/class1.cpp" id="Snippet6":::
+ to a array beginning at index value 0.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeCatchClauseCollection/Overview/class1.cs" id="Snippet6":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeCatchClauseCollectionExample/VB/class1.vb" id="Snippet6":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeCatchClauseCollectionExample/VB/class1.vb" id="Snippet6":::
+
]]>
- The destination array is multidimensional.
-
- -or-
-
+ The destination array is multidimensional.
+
+ -or-
+
The number of elements in the is greater than the available space between the index of the target array specified by the parameter and the end of the target array.
The parameter is .
The parameter is less than the target array's minimum index.
@@ -489,15 +483,14 @@
Gets the index of the specified object in the collection, if it exists in the collection.
The index of the specified object, if found, in the collection; otherwise, -1.
- object and uses the method to get the index value at which it was found.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeCatchClauseCollectionExample/CPP/class1.cpp" id="Snippet5":::
+ object and uses the method to get the index value at which it was found.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeCatchClauseCollection/Overview/class1.cs" id="Snippet5":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeCatchClauseCollectionExample/VB/class1.vb" id="Snippet5":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeCatchClauseCollectionExample/VB/class1.vb" id="Snippet5":::
+
]]>
@@ -540,15 +533,14 @@
The object to insert.
Inserts the specified object into the collection at the specified index.
- method to add a object to a .
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeCatchClauseCollectionExample/CPP/class1.cpp" id="Snippet8":::
+ method to add a object to a .
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeCatchClauseCollection/Overview/class1.cs" id="Snippet8":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeCatchClauseCollectionExample/VB/class1.vb" id="Snippet8":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeCatchClauseCollectionExample/VB/class1.vb" id="Snippet8":::
+
]]>
@@ -590,11 +582,11 @@
Gets or sets the object at the specified index in the collection.
A object at each valid index.
-
The parameter is outside the valid range of indexes for the collection.
@@ -636,15 +628,14 @@
The object to remove from the collection.
Removes the specified object from the collection.
- method to delete a object from a .
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeCatchClauseCollectionExample/CPP/class1.cpp" id="Snippet9":::
+ method to delete a object from a .
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeCatchClauseCollection/Overview/class1.cs" id="Snippet9":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeCatchClauseCollectionExample/VB/class1.vb" id="Snippet9":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeCatchClauseCollectionExample/VB/class1.vb" id="Snippet9":::
+
]]>
The specified object is not found in the collection.
diff --git a/xml/System.CodeDom/CodeComment.xml b/xml/System.CodeDom/CodeComment.xml
index 9dff369c555..04cbc8f23c2 100644
--- a/xml/System.CodeDom/CodeComment.xml
+++ b/xml/System.CodeDom/CodeComment.xml
@@ -48,24 +48,23 @@
Represents a comment.
- can be used to represent a single line comment.
+
+ A can contain a and allows it to be treated as a statement and generated as code within a collection of statements. Multi-line comments can be represented with multiple objects.
+
+ To include a comment in a CodeDOM graph that can be generated to source code, add a to a , and add this to the statements collection of a or to the comments collection of a or any object that derives from .
+
+
+
+## Examples
+ This example demonstrates using a to represent a comment in source code.
-## Remarks
- can be used to represent a single line comment.
-
- A can contain a and allows it to be treated as a statement and generated as code within a collection of statements. Multi-line comments can be represented with multiple objects.
-
- To include a comment in a CodeDOM graph that can be generated to source code, add a to a , and add this to the statements collection of a or to the comments collection of a or any object that derives from .
-
-
-
-## Examples
- This example demonstrates using a to represent a comment in source code.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeCommentExample/CPP/codecommentexample.cpp" id="Snippet2":::
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeComment/Overview/codecommentexample.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeCommentExample/VB/codecommentexample.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeCommentExample/VB/codecommentexample.vb" id="Snippet2":::
+
]]>
@@ -231,11 +230,11 @@
if the comment is a documentation comment; otherwise, .
-
@@ -278,11 +277,11 @@
Gets or sets the text of the comment.
A string containing the comment text.
- objects should be defined.
-
+ objects should be defined.
+
]]>
diff --git a/xml/System.CodeDom/CodeCommentStatement.xml b/xml/System.CodeDom/CodeCommentStatement.xml
index 4001f55b053..29d32ef78e8 100644
--- a/xml/System.CodeDom/CodeCommentStatement.xml
+++ b/xml/System.CodeDom/CodeCommentStatement.xml
@@ -48,20 +48,19 @@
Represents a statement consisting of a single comment.
- can be used to represent a single-line comment statement. is a statement, so it can be inserted into a statements collection and will appear on its own line. can also be added to the comments collection of or any object that derives from .
+
+
+
+## Examples
+ This example demonstrates using a to represent a comment in source code.
-## Remarks
- can be used to represent a single-line comment statement. is a statement, so it can be inserted into a statements collection and will appear on its own line. can also be added to the comments collection of or any object that derives from .
-
-
-
-## Examples
- This example demonstrates using a to represent a comment in source code.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeCommentExample/CPP/codecommentexample.cpp" id="Snippet2":::
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeComment/Overview/codecommentexample.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeCommentExample/VB/codecommentexample.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeCommentExample/VB/codecommentexample.vb" id="Snippet2":::
+
]]>
@@ -221,24 +220,24 @@
if the comment is a documentation comment; otherwise, .
Initializes a new instance of the class using the specified text and documentation comment flag.
- is a documentation comment and the comment is structured using triple delimiter characters. For example, in C# the comment is "`///`", in Visual Basic "`'''`". Documentation comments are used to identify an XML comment field, such as a type or member summary identified by the `` element.
-
-
-
-## Examples
- The following code example demonstrates the use of the constructor to create a comment statement to be used as an XML comment field. This example is part of a larger example that follows.
-
+ is a documentation comment and the comment is structured using triple delimiter characters. For example, in C# the comment is "`///`", in Visual Basic "`'''`". Documentation comments are used to identify an XML comment field, such as a type or member summary identified by the `` element.
+
+
+
+## Examples
+ The following code example demonstrates the use of the constructor to create a comment statement to be used as an XML comment field. This example is part of a larger example that follows.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeCommentStatement/.ctor/program.cs" id="Snippet3":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDomHelloWorldSample/vb/program.vb" id="Snippet3":::
-
- The following code example demonstrates the creation of a simple "Hello World" console application and the generation of an XML documentation file for the compiled application.
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDomHelloWorldSample/vb/program.vb" id="Snippet3":::
+
+ The following code example demonstrates the creation of a simple "Hello World" console application and the generation of an XML documentation file for the compiled application.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeCommentStatement/.ctor/program.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDomHelloWorldSample/vb/program.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDomHelloWorldSample/vb/program.vb" id="Snippet1":::
+
]]>
diff --git a/xml/System.CodeDom/CodeCommentStatementCollection.xml b/xml/System.CodeDom/CodeCommentStatementCollection.xml
index 299d7af17b3..6364625a789 100644
--- a/xml/System.CodeDom/CodeCommentStatementCollection.xml
+++ b/xml/System.CodeDom/CodeCommentStatementCollection.xml
@@ -48,20 +48,19 @@
Represents a collection of objects.
- class provides a simple collection object that can be used to store a set of objects.
+
+
+
+## Examples
+ The following example demonstrates the use of the class methods. The example creates a new instance of the class and uses the methods to add statements to the collection, return their index, and add or remove attributes at a specific index point.
-## Remarks
- The class provides a simple collection object that can be used to store a set of objects.
-
-
-
-## Examples
- The following example demonstrates the use of the class methods. The example creates a new instance of the class and uses the methods to add statements to the collection, return their index, and add or remove attributes at a specific index point.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeCommentStatementCollectionExample/CPP/class1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeCommentStatementCollection/Overview/class1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeCommentStatementCollectionExample/VB/class1.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeCommentStatementCollectionExample/VB/class1.vb" id="Snippet1":::
+
]]>
@@ -219,15 +218,14 @@
Adds the specified object to the collection.
The index at which the new element was inserted.
- object to a instance.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeCommentStatementCollectionExample/CPP/class1.cpp" id="Snippet3":::
+ object to a instance.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeCommentStatementCollection/Overview/class1.cs" id="Snippet3":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeCommentStatementCollectionExample/VB/class1.vb" id="Snippet3":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeCommentStatementCollectionExample/VB/class1.vb" id="Snippet3":::
+
]]>
@@ -277,15 +275,14 @@
An array of type that contains the objects to add to the collection.
Copies the elements of the specified array to the end of the collection.
- method overload to add the members of a array to the .
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeCommentStatementCollectionExample/CPP/class1.cpp" id="Snippet4":::
+ method overload to add the members of a array to the .
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeCommentStatementCollection/Overview/class1.cs" id="Snippet4":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeCommentStatementCollectionExample/VB/class1.vb" id="Snippet4":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeCommentStatementCollectionExample/VB/class1.vb" id="Snippet4":::
+
]]>
@@ -328,15 +325,14 @@
A that contains the objects to add to the collection.
Copies the contents of another object to the end of the collection.
- method overload to add the members of one to another.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeCommentStatementCollectionExample/CPP/class1.cpp" id="Snippet4":::
+ method overload to add the members of one to another.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeCommentStatementCollection/Overview/class1.cs" id="Snippet4":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeCommentStatementCollectionExample/VB/class1.vb" id="Snippet4":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeCommentStatementCollectionExample/VB/class1.vb" id="Snippet4":::
+
]]>
@@ -381,15 +377,14 @@
if the collection contains the specified object; otherwise, .
- method to search for the presence of a specific object and gets the index value at which it was found.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeCommentStatementCollectionExample/CPP/class1.cpp" id="Snippet5":::
+ method to search for the presence of a specific object and gets the index value at which it was found.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeCommentStatementCollection/Overview/class1.cs" id="Snippet5":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeCommentStatementCollectionExample/VB/class1.vb" id="Snippet5":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeCommentStatementCollectionExample/VB/class1.vb" id="Snippet5":::
+
]]>
@@ -432,21 +427,20 @@
The index of the array at which to begin inserting.
Copies the collection objects to the specified one-dimensional beginning at the specified index.
- to an array beginning at the index value 0.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeCommentStatementCollectionExample/CPP/class1.cpp" id="Snippet6":::
+ to an array beginning at the index value 0.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeCommentStatementCollection/Overview/class1.cs" id="Snippet6":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeCommentStatementCollectionExample/VB/class1.vb" id="Snippet6":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeCommentStatementCollectionExample/VB/class1.vb" id="Snippet6":::
+
]]>
- The destination array is multidimensional.
-
- -or-
-
+ The destination array is multidimensional.
+
+ -or-
+
The number of elements in the is greater than the available space between the index of the target array specified by the parameter and the end of the target array.
The parameter is .
The parameter is less than the target array's minimum index.
@@ -489,15 +483,14 @@
Gets the index of the specified object in the collection, if it exists in the collection.
The index of the specified object, if found, in the collection; otherwise, -1.
- object and uses the method to get the index value at which it was found.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeCommentStatementCollectionExample/CPP/class1.cpp" id="Snippet5":::
+ object and uses the method to get the index value at which it was found.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeCommentStatementCollection/Overview/class1.cs" id="Snippet5":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeCommentStatementCollectionExample/VB/class1.vb" id="Snippet5":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeCommentStatementCollectionExample/VB/class1.vb" id="Snippet5":::
+
]]>
@@ -540,15 +533,14 @@
The object to insert.
Inserts a object into the collection at the specified index.
- method to add a object to the .
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeCommentStatementCollectionExample/CPP/class1.cpp" id="Snippet8":::
+ method to add a object to the .
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeCommentStatementCollection/Overview/class1.cs" id="Snippet8":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeCommentStatementCollectionExample/VB/class1.vb" id="Snippet8":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeCommentStatementCollectionExample/VB/class1.vb" id="Snippet8":::
+
]]>
@@ -590,11 +582,11 @@
Gets or sets the object at the specified index in the collection.
A object at each valid index.
-
The parameter is outside the valid range of indexes for the collection.
@@ -635,15 +627,14 @@
The object to remove from the collection.
Removes the specified object from the collection.
- method to delete a object from the .
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeCommentStatementCollectionExample/CPP/class1.cpp" id="Snippet9":::
+ method to delete a object from the .
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeCommentStatementCollection/Overview/class1.cs" id="Snippet9":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeCommentStatementCollectionExample/VB/class1.vb" id="Snippet9":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeCommentStatementCollectionExample/VB/class1.vb" id="Snippet9":::
+
]]>
The specified object is not found in the collection.
diff --git a/xml/System.CodeDom/CodeCompileUnit.xml b/xml/System.CodeDom/CodeCompileUnit.xml
index ceba8e7b24e..f80d0b3d8ba 100644
--- a/xml/System.CodeDom/CodeCompileUnit.xml
+++ b/xml/System.CodeDom/CodeCompileUnit.xml
@@ -48,27 +48,26 @@
Provides a container for a CodeDOM program graph.
- provides a container for a CodeDOM program graph.
-
- contains a collection that can store objects containing CodeDOM source code graphs, along with a collection of assemblies referenced by the project, and a collection of attributes for the project assembly.
-
- A can be passed to the method of an implementation along with other parameters to generate code based on the program graph contained by the compile unit.
-
+ provides a container for a CodeDOM program graph.
+
+ contains a collection that can store objects containing CodeDOM source code graphs, along with a collection of assemblies referenced by the project, and a collection of attributes for the project assembly.
+
+ A can be passed to the method of an implementation along with other parameters to generate code based on the program graph contained by the compile unit.
+
> [!NOTE]
-> Some languages support only a single namespace that contains a single class in a compile unit.
-
-
-
-## Examples
- The following code example constructs a that models the program structure of a simple "Hello World" program. This code example is part of a larger example that also produces code from this model, and is provided for the class.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeDomExample/CPP/source.cpp" id="Snippet2":::
+> Some languages support only a single namespace that contains a single class in a compile unit.
+
+
+
+## Examples
+ The following code example constructs a that models the program structure of a simple "Hello World" program. This code example is part of a larger example that also produces code from this model, and is provided for the class.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeCompileUnit/Overview/source.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDomExample/VB/source.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDomExample/VB/source.vb" id="Snippet2":::
+
]]>
@@ -135,11 +134,11 @@
Gets a collection of custom attributes for the generated assembly.
A that indicates the custom attributes for the generated assembly.
- objects representing attributes for the generated assembly from this collection.
-
+ objects representing attributes for the generated assembly from this collection.
+
]]>
@@ -175,14 +174,14 @@
Gets a object containing end directives.
A object containing end directives.
- property. This example is part of a larger example provided for the class.
-
+ property. This example is part of a larger example provided for the class.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeChecksumPragma/Overview/codedirective.cs" id="Snippet3":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.CodeDom.CodeDirectives/VB/codedirective.vb" id="Snippet3":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.CodeDom.CodeDirectives/VB/codedirective.vb" id="Snippet3":::
+
]]>
@@ -225,23 +224,22 @@
Gets the collection of namespaces.
A that indicates the namespaces that the compile unit uses.
- objects from this collection. Each object represents a namespace.
-
+ objects from this collection. Each object represents a namespace.
+
> [!NOTE]
-> Some languages support only a single namespace that contains a single class in a compile unit.
-
-
-
-## Examples
- The following code example constructs a that models the program structure of a simple "Hello World" program. This example is part of a larger example that also produces code from this model, and is provided for the class.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeDomExample/CPP/source.cpp" id="Snippet2":::
+> Some languages support only a single namespace that contains a single class in a compile unit.
+
+
+
+## Examples
+ The following code example constructs a that models the program structure of a simple "Hello World" program. This example is part of a larger example that also produces code from this model, and is provided for the class.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeCompileUnit/Overview/source.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDomExample/VB/source.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDomExample/VB/source.vb" id="Snippet2":::
+
]]>
@@ -279,11 +277,11 @@
Gets the referenced assemblies.
A that contains the file names of the referenced assemblies.
-
@@ -319,14 +317,14 @@
Gets a object containing start directives.
A object containing start directives.
- property. This example is part of a larger example provided for the class.
-
+ property. This example is part of a larger example provided for the class.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeChecksumPragma/Overview/codedirective.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.CodeDom.CodeDirectives/VB/codedirective.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.CodeDom.CodeDirectives/VB/codedirective.vb" id="Snippet2":::
+
]]>
diff --git a/xml/System.CodeDom/CodeConditionStatement.xml b/xml/System.CodeDom/CodeConditionStatement.xml
index 71eeb74d61f..eaf5584ca69 100644
--- a/xml/System.CodeDom/CodeConditionStatement.xml
+++ b/xml/System.CodeDom/CodeConditionStatement.xml
@@ -48,22 +48,21 @@
Represents a conditional branch statement, typically represented as an statement.
- can be used to represent code that consists of a conditional expression, a collection of statements to execute if the conditional expression evaluates to `true`, and an optional collection of statements to execute if the conditional expression evaluates to `false`. A is generated in many languages as an `if` statement.
+
+ The property indicates the expression to test. The property contains the statements to execute if the expression to test evaluates to `true`. The property contains the statements to execute if the expression to test evaluates to `false`.
+
+
+
+## Examples
+ This example demonstrates using a to represent an `if` statement with an `else` block.
-## Remarks
- can be used to represent code that consists of a conditional expression, a collection of statements to execute if the conditional expression evaluates to `true`, and an optional collection of statements to execute if the conditional expression evaluates to `false`. A is generated in many languages as an `if` statement.
-
- The property indicates the expression to test. The property contains the statements to execute if the expression to test evaluates to `true`. The property contains the statements to execute if the expression to test evaluates to `false`.
-
-
-
-## Examples
- This example demonstrates using a to represent an `if` statement with an `else` block.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeConditionStatementExample/CPP/codeconditionstatementexample.cpp" id="Snippet2":::
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeConditionStatement/Overview/codeconditionstatementexample.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeConditionStatementExample/VB/codeconditionstatementexample.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeConditionStatementExample/VB/codeconditionstatementexample.vb" id="Snippet2":::
+
]]>
@@ -234,11 +233,11 @@
Gets or sets the expression to evaluate or .
A to evaluate or .
- collection will be executed. If this conditional expression evaluates to `false` and the collection is not empty, the code contained in the collection will be executed.
-
+ collection will be executed. If this conditional expression evaluates to `false` and the collection is not empty, the code contained in the collection will be executed.
+
]]>
diff --git a/xml/System.CodeDom/CodeConstructor.xml b/xml/System.CodeDom/CodeConstructor.xml
index 9122c3161a1..f7586ebf914 100644
--- a/xml/System.CodeDom/CodeConstructor.xml
+++ b/xml/System.CodeDom/CodeConstructor.xml
@@ -48,22 +48,21 @@
Represents a declaration for an instance constructor of a type.
- can be used to represent a declaration of an instance constructor for a type. Use to declare a static constructor for a type.
+
+ If the constructor calls a base class constructor, set the constructor arguments for the base class constructor in the property. If the constructor overloads another constructor for the type, set the constructor arguments to pass to the overloaded type constructor in the property.
+
+
+
+## Examples
+ This example demonstrates using a to declare several types of constructors.
-## Remarks
- can be used to represent a declaration of an instance constructor for a type. Use to declare a static constructor for a type.
-
- If the constructor calls a base class constructor, set the constructor arguments for the base class constructor in the property. If the constructor overloads another constructor for the type, set the constructor arguments to pass to the overloaded type constructor in the property.
-
-
-
-## Examples
- This example demonstrates using a to declare several types of constructors.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeConstructorExample/CPP/codeconstructorexample.cpp" id="Snippet2":::
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeConstructor/Overview/codeconstructorexample.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeConstructorExample/VB/codeconstructorexample.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeConstructorExample/VB/codeconstructorexample.vb" id="Snippet2":::
+
]]>
@@ -136,11 +135,11 @@
Gets the collection of base constructor arguments.
A that contains the base constructor arguments.
- overloads a base class constructor, this collection contains any arguments to pass to a base class constructor. To call a base class constructor with no arguments, set a containing an empty string ("") to this collection.
-
+ overloads a base class constructor, this collection contains any arguments to pass to a base class constructor. To call a base class constructor with no arguments, set a containing an empty string ("") to this collection.
+
]]>
@@ -184,11 +183,11 @@
Gets the collection of chained constructor arguments.
A that contains the chained constructor arguments.
- overloads another constructor of the same type, this collection contains any arguments to pass to the overloaded type constructor. To call a constructor for the current type with no arguments, set a containing an empty string ("") to this collection.
-
+ overloads another constructor of the same type, this collection contains any arguments to pass to the overloaded type constructor. To call a constructor for the current type with no arguments, set a containing an empty string ("") to this collection.
+
]]>
diff --git a/xml/System.CodeDom/CodeDelegateCreateExpression.xml b/xml/System.CodeDom/CodeDelegateCreateExpression.xml
index 46b90d27af8..a6ad6ba8b43 100644
--- a/xml/System.CodeDom/CodeDelegateCreateExpression.xml
+++ b/xml/System.CodeDom/CodeDelegateCreateExpression.xml
@@ -48,24 +48,23 @@
Represents an expression that creates a delegate.
- represents code that creates a delegate. is often used with or to represent an event handler to attach or remove from an event.
+
+ The property specifies the type of delegate to create. The property indicates the object that contains the event-handler method. The property indicates the name of the event-handler method whose method signature matches the method signature of the delegate.
+
+ In C#, a delegate creation expression is typically of the following form: `new EventHandler(this.HandleEventMethod)`. In Visual Basic, a delegate creation expression is typically of the following form: `AddressOf Me.HandleEventMethod`.
+
+
+
+## Examples
+ The following example code uses a to create a delegate.
-## Remarks
- represents code that creates a delegate. is often used with or to represent an event handler to attach or remove from an event.
-
- The property specifies the type of delegate to create. The property indicates the object that contains the event-handler method. The property indicates the name of the event-handler method whose method signature matches the method signature of the delegate.
-
- In C#, a delegate creation expression is typically of the following form: `new EventHandler(this.HandleEventMethod)`. In Visual Basic, a delegate creation expression is typically of the following form: `AddressOf Me.HandleEventMethod`.
-
-
-
-## Examples
- The following example code uses a to create a delegate.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeAttachEventStatementExample/CPP/codeattacheventstatementexample.cpp" id="Snippet3":::
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeAttachEventStatement/Overview/codeattacheventstatementexample.cs" id="Snippet3":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeAttachEventStatementExample/VB/codeattacheventstatementexample.vb" id="Snippet3":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeAttachEventStatementExample/VB/codeattacheventstatementexample.vb" id="Snippet3":::
+
]]>
diff --git a/xml/System.CodeDom/CodeDelegateInvokeExpression.xml b/xml/System.CodeDom/CodeDelegateInvokeExpression.xml
index 635a1fc5848..6762845106f 100644
--- a/xml/System.CodeDom/CodeDelegateInvokeExpression.xml
+++ b/xml/System.CodeDom/CodeDelegateInvokeExpression.xml
@@ -48,22 +48,21 @@
Represents an expression that raises an event.
- can be used to represent code that invokes an event. Invoking an event invokes all delegates that are registered with the event using the specified parameters.
+
+ The property specifies the event to invoke. The property specifies the parameters to pass to the delegates for the event.
+
+
+
+## Examples
+ The following example demonstrates use of a to invoke an event named `TestEvent`.
-## Remarks
- can be used to represent code that invokes an event. Invoking an event invokes all delegates that are registered with the event using the specified parameters.
-
- The property specifies the event to invoke. The property specifies the parameters to pass to the delegates for the event.
-
-
-
-## Examples
- The following example demonstrates use of a to invoke an event named `TestEvent`.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeDelegateInvokeExpressionExample/CPP/codedelegateinvokeexpressionexample.cpp" id="Snippet3":::
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeDelegateInvokeExpression/Overview/codedelegateinvokeexpressionexample.cs" id="Snippet3":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDelegateInvokeExpressionExample/VB/codedelegateinvokeexpressionexample.vb" id="Snippet3":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDelegateInvokeExpressionExample/VB/codedelegateinvokeexpressionexample.vb" id="Snippet3":::
+
]]>
diff --git a/xml/System.CodeDom/CodeDirectionExpression.xml b/xml/System.CodeDom/CodeDirectionExpression.xml
index 941b5b1e785..ad8b9c138e5 100644
--- a/xml/System.CodeDom/CodeDirectionExpression.xml
+++ b/xml/System.CodeDom/CodeDirectionExpression.xml
@@ -48,25 +48,24 @@
Represents an expression used as a method invoke parameter along with a reference direction indicator.
- can represent a parameter passed to a method and the reference direction of the parameter.
-
- The property indicates the expression to qualify with a direction. The property indicates the direction of the parameter using one of the enumeration values.
-
+ can represent a parameter passed to a method and the reference direction of the parameter.
+
+ The property indicates the expression to qualify with a direction. The property indicates the direction of the parameter using one of the enumeration values.
+
> [!NOTE]
-> is intended to be used as a method invoke parameter, and should not be used when declaring methods.
+> is intended to be used as a method invoke parameter, and should not be used when declaring methods.
+
+
+
+## Examples
+ The following example demonstrates use of a to specify a field direction modifier for an expression to pass as a method parameter.
-
-
-## Examples
- The following example demonstrates use of a to specify a field direction modifier for an expression to pass as a method parameter.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeMultiExample/CPP/codemultiexample.cpp" id="Snippet4":::
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeDirectionExpression/Overview/codemultiexample.cs" id="Snippet4":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeMultiExample/VB/codemultiexample.vb" id="Snippet4":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeMultiExample/VB/codemultiexample.vb" id="Snippet4":::
+
]]>
diff --git a/xml/System.CodeDom/CodeEntryPointMethod.xml b/xml/System.CodeDom/CodeEntryPointMethod.xml
index 49437ae0d79..89c981e54cb 100644
--- a/xml/System.CodeDom/CodeEntryPointMethod.xml
+++ b/xml/System.CodeDom/CodeEntryPointMethod.xml
@@ -48,20 +48,19 @@
Represents the entry point method of an executable.
- is a that represents the entry point method of an executable.
+
+
+
+## Examples
+ This example demonstrates using a to indicate the method to start program execution at.
-## Remarks
- A is a that represents the entry point method of an executable.
-
-
-
-## Examples
- This example demonstrates using a to indicate the method to start program execution at.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeEntryPointMethod/CPP/codeentrypointmethodexample.cpp" id="Snippet2":::
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeEntryPointMethod/Overview/codeentrypointmethodexample.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeEntryPointMethod/VB/codeentrypointmethodexample.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeEntryPointMethod/VB/codeentrypointmethodexample.vb" id="Snippet2":::
+
]]>
diff --git a/xml/System.CodeDom/CodeEventReferenceExpression.xml b/xml/System.CodeDom/CodeEventReferenceExpression.xml
index b49d7381024..e88df944bc4 100644
--- a/xml/System.CodeDom/CodeEventReferenceExpression.xml
+++ b/xml/System.CodeDom/CodeEventReferenceExpression.xml
@@ -48,22 +48,21 @@
Represents a reference to an event.
- can be used to represent a reference to an event.
+
+ The property specifies the object that contains the event. The property specifies the name of the event.
+
+
+
+## Examples
+ The following example demonstrates use of to reference an event named TestEvent.
-## Remarks
- can be used to represent a reference to an event.
-
- The property specifies the object that contains the event. The property specifies the name of the event.
-
-
-
-## Examples
- The following example demonstrates use of to reference an event named TestEvent.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeMultiExample/CPP/codemultiexample.cpp" id="Snippet2":::
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeDirectionExpression/Overview/codemultiexample.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeMultiExample/VB/codemultiexample.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeMultiExample/VB/codemultiexample.vb" id="Snippet2":::
+
]]>
diff --git a/xml/System.CodeDom/CodeExpressionCollection.xml b/xml/System.CodeDom/CodeExpressionCollection.xml
index 388d695a570..389ec96eee0 100644
--- a/xml/System.CodeDom/CodeExpressionCollection.xml
+++ b/xml/System.CodeDom/CodeExpressionCollection.xml
@@ -48,22 +48,21 @@
Represents a collection of objects.
- class provides a simple collection object that can be used to store a set of objects.
+
+
+
+## Examples
+ The following example demonstrates the use of the class methods. The example creates a new instance of the class and uses the methods to add statements to the collection, return their index, and add or remove attributes at a specific index point.
-## Remarks
- Provides a simple collection object that can represent a set of Code Document Object Model (CodeDOM) expression objects.
-
- The class provides a simple collection object that can be used to store a set of objects.
-
-
-
-## Examples
- The following example demonstrates the use of the class methods. The example creates a new instance of the class and uses the methods to add statements to the collection, return their index, and add or remove attributes at a specific index point.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeExpressionCollectionExample/CPP/class1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeExpressionCollection/Overview/class1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeExpressionCollectionExample/VB/class1.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeExpressionCollectionExample/VB/class1.vb" id="Snippet1":::
+
]]>
@@ -221,15 +220,14 @@
Adds the specified object to the collection.
The index at which the new element was inserted.
- object to a instance.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeExpressionCollectionExample/CPP/class1.cpp" id="Snippet3":::
+ object to a instance.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeExpressionCollection/Overview/class1.cs" id="Snippet3":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeExpressionCollectionExample/VB/class1.vb" id="Snippet3":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeExpressionCollectionExample/VB/class1.vb" id="Snippet3":::
+
]]>
@@ -279,15 +277,14 @@
An array of type that contains the objects to add to the collection.
Copies the elements of the specified array to the end of the collection.
- method overload to add the members of a array to a .
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeExpressionCollectionExample/CPP/class1.cpp" id="Snippet4":::
+ method overload to add the members of a array to a .
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeExpressionCollection/Overview/class1.cs" id="Snippet4":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeExpressionCollectionExample/VB/class1.vb" id="Snippet4":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeExpressionCollectionExample/VB/class1.vb" id="Snippet4":::
+
]]>
@@ -330,15 +327,14 @@
A that contains the objects to add to the collection.
Copies the contents of another object to the end of the collection.
- method overload to add the members of one object to another .
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeExpressionCollectionExample/CPP/class1.cpp" id="Snippet4":::
+ method overload to add the members of one object to another .
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeExpressionCollection/Overview/class1.cs" id="Snippet4":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeExpressionCollectionExample/VB/class1.vb" id="Snippet4":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeExpressionCollectionExample/VB/class1.vb" id="Snippet4":::
+
]]>
@@ -383,15 +379,14 @@
if the collection contains the specified object; otherwise, .
- method to search for the presence of a specific object and gets the index value at which it was found.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeExpressionCollectionExample/CPP/class1.cpp" id="Snippet5":::
+ method to search for the presence of a specific object and gets the index value at which it was found.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeExpressionCollection/Overview/class1.cs" id="Snippet5":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeExpressionCollectionExample/VB/class1.vb" id="Snippet5":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeExpressionCollectionExample/VB/class1.vb" id="Snippet5":::
+
]]>
@@ -434,21 +429,20 @@
The index of the array at which to begin inserting.
Copies the collection objects to a one-dimensional instance beginning at the specified index.
- to a array beginning at the index value 0.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeExpressionCollectionExample/CPP/class1.cpp" id="Snippet6":::
+ to a array beginning at the index value 0.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeExpressionCollection/Overview/class1.cs" id="Snippet6":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeExpressionCollectionExample/VB/class1.vb" id="Snippet6":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeExpressionCollectionExample/VB/class1.vb" id="Snippet6":::
+
]]>
- The destination array is multidimensional.
-
- -or-
-
+ The destination array is multidimensional.
+
+ -or-
+
The number of elements in the is greater than the available space between the index of the target array specified by the parameter and the end of the target array.
The parameter is .
The parameter is less than the target array's minimum index.
@@ -491,15 +485,14 @@
Gets the index of the specified object in the collection, if it exists in the collection.
The index of the specified object, if found, in the collection; otherwise, -1.
- object and uses the method to get the index value at which it was found.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeExpressionCollectionExample/CPP/class1.cpp" id="Snippet5":::
+ object and uses the method to get the index value at which it was found.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeExpressionCollection/Overview/class1.cs" id="Snippet5":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeExpressionCollectionExample/VB/class1.vb" id="Snippet5":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeExpressionCollectionExample/VB/class1.vb" id="Snippet5":::
+
]]>
@@ -542,15 +535,14 @@
The object to insert.
Inserts the specified object into the collection at the specified index.
- method to add a object to a .
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeExpressionCollectionExample/CPP/class1.cpp" id="Snippet8":::
+ method to add a object to a .
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeExpressionCollection/Overview/class1.cs" id="Snippet8":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeExpressionCollectionExample/VB/class1.vb" id="Snippet8":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeExpressionCollectionExample/VB/class1.vb" id="Snippet8":::
+
]]>
@@ -592,11 +584,11 @@
Gets or sets the object at the specified index in the collection.
A object at each valid index.
-
The parameter is outside the valid range of indexes for the collection.
@@ -637,15 +629,14 @@
The object to remove from the collection.
Removes the specified object from the collection.
- method to delete a object from a .
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeExpressionCollectionExample/CPP/class1.cpp" id="Snippet9":::
+ method to delete a object from a .
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeExpressionCollection/Overview/class1.cs" id="Snippet9":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeExpressionCollectionExample/VB/class1.vb" id="Snippet9":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeExpressionCollectionExample/VB/class1.vb" id="Snippet9":::
+
]]>
The specified object is not found in the collection.
diff --git a/xml/System.CodeDom/CodeExpressionStatement.xml b/xml/System.CodeDom/CodeExpressionStatement.xml
index 4df4eb77f33..a5a8abc0ee2 100644
--- a/xml/System.CodeDom/CodeExpressionStatement.xml
+++ b/xml/System.CodeDom/CodeExpressionStatement.xml
@@ -48,20 +48,19 @@
Represents a statement that consists of a single expression.
- contains a object, and it can be added to a object, allowing some expressions to stand alone. For example, a contained by a can represent a method call without a return value.
-
-
-
-## Examples
- The following example demonstrates how to create an instance of the class by using a object.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeDomSampleBatch/CPP/class1.cpp" id="Snippet1":::
+ contains a object, and it can be added to a object, allowing some expressions to stand alone. For example, a contained by a can represent a method call without a return value.
+
+
+
+## Examples
+ The following example demonstrates how to create an instance of the class by using a object.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeExpressionStatement/Overview/class1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDomSampleBatch/VB/class1.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDomSampleBatch/VB/class1.vb" id="Snippet1":::
+
]]>
@@ -149,15 +148,14 @@
A for the statement.
Initializes a new instance of the class by using the specified expression.
- object and uses it as a parameter to initialize an instance of the class.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeDomSampleBatch/CPP/class1.cpp" id="Snippet1":::
+ object and uses it as a parameter to initialize an instance of the class.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeExpressionStatement/Overview/class1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDomSampleBatch/VB/class1.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDomSampleBatch/VB/class1.vb" id="Snippet1":::
+
]]>
diff --git a/xml/System.CodeDom/CodeFieldReferenceExpression.xml b/xml/System.CodeDom/CodeFieldReferenceExpression.xml
index ef708278ae2..05acd132819 100644
--- a/xml/System.CodeDom/CodeFieldReferenceExpression.xml
+++ b/xml/System.CodeDom/CodeFieldReferenceExpression.xml
@@ -48,22 +48,21 @@
Represents a reference to a field.
- can be used to represent a reference to a field.
-
- The property specifies the object that contains the field. The property specifies the name of the field to reference.
-
-
-
-## Examples
- The following example demonstrates use of a to reference a field.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeReferenceExample/CPP/codereferenceexample.cpp" id="Snippet2":::
+ can be used to represent a reference to a field.
+
+ The property specifies the object that contains the field. The property specifies the name of the field to reference.
+
+
+
+## Examples
+ The following example demonstrates use of a to reference a field.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeFieldReferenceExpression/Overview/codereferenceexample.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeReferenceExample/VB/codereferenceexample.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeReferenceExample/VB/codereferenceexample.vb" id="Snippet2":::
+
]]>
diff --git a/xml/System.CodeDom/CodeGotoStatement.xml b/xml/System.CodeDom/CodeGotoStatement.xml
index 5cb11e66e1a..81a20e3088b 100644
--- a/xml/System.CodeDom/CodeGotoStatement.xml
+++ b/xml/System.CodeDom/CodeGotoStatement.xml
@@ -63,7 +63,6 @@
## Examples
The following example code demonstrates use of a and a to redirect program flow.
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeGotoStatementExample/CPP/codegotostatementexample.cpp" id="Snippet2":::
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeGotoStatement/Overview/codegotostatementexample.cs" id="Snippet2":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeGotoStatementExample/VB/codegotostatementexample.vb" id="Snippet2":::
diff --git a/xml/System.CodeDom/CodeIndexerExpression.xml b/xml/System.CodeDom/CodeIndexerExpression.xml
index f7e457f2600..9a5fbbab255 100644
--- a/xml/System.CodeDom/CodeIndexerExpression.xml
+++ b/xml/System.CodeDom/CodeIndexerExpression.xml
@@ -48,20 +48,19 @@
Represents a reference to an indexer property of an object.
- can be used to represent a reference to a code indexer, or non-array indexer. Use to represent a reference to array indexers.
-
-
-
-## Examples
- The following example demonstrates use of a to reference a type indexer for the current object.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeMultiExample/CPP/codemultiexample.cpp" id="Snippet3":::
+ can be used to represent a reference to a code indexer, or non-array indexer. Use to represent a reference to array indexers.
+
+
+
+## Examples
+ The following example demonstrates use of a to reference a type indexer for the current object.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeDirectionExpression/Overview/codemultiexample.cs" id="Snippet3":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeMultiExample/VB/codemultiexample.vb" id="Snippet3":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeMultiExample/VB/codemultiexample.vb" id="Snippet3":::
+
]]>
@@ -187,11 +186,11 @@
Gets the collection of indexes of the indexer expression.
A that indicates the index or indexes of the indexer expression.
- can contain a that specifies a single index within the target indexer, or multiple objects that together specify a specific intersection of indexes across the dimensions of the indexer.
-
+ can contain a that specifies a single index within the target indexer, or multiple objects that together specify a specific intersection of indexes across the dimensions of the indexer.
+
]]>
@@ -238,11 +237,11 @@
Gets or sets the target object that can be indexed.
A that indicates the indexer object.
-
diff --git a/xml/System.CodeDom/CodeIterationStatement.xml b/xml/System.CodeDom/CodeIterationStatement.xml
index c298f81fba9..02e1853e284 100644
--- a/xml/System.CodeDom/CodeIterationStatement.xml
+++ b/xml/System.CodeDom/CodeIterationStatement.xml
@@ -48,22 +48,21 @@
Represents a statement, or a loop through a block of statements, using a test expression as a condition for continuing to loop.
- can represent a `for` loop or `while` loop.
-
- The property specifies the statement to execute before the first loop iteration. The property specifies the loop continuation expression, which must evaluate to `true` at the end of each loop iteration for another iteration to begin. The property specifies the statement to execute at the end of each loop iteration. The property specifies the collection of statements to execute within the loop.
-
-
-
-## Examples
- This example demonstrates using a to represent a `for` loop.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeIterationStatementExample/CPP/codeiterationstatementexample.cpp" id="Snippet2":::
+ can represent a `for` loop or `while` loop.
+
+ The property specifies the statement to execute before the first loop iteration. The property specifies the loop continuation expression, which must evaluate to `true` at the end of each loop iteration for another iteration to begin. The property specifies the statement to execute at the end of each loop iteration. The property specifies the collection of statements to execute within the loop.
+
+
+
+## Examples
+ This example demonstrates using a to represent a `for` loop.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeIterationStatement/Overview/codeiterationstatementexample.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeIterationStatementExample/VB/codeiterationstatementexample.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeIterationStatementExample/VB/codeiterationstatementexample.vb" id="Snippet2":::
+
]]>
@@ -198,11 +197,11 @@
Gets or sets the statement that is called after each loop cycle.
A that indicates the per cycle increment statement.
-
@@ -250,11 +249,11 @@
Gets or sets the loop initialization statement.
A that indicates the loop initialization statement.
- that contains a that contains an empty string.
-
+ that contains a that contains an empty string.
+
]]>
@@ -342,11 +341,11 @@
Gets or sets the expression to test as the condition that continues the loop.
A that indicates the expression to test.
-
diff --git a/xml/System.CodeDom/CodeLabeledStatement.xml b/xml/System.CodeDom/CodeLabeledStatement.xml
index f87ae21057e..21a6c5c7406 100644
--- a/xml/System.CodeDom/CodeLabeledStatement.xml
+++ b/xml/System.CodeDom/CodeLabeledStatement.xml
@@ -48,25 +48,24 @@
Represents a labeled statement or a stand-alone label.
- represents a label and optionally, an associated statement. A label can be used to indicate the target of a .
-
- The property is optional. To create only a label, leave the property uninitialized.
-
+ represents a label and optionally, an associated statement. A label can be used to indicate the target of a .
+
+ The property is optional. To create only a label, leave the property uninitialized.
+
> [!NOTE]
-> Not all languages support `goto` statements and labels, so you should test whether a code generator supports `goto` statements and labels by calling the method with the flag.
-
-
-
-## Examples
- The following example code demonstrates use of a and a to redirect program flow.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeGotoStatementExample/CPP/codegotostatementexample.cpp" id="Snippet2":::
+> Not all languages support `goto` statements and labels, so you should test whether a code generator supports `goto` statements and labels by calling the method with the flag.
+
+
+
+## Examples
+ The following example code demonstrates use of a and a to redirect program flow.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeGotoStatement/Overview/codegotostatementexample.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeGotoStatementExample/VB/codegotostatementexample.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeGotoStatementExample/VB/codegotostatementexample.vb" id="Snippet2":::
+
]]>
@@ -281,11 +280,11 @@
Gets or sets the optional associated statement.
A that indicates the statement associated with the label.
- represents only a label, rather than a labeled statement.
-
+ represents only a label, rather than a labeled statement.
+
]]>
diff --git a/xml/System.CodeDom/CodeLinePragma.xml b/xml/System.CodeDom/CodeLinePragma.xml
index b526f9f8d13..38d9551a3b6 100644
--- a/xml/System.CodeDom/CodeLinePragma.xml
+++ b/xml/System.CodeDom/CodeLinePragma.xml
@@ -48,20 +48,19 @@
Represents a specific location within a specific file.
- can be used to represent a specific location within a file. This type of object is often used after compilation by debugging tools to store locations of associated code elements, such as position references associated with compiler warnings and errors.
-
-
-
-## Examples
- The following code example demonstrates the use of the class to reference a specific line of a source file.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeDomSampleBatch/CPP/class1.cpp" id="Snippet2":::
+ can be used to represent a specific location within a file. This type of object is often used after compilation by debugging tools to store locations of associated code elements, such as position references associated with compiler warnings and errors.
+
+
+
+## Examples
+ The following code example demonstrates the use of the class to reference a specific line of a source file.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeExpressionStatement/Overview/class1.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDomSampleBatch/VB/class1.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDomSampleBatch/VB/class1.vb" id="Snippet2":::
+
]]>
@@ -108,11 +107,11 @@
Initializes a new instance of the class.
- and properties.
-
+ and properties.
+
]]>
@@ -151,15 +150,14 @@
The line number to store a reference to.
Initializes a new instance of the class.
- class to reference a specific line of a source file.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeDomSampleBatch/CPP/class1.cpp" id="Snippet2":::
+ class to reference a specific line of a source file.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeExpressionStatement/Overview/class1.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDomSampleBatch/VB/class1.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDomSampleBatch/VB/class1.vb" id="Snippet2":::
+
]]>
diff --git a/xml/System.CodeDom/CodeMemberEvent.xml b/xml/System.CodeDom/CodeMemberEvent.xml
index c6f5ebab84a..72b5c00c38a 100644
--- a/xml/System.CodeDom/CodeMemberEvent.xml
+++ b/xml/System.CodeDom/CodeMemberEvent.xml
@@ -48,20 +48,19 @@
Represents a declaration for an event of a type.
- can be used to represent event members of a type. has properties to indicate the data type of the event, whether it privately implements a data type, and what interface types, if any, the member event implements.
-
-
-
-## Examples
- This example demonstrates use of a to declare an event that takes a `System.EventHandler` delegate:
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeMemberEventSample/CPP/codemembereventexample.cpp" id="Snippet3":::
+ can be used to represent event members of a type. has properties to indicate the data type of the event, whether it privately implements a data type, and what interface types, if any, the member event implements.
+
+
+
+## Examples
+ This example demonstrates use of a to declare an event that takes a `System.EventHandler` delegate:
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeMemberEvent/Overview/codemembereventexample.cs" id="Snippet3":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeMemberEventSample/VB/codemembereventexample.vb" id="Snippet3":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeMemberEventSample/VB/codemembereventexample.vb" id="Snippet3":::
+
]]>
@@ -134,11 +133,11 @@
Gets or sets the data type that the member event implements.
A that indicates the data type or types that the member event implements.
-
@@ -185,11 +184,11 @@
Gets or sets the privately implemented data type, if any.
A that indicates the data type that the event privately implements.
-
diff --git a/xml/System.CodeDom/CodeMemberField.xml b/xml/System.CodeDom/CodeMemberField.xml
index 54b34bae91f..0ffa83f588b 100644
--- a/xml/System.CodeDom/CodeMemberField.xml
+++ b/xml/System.CodeDom/CodeMemberField.xml
@@ -48,24 +48,22 @@
Represents a declaration for a field of a type.
- can be used to represent the declaration for a field of a type.
-
-
-
-## Examples
- The following example demonstrates use of a to declare a field of type `string` named `testStringField`.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeMemberFieldExample/CPP/codememberfieldexample.cpp" id="Snippet2":::
+ can be used to represent the declaration for a field of a type.
+
+
+
+## Examples
+ The following example demonstrates use of a to declare a field of type `string` named `testStringField`.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeMemberField/Overview/codememberfieldexample.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeMemberFieldExample/VB/codememberfieldexample.vb" id="Snippet2":::
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeMemberFieldPublicConstExample/CPP/class1.cpp" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeMemberFieldExample/VB/codememberfieldexample.vb" id="Snippet2":::
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeMemberField/Overview/class1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeMemberFieldPublicConstExample/VB/class1.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeMemberFieldPublicConstExample/VB/class1.vb" id="Snippet1":::
+
]]>
@@ -185,16 +183,16 @@
The name of the field.
Initializes a new instance of the class using the specified field type and field name.
- [!NOTE]
-> You must use square brackets ([]) and not the C# angle brackets (<>) to delimit generic parameters.
-
- To avoid the possibility of making a syntactic mistake, consider using the constructor that takes a type instead of a string as a parameter.
-
+> You must use square brackets ([]) and not the C# angle brackets (<>) to delimit generic parameters.
+
+ To avoid the possibility of making a syntactic mistake, consider using the constructor that takes a type instead of a string as a parameter.
+
]]>
@@ -277,14 +275,14 @@
Gets or sets the initialization expression for the field.
The initialization expression for the field.
- property.
-
+ property.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeMemberField/InitExpression/program.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeMemberFieldInit/VB/program.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeMemberFieldInit/VB/program.vb" id="Snippet1":::
+
]]>
diff --git a/xml/System.CodeDom/CodeMemberMethod.xml b/xml/System.CodeDom/CodeMemberMethod.xml
index 7c81f0fca66..25292bab9dd 100644
--- a/xml/System.CodeDom/CodeMemberMethod.xml
+++ b/xml/System.CodeDom/CodeMemberMethod.xml
@@ -48,22 +48,21 @@
Represents a declaration for a method of a type.
- can be used to represent the declaration for a method.
-
- The property specifies the data type of the method's return value. The property contains the method's parameters. The property contains the statements of the method.
-
-
-
-## Examples
- The following example demonstrates use of a to declare a method that accepts a parameter and returns a value.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeMemberMethodExample/CPP/codemembermethodexample.cpp" id="Snippet2":::
+ can be used to represent the declaration for a method.
+
+ The property specifies the data type of the method's return value. The property contains the method's parameters. The property contains the statements of the method.
+
+
+
+## Examples
+ The following example demonstrates use of a to declare a method that accepts a parameter and returns a value.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeMemberMethod/Overview/codemembermethodexample.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeMemberMethodExample/VB/codemembermethodexample.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeMemberMethodExample/VB/codemembermethodexample.vb" id="Snippet2":::
+
]]>
@@ -96,19 +95,19 @@
Initializes a new instance of the class.
- object.
-
-
-
-## Examples
- The following code example shows the use of the constructor to create a instance. This example is part of a larger example provided for the method.
-
+ object.
+
+
+
+## Examples
+ The following code example shows the use of the constructor to create a instance. This example is part of a larger example provided for the method.
+
:::code language="csharp" source="~/snippets/csharp/Microsoft.CSharp/CSharpCodeProvider/GenerateCodeFromMember/program.cs" id="Snippet3":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDom_GenerateCodeFromMember/vb/module1.vb" id="Snippet3":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDom_GenerateCodeFromMember/vb/module1.vb" id="Snippet3":::
+
]]>
@@ -145,15 +144,15 @@
Gets the data types of the interfaces implemented by this method, unless it is a private method implementation, which is indicated by the property.
A that indicates the interfaces implemented by this method.
- represents a declaration for a public method, and this method implements a method on an interface, the interface or interfaces this method implements a method of should be referenced in this collection.
-
- The method should still have the same name as the method of the interface that is implemented by this method. For some languages, like C#, this has no effect on the syntax. For others, like Visual Basic, there is a special syntax for implementing interfaces. If the method is privately implementing a single interface, the property should be used instead.
-
+ represents a declaration for a public method, and this method implements a method on an interface, the interface or interfaces this method implements a method of should be referenced in this collection.
+
+ The method should still have the same name as the method of the interface that is implemented by this method. For some languages, like C#, this has no effect on the syntax. For others, like Visual Basic, there is a special syntax for implementing interfaces. If the method is privately implementing a single interface, the property should be used instead.
+
]]>
@@ -337,13 +336,13 @@
Gets or sets the data type of the interface this method, if private, implements a method of, if any.
A that indicates the data type of the interface with the method that the private method whose declaration is represented by this implements.
- represents the declaration of a private method and the method implements a method of an interface, this property should indicate the interface type that the method is implementing a method of.
-
- The type referenced by this property must be an interface.
-
+ represents the declaration of a private method and the method implements a method of an interface, this property should indicate the interface type that the method is implementing a method of.
+
+ The type referenced by this property must be an interface.
+
]]>
@@ -494,19 +493,19 @@
Gets the type parameters for the current generic method.
A that contains the type parameters for the generic method.
- property to add two type parameters to the `printMethod`. This example is part of a larger example provided for the class.
-
+ property to add two type parameters to the `printMethod`. This example is part of a larger example provided for the class.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeDefaultValueExpression/Overview/codedomgenerics.cs" id="Snippet6":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.CodeDOM.Generics.1/VB/codedomgenerics.vb" id="Snippet6":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.CodeDOM.Generics.1/VB/codedomgenerics.vb" id="Snippet6":::
+
]]>
diff --git a/xml/System.CodeDom/CodeMemberProperty.xml b/xml/System.CodeDom/CodeMemberProperty.xml
index b55067a81fb..97c7d491914 100644
--- a/xml/System.CodeDom/CodeMemberProperty.xml
+++ b/xml/System.CodeDom/CodeMemberProperty.xml
@@ -48,22 +48,21 @@
Represents a declaration for a property of a type.
- can be used to represent the declaration for a property of a type.
-
- The property specifies the data type of the property. The property contains any get statement methods for the property. The property contains any set statement methods for the property. The property specifies any parameters for the property, such as are required for an indexer property.
-
-
-
-## Examples
- The following example code demonstrates use of a to define a `string` property with `get` and `set` accessors.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeMemberPropertyExample/CPP/codememberpropertyexample.cpp" id="Snippet3":::
+ can be used to represent the declaration for a property of a type.
+
+ The property specifies the data type of the property. The property contains any get statement methods for the property. The property contains any set statement methods for the property. The property specifies any parameters for the property, such as are required for an indexer property.
+
+
+
+## Examples
+ The following example code demonstrates use of a to define a `string` property with `get` and `set` accessors.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeMemberProperty/Overview/codememberpropertyexample.cs" id="Snippet3":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeMemberPropertyExample/VB/codememberpropertyexample.vb" id="Snippet3":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeMemberPropertyExample/VB/codememberpropertyexample.vb" id="Snippet3":::
+
]]>
@@ -136,11 +135,11 @@
Gets the collection of statements for the property.
A that contains the statements for the member property.
- should return the value for the member property. Use a to return a value of the data type of the property.
-
+ should return the value for the member property. Use a to return a value of the data type of the property.
+
]]>
@@ -180,13 +179,13 @@
if the property of the collection is non-zero, or if the value of this property has been set to ; otherwise, .
- [!NOTE]
-> Setting this property to `false` clears the collection.
-
+> Setting this property to `false` clears the collection.
+
]]>
@@ -225,14 +224,14 @@
if the property of the collection is non-zero; otherwise, .
- will return `false` if the property is read-only.
-
+ will return `false` if the property is read-only.
+
> [!NOTE]
-> Setting this property to `false` will clear the collection.
-
+> Setting this property to `false` will clear the collection.
+
]]>
@@ -270,11 +269,11 @@
Gets the data types of any interfaces that the property implements.
A that indicates the data types the property implements.
-
@@ -317,13 +316,13 @@
Gets the collection of declaration expressions for the property.
A that indicates the declaration expressions for the property.
- [!NOTE]
-> In general, properties do not have parameters. CodeDom supports an exception to this. For any property that has the special name "Item" and one or more parameters, it will declare an indexer property for the class. However, not all languages support the declaration of indexers.
-
+> In general, properties do not have parameters. CodeDom supports an exception to this. For any property that has the special name "Item" and one or more parameters, it will declare an indexer property for the class. However, not all languages support the declaration of indexers.
+
]]>
@@ -371,11 +370,11 @@
Gets or sets the data type of the interface, if any, this property, if private, implements.
A that indicates the data type of the interface, if any, the property, if private, implements.
-
@@ -418,11 +417,11 @@
Gets the collection of statements for the property.
A that contains the statements for the member property.
- represents a reference to the object passed to the set method.
-
+ represents a reference to the object passed to the set method.
+
]]>
diff --git a/xml/System.CodeDom/CodeMethodInvokeExpression.xml b/xml/System.CodeDom/CodeMethodInvokeExpression.xml
index 82d78bbe0bc..d758ea47ea4 100644
--- a/xml/System.CodeDom/CodeMethodInvokeExpression.xml
+++ b/xml/System.CodeDom/CodeMethodInvokeExpression.xml
@@ -48,22 +48,21 @@
Represents an expression that invokes a method.
- can be used to represent an expression that invokes a method.
-
- The property specifies the method to invoke. The property indicates the parameters to pass to the method. Use a to specify the field direction of a parameter.
-
-
-
-## Examples
- This example demonstrates using a to invoke a method.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeMethodInvokeExpression/CPP/codemethodinvokeexpressionexample.cpp" id="Snippet2":::
+ can be used to represent an expression that invokes a method.
+
+ The property specifies the method to invoke. The property indicates the parameters to pass to the method. Use a to specify the field direction of a parameter.
+
+
+
+## Examples
+ This example demonstrates using a to invoke a method.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeMethodInvokeExpression/Overview/codemethodinvokeexpressionexample.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeMethodInvokeExpression/VB/codemethodinvokeexpressionexample.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeMethodInvokeExpression/VB/codemethodinvokeexpressionexample.vb" id="Snippet2":::
+
]]>
@@ -275,11 +274,11 @@
Gets the parameters to invoke the method with.
A that indicates the parameters to invoke the method with.
- to specify a field direction for the parameter.
-
+ to specify a field direction for the parameter.
+
]]>
diff --git a/xml/System.CodeDom/CodeMethodReferenceExpression.xml b/xml/System.CodeDom/CodeMethodReferenceExpression.xml
index 58b520524ab..c06ba7c32ce 100644
--- a/xml/System.CodeDom/CodeMethodReferenceExpression.xml
+++ b/xml/System.CodeDom/CodeMethodReferenceExpression.xml
@@ -48,24 +48,23 @@
Represents a reference to a method.
- can be used to represent an expression of the form Object.Method.
-
- The property indicates the object that contains the method. The property indicates the name of the method.
-
- A is used with a to indicate the method to invoke, and with a to indicate the method to handle the event.
-
-
-
-## Examples
- The following code example uses a to refer to a method:
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeMethodReferenceExample/CPP/codemethodreferenceexample.cpp" id="Snippet3":::
+ can be used to represent an expression of the form Object.Method.
+
+ The property indicates the object that contains the method. The property indicates the name of the method.
+
+ A is used with a to indicate the method to invoke, and with a to indicate the method to handle the event.
+
+
+
+## Examples
+ The following code example uses a to refer to a method:
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeMethodReferenceExpression/Overview/codemethodreferenceexample.cs" id="Snippet3":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeMethodReferenceExample/VB/codemethodreferenceexample.vb" id="Snippet3":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeMethodReferenceExample/VB/codemethodreferenceexample.vb" id="Snippet3":::
+
]]>
@@ -194,20 +193,19 @@
An array of values that specify the for this .
Initializes a new instance of the class using the specified target object, method name, and generic type arguments.
-
@@ -334,11 +332,11 @@
Gets the type arguments for the current generic method reference expression.
A containing the type arguments for the current code .
- property represents a collection of type references to be substituted for the type parameter references of the current generic method.
-
+ property represents a collection of type references to be substituted for the type parameter references of the current generic method.
+
]]>
diff --git a/xml/System.CodeDom/CodeMethodReturnStatement.xml b/xml/System.CodeDom/CodeMethodReturnStatement.xml
index f3ae8a35392..80cdbf3bd7f 100644
--- a/xml/System.CodeDom/CodeMethodReturnStatement.xml
+++ b/xml/System.CodeDom/CodeMethodReturnStatement.xml
@@ -48,20 +48,19 @@
Represents a return value statement.
- can be used to represent a return value statement. The property specifies the value to return.
-
-
-
-## Examples
- The following example demonstrates use of a to return a value from a method.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeMemberMethodExample/CPP/codemembermethodexample.cpp" id="Snippet2":::
+ can be used to represent a return value statement. The property specifies the value to return.
+
+
+
+## Examples
+ The following example demonstrates use of a to return a value from a method.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeMemberMethod/Overview/codemembermethodexample.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeMemberMethodExample/VB/codemembermethodexample.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeMemberMethodExample/VB/codemembermethodexample.vb" id="Snippet2":::
+
]]>
@@ -188,11 +187,11 @@
Gets or sets the return value.
A that indicates the value to return for the return statement, or if the statement is part of a subroutine.
-
diff --git a/xml/System.CodeDom/CodeNamespace.xml b/xml/System.CodeDom/CodeNamespace.xml
index f916305f173..fc0c4401f56 100644
--- a/xml/System.CodeDom/CodeNamespace.xml
+++ b/xml/System.CodeDom/CodeNamespace.xml
@@ -48,27 +48,26 @@
Represents a namespace declaration.
- can be used to represent a namespace declaration.
-
- The property specifies the name of the namespace. The property contains the namespace import directives for the namespace. The property contains the type declarations for the namespace. The property contains the comments that apply at the namespace level.
-
- In some languages, a namespace can function as a container for type declarations; all types in the same namespace are accessible without using fully-qualified type references, if there is no conflict between type names.
-
+ can be used to represent a namespace declaration.
+
+ The property specifies the name of the namespace. The property contains the namespace import directives for the namespace. The property contains the type declarations for the namespace. The property contains the comments that apply at the namespace level.
+
+ In some languages, a namespace can function as a container for type declarations; all types in the same namespace are accessible without using fully-qualified type references, if there is no conflict between type names.
+
> [!NOTE]
-> Use fully qualified type references to avoid potential ambiguity.
-
-
-
-## Examples
- The following example code demonstrates use of a to declare a namespace.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeNamespaceExample/CPP/codenamespaceexample.cpp" id="Snippet2":::
+> Use fully qualified type references to avoid potential ambiguity.
+
+
+
+## Examples
+ The following example code demonstrates use of a to declare a namespace.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeNamespace/Overview/codenamespaceexample.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeNamespaceExample/VB/codenamespaceexample.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeNamespaceExample/VB/codenamespaceexample.vb" id="Snippet2":::
+
]]>
diff --git a/xml/System.CodeDom/CodeNamespaceCollection.xml b/xml/System.CodeDom/CodeNamespaceCollection.xml
index 4c6ce2e6727..cc93818c5cc 100644
--- a/xml/System.CodeDom/CodeNamespaceCollection.xml
+++ b/xml/System.CodeDom/CodeNamespaceCollection.xml
@@ -48,20 +48,19 @@
Represents a collection of objects.
- class provides a simple collection object that can be used to store a set of objects.
-
-
-
-## Examples
- The following example demonstrates how to use the class. The example creates a new instance of the class and uses several methods to add statements to the collection, return their index, and add or remove attributes at a specific index point.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeNamespaceCollectionExample/CPP/class1.cpp" id="Snippet1":::
+ class provides a simple collection object that can be used to store a set of objects.
+
+
+
+## Examples
+ The following example demonstrates how to use the class. The example creates a new instance of the class and uses several methods to add statements to the collection, return their index, and add or remove attributes at a specific index point.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeNamespaceCollection/Overview/class1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeNamespaceCollectionExample/VB/class1.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeNamespaceCollectionExample/VB/class1.vb" id="Snippet1":::
+
]]>
@@ -110,15 +109,14 @@
Initializes a new instance of the class.
- class.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeNamespaceCollectionExample/CPP/class1.cpp" id="Snippet2":::
+ class.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeNamespaceCollection/Overview/class1.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeNamespaceCollectionExample/VB/class1.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeNamespaceCollectionExample/VB/class1.vb" id="Snippet2":::
+
]]>
@@ -230,15 +228,14 @@
Adds the specified object to the collection.
The index at which the new element was inserted.
- method to add a object to a instance.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeNamespaceCollectionExample/CPP/class1.cpp" id="Snippet3":::
+ method to add a object to a instance.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeNamespaceCollection/Overview/class1.cs" id="Snippet3":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeNamespaceCollectionExample/VB/class1.vb" id="Snippet3":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeNamespaceCollectionExample/VB/class1.vb" id="Snippet3":::
+
]]>
@@ -288,15 +285,14 @@
An array of type that contains the objects to add to the collection.
Copies the elements of the specified array to the end of the collection.
- method overload to add members of a array to the .
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeNamespaceCollectionExample/CPP/class1.cpp" id="Snippet4":::
+ method overload to add members of a array to the .
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeNamespaceCollection/Overview/class1.cs" id="Snippet4":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeNamespaceCollectionExample/VB/class1.vb" id="Snippet4":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeNamespaceCollectionExample/VB/class1.vb" id="Snippet4":::
+
]]>
@@ -339,15 +335,14 @@
A that contains the objects to add to the collection.
Adds the contents of the specified object to the end of the collection.
- method overload to add objects from one to another .
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeNamespaceCollectionExample/CPP/class1.cpp" id="Snippet4":::
+ method overload to add objects from one to another .
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeNamespaceCollection/Overview/class1.cs" id="Snippet4":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeNamespaceCollectionExample/VB/class1.vb" id="Snippet4":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeNamespaceCollectionExample/VB/class1.vb" id="Snippet4":::
+
]]>
@@ -392,15 +387,14 @@
if the is contained in the collection; otherwise, .
- method to find a object in a .
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeNamespaceCollectionExample/CPP/class1.cpp" id="Snippet5":::
+ method to find a object in a .
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeNamespaceCollection/Overview/class1.cs" id="Snippet5":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeNamespaceCollectionExample/VB/class1.vb" id="Snippet5":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeNamespaceCollectionExample/VB/class1.vb" id="Snippet5":::
+
]]>
@@ -443,21 +437,20 @@
The index of the array at which to begin inserting.
Copies the collection objects to a one-dimensional instance, starting at the specified index.
- method to copy the contents of a object to an array, starting at the specified index value.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeNamespaceCollectionExample/CPP/class1.cpp" id="Snippet6":::
+ method to copy the contents of a object to an array, starting at the specified index value.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeNamespaceCollection/Overview/class1.cs" id="Snippet6":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeNamespaceCollectionExample/VB/class1.vb" id="Snippet6":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeNamespaceCollectionExample/VB/class1.vb" id="Snippet6":::
+
]]>
- The destination array is multidimensional.
-
- -or-
-
+ The destination array is multidimensional.
+
+ -or-
+
The number of elements in the is greater than the available space between the index of the target array specified by the parameter and the end of the target array.
The parameter is .
The parameter is less than the target array's minimum index.
@@ -500,15 +493,14 @@
Gets the index of the specified object in the , if it exists in the collection.
The index of the specified , if it is found, in the collection; otherwise, -1.
- and uses the method to retrieve the index value at which it was found.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeNamespaceCollectionExample/CPP/class1.cpp" id="Snippet5":::
+ and uses the method to retrieve the index value at which it was found.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeNamespaceCollection/Overview/class1.cs" id="Snippet5":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeNamespaceCollectionExample/VB/class1.vb" id="Snippet5":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeNamespaceCollectionExample/VB/class1.vb" id="Snippet5":::
+
]]>
@@ -551,15 +543,14 @@
The to insert.
Inserts the specified object into the collection at the specified index.
- method to insert a object into a .
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeNamespaceCollectionExample/CPP/class1.cpp" id="Snippet8":::
+ method to insert a object into a .
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeNamespaceCollection/Overview/class1.cs" id="Snippet8":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeNamespaceCollectionExample/VB/class1.vb" id="Snippet8":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeNamespaceCollectionExample/VB/class1.vb" id="Snippet8":::
+
]]>
@@ -601,11 +592,11 @@
Gets or sets the object at the specified index in the collection.
A at each valid index.
-
The parameter is outside the valid range of indexes for the collection.
@@ -647,15 +638,14 @@
The to remove from the collection.
Removes the specified object from the collection.
- method to delete a object from a .
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeNamespaceCollectionExample/CPP/class1.cpp" id="Snippet9":::
+ method to delete a object from a .
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeNamespaceCollection/Overview/class1.cs" id="Snippet9":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeNamespaceCollectionExample/VB/class1.vb" id="Snippet9":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeNamespaceCollectionExample/VB/class1.vb" id="Snippet9":::
+
]]>
The specified object is not found in the collection.
diff --git a/xml/System.CodeDom/CodeNamespaceImport.xml b/xml/System.CodeDom/CodeNamespaceImport.xml
index ba45be25a2a..7f22e9fe7db 100644
--- a/xml/System.CodeDom/CodeNamespaceImport.xml
+++ b/xml/System.CodeDom/CodeNamespaceImport.xml
@@ -48,25 +48,24 @@
Represents a namespace import directive that indicates a namespace to use.
- can be used to represent a namespace import directive.
-
- In most languages, a namespace import directive causes visibility of the types within the imported namespaces to code that references types in the imported namespaces.
-
+ can be used to represent a namespace import directive.
+
+ In most languages, a namespace import directive causes visibility of the types within the imported namespaces to code that references types in the imported namespaces.
+
> [!NOTE]
-> Use fully qualified type references to avoid potential ambiguity.
-
-
-
-## Examples
- The following example code demonstrates use of a to import the namespace:
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeNamespaceImportExample/CPP/codenamespaceimportexample.cpp" id="Snippet2":::
+> Use fully qualified type references to avoid potential ambiguity.
+
+
+
+## Examples
+ The following example code demonstrates use of a to import the namespace:
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeNamespaceImport/Overview/codenamespaceimportexample.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeNamespaceImportExample/VB/codenamespaceimportexample.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeNamespaceImportExample/VB/codenamespaceimportexample.vb" id="Snippet2":::
+
]]>
diff --git a/xml/System.CodeDom/CodeNamespaceImportCollection.xml b/xml/System.CodeDom/CodeNamespaceImportCollection.xml
index 71b3a353917..b08f819c70f 100644
--- a/xml/System.CodeDom/CodeNamespaceImportCollection.xml
+++ b/xml/System.CodeDom/CodeNamespaceImportCollection.xml
@@ -59,20 +59,19 @@
Represents a collection of objects.
- class provides a simple collection object that can be used to store a set of objects.
-
-
-
-## Examples
- The following example demonstrates some of the members of the class. The example initializes a new instance of the class, adds objects to it, and gets the total number of objects in the collection.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeDomSampleBatch/CPP/class1.cpp" id="Snippet3":::
+ class provides a simple collection object that can be used to store a set of objects.
+
+
+
+## Examples
+ The following example demonstrates some of the members of the class. The example initializes a new instance of the class, adds objects to it, and gets the total number of objects in the collection.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeExpressionStatement/Overview/class1.cs" id="Snippet3":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDomSampleBatch/VB/class1.vb" id="Snippet3":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDomSampleBatch/VB/class1.vb" id="Snippet3":::
+
]]>
@@ -143,15 +142,14 @@
The object to add to the collection.
Adds a object to the collection.
- object to a instance.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeDomSampleBatch/CPP/class1.cpp" id="Snippet5":::
+ object to a instance.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeExpressionStatement/Overview/class1.cs" id="Snippet5":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDomSampleBatch/VB/class1.vb" id="Snippet5":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDomSampleBatch/VB/class1.vb" id="Snippet5":::
+
]]>
@@ -192,15 +190,14 @@
An array of type that contains the objects to add to the collection.
Adds a set of objects to the collection.
- method to add the members of a array to a .
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeDomSampleBatch/CPP/class1.cpp" id="Snippet6":::
+ method to add the members of a array to a .
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeExpressionStatement/Overview/class1.cs" id="Snippet6":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDomSampleBatch/VB/class1.vb" id="Snippet6":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDomSampleBatch/VB/class1.vb" id="Snippet6":::
+
]]>
@@ -277,15 +274,14 @@
Gets the number of namespaces in the collection.
The number of namespaces in the collection.
- object.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeDomSampleBatch/CPP/class1.cpp" id="Snippet7":::
+ object.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeExpressionStatement/Overview/class1.cs" id="Snippet7":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDomSampleBatch/VB/class1.vb" id="Snippet7":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDomSampleBatch/VB/class1.vb" id="Snippet7":::
+
]]>
@@ -405,11 +401,11 @@
The zero-based index in at which copying begins.
Copies the elements of the to an , starting at a particular index.
- instance is cast to an interface.
-
+ instance is cast to an interface.
+
]]>
@@ -636,11 +632,11 @@ This member is an explicit interface member implementation. It can be used only
Adds an object to the .
The position at which the new element was inserted.
- instance is cast to an interface.
-
+ instance is cast to an interface.
+
]]>
@@ -686,11 +682,11 @@ This member is an explicit interface member implementation. It can be used only
Removes all items from the .
- instance is cast to an interface.
-
+ instance is cast to an interface.
+
]]>
@@ -735,11 +731,11 @@ This member is an explicit interface member implementation. It can be used only
if the value is in the list; otherwise, .
- instance is cast to an interface.
-
+ instance is cast to an interface.
+
]]>
@@ -783,11 +779,11 @@ This member is an explicit interface member implementation. It can be used only
Determines the index of a specific item in the .
The index of if it is found in the list; otherwise, -1.
- instance is cast to an interface.
-
+ instance is cast to an interface.
+
]]>
@@ -832,11 +828,11 @@ This member is an explicit interface member implementation. It can be used only
The to insert into the .
Inserts an item in the at the specified position.
- instance is cast to an interface.
-
+ instance is cast to an interface.
+
]]>
@@ -1015,11 +1011,11 @@ This member is an explicit interface member implementation. It can be used only
The to remove from the .
Removes the first occurrence of a specific object from the .
- instance is cast to an interface.
-
+ instance is cast to an interface.
+
]]>
@@ -1062,11 +1058,11 @@ This member is an explicit interface member implementation. It can be used only
The zero-based index of the element to remove.
Removes the element at the specified index of the .
- instance is cast to an interface.
-
+ instance is cast to an interface.
+
]]>
diff --git a/xml/System.CodeDom/CodeObjectCreateExpression.xml b/xml/System.CodeDom/CodeObjectCreateExpression.xml
index 011998f7498..563fc838343 100644
--- a/xml/System.CodeDom/CodeObjectCreateExpression.xml
+++ b/xml/System.CodeDom/CodeObjectCreateExpression.xml
@@ -48,22 +48,21 @@
Represents an expression that creates a new instance of a type.
- can be used to represent an expression that creates an instance of a type.
-
- The property specifies the data type to create a new instance of. The property specifies the parameters to pass to the constructor of the type to create a new instance of.
-
-
-
-## Examples
- The following example demonstrates use of to create a new instance of the System.DateTime class using the parameterless constructor.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeMultiExample/CPP/codemultiexample.cpp" id="Snippet5":::
+ can be used to represent an expression that creates an instance of a type.
+
+ The property specifies the data type to create a new instance of. The property specifies the parameters to pass to the constructor of the type to create a new instance of.
+
+
+
+## Examples
+ The following example demonstrates use of to create a new instance of the System.DateTime class using the parameterless constructor.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeDirectionExpression/Overview/codemultiexample.cs" id="Snippet5":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeMultiExample/VB/codemultiexample.vb" id="Snippet5":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeMultiExample/VB/codemultiexample.vb" id="Snippet5":::
+
]]>
diff --git a/xml/System.CodeDom/CodeParameterDeclarationExpression.xml b/xml/System.CodeDom/CodeParameterDeclarationExpression.xml
index 2df5d3aa196..68e0a41b3bf 100644
--- a/xml/System.CodeDom/CodeParameterDeclarationExpression.xml
+++ b/xml/System.CodeDom/CodeParameterDeclarationExpression.xml
@@ -48,22 +48,21 @@
Represents a parameter declaration for a method, property, or constructor.
- can be used to represent code that declares a parameter for a method, property, or constructor.
-
- The property specifies the name of the parameter. The property specifies the data type of the parameter. The property specifies the direction modifier of the parameter. The property specifies the attributes associated with the parameter.
-
-
-
-## Examples
- The following example demonstrates use of to declare parameters of a method using different field reference type specifiers.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeParameterDeclarationExample/CPP/codeparameterdeclarationexample.cpp" id="Snippet3":::
+ can be used to represent code that declares a parameter for a method, property, or constructor.
+
+ The property specifies the name of the parameter. The property specifies the data type of the parameter. The property specifies the direction modifier of the parameter. The property specifies the attributes associated with the parameter.
+
+
+
+## Examples
+ The following example demonstrates use of to declare parameters of a method using different field reference type specifiers.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeParameterDeclarationExpression/Overview/codeparameterdeclarationexample.cs" id="Snippet3":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeParameterDeclarationExample/VB/codeparameterdeclarationexample.vb" id="Snippet3":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeParameterDeclarationExample/VB/codeparameterdeclarationexample.vb" id="Snippet3":::
+
]]>
@@ -184,16 +183,16 @@
The name of the parameter to declare.
Initializes a new instance of the class using the specified parameter type and name.
- [!NOTE]
-> You must use square brackets ([]) and not the C# angle brackets (<>) to delimit generic parameters.
-
- To avoid the possibility of making a syntactic mistake, consider using the constructor that takes a type instead of a string as a parameter.
-
+> You must use square brackets ([]) and not the C# angle brackets (<>) to delimit generic parameters.
+
+ To avoid the possibility of making a syntactic mistake, consider using the constructor that takes a type instead of a string as a parameter.
+
]]>
diff --git a/xml/System.CodeDom/CodeParameterDeclarationExpressionCollection.xml b/xml/System.CodeDom/CodeParameterDeclarationExpressionCollection.xml
index f6913f814a3..148b0bd9c40 100644
--- a/xml/System.CodeDom/CodeParameterDeclarationExpressionCollection.xml
+++ b/xml/System.CodeDom/CodeParameterDeclarationExpressionCollection.xml
@@ -48,20 +48,19 @@
Represents a collection of objects.
- class provides a simple collection object that can be used to store a set of objects.
-
-
-
-## Examples
- The following example demonstrates how to use the class methods. The example creates a new instance of the class and uses the methods to add statements to the collection, return their index, and add or remove attributes at a specific index point.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeParameterDeclarationExpressionCollectionExample/CPP/class1.cpp" id="Snippet1":::
+ class provides a simple collection object that can be used to store a set of objects.
+
+
+
+## Examples
+ The following example demonstrates how to use the class methods. The example creates a new instance of the class and uses the methods to add statements to the collection, return their index, and add or remove attributes at a specific index point.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeParameterDeclarationExpressionCollection/Overview/class1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeParameterDeclarationExpressionCollectionExample/VB/class1.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeParameterDeclarationExpressionCollectionExample/VB/class1.vb" id="Snippet1":::
+
]]>
@@ -219,15 +218,14 @@
Adds the specified to the collection.
The index at which the new element was inserted.
- object to a instance.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeParameterDeclarationExpressionCollectionExample/CPP/class1.cpp" id="Snippet3":::
+ object to a instance.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeParameterDeclarationExpressionCollection/Overview/class1.cs" id="Snippet3":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeParameterDeclarationExpressionCollectionExample/VB/class1.vb" id="Snippet3":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeParameterDeclarationExpressionCollectionExample/VB/class1.vb" id="Snippet3":::
+
]]>
@@ -277,15 +275,14 @@
An array of type containing the objects to add to the collection.
Copies the elements of the specified array to the end of the collection.
- method overload to add the members of a array to a .
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeParameterDeclarationExpressionCollectionExample/CPP/class1.cpp" id="Snippet4":::
+ method overload to add the members of a array to a .
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeParameterDeclarationExpressionCollection/Overview/class1.cs" id="Snippet4":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeParameterDeclarationExpressionCollectionExample/VB/class1.vb" id="Snippet4":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeParameterDeclarationExpressionCollectionExample/VB/class1.vb" id="Snippet4":::
+
]]>
@@ -328,15 +325,14 @@
A containing the objects to add to the collection.
Adds the contents of another to the end of the collection.
- method overload to add the members of one object to another .
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeParameterDeclarationExpressionCollectionExample/CPP/class1.cpp" id="Snippet4":::
+ method overload to add the members of one object to another .
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeParameterDeclarationExpressionCollection/Overview/class1.cs" id="Snippet4":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeParameterDeclarationExpressionCollectionExample/VB/class1.vb" id="Snippet4":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeParameterDeclarationExpressionCollectionExample/VB/class1.vb" id="Snippet4":::
+
]]>
@@ -381,15 +377,14 @@
if the collection contains the specified object; otherwise, .
- method to search for the presence of a specific object and get the index value at which it was found.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeParameterDeclarationExpressionCollectionExample/CPP/class1.cpp" id="Snippet5":::
+ method to search for the presence of a specific object and get the index value at which it was found.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeParameterDeclarationExpressionCollection/Overview/class1.cs" id="Snippet5":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeParameterDeclarationExpressionCollectionExample/VB/class1.vb" id="Snippet5":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeParameterDeclarationExpressionCollectionExample/VB/class1.vb" id="Snippet5":::
+
]]>
@@ -432,21 +427,20 @@
The index of the array at which to begin inserting.
Copies the collection objects to a one-dimensional instance beginning at the specified index.
- to an beginning at the specified index value.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeParameterDeclarationExpressionCollectionExample/CPP/class1.cpp" id="Snippet6":::
+ to an beginning at the specified index value.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeParameterDeclarationExpressionCollection/Overview/class1.cs" id="Snippet6":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeParameterDeclarationExpressionCollectionExample/VB/class1.vb" id="Snippet6":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeParameterDeclarationExpressionCollectionExample/VB/class1.vb" id="Snippet6":::
+
]]>
- The destination array is multidimensional.
-
- -or-
-
+ The destination array is multidimensional.
+
+ -or-
+
The number of elements in the is greater than the available space between the index of the target array specified by the parameter and the end of the target array.
The parameter is .
The parameter is less than the target array's minimum index.
@@ -489,15 +483,14 @@
Gets the index in the collection of the specified , if it exists in the collection.
The index in the collection of the specified object, if found; otherwise, -1.
- instance and uses the method to get the index value at which it was found.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeParameterDeclarationExpressionCollectionExample/CPP/class1.cpp" id="Snippet5":::
+ instance and uses the method to get the index value at which it was found.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeParameterDeclarationExpressionCollection/Overview/class1.cs" id="Snippet5":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeParameterDeclarationExpressionCollectionExample/VB/class1.vb" id="Snippet5":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeParameterDeclarationExpressionCollectionExample/VB/class1.vb" id="Snippet5":::
+
]]>
@@ -540,15 +533,14 @@
The to insert.
Inserts the specified into the collection at the specified index.
- method to add a object to a .
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeParameterDeclarationExpressionCollectionExample/CPP/class1.cpp" id="Snippet8":::
+ method to add a object to a .
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeParameterDeclarationExpressionCollection/Overview/class1.cs" id="Snippet8":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeParameterDeclarationExpressionCollectionExample/VB/class1.vb" id="Snippet8":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeParameterDeclarationExpressionCollectionExample/VB/class1.vb" id="Snippet8":::
+
]]>
@@ -590,11 +582,11 @@
Gets or sets the at the specified index in the collection.
A at each valid index.
-
The parameter is outside the valid range of indexes for the collection.
@@ -635,15 +627,14 @@
The to remove from the collection.
Removes the specified from the collection.
- method to delete a object from a .
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeParameterDeclarationExpressionCollectionExample/CPP/class1.cpp" id="Snippet9":::
+ method to delete a object from a .
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeParameterDeclarationExpressionCollection/Overview/class1.cs" id="Snippet9":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeParameterDeclarationExpressionCollectionExample/VB/class1.vb" id="Snippet9":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeParameterDeclarationExpressionCollectionExample/VB/class1.vb" id="Snippet9":::
+
]]>
The specified object is not found in the collection.
diff --git a/xml/System.CodeDom/CodePrimitiveExpression.xml b/xml/System.CodeDom/CodePrimitiveExpression.xml
index 15cb96138be..6ae05003846 100644
--- a/xml/System.CodeDom/CodePrimitiveExpression.xml
+++ b/xml/System.CodeDom/CodePrimitiveExpression.xml
@@ -48,24 +48,23 @@
Represents a primitive data type value.
- can be used to represent an expression that indicates a primitive data type value.
-
- The property specifies the primitive data type value to represent.
-
- Primitive data types that can be represented using include `null`; string; 16-, 32-, and 64-bit signed integers; and single-precision and double-precision floating-point numbers.
-
-
-
-## Examples
- The following example demonstrates use of to represent values of several primitive types.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodePrimitiveExpressionExample/CPP/codeprimitiveexpressionexample.cpp" id="Snippet2":::
+ can be used to represent an expression that indicates a primitive data type value.
+
+ The property specifies the primitive data type value to represent.
+
+ Primitive data types that can be represented using include `null`; string; 16-, 32-, and 64-bit signed integers; and single-precision and double-precision floating-point numbers.
+
+
+
+## Examples
+ The following example demonstrates use of to represent values of several primitive types.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodePrimitiveExpression/Overview/codeprimitiveexpressionexample.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodePrimitiveExpressionExample/VB/codeprimitiveexpressionexample.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodePrimitiveExpressionExample/VB/codeprimitiveexpressionexample.vb" id="Snippet2":::
+
]]>
@@ -191,11 +190,11 @@
Gets or sets the primitive data type to represent.
The primitive data type instance to represent the value of.
-
diff --git a/xml/System.CodeDom/CodePropertyReferenceExpression.xml b/xml/System.CodeDom/CodePropertyReferenceExpression.xml
index b7ea798d9dc..94813c34e9c 100644
--- a/xml/System.CodeDom/CodePropertyReferenceExpression.xml
+++ b/xml/System.CodeDom/CodePropertyReferenceExpression.xml
@@ -48,24 +48,23 @@
Represents a reference to the value of a property.
- can be used to represent a reference to the value of a property.
-
- The property specifies the object that contains the property to reference. The property specifies the name of the property to reference.
-
- This object does not have a property to indicate whether the reference is used in a `get` or `set`. If the property reference occurs on the left, assigned to, side of an assignment statement, then it is a `set`.
-
-
-
-## Examples
- The following example code demonstrates use of a to refer to a property.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeReferenceExample/CPP/codereferenceexample.cpp" id="Snippet3":::
+ can be used to represent a reference to the value of a property.
+
+ The property specifies the object that contains the property to reference. The property specifies the name of the property to reference.
+
+ This object does not have a property to indicate whether the reference is used in a `get` or `set`. If the property reference occurs on the left, assigned to, side of an assignment statement, then it is a `set`.
+
+
+
+## Examples
+ The following example code demonstrates use of a to refer to a property.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeFieldReferenceExpression/Overview/codereferenceexample.cs" id="Snippet3":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeReferenceExample/VB/codereferenceexample.vb" id="Snippet3":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeReferenceExample/VB/codereferenceexample.vb" id="Snippet3":::
+
]]>
diff --git a/xml/System.CodeDom/CodePropertySetValueReferenceExpression.xml b/xml/System.CodeDom/CodePropertySetValueReferenceExpression.xml
index 3eb46195a34..23e0909a747 100644
--- a/xml/System.CodeDom/CodePropertySetValueReferenceExpression.xml
+++ b/xml/System.CodeDom/CodePropertySetValueReferenceExpression.xml
@@ -48,22 +48,21 @@
Represents the value argument of a property set method call within a property set method.
- represents the value argument of a property set method call within a property set method declaration.
-
- A property set method typically assigns or uses the value assigned to the property. Within the property set method, this value is represented by an implicit variable represented in CodeDOM by a .
-
-
-
-## Examples
- This example demonstrates use of a to represent the value argument passed to a property set value statement block.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodePropertySetValueExample/CPP/codepropertysetvalueexample.cpp" id="Snippet2":::
+ represents the value argument of a property set method call within a property set method declaration.
+
+ A property set method typically assigns or uses the value assigned to the property. Within the property set method, this value is represented by an implicit variable represented in CodeDOM by a .
+
+
+
+## Examples
+ This example demonstrates use of a to represent the value argument passed to a property set value statement block.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodePropertySetValueReferenceExpression/Overview/codepropertysetvalueexample.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodePropertySetValueExample/VB/codepropertysetvalueexample.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodePropertySetValueExample/VB/codepropertysetvalueexample.vb" id="Snippet2":::
+
]]>
diff --git a/xml/System.CodeDom/CodeRemoveEventStatement.xml b/xml/System.CodeDom/CodeRemoveEventStatement.xml
index 9741b7bb1d0..ece71a0b18e 100644
--- a/xml/System.CodeDom/CodeRemoveEventStatement.xml
+++ b/xml/System.CodeDom/CodeRemoveEventStatement.xml
@@ -48,22 +48,21 @@
Represents a statement that removes an event handler.
- can be used to represent a statement that removes an event handler for an event.
-
- The property specifies the event to remove the event handler from. The property specifies the event handler to remove.
-
-
-
-## Examples
- The following example demonstrates use of a to remove a delegate from an event.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeRemoveEventExample/CPP/coderemoveeventexample.cpp" id="Snippet2":::
+ can be used to represent a statement that removes an event handler for an event.
+
+ The property specifies the event to remove the event handler from. The property specifies the event handler to remove.
+
+
+
+## Examples
+ The following example demonstrates use of a to remove a delegate from an event.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeRemoveEventStatement/Overview/coderemoveeventexample.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeRemoveEventExample/VB/coderemoveeventexample.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeRemoveEventExample/VB/coderemoveeventexample.vb" id="Snippet2":::
+
]]>
diff --git a/xml/System.CodeDom/CodeSnippetCompileUnit.xml b/xml/System.CodeDom/CodeSnippetCompileUnit.xml
index 58f01ef4122..91b69c79e44 100644
--- a/xml/System.CodeDom/CodeSnippetCompileUnit.xml
+++ b/xml/System.CodeDom/CodeSnippetCompileUnit.xml
@@ -48,24 +48,23 @@
Represents a literal code fragment that can be compiled.
- can represent a literal block of code that is included directly in the source without modification.
-
- A stores a section of code, exactly in its original format, as a string. The CodeDOM does not translate literal code fragments. Literal code fragments are stored and output in their original format. CodeDOM objects that contain literal code are provided so developers can encapsulate code that is already in the target language.
-
- The property contains the literal code fragment as a string. The property is optional and specifies the position of the code within a source code document.
-
-
-
-## Examples
- The following code example demonstrates how to create a new instance of the class by using a string that represents literal code.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeDomSampleBatch/CPP/class1.cpp" id="Snippet8":::
+ can represent a literal block of code that is included directly in the source without modification.
+
+ A stores a section of code, exactly in its original format, as a string. The CodeDOM does not translate literal code fragments. Literal code fragments are stored and output in their original format. CodeDOM objects that contain literal code are provided so developers can encapsulate code that is already in the target language.
+
+ The property contains the literal code fragment as a string. The property is optional and specifies the position of the code within a source code document.
+
+
+
+## Examples
+ The following code example demonstrates how to create a new instance of the class by using a string that represents literal code.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeExpressionStatement/Overview/class1.cs" id="Snippet8":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDomSampleBatch/VB/class1.vb" id="Snippet8":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDomSampleBatch/VB/class1.vb" id="Snippet8":::
+
]]>
@@ -112,11 +111,11 @@
Initializes a new instance of the class.
- property.
-
+ property.
+
]]>
@@ -153,15 +152,14 @@
The literal code fragment to represent.
Initializes a new instance of the class.
- class by using a string that represents literal code.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeDomSampleBatch/CPP/class1.cpp" id="Snippet8":::
+ class by using a string that represents literal code.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeExpressionStatement/Overview/class1.cs" id="Snippet8":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDomSampleBatch/VB/class1.vb" id="Snippet8":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDomSampleBatch/VB/class1.vb" id="Snippet8":::
+
]]>
diff --git a/xml/System.CodeDom/CodeSnippetExpression.xml b/xml/System.CodeDom/CodeSnippetExpression.xml
index a3e94a608e0..df1532bc2ce 100644
--- a/xml/System.CodeDom/CodeSnippetExpression.xml
+++ b/xml/System.CodeDom/CodeSnippetExpression.xml
@@ -48,22 +48,21 @@
Represents a literal expression.
- property contains the literal code for this snippet expression.
-
-
-
-## Examples
- The following code example demonstrates how to create an instance of the class using a literal code fragment.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeDomSampleBatch/CPP/class1.cpp" id="Snippet9":::
+ property contains the literal code for this snippet expression.
+
+
+
+## Examples
+ The following code example demonstrates how to create an instance of the class using a literal code fragment.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeExpressionStatement/Overview/class1.cs" id="Snippet9":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDomSampleBatch/VB/class1.vb" id="Snippet9":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDomSampleBatch/VB/class1.vb" id="Snippet9":::
+
]]>
@@ -145,15 +144,14 @@
The literal expression to represent.
Initializes a new instance of the class using the specified literal expression.
- constructor to create an instance of the class.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeDomSampleBatch/CPP/class1.cpp" id="Snippet9":::
+ constructor to create an instance of the class.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeExpressionStatement/Overview/class1.cs" id="Snippet9":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDomSampleBatch/VB/class1.vb" id="Snippet9":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDomSampleBatch/VB/class1.vb" id="Snippet9":::
+
]]>
@@ -196,11 +194,11 @@
Gets or sets the literal string of code.
The literal string.
-
diff --git a/xml/System.CodeDom/CodeStatementCollection.xml b/xml/System.CodeDom/CodeStatementCollection.xml
index 056a61366df..9396772626d 100644
--- a/xml/System.CodeDom/CodeStatementCollection.xml
+++ b/xml/System.CodeDom/CodeStatementCollection.xml
@@ -48,20 +48,19 @@
Represents a collection of objects.
- class provides a simple collection object that can be used to store a set of objects.
-
-
-
-## Examples
- The following example demonstrates how to use the class. The example creates a new instance of the class and uses several methods to add statements to the collection, return their index, and add or remove statements at a specific index point.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeStatementCollectionExample/CPP/class1.cpp" id="Snippet1":::
+ class provides a simple collection object that can be used to store a set of objects.
+
+
+
+## Examples
+ The following example demonstrates how to use the class. The example creates a new instance of the class and uses several methods to add statements to the collection, return their index, and add or remove statements at a specific index point.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeStatementCollection/Overview/class1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeStatementCollectionExample/VB/class1.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeStatementCollectionExample/VB/class1.vb" id="Snippet1":::
+
]]>
@@ -110,15 +109,14 @@
Initializes a new instance of the class.
- class.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeStatementCollectionExample/CPP/class1.cpp" id="Snippet2":::
+ class.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeStatementCollection/Overview/class1.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeStatementCollectionExample/VB/class1.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeStatementCollectionExample/VB/class1.vb" id="Snippet2":::
+
]]>
@@ -279,15 +277,14 @@
Adds the specified object to the collection.
The index at which the new element was inserted.
- object to a instance.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeStatementCollectionExample/CPP/class1.cpp" id="Snippet3":::
+ object to a instance.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeStatementCollection/Overview/class1.cs" id="Snippet3":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeStatementCollectionExample/VB/class1.vb" id="Snippet3":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeStatementCollectionExample/VB/class1.vb" id="Snippet3":::
+
]]>
@@ -337,15 +334,14 @@
An array of objects to add to the collection.
Adds a set of objects to the collection.
- method overload to add the members of an array to a instance.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeStatementCollectionExample/CPP/class1.cpp" id="Snippet4":::
+ method overload to add the members of an array to a instance.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeStatementCollection/Overview/class1.cs" id="Snippet4":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeStatementCollectionExample/VB/class1.vb" id="Snippet4":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeStatementCollectionExample/VB/class1.vb" id="Snippet4":::
+
]]>
@@ -388,15 +384,14 @@
A object that contains the objects to add to the collection.
Adds the contents of another object to the end of the collection.
- method overload to add the members of one to another.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeStatementCollectionExample/CPP/class1.cpp" id="Snippet4":::
+ method overload to add the members of one to another.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeStatementCollection/Overview/class1.cs" id="Snippet4":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeStatementCollectionExample/VB/class1.vb" id="Snippet4":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeStatementCollectionExample/VB/class1.vb" id="Snippet4":::
+
]]>
@@ -441,15 +436,14 @@
if the collection contains the specified object; otherwise, .
- method to search for the presence of a specific and retrieve the index value at which it was found.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeStatementCollectionExample/CPP/class1.cpp" id="Snippet5":::
+ method to search for the presence of a specific and retrieve the index value at which it was found.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeStatementCollection/Overview/class1.cs" id="Snippet5":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeStatementCollectionExample/VB/class1.vb" id="Snippet5":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeStatementCollectionExample/VB/class1.vb" id="Snippet5":::
+
]]>
@@ -492,21 +486,20 @@
The index of the array at which to begin inserting.
Copies the elements of the object to a one-dimensional instance, starting at the specified index.
- object to an array, starting at the specified index value.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeStatementCollectionExample/CPP/class1.cpp" id="Snippet6":::
+ object to an array, starting at the specified index value.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeStatementCollection/Overview/class1.cs" id="Snippet6":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeStatementCollectionExample/VB/class1.vb" id="Snippet6":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeStatementCollectionExample/VB/class1.vb" id="Snippet6":::
+
]]>
- The destination array is multidimensional.
-
- -or-
-
+ The destination array is multidimensional.
+
+ -or-
+
The number of elements in the is greater than the available space between the index of the target array specified by the parameter and the end of the target array.
The parameter is .
The parameter is less than the target array's minimum index.
@@ -549,15 +542,14 @@
Gets the index of the specified object in the , if it exists in the collection.
The index of the specified object, if it is found, in the collection; otherwise, -1.
- and uses the method to retrieve the index value at which it was found.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeStatementCollectionExample/CPP/class1.cpp" id="Snippet5":::
+ and uses the method to retrieve the index value at which it was found.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeStatementCollection/Overview/class1.cs" id="Snippet5":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeStatementCollectionExample/VB/class1.vb" id="Snippet5":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeStatementCollectionExample/VB/class1.vb" id="Snippet5":::
+
]]>
@@ -600,15 +592,14 @@
The object to insert.
Inserts the specified object into the collection at the specified index.
- method to add a object to a .
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeStatementCollectionExample/CPP/class1.cpp" id="Snippet8":::
+ method to add a object to a .
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeStatementCollection/Overview/class1.cs" id="Snippet8":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeStatementCollectionExample/VB/class1.vb" id="Snippet8":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeStatementCollectionExample/VB/class1.vb" id="Snippet8":::
+
]]>
@@ -650,11 +641,11 @@
Gets or sets the object at the specified index in the collection.
A at each valid index.
-
The parameter is outside the valid range of indexes for the collection.
@@ -695,15 +686,14 @@
The to remove from the collection.
Removes the specified object from the collection.
- method to delete a object from a .
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeStatementCollectionExample/CPP/class1.cpp" id="Snippet9":::
+ method to delete a object from a .
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeStatementCollection/Overview/class1.cs" id="Snippet9":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeStatementCollectionExample/VB/class1.vb" id="Snippet9":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeStatementCollectionExample/VB/class1.vb" id="Snippet9":::
+
]]>
The specified object is not found in the collection.
diff --git a/xml/System.CodeDom/CodeThisReferenceExpression.xml b/xml/System.CodeDom/CodeThisReferenceExpression.xml
index 6e93516bf54..f8a23e0783c 100644
--- a/xml/System.CodeDom/CodeThisReferenceExpression.xml
+++ b/xml/System.CodeDom/CodeThisReferenceExpression.xml
@@ -48,20 +48,19 @@
Represents a reference to the current local class instance.
- to refer to the current object.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeMethodReferenceExample/CPP/codemethodreferenceexample.cpp" id="Snippet3":::
+ to refer to the current object.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeMethodReferenceExpression/Overview/codemethodreferenceexample.cs" id="Snippet3":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeMethodReferenceExample/VB/codemethodreferenceexample.vb" id="Snippet3":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeMethodReferenceExample/VB/codemethodreferenceexample.vb" id="Snippet3":::
+
]]>
diff --git a/xml/System.CodeDom/CodeThrowExceptionStatement.xml b/xml/System.CodeDom/CodeThrowExceptionStatement.xml
index 7940bca53c6..17ad4e08d90 100644
--- a/xml/System.CodeDom/CodeThrowExceptionStatement.xml
+++ b/xml/System.CodeDom/CodeThrowExceptionStatement.xml
@@ -48,22 +48,21 @@
Represents a statement that throws an exception.
- can represent a statement that throws an exception. The expression should be, or evaluate to, a reference to an instance of a type that derives from the class.
-
- The property specifies the exception to throw.
-
-
-
-## Examples
- This example demonstrates using a to throw a new `System.Exception`.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeThrowExceptionStatement/CPP/codethrowexceptionstatementexample.cpp" id="Snippet2":::
+ can represent a statement that throws an exception. The expression should be, or evaluate to, a reference to an instance of a type that derives from the class.
+
+ The property specifies the exception to throw.
+
+
+
+## Examples
+ This example demonstrates using a to throw a new `System.Exception`.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeThrowExceptionStatement/Overview/codethrowexceptionstatementexample.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeThrowExceptionStatement/VB/codethrowexceptionstatementexample.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeThrowExceptionStatement/VB/codethrowexceptionstatementexample.vb" id="Snippet2":::
+
]]>
diff --git a/xml/System.CodeDom/CodeTryCatchFinallyStatement.xml b/xml/System.CodeDom/CodeTryCatchFinallyStatement.xml
index 345bff3d053..c5492fe0b81 100644
--- a/xml/System.CodeDom/CodeTryCatchFinallyStatement.xml
+++ b/xml/System.CodeDom/CodeTryCatchFinallyStatement.xml
@@ -48,25 +48,24 @@
Represents a block with any number of clauses and, optionally, a block.
- can be used to represent a `try`/`catch` block of code.
-
- The property contains the statements to execute within a `try` block. The property contains the `catch` clauses to handle caught exceptions. The property contains the statements to execute within a `finally` block.
-
+ can be used to represent a `try`/`catch` block of code.
+
+ The property contains the statements to execute within a `try` block. The property contains the `catch` clauses to handle caught exceptions. The property contains the statements to execute within a `finally` block.
+
> [!NOTE]
-> Not all languages support `try`/`catch` blocks. Call the method with the flag to determine whether a code generator supports `try`/`catch` blocks.
-
-
-
-## Examples
- The following example code demonstrates use of a to define a `try...catch...finally` statement for exception handling.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeTryCatchFinallyExample/CPP/codetrycatchfinallyexample.cpp" id="Snippet2":::
+> Not all languages support `try`/`catch` blocks. Call the method with the flag to determine whether a code generator supports `try`/`catch` blocks.
+
+
+
+## Examples
+ The following example code demonstrates use of a to define a `try...catch...finally` statement for exception handling.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeCatchClause/Overview/codetrycatchfinallyexample.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTryCatchFinallyExample/VB/codetrycatchfinallyexample.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTryCatchFinallyExample/VB/codetrycatchfinallyexample.vb" id="Snippet2":::
+
]]>
diff --git a/xml/System.CodeDom/CodeTypeConstructor.xml b/xml/System.CodeDom/CodeTypeConstructor.xml
index bec7213aa65..8ccc2d0794e 100644
--- a/xml/System.CodeDom/CodeTypeConstructor.xml
+++ b/xml/System.CodeDom/CodeTypeConstructor.xml
@@ -48,23 +48,22 @@
Represents a static constructor for a class.
- can be used to represent the static constructor for a class. A static constructor is called once when the type is loaded.
-
+ can be used to represent the static constructor for a class. A static constructor is called once when the type is loaded.
+
> [!NOTE]
-> Not all languages support static constructors. Support for static constructors can be checked by calling with the flag to determine if static constructors are supported by the code generator for a particular language.
-
-
-
-## Examples
- The following example demonstrates use of a to declare a static constructor for a type.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeTypeConstructorExample/CPP/codetypeconstructorexample.cpp" id="Snippet2":::
+> Not all languages support static constructors. Support for static constructors can be checked by calling with the flag to determine if static constructors are supported by the code generator for a particular language.
+
+
+
+## Examples
+ The following example demonstrates use of a to declare a static constructor for a type.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeTypeConstructor/Overview/codetypeconstructorexample.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTypeConstructorExample/VB/codetypeconstructorexample.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTypeConstructorExample/VB/codetypeconstructorexample.vb" id="Snippet2":::
+
]]>
diff --git a/xml/System.CodeDom/CodeTypeDeclaration.xml b/xml/System.CodeDom/CodeTypeDeclaration.xml
index 14feab085ac..687e1733682 100644
--- a/xml/System.CodeDom/CodeTypeDeclaration.xml
+++ b/xml/System.CodeDom/CodeTypeDeclaration.xml
@@ -48,27 +48,26 @@
Represents a type declaration for a class, structure, interface, or enumeration.
- can be used to represent code that declares a class, structure, interface, or enumeration. can be used to declare a type that is nested within another type.
-
- The property specifies the base type or base types of the type being declared. The property contains the type members, which can include methods, fields, properties, comments and other types. The property indicates the values for the type declaration, which indicate the type category of the type. The , , , and methods indicate whether the type is a class, structure, enumeration, or interface type, respectively.
-
+ can be used to represent code that declares a class, structure, interface, or enumeration. can be used to declare a type that is nested within another type.
+
+ The property specifies the base type or base types of the type being declared. The property contains the type members, which can include methods, fields, properties, comments and other types. The property indicates the values for the type declaration, which indicate the type category of the type. The , , , and methods indicate whether the type is a class, structure, enumeration, or interface type, respectively.
+
> [!NOTE]
-> Some programming languages only support the declaration of reference types, or classes. To check a language-specific CodeDOM code generator for support for declaring interfaces, enumerations, or value types, call the method to test for the appropriate flags. indicates support for interfaces, indicates support for enumerations, and indicates support for value types such as structures.
-
- You can build a class or a structure implementation in one complete declaration, or spread the implementation across multiple declarations. The property indicates whether the type declaration is complete or partial. Not all code generators support partial type declarations, so you should test for this support by calling the method with the flag .
-
-
-
-## Examples
- This example demonstrates using a to declare a type.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeTypeDeclarationExample/CPP/codetypedeclarationexample.cpp" id="Snippet2":::
+> Some programming languages only support the declaration of reference types, or classes. To check a language-specific CodeDOM code generator for support for declaring interfaces, enumerations, or value types, call the method to test for the appropriate flags. indicates support for interfaces, indicates support for enumerations, and indicates support for value types such as structures.
+
+ You can build a class or a structure implementation in one complete declaration, or spread the implementation across multiple declarations. The property indicates whether the type declaration is complete or partial. Not all code generators support partial type declarations, so you should test for this support by calling the method with the flag .
+
+
+
+## Examples
+ This example demonstrates using a to declare a type.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeTypeDeclaration/Overview/codetypedeclarationexample.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTypeDeclarationExample/VB/codetypedeclarationexample.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTypeDeclarationExample/VB/codetypedeclarationexample.vb" id="Snippet2":::
+
]]>
@@ -180,45 +179,45 @@
Gets the base types of the type.
A object that indicates the base types of the type.
- as the first item in the collection.
-
+ as the first item in the collection.
+
> [!NOTE]
-> In the .NET Framework version 2.0 you do not need the for if the interface you are implementing already exists and you are referring to it by type. For example, if you are implementing the interface and add it to the collection with this statement, `ctd.BaseTypes.Add(New CodeTypeReference(typeof(ICollection)))`, you do not need the preceding `ctd.BaseTypes.Add(New CodeTypeReference(GetType(Object)))` statement.
-
- The following code illustrates the addition of a to the collection that refers to .
-
-```vb
-Dim ctd As New CodeTypeDeclaration("Class1")
-ctd.IsClass = True
-ctd.BaseTypes.Add(New CodeTypeReference(GetType(Object)))
-ctd.BaseTypes.Add(New CodeTypeReference("Interface1"))
-```
-
-```csharp
-CodeTypeDeclaration ctd = new CodeTypeDeclaration("Class1");
-ctd.IsClass = true;
-ctd.BaseTypes.Add(new CodeTypeReference(typeof(Object)));
-ctd.BaseTypes.Add(new CodeTypeReference("Interface1"));
-```
-
- The preceding code generates the equivalent of the following Visual Basic code.
-
-```vb
-Public Class Class1
-Implements Interface1
-```
-
- However, the Visual Basic code actually generated is the following.
-
-```vb
-Public Class Class1
-Inherits Object
-Implements Interface1
-```
-
+> In the .NET Framework version 2.0 you do not need the for if the interface you are implementing already exists and you are referring to it by type. For example, if you are implementing the interface and add it to the collection with this statement, `ctd.BaseTypes.Add(New CodeTypeReference(typeof(ICollection)))`, you do not need the preceding `ctd.BaseTypes.Add(New CodeTypeReference(GetType(Object)))` statement.
+
+ The following code illustrates the addition of a to the collection that refers to .
+
+```vb
+Dim ctd As New CodeTypeDeclaration("Class1")
+ctd.IsClass = True
+ctd.BaseTypes.Add(New CodeTypeReference(GetType(Object)))
+ctd.BaseTypes.Add(New CodeTypeReference("Interface1"))
+```
+
+```csharp
+CodeTypeDeclaration ctd = new CodeTypeDeclaration("Class1");
+ctd.IsClass = true;
+ctd.BaseTypes.Add(new CodeTypeReference(typeof(Object)));
+ctd.BaseTypes.Add(new CodeTypeReference("Interface1"));
+```
+
+ The preceding code generates the equivalent of the following Visual Basic code.
+
+```vb
+Public Class Class1
+Implements Interface1
+```
+
+ However, the Visual Basic code actually generated is the following.
+
+```vb
+Public Class Class1
+Inherits Object
+Implements Interface1
+```
+
]]>
@@ -377,37 +376,35 @@ Implements Interface1
if the class or structure declaration is a partial representation of the implementation; if the declaration is a complete implementation of the class or structure. The default is .
- property to `false`, which indicates that the type declaration represents all details for the class or structure implementation.
-
- A partial type declaration makes it easier to build different portions of a class or structure implementation in different modules of your application. The partial type declarations can be stored in one source file, or spread across multiple source files that are eventually compiled together to form the combined type implementation.
-
- The C# language supports partial type declarations of classes and structures through the `partial` keyword. Visual Basic supports partial type declarations of classes and structures with the `Partial` keyword. Not all code generators support partial type declarations, so you should test for this support by calling the method with the flag .
-
+ property to `false`, which indicates that the type declaration represents all details for the class or structure implementation.
+
+ A partial type declaration makes it easier to build different portions of a class or structure implementation in different modules of your application. The partial type declarations can be stored in one source file, or spread across multiple source files that are eventually compiled together to form the combined type implementation.
+
+ The C# language supports partial type declarations of classes and structures through the `partial` keyword. Visual Basic supports partial type declarations of classes and structures with the `Partial` keyword. Not all code generators support partial type declarations, so you should test for this support by calling the method with the flag .
+
> [!NOTE]
-> Partial type declarations are supported for classes and structures. If you specify a partial type declaration for an enumeration or interface, the generated code produces compiler errors.
-
- When supplying a class or structure implementation across multiple declarations, set the property to `true` for the initial declaration and all supplemental declarations. The initial declaration must fully specify the type signature, including access modifiers, inherited types, and implemented interfaces. The supplementary declarations do not need to re-specify the type signature. A compiler error typically results if you redefine the type signature in a supplementary declaration.
-
- Visual Studio 2005 uses partial types to separate user-generated code from designer code. In Visual Basic Windows Application projects, the user code is placed in a partial class that is not qualified by the `Partial` keyword; the designer-provided code appears in the partial class that has the `Partial` keyword. In C#, both the user code and designer code appear in partial classes identified by the `partial` keyword.
-
-
-
-## Examples
- This example demonstrates using a to supply a class implementation across multiple declarations. The example builds the initial class declaration statement and sets the property to `true`.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeDomPartialTypeExample/CPP/source.cpp" id="Snippet3":::
+> Partial type declarations are supported for classes and structures. If you specify a partial type declaration for an enumeration or interface, the generated code produces compiler errors.
+
+ When supplying a class or structure implementation across multiple declarations, set the property to `true` for the initial declaration and all supplemental declarations. The initial declaration must fully specify the type signature, including access modifiers, inherited types, and implemented interfaces. The supplementary declarations do not need to re-specify the type signature. A compiler error typically results if you redefine the type signature in a supplementary declaration.
+
+ Visual Studio 2005 uses partial types to separate user-generated code from designer code. In Visual Basic Windows Application projects, the user code is placed in a partial class that is not qualified by the `Partial` keyword; the designer-provided code appears in the partial class that has the `Partial` keyword. In C#, both the user code and designer code appear in partial classes identified by the `partial` keyword.
+
+
+
+## Examples
+ This example demonstrates using a to supply a class implementation across multiple declarations. The example builds the initial class declaration statement and sets the property to `true`.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeTypeDeclaration/IsPartial/source.cs" id="Snippet3":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDomPartialTypeExample/VB/source.vb" id="Snippet3":::
-
- A different method in the example extends the class implementation. This method builds a new type declaration statement for the existing class and sets the property to `true`. The compiler combines the two partial type declarations together for the complete class implementation.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeDomPartialTypeExample/CPP/source.cpp" id="Snippet7":::
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDomPartialTypeExample/VB/source.vb" id="Snippet3":::
+
+ A different method in the example extends the class implementation. This method builds a new type declaration statement for the existing class and sets the property to `true`. The compiler combines the two partial type declarations together for the complete class implementation.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeTypeDeclaration/IsPartial/source.cs" id="Snippet7":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDomPartialTypeExample/VB/source.vb" id="Snippet7":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeDomPartialTypeExample/VB/source.vb" id="Snippet7":::
+
]]>
@@ -599,17 +596,17 @@ Implements Interface1
Gets or sets the attributes of the type.
A object that indicates the attributes of the type.
- property contains the same type of values used by when investigating a type at run time. Many of these flags do not correspond to the type declaration syntax for some languages. As a result, only the following flags are significant to : , , , , , , , and .
-
+ property contains the same type of values used by when investigating a type at run time. Many of these flags do not correspond to the type declaration syntax for some languages. As a result, only the following flags are significant to : , , , , , , , and .
+
> [!NOTE]
-> Some of the flags such as overlap with the meaning of flags in the property of that is inherited from . The property is a side effect of the class inheriting from so that classes can be nested. The flags in the property should be used instead of the flags in the property.
-
+> Some of the flags such as overlap with the meaning of flags in the property of that is inherited from . The property is a side effect of the class inheriting from so that classes can be nested. The flags in the property should be used instead of the flags in the property.
+
> [!NOTE]
-> The pattern for setting the visibility flags (flags containing the words `Public` or `Nested`) is to mask out all visibility flags using the and then set the desired visibility flag. For example, the C# code statement to identify the (named `cd`) as an internal class is `cd.TypeAttributes = (cd.TypeAttributes & ~TypeAttributes.VisibilityMask) | TypeAttributes.NotPublic;`. The code to set the same value in Visual Basic is `cd.TypeAttributes = (cd.TypeAttributes And (TypeAttributes.VisibilityMask Xor -1)) Or TypeAttributes.NotPublic`. Setting the property directly to a visibility flag (`cd.TypeAttributes = TypeAttributes.NotPublic;`) erases all other flags that might be set.
-
+> The pattern for setting the visibility flags (flags containing the words `Public` or `Nested`) is to mask out all visibility flags using the and then set the desired visibility flag. For example, the C# code statement to identify the (named `cd`) as an internal class is `cd.TypeAttributes = (cd.TypeAttributes & ~TypeAttributes.VisibilityMask) | TypeAttributes.NotPublic;`. The code to set the same value in Visual Basic is `cd.TypeAttributes = (cd.TypeAttributes And (TypeAttributes.VisibilityMask Xor -1)) Or TypeAttributes.NotPublic`. Setting the property directly to a visibility flag (`cd.TypeAttributes = TypeAttributes.NotPublic;`) erases all other flags that might be set.
+
]]>
@@ -652,13 +649,13 @@ Implements Interface1
Gets the type parameters for the type declaration.
A that contains the type parameters for the type declaration.
- class contains the type parameter `T`.
-
- For more information on generics, see [Generics in the .NET Framework Class Library](/dotnet/csharp/programming-guide/generics/generics-in-the-net-framework-class-library).
-
+ class contains the type parameter `T`.
+
+ For more information on generics, see [Generics in the .NET Framework Class Library](/dotnet/csharp/programming-guide/generics/generics-in-the-net-framework-class-library).
+
]]>
diff --git a/xml/System.CodeDom/CodeTypeDeclarationCollection.xml b/xml/System.CodeDom/CodeTypeDeclarationCollection.xml
index 32ba56f09d6..5bc11885e96 100644
--- a/xml/System.CodeDom/CodeTypeDeclarationCollection.xml
+++ b/xml/System.CodeDom/CodeTypeDeclarationCollection.xml
@@ -48,20 +48,19 @@
Represents a collection of objects.
- class provides a simple collection object that can be used to store a set of objects.
-
-
-
-## Examples
- The following example demonstrates how to use the class. The example creates a new instance of the class and uses several methods to add statements to the collection, return their index, and add or remove attributes at a specific index point.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeTypeDeclarationCollectionExample/CPP/class1.cpp" id="Snippet1":::
+ class provides a simple collection object that can be used to store a set of objects.
+
+
+
+## Examples
+ The following example demonstrates how to use the class. The example creates a new instance of the class and uses several methods to add statements to the collection, return their index, and add or remove attributes at a specific index point.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeTypeDeclarationCollection/Overview/class1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTypeDeclarationCollectionExample/VB/class1.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTypeDeclarationCollectionExample/VB/class1.vb" id="Snippet1":::
+
]]>
@@ -110,15 +109,14 @@
Initializes a new instance of the class.
- class.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeTypeDeclarationCollectionExample/CPP/class1.cpp" id="Snippet2":::
+ class.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeTypeDeclarationCollection/Overview/class1.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTypeDeclarationCollectionExample/VB/class1.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTypeDeclarationCollectionExample/VB/class1.vb" id="Snippet2":::
+
]]>
@@ -227,15 +225,14 @@
Adds the specified object to the collection.
The index at which the new element was inserted.
- method to add a object to a .
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeTypeDeclarationCollectionExample/CPP/class1.cpp" id="Snippet3":::
+ method to add a object to a .
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeTypeDeclarationCollection/Overview/class1.cs" id="Snippet3":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTypeDeclarationCollectionExample/VB/class1.vb" id="Snippet3":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTypeDeclarationCollectionExample/VB/class1.vb" id="Snippet3":::
+
]]>
@@ -285,15 +282,14 @@
An array of type that contains the objects to add to the collection.
Copies the elements of the specified array to the end of the collection.
- method overload to add an array of objects to a .
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeTypeDeclarationCollectionExample/CPP/class1.cpp" id="Snippet4":::
+ method overload to add an array of objects to a .
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeTypeDeclarationCollection/Overview/class1.cs" id="Snippet4":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTypeDeclarationCollectionExample/VB/class1.vb" id="Snippet4":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTypeDeclarationCollectionExample/VB/class1.vb" id="Snippet4":::
+
]]>
@@ -336,15 +332,14 @@
A object that contains the objects to add to the collection.
Adds the contents of another object to the end of the collection.
- method overload to add objects from one to another .
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeTypeDeclarationCollectionExample/CPP/class1.cpp" id="Snippet4":::
+ method overload to add objects from one to another .
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeTypeDeclarationCollection/Overview/class1.cs" id="Snippet4":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTypeDeclarationCollectionExample/VB/class1.vb" id="Snippet4":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTypeDeclarationCollectionExample/VB/class1.vb" id="Snippet4":::
+
]]>
@@ -389,15 +384,14 @@
if the collection contains the specified object; otherwise, .
- method to find a object in a .
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeTypeDeclarationCollectionExample/CPP/class1.cpp" id="Snippet5":::
+ method to find a object in a .
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeTypeDeclarationCollection/Overview/class1.cs" id="Snippet5":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTypeDeclarationCollectionExample/VB/class1.vb" id="Snippet5":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTypeDeclarationCollectionExample/VB/class1.vb" id="Snippet5":::
+
]]>
@@ -440,21 +434,20 @@
The index of the array at which to begin inserting.
Copies the elements in the object to a one-dimensional instance, starting at the specified index.
- method to copy the contents of a object to an array, starting at the specified index value.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeTypeDeclarationCollectionExample/CPP/class1.cpp" id="Snippet6":::
+ method to copy the contents of a object to an array, starting at the specified index value.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeTypeDeclarationCollection/Overview/class1.cs" id="Snippet6":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTypeDeclarationCollectionExample/VB/class1.vb" id="Snippet6":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTypeDeclarationCollectionExample/VB/class1.vb" id="Snippet6":::
+
]]>
- The destination array is multidimensional.
-
- -or-
-
+ The destination array is multidimensional.
+
+ -or-
+
The number of elements in the is greater than the available space between the index of the target array specified by the parameter and the end of the target array.
The parameter is .
The parameter is less than the target array's minimum index.
@@ -497,15 +490,14 @@
Gets the index of the specified object in the , if it exists in the collection.
The index of the specified object, if it is found, in the collection; otherwise, -1.
- entries from a object and displays their names and indexes returned by the method.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeTypeDeclarationCollectionExample/CPP/class1.cpp" id="Snippet5":::
+ entries from a object and displays their names and indexes returned by the method.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeTypeDeclarationCollection/Overview/class1.cs" id="Snippet5":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTypeDeclarationCollectionExample/VB/class1.vb" id="Snippet5":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTypeDeclarationCollectionExample/VB/class1.vb" id="Snippet5":::
+
]]>
@@ -548,15 +540,14 @@
The object to insert.
Inserts the specified object into the collection at the specified index.
- method to insert a object into a .
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeTypeDeclarationCollectionExample/CPP/class1.cpp" id="Snippet8":::
+ method to insert a object into a .
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeTypeDeclarationCollection/Overview/class1.cs" id="Snippet8":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTypeDeclarationCollectionExample/VB/class1.vb" id="Snippet8":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTypeDeclarationCollectionExample/VB/class1.vb" id="Snippet8":::
+
]]>
@@ -598,11 +589,11 @@
Gets or sets the object at the specified index in the collection.
A at each valid index.
-
The parameter is outside the valid range of indexes for the collection.
@@ -643,15 +634,14 @@
The to remove from the collection.
Removes the specified object from the collection.
- method to delete a object from a .
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeTypeDeclarationCollectionExample/CPP/class1.cpp" id="Snippet9":::
+ method to delete a object from a .
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeTypeDeclarationCollection/Overview/class1.cs" id="Snippet9":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTypeDeclarationCollectionExample/VB/class1.vb" id="Snippet9":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTypeDeclarationCollectionExample/VB/class1.vb" id="Snippet9":::
+
]]>
The specified object is not found in the collection.
diff --git a/xml/System.CodeDom/CodeTypeDelegate.xml b/xml/System.CodeDom/CodeTypeDelegate.xml
index b9b2abc770f..2bc2a99da3f 100644
--- a/xml/System.CodeDom/CodeTypeDelegate.xml
+++ b/xml/System.CodeDom/CodeTypeDelegate.xml
@@ -48,27 +48,26 @@
Represents a delegate declaration.
- can be used to declare a delegate type, or event handler. A delegate defines a method signature that can be used by callback methods or event handlers. Delegates can be declared at the namespace level or nested inside other types. Delegates cannot be nested inside other delegates.
-
- The property specifies the data type of the event handler returned by the delegate. The property contains the parameters for the delegate type.
-
- should not be used for enumeration, interface, or type declaration. Instead, use for those.
-
+ can be used to declare a delegate type, or event handler. A delegate defines a method signature that can be used by callback methods or event handlers. Delegates can be declared at the namespace level or nested inside other types. Delegates cannot be nested inside other delegates.
+
+ The property specifies the data type of the event handler returned by the delegate. The property contains the parameters for the delegate type.
+
+ should not be used for enumeration, interface, or type declaration. Instead, use for those.
+
> [!NOTE]
-> Not all languages support the declaration of delegates. Call the method with the flag to determine if it is supported in a particular language.
-
-
-
-## Examples
- The following example code demonstrates use of a to declare a new delegate type.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeTypeDelegateExample/CPP/codetypedelegateexample.cpp" id="Snippet3":::
+> Not all languages support the declaration of delegates. Call the method with the flag to determine if it is supported in a particular language.
+
+
+
+## Examples
+ The following example code demonstrates use of a to declare a new delegate type.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeTypeDelegate/Overview/codetypedelegateexample.cs" id="Snippet3":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTypeDelegateExample/VB/codetypedelegateexample.vb" id="Snippet3":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTypeDelegateExample/VB/codetypedelegateexample.vb" id="Snippet3":::
+
]]>
diff --git a/xml/System.CodeDom/CodeTypeMemberCollection.xml b/xml/System.CodeDom/CodeTypeMemberCollection.xml
index be60e75488d..0fdb8f3d0c4 100644
--- a/xml/System.CodeDom/CodeTypeMemberCollection.xml
+++ b/xml/System.CodeDom/CodeTypeMemberCollection.xml
@@ -48,20 +48,19 @@
Represents a collection of objects.
- class provides a simple collection object that can be used to store a set of objects.
-
-
-
-## Examples
- The following code example demonstrates the use of the class. The example creates a new instance of the class and uses several methods to add statements to the collection, return their index, and add or remove attributes at a specific index point.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeTypeMemberCollectionExample/CPP/class1.cpp" id="Snippet1":::
+ class provides a simple collection object that can be used to store a set of objects.
+
+
+
+## Examples
+ The following code example demonstrates the use of the class. The example creates a new instance of the class and uses several methods to add statements to the collection, return their index, and add or remove attributes at a specific index point.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeTypeMemberCollection/Overview/class1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTypeMemberCollectionExample/VB/class1.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTypeMemberCollectionExample/VB/class1.vb" id="Snippet1":::
+
]]>
@@ -110,15 +109,14 @@
Initializes a new instance of the class.
- class.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeTypeMemberCollectionExample/CPP/class1.cpp" id="Snippet2":::
+ class.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeTypeMemberCollection/Overview/class1.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTypeMemberCollectionExample/VB/class1.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTypeMemberCollectionExample/VB/class1.vb" id="Snippet2":::
+
]]>
@@ -227,15 +225,14 @@
Adds a with the specified value to the collection.
The index at which the new element was inserted.
- object to a instance.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeTypeMemberCollectionExample/CPP/class1.cpp" id="Snippet3":::
+ object to a instance.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeTypeMemberCollection/Overview/class1.cs" id="Snippet3":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTypeMemberCollectionExample/VB/class1.vb" id="Snippet3":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTypeMemberCollectionExample/VB/class1.vb" id="Snippet3":::
+
]]>
@@ -285,15 +282,14 @@
An array of type containing the objects to add to the collection.
Copies the elements of the specified array to the end of the collection.
- method overloads to add the members of an array to a object, and to add the members of one to another.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeTypeMemberCollectionExample/CPP/class1.cpp" id="Snippet4":::
+ method overloads to add the members of an array to a object, and to add the members of one to another.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeTypeMemberCollection/Overview/class1.cs" id="Snippet4":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTypeMemberCollectionExample/VB/class1.vb" id="Snippet4":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTypeMemberCollectionExample/VB/class1.vb" id="Snippet4":::
+
]]>
@@ -336,15 +332,14 @@
A containing the objects to add to the collection.
Adds the contents of another to the end of the collection.
- method overloads to add the members of an array to a object, and to add the members of one to another.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeTypeMemberCollectionExample/CPP/class1.cpp" id="Snippet4":::
+ method overloads to add the members of an array to a object, and to add the members of one to another.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeTypeMemberCollection/Overview/class1.cs" id="Snippet4":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTypeMemberCollectionExample/VB/class1.vb" id="Snippet4":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTypeMemberCollectionExample/VB/class1.vb" id="Snippet4":::
+
]]>
@@ -389,15 +384,14 @@
if the collection contains the specified object; otherwise, .
- method to search for the presence of a specific object and retrieve the index value at which it was found.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeTypeMemberCollectionExample/CPP/class1.cpp" id="Snippet5":::
+ method to search for the presence of a specific object and retrieve the index value at which it was found.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeTypeMemberCollection/Overview/class1.cs" id="Snippet5":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTypeMemberCollectionExample/VB/class1.vb" id="Snippet5":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTypeMemberCollectionExample/VB/class1.vb" id="Snippet5":::
+
]]>
@@ -440,21 +434,20 @@
The index of the array at which to begin inserting.
Copies the collection objects to a one-dimensional instance, beginning at the specified index.
- to an array, beginning at the specified index value.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeTypeMemberCollectionExample/CPP/class1.cpp" id="Snippet6":::
+ to an array, beginning at the specified index value.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeTypeMemberCollection/Overview/class1.cs" id="Snippet6":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTypeMemberCollectionExample/VB/class1.vb" id="Snippet6":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTypeMemberCollectionExample/VB/class1.vb" id="Snippet6":::
+
]]>
- The destination array is multidimensional.
-
- -or-
-
+ The destination array is multidimensional.
+
+ -or-
+
The number of elements in the is greater than the available space between the index of the target array specified by the parameter and the end of the target array.
The parameter is .
The parameter is less than the target array's minimum index.
@@ -497,15 +490,14 @@
Gets the index in the collection of the specified , if it exists in the collection.
The index in the collection of the specified object, if found; otherwise, -1.
- object and uses the method to retrieve the index value at which it was found.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeTypeMemberCollectionExample/CPP/class1.cpp" id="Snippet5":::
+ object and uses the method to retrieve the index value at which it was found.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeTypeMemberCollection/Overview/class1.cs" id="Snippet5":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTypeMemberCollectionExample/VB/class1.vb" id="Snippet5":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTypeMemberCollectionExample/VB/class1.vb" id="Snippet5":::
+
]]>
@@ -548,15 +540,14 @@
The to insert.
Inserts the specified into the collection at the specified index.
- method to add a object to a .
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeTypeMemberCollectionExample/CPP/class1.cpp" id="Snippet8":::
+ method to add a object to a .
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeTypeMemberCollection/Overview/class1.cs" id="Snippet8":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTypeMemberCollectionExample/VB/class1.vb" id="Snippet8":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTypeMemberCollectionExample/VB/class1.vb" id="Snippet8":::
+
]]>
@@ -598,11 +589,11 @@
Gets or sets the at the specified index in the collection.
A at each valid index.
-
The parameter is outside the valid range of indexes for the collection.
@@ -643,15 +634,14 @@
The to remove from the collection.
Removes a specific from the collection.
- method to delete a object from a .
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeTypeMemberCollectionExample/CPP/class1.cpp" id="Snippet9":::
+ method to delete a object from a .
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeTypeMemberCollection/Overview/class1.cs" id="Snippet9":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTypeMemberCollectionExample/VB/class1.vb" id="Snippet9":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTypeMemberCollectionExample/VB/class1.vb" id="Snippet9":::
+
]]>
The specified object is not found in the collection.
diff --git a/xml/System.CodeDom/CodeTypeOfExpression.xml b/xml/System.CodeDom/CodeTypeOfExpression.xml
index 0380a1225cf..2dfdedf14d4 100644
--- a/xml/System.CodeDom/CodeTypeOfExpression.xml
+++ b/xml/System.CodeDom/CodeTypeOfExpression.xml
@@ -48,24 +48,23 @@
Represents a expression, an expression that returns a for a specified type name.
- represents a `typeof` expression that returns a at runtime.
-
- The property specifies the data type to return a object for.
-
- Use to represent source code that refers to a type by name, such as when creating a to cast an object to a name-specified type.
-
-
-
-## Examples
- The following example demonstrates use of a to represent a typeof expression.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeTypeOfExample/CPP/codetypeofexample.cpp" id="Snippet2":::
+ represents a `typeof` expression that returns a at runtime.
+
+ The property specifies the data type to return a object for.
+
+ Use to represent source code that refers to a type by name, such as when creating a to cast an object to a name-specified type.
+
+
+
+## Examples
+ The following example demonstrates use of a to represent a typeof expression.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeTypeOfExpression/Overview/codetypeofexample.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTypeOfExample/VB/codetypeofexample.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTypeOfExample/VB/codetypeofexample.vb" id="Snippet2":::
+
]]>
diff --git a/xml/System.CodeDom/CodeTypeReference.xml b/xml/System.CodeDom/CodeTypeReference.xml
index 401743c89b8..0e84e9a4dec 100644
--- a/xml/System.CodeDom/CodeTypeReference.xml
+++ b/xml/System.CodeDom/CodeTypeReference.xml
@@ -48,24 +48,23 @@
Represents a reference to a type.
- object is used to represent a type for CodeDOM objects. When CodeDOM types have a `Type` property, it is of type . For example, the property is a that represents a field's data type.
-
- A can be initialized with a object or a string. It is generally recommended to use a to do this, although it may not always be possible. If initializing an instance of this class with a string, it is strongly recommended to always use fully qualified types, such as "System.Console" instead of just "Console", because not all languages support importing namespaces. Array types can be specified by either passing in a type object for an array or using one of the constructors that accept rank as a parameter.
-
- The property specifies the name of the type to reference. For references to array types, the property indicates the type of the elements of the array, and the property indicates the number of dimensions in the array.
-
-
-
-## Examples
- The following example demonstrates use of a to represent a reference to a type.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeTypeOfExample/CPP/codetypeofexample.cpp" id="Snippet2":::
+ object is used to represent a type for CodeDOM objects. When CodeDOM types have a `Type` property, it is of type . For example, the property is a that represents a field's data type.
+
+ A can be initialized with a object or a string. It is generally recommended to use a to do this, although it may not always be possible. If initializing an instance of this class with a string, it is strongly recommended to always use fully qualified types, such as "System.Console" instead of just "Console", because not all languages support importing namespaces. Array types can be specified by either passing in a type object for an array or using one of the constructors that accept rank as a parameter.
+
+ The property specifies the name of the type to reference. For references to array types, the property indicates the type of the elements of the array, and the property indicates the number of dimensions in the array.
+
+
+
+## Examples
+ The following example demonstrates use of a to represent a reference to a type.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeTypeOfExpression/Overview/codetypeofexample.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTypeOfExample/VB/codetypeofexample.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTypeOfExample/VB/codetypeofexample.vb" id="Snippet2":::
+
]]>
@@ -106,11 +105,11 @@
Initializes a new instance of the class.
- object. If you use this constructor, set properties to establish the type reference.
-
+ object. If you use this constructor, set properties to establish the type reference.
+
]]>
@@ -181,16 +180,16 @@
The name of the type to reference.
Initializes a new instance of the class using the specified type name.
- type, where `K` is a string and `V` is a of integers, is represented by reflection as the following (with the assembly information removed): ``System.Collections.Generic.Dictionary`2[[System.String], [System.Collections.Generic.List`1[[System.Int32]]]]``.
-
+ type, where `K` is a string and `V` is a of integers, is represented by reflection as the following (with the assembly information removed): ``System.Collections.Generic.Dictionary`2[[System.String], [System.Collections.Generic.List`1[[System.Int32]]]]``.
+
> [!NOTE]
-> You must use square brackets ([]) and not the C# angle brackets (<>) to delimit generic parameters.
-
- To avoid the possibility of making a mistake in specifying the syntax, consider using the constructor that takes a type as a parameter instead of a string.
-
+> You must use square brackets ([]) and not the C# angle brackets (<>) to delimit generic parameters.
+
+ To avoid the possibility of making a mistake in specifying the syntax, consider using the constructor that takes a type as a parameter instead of a string.
+
]]>
@@ -265,11 +264,11 @@
The number of dimensions in the array.
Initializes a new instance of the class using the specified array type and rank.
- objects.
-
+ objects.
+
]]>
@@ -476,11 +475,11 @@
Gets or sets the type of the elements in the array.
A that indicates the type of the array elements.
- property is greater than or equal to 1.
-
+ property is greater than or equal to 1.
+
]]>
@@ -561,54 +560,54 @@
Gets or sets the name of the type being referenced.
The name of the type being referenced.
- [!NOTE]
-> The name of the property may be misleading. This property contains just the type name with any array adornments or generic type arguments removed, not the base or parent type as might be expected. For example, the value for ``System.Collections.Generic.Dictionary`2[[System.String], [System.Collections.Generic.List`1[[System.Int32]]]]`` is ``System.Collections.Generic.Dictionary`2``.
-
-## Representation of Generic Types
- The information in this section is intended for CodeDom provider developers and only applies to CLS-compliant languages. The return value can contain generic types. Generic types are formatted with the name of the type followed by a grave accent ("`") followed by a count of the generic type arguments. The generic type arguments can be found in the returned by the property. The values returned by and the associated contain the same content as the value of the type returned by reflection.
-
- For example, a constructed where `K` is a string and `V` is a constructed of integers is represented by reflection as the following (with the assembly information removed):
-
-```
-System.Collections.Generic.Dictionary`2[[System.String], [System.Collections.Generic.List`1[[System.Int32]]]]
-```
-
- Recursively parsing the property from the for yields the same strings as the reflection representation above:
-
-- The property for the parent returns the following:
-
- ```
- System.Collections.Generic.Dictionary`2
- ```
-
-- The property for the first object in the collection returns the following:
-
- ```
- System.String
- ```
-
-- The property for the second object in the collection returns the following:
-
- ```
- System.Collections.Generic.List`1
- ```
-
-- The property in the object for ``System.Collections.Generic.List`1`` returns the following:
-
- ```
- System.Int32
- ```
-
- The type argument count should be used when parsing the associated values. The common practice is to remove the type argument count from the generated code, but the practice is compiler specific. It is important to note that the type argument count can be found within a nested type name, in which case it is followed by a plus sign ("+").
-
+> The name of the property may be misleading. This property contains just the type name with any array adornments or generic type arguments removed, not the base or parent type as might be expected. For example, the value for ``System.Collections.Generic.Dictionary`2[[System.String], [System.Collections.Generic.List`1[[System.Int32]]]]`` is ``System.Collections.Generic.Dictionary`2``.
+
+## Representation of Generic Types
+ The information in this section is intended for CodeDom provider developers and only applies to CLS-compliant languages. The return value can contain generic types. Generic types are formatted with the name of the type followed by a grave accent ("`") followed by a count of the generic type arguments. The generic type arguments can be found in the returned by the property. The values returned by and the associated contain the same content as the value of the type returned by reflection.
+
+ For example, a constructed where `K` is a string and `V` is a constructed of integers is represented by reflection as the following (with the assembly information removed):
+
+```
+System.Collections.Generic.Dictionary`2[[System.String], [System.Collections.Generic.List`1[[System.Int32]]]]
+```
+
+ Recursively parsing the property from the for yields the same strings as the reflection representation above:
+
+- The property for the parent returns the following:
+
+ ```
+ System.Collections.Generic.Dictionary`2
+ ```
+
+- The property for the first object in the collection returns the following:
+
+ ```
+ System.String
+ ```
+
+- The property for the second object in the collection returns the following:
+
+ ```
+ System.Collections.Generic.List`1
+ ```
+
+- The property in the object for ``System.Collections.Generic.List`1`` returns the following:
+
+ ```
+ System.Int32
+ ```
+
+ The type argument count should be used when parsing the associated values. The common practice is to remove the type argument count from the generated code, but the practice is compiler specific. It is important to note that the type argument count can be found within a nested type name, in which case it is followed by a plus sign ("+").
+
> [!NOTE]
-> When creating a generic , the recommended practice is to specify the type arguments as objects or use the constructor that takes a . Use of the constructor that creates a from a string can lead to undiscoverable type-argument errors.
-
+> When creating a generic , the recommended practice is to specify the type arguments as objects or use the constructor that takes a . Use of the constructor that creates a from a string can lead to undiscoverable type-argument errors.
+
]]>
@@ -697,11 +696,11 @@ System.Collections.Generic.Dictionary`2[[System.String], [System.Collections.Gen
Gets the type arguments for the current generic type reference.
A containing the type arguments for the current object.
- property is a collection of type references to be substituted for the type parameter references of the current generic type. The collection contains all the type arguments for all nested types. For an example, see the property.
-
+ property is a collection of type references to be substituted for the type parameter references of the current generic type. The collection contains all the type arguments for all nested types. For an example, see the property.
+
]]>
diff --git a/xml/System.CodeDom/CodeTypeReferenceCollection.xml b/xml/System.CodeDom/CodeTypeReferenceCollection.xml
index 4c865c89c72..0e00a85a7e8 100644
--- a/xml/System.CodeDom/CodeTypeReferenceCollection.xml
+++ b/xml/System.CodeDom/CodeTypeReferenceCollection.xml
@@ -48,18 +48,17 @@
Represents a collection of objects.
- class provides a simple collection object that can be used to store a set of objects.
-
-
-
-## Examples
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeTypeReferenceCollection/CPP/class1.cpp" id="Snippet1":::
+ class provides a simple collection object that can be used to store a set of objects.
+
+
+
+## Examples
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeTypeReferenceCollection/Overview/class1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTypeReferenceCollection/VB/class1.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTypeReferenceCollection/VB/class1.vb" id="Snippet1":::
+
]]>
@@ -108,13 +107,12 @@
Initializes a new instance of the class.
-
@@ -232,13 +230,12 @@
Adds the specified to the collection.
The index at which the new element was inserted.
-
@@ -362,13 +359,12 @@
An array of type containing the objects to add to the collection.
Copies the elements of the specified array to the end of the collection.
-
@@ -411,13 +407,12 @@
A containing the objects to add to the collection.
Adds the contents of the specified to the end of the collection.
-
@@ -462,13 +457,12 @@
if the is contained in the collection; otherwise, .
-
@@ -511,19 +505,18 @@
The index of the array at which to begin inserting.
Copies the items in the collection to the specified one-dimensional at the specified index.
-
- The parameter is multidimensional.
-
- -or-
-
+ The parameter is multidimensional.
+
+ -or-
+
The number of elements in the is greater than the available space between the index of the target array specified by the parameter and the end of the target array.
The parameter is .
The parameter is less than the target array's minimum index.
@@ -566,13 +559,12 @@
Gets the index in the collection of the specified , if it exists in the collection.
The index of the specified in the collection if found; otherwise, -1.
-
@@ -615,13 +607,12 @@
The to insert.
Inserts a into the collection at the specified index.
-
@@ -663,11 +654,11 @@
Gets or sets the at the specified index in the collection.
A at each valid index.
-
The parameter is outside the valid range of indexes for the collection.
@@ -708,13 +699,12 @@
The to remove from the collection.
Removes the specified from the collection.
-
The specified object is not found in the collection.
diff --git a/xml/System.CodeDom/CodeTypeReferenceExpression.xml b/xml/System.CodeDom/CodeTypeReferenceExpression.xml
index 4ef89c7a3c5..9653d68a9d8 100644
--- a/xml/System.CodeDom/CodeTypeReferenceExpression.xml
+++ b/xml/System.CodeDom/CodeTypeReferenceExpression.xml
@@ -48,22 +48,21 @@
Represents a reference to a data type.
- can be used to reference a particular data type.
-
- The property specifies the data type to reference.
-
-
-
-## Examples
- The following example demonstrates use of a to represent a reference to a type.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeTypeOfExample/CPP/codetypeofexample.cpp" id="Snippet3":::
+ can be used to reference a particular data type.
+
+ The property specifies the data type to reference.
+
+
+
+## Examples
+ The following example demonstrates use of a to represent a reference to a type.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeTypeOfExpression/Overview/codetypeofexample.cs" id="Snippet3":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTypeOfExample/VB/codetypeofexample.vb" id="Snippet3":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeTypeOfExample/VB/codetypeofexample.vb" id="Snippet3":::
+
]]>
diff --git a/xml/System.CodeDom/CodeVariableDeclarationStatement.xml b/xml/System.CodeDom/CodeVariableDeclarationStatement.xml
index 2de3a4103eb..fba5c9c81a1 100644
--- a/xml/System.CodeDom/CodeVariableDeclarationStatement.xml
+++ b/xml/System.CodeDom/CodeVariableDeclarationStatement.xml
@@ -48,25 +48,24 @@
Represents a variable declaration.
- can be used to represent code that declares a variable.
-
- The property specifies the type of the variable to declare. The property specifies the name of the variable to declare. The property is optional, and specifies an initialization expression to assign to the variable after it is created.
-
+ can be used to represent code that declares a variable.
+
+ The property specifies the type of the variable to declare. The property specifies the name of the variable to declare. The property is optional, and specifies an initialization expression to assign to the variable after it is created.
+
> [!NOTE]
-> Some languages can implement the optional variable initialization expression by making a separate assignment statement after the variable declaration.
-
-
-
-## Examples
- This example demonstrates using a to declare a variable.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeVariableDeclarationStatementExample/CPP/codevariabledeclarationstatementexample.cpp" id="Snippet2":::
+> Some languages can implement the optional variable initialization expression by making a separate assignment statement after the variable declaration.
+
+
+
+## Examples
+ This example demonstrates using a to declare a variable.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeVariableDeclarationStatement/Overview/codevariabledeclarationstatementexample.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeVariableDeclarationStatementExample/VB/codevariabledeclarationstatementexample.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeVariableDeclarationStatementExample/VB/codevariabledeclarationstatementexample.vb" id="Snippet2":::
+
]]>
diff --git a/xml/System.CodeDom/CodeVariableReferenceExpression.xml b/xml/System.CodeDom/CodeVariableReferenceExpression.xml
index 989ea486ff2..02417e1bf28 100644
--- a/xml/System.CodeDom/CodeVariableReferenceExpression.xml
+++ b/xml/System.CodeDom/CodeVariableReferenceExpression.xml
@@ -48,24 +48,23 @@
Represents a reference to a local variable.
- can be used to represent a reference to a local variable.
-
- The property specifies the name of the local variable to reference.
-
- Use to reference a field. Use to reference a property. Use to reference an event.
-
-
-
-## Examples
- The following example code demonstrates use of a to refer to a local variable.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeReferenceExample/CPP/codereferenceexample.cpp" id="Snippet4":::
+ can be used to represent a reference to a local variable.
+
+ The property specifies the name of the local variable to reference.
+
+ Use to reference a field. Use to reference a property. Use to reference an event.
+
+
+
+## Examples
+ The following example code demonstrates use of a to refer to a local variable.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeFieldReferenceExpression/Overview/codereferenceexample.cs" id="Snippet4":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeReferenceExample/VB/codereferenceexample.vb" id="Snippet4":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeReferenceExample/VB/codereferenceexample.vb" id="Snippet4":::
+
]]>
diff --git a/xml/System.CodeDom/FieldDirection.xml b/xml/System.CodeDom/FieldDirection.xml
index 19dbe853912..2a742b1be04 100644
--- a/xml/System.CodeDom/FieldDirection.xml
+++ b/xml/System.CodeDom/FieldDirection.xml
@@ -43,20 +43,19 @@
Defines identifiers used to indicate the direction of parameter and argument declarations.
- allows for passing arguments to functions by reference, or using incoming or outgoing parameters.
-
-
-
-## Examples
- The following example demonstrates use of to indicate the field direction types of the parameters of a method in a method declaration.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeParameterDeclarationExample/CPP/codeparameterdeclarationexample.cpp" id="Snippet3":::
+ allows for passing arguments to functions by reference, or using incoming or outgoing parameters.
+
+
+
+## Examples
+ The following example demonstrates use of to indicate the field direction types of the parameters of a method in a method declaration.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeParameterDeclarationExpression/Overview/codeparameterdeclarationexample.cs" id="Snippet3":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeParameterDeclarationExample/VB/codeparameterdeclarationexample.vb" id="Snippet3":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeParameterDeclarationExample/VB/codeparameterdeclarationexample.vb" id="Snippet3":::
+
]]>
diff --git a/xml/System.CodeDom/MemberAttributes.xml b/xml/System.CodeDom/MemberAttributes.xml
index 6faa5b8ae13..86fd18495e1 100644
--- a/xml/System.CodeDom/MemberAttributes.xml
+++ b/xml/System.CodeDom/MemberAttributes.xml
@@ -47,26 +47,25 @@
Defines member attribute identifiers for class members.
- enumeration can be used to indicate the scope and access attributes of a class member.
-
+ enumeration can be used to indicate the scope and access attributes of a class member.
+
> [!NOTE]
-> There is no `Virtual` member attribute. A member is declared virtual by setting its member access to Public (`property1.Attributes = MemberAttributes.Public`) without specifying it as Final. The absence of the Final flag makes a member `virtual` in C# (`public virtual`), `overridable` in Visual Basic (`Public Overridable`). To avoid declaring the member as `virtual` or `overridable`, set both the Public and Final flags in the property. See the property for more information on setting member attributes.
-
+> There is no `Virtual` member attribute. A member is declared virtual by setting its member access to Public (`property1.Attributes = MemberAttributes.Public`) without specifying it as Final. The absence of the Final flag makes a member `virtual` in C# (`public virtual`), `overridable` in Visual Basic (`Public Overridable`). To avoid declaring the member as `virtual` or `overridable`, set both the Public and Final flags in the property. See the property for more information on setting member attributes.
+
> [!NOTE]
-> The pattern for setting the access flags (flags containing the terms `Public`, `Private`, `Assembly`, or `Family`) is to mask out all access flags using the AccessMask mask and then set the desired access flag. For example, the code statement to identify a constructor (named `constructor1`) as public is `constructor1.Attributes = (constructor1.Attributes & ~MemberAttributes.AccessMask) | MemberAttributes.Public;`. Setting the property directly to an access flag (for example, `constructor1.Attributes = MemberAttributes.Public;`) erases all other flags that might be set. This pattern should also be used for setting the scope flags (Abstract, Final, Static, Override or Const) using the ScopeMask mask.
-
-
-
-## Examples
- The following example code demonstrates use of a to define a `string` property with `get` and `set` accessors.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CodeMemberPropertyExample/CPP/codememberpropertyexample.cpp" id="Snippet3":::
+> The pattern for setting the access flags (flags containing the terms `Public`, `Private`, `Assembly`, or `Family`) is to mask out all access flags using the AccessMask mask and then set the desired access flag. For example, the code statement to identify a constructor (named `constructor1`) as public is `constructor1.Attributes = (constructor1.Attributes & ~MemberAttributes.AccessMask) | MemberAttributes.Public;`. Setting the property directly to an access flag (for example, `constructor1.Attributes = MemberAttributes.Public;`) erases all other flags that might be set. This pattern should also be used for setting the scope flags (Abstract, Final, Static, Override or Const) using the ScopeMask mask.
+
+
+
+## Examples
+ The following example code demonstrates use of a to define a `string` property with `get` and `set` accessors.
+
:::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeMemberProperty/Overview/codememberpropertyexample.cs" id="Snippet3":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeMemberPropertyExample/VB/codememberpropertyexample.vb" id="Snippet3":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CodeMemberPropertyExample/VB/codememberpropertyexample.vb" id="Snippet3":::
+
]]>