Skip to content

Commit e7251d9

Browse files
authored
Add files that didn't copy because of script err (#3999)
* Add files that didn't copy because of script err * Fixed gitignore setting; added items now picked up by git * Added missing files from snippets * little change to force rebuild
1 parent 1d52226 commit e7251d9

File tree

127 files changed

+6381
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+6381
-2
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ samples/WebApplication1/src/WebApplication1/wwwroot/lib/
211211

212212
_site/
213213
api_src/
214-
api/
214+
/api/
215215
_themes/
216216
_themes.pdf/
217217
_csharplang/

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
This repo contains documentation for the .NET API Reference.
44

55
The main repository for .NET documentation is the [.NET Docs repository](https://github.com/dotnet/docs). See the [Contributing Guide](https://github.com/dotnet/docs/blob/master/CONTRIBUTING.md) for information on updating .NET API reference documentation.
6-
We are tracking all work for this repository using [GitHub issues](https://github.com/dotnet/dotnet-api-docs/issues). The documentation for APIs is built from the text in this repo, and the samples in the [dotnet/samples](https://github.com/dotnet/samples) repository. You can select the [Repo - samples](https://github.com/dotnet/docs/issues?q=is%3Aopen+is%3Aissue+label%3A%22%3Afile_folder%3A+Repo+-+samples%22) label to see issues that concern sample code.
6+
We're tracking all work for this repository using [GitHub issues](https://github.com/dotnet/dotnet-api-docs/issues). The documentation for APIs is built from the text in this repo, and the samples in the [dotnet/samples](https://github.com/dotnet/samples) repository. You can select the [Repo - samples](https://github.com/dotnet/docs/issues?q=is%3Aopen+is%3Aissue+label%3A%22%3Afile_folder%3A+Repo+-+samples%22) label to see issues that concern sample code.
77

88
This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community. For more information, see the [.NET Foundation Code of Conduct](https://dotnetfoundation.org/code-of-conduct).
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
2+
// <snippet23>
3+
using namespace System;
4+
int main()
5+
{
6+
char chA = 'A';
7+
char ch1 = '1';
8+
String^ str = "test string";
9+
Console::WriteLine( chA.CompareTo( 'B' ) ); // Output: "-1" (meaning 'A' is 1 less than 'B')
10+
Console::WriteLine( chA.Equals( 'A' ) ); // Output: "True"
11+
Console::WriteLine( Char::GetNumericValue( ch1 ) ); // Output: "1"
12+
Console::WriteLine( Char::IsControl( '\t' ) ); // Output: "True"
13+
Console::WriteLine( Char::IsDigit( ch1 ) ); // Output: "True"
14+
Console::WriteLine( Char::IsLetter( ',' ) ); // Output: "False"
15+
Console::WriteLine( Char::IsLower( 'u' ) ); // Output: "True"
16+
Console::WriteLine( Char::IsNumber( ch1 ) ); // Output: "True"
17+
Console::WriteLine( Char::IsPunctuation( '.' ) ); // Output: "True"
18+
Console::WriteLine( Char::IsSeparator( str, 4 ) ); // Output: "True"
19+
Console::WriteLine( Char::IsSymbol( '+' ) ); // Output: "True"
20+
Console::WriteLine( Char::IsWhiteSpace( str, 4 ) ); // Output: "True"
21+
Console::WriteLine( Char::Parse( "S" ) ); // Output: "S"
22+
Console::WriteLine( Char::ToLower( 'M' ) ); // Output: "m"
23+
Console::WriteLine( 'x' ); // Output: "x"
24+
}
25+
26+
// </snippet23>
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<!-- <Snippet1> -->
2+
<%@ Page Language="C#" %>
3+
<%@ Import Namespace="System.Web.Script.Serialization" %>
4+
<%@ Import Namespace="System.Web.Script.Serialization.TypeResolver.CS" %>
5+
6+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
7+
8+
<script runat="server">
9+
10+
protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e)
11+
{
12+
13+
ColorType customObject = new ColorType();
14+
JavaScriptSerializer serializer;
15+
16+
switch(((RadioButtonList)sender).SelectedIndex)
17+
{
18+
case 0:
19+
serializer = new JavaScriptSerializer();
20+
Label1.Text = serializer.Serialize(customObject);
21+
break;
22+
case 1:
23+
serializer = new JavaScriptSerializer(new SimpleTypeResolver());
24+
Label1.Text = serializer.Serialize(customObject);
25+
break;
26+
case 2:
27+
serializer = new JavaScriptSerializer(new CustomTypeResolver());
28+
Label1.Text = serializer.Serialize(customObject);
29+
break;
30+
}
31+
}
32+
</script>
33+
34+
<html xmlns="http://www.w3.org/1999/xhtml" >
35+
<head runat="server">
36+
<title>Type Resolvers</title>
37+
<style type="text/css">
38+
body { font: 10pt Trebuchet MS;
39+
font-color: #000000;
40+
}
41+
42+
.text { font: 8pt Trebuchet MS }
43+
</style>
44+
</head>
45+
<body>
46+
<form id="form1" runat="server">
47+
<div>
48+
Select one of the following serialization types:
49+
<asp:RadioButtonList ID="RadioButtonList1" runat="server" OnSelectedIndexChanged="RadioButtonList1_SelectedIndexChanged" AutoPostBack="True">
50+
<asp:ListItem Value="0">Serialization with no type resolver</asp:ListItem>
51+
<asp:ListItem Value="1">Serialization with the SimpleTypeResolver class</asp:ListItem>
52+
<asp:ListItem Value="2">Serialization with a custom type resolver</asp:ListItem>
53+
</asp:RadioButtonList>
54+
<br />
55+
Note the different resulting serialized strings. The ones that use type resolvers have an extra __type tag.
56+
<hr />
57+
Results:
58+
<table border="0" cellpadding="0" cellspacing="0" width="100%">
59+
<tr>
60+
<td>
61+
<asp:Label ID="Label1" runat="server" ></asp:Label><br />
62+
</td>
63+
</tr>
64+
</table>
65+
<br />
66+
&nbsp;</div>
67+
</form>
68+
</body>
69+
</html>
70+
<!-- </Snippet1> -->
Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
<!-- <Snippet4> -->
2+
<%@ Page Language="C#" %>
3+
<%@ Import Namespace="System.Web.Script.Serialization" %>
4+
5+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
6+
7+
<script runat="server">
8+
9+
JavaScriptSerializer serializer;
10+
protected void Page_Load(object sender, EventArgs e)
11+
{
12+
//<Snippet1>
13+
serializer = new JavaScriptSerializer();
14+
15+
// Register the custom converter.
16+
serializer.RegisterConverters(new JavaScriptConverter[] {
17+
new System.Web.Script.Serialization.CS.ListItemCollectionConverter() });
18+
//</Snippet1>
19+
this.SetFocus(TextBox1);
20+
}
21+
22+
protected void saveButton_Click(object sender, EventArgs e)
23+
{
24+
// Save the current state of the ListBox control.
25+
SavedState.Text = serializer.Serialize(ListBox1.Items);
26+
recoverButton.Enabled = true;
27+
Message.Text = "State saved";
28+
}
29+
30+
protected void recoverButton_Click(object sender, EventArgs e)
31+
{
32+
//Recover the saved items of the ListBox control.
33+
ListItemCollection recoveredList = serializer.Deserialize<ListItemCollection>(SavedState.Text);
34+
ListItem[] newListItemArray = new ListItem[recoveredList.Count];
35+
recoveredList.CopyTo(newListItemArray, 0);
36+
ListBox1.Items.Clear();
37+
ListBox1.Items.AddRange(newListItemArray);
38+
Message.Text = "Last saved state recovered.";
39+
}
40+
41+
protected void clearButton_Click(object sender, EventArgs e)
42+
{
43+
// Remove all items from the ListBox control.
44+
ListBox1.Items.Clear();
45+
Message.Text = "All items removed";
46+
}
47+
48+
protected void ContactsGrid_SelectedIndexChanged(object sender, EventArgs e)
49+
{
50+
// Get the currently selected row using the SelectedRow property.
51+
GridViewRow row = ContactsGrid.SelectedRow;
52+
53+
// Get the ID of item selected.
54+
string itemId = ContactsGrid.DataKeys[row.RowIndex].Value.ToString();
55+
ListItem newItem = new ListItem(row.Cells[4].Text, itemId);
56+
57+
// Check if the item already exists in the ListBox control.
58+
if (!ListBox1.Items.Contains(newItem))
59+
{
60+
// Add the item to the ListBox control.
61+
ListBox1.Items.Add(newItem);
62+
Message.Text = "Item added";
63+
}
64+
else
65+
Message.Text = "Item already exists";
66+
}
67+
68+
protected void ContactsGrid_PageIndexChanged(object sender, EventArgs e)
69+
{
70+
//Reset the selected index.
71+
ContactsGrid.SelectedIndex = -1;
72+
}
73+
74+
protected void searchButton_Click(object sender, EventArgs e)
75+
{
76+
//Reset indexes.
77+
ContactsGrid.SelectedIndex = -1;
78+
ContactsGrid.PageIndex = 0;
79+
80+
//Set focus on the TextBox control.
81+
ScriptManager1.SetFocus(TextBox1);
82+
}
83+
84+
protected void CheckBox1_CheckedChanged(object sender, EventArgs e)
85+
{
86+
// Show/hide the saved state string.
87+
SavedState.Visible = CheckBox1.Checked;
88+
StateLabel.Visible = CheckBox1.Checked;
89+
}
90+
</script>
91+
92+
<html xmlns="http://www.w3.org/1999/xhtml" >
93+
<head runat="server">
94+
<title>Save/Recover state</title>
95+
<style type="text/css">
96+
body { font: 11pt Trebuchet MS;
97+
font-color: #000000;
98+
padding-top: 72px;
99+
text-align: center }
100+
101+
.text { font: 8pt Trebuchet MS }
102+
</style>
103+
</head>
104+
<body>
105+
<form id="form1" runat="server" defaultbutton="searchButton" defaultfocus="TextBox1">
106+
<h3>
107+
<span style="text-decoration: underline">
108+
Contacts Selection</span><br />
109+
</h3>
110+
<asp:ScriptManager runat="server" ID="ScriptManager1" />
111+
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
112+
<ContentTemplate>
113+
Type contact's first name:
114+
<asp:TextBox ID="TextBox1" runat="server" />
115+
<asp:Button ID="searchButton" runat="server" Text="Search" OnClick="searchButton_Click" />&nbsp;
116+
<br />
117+
<br />
118+
<table border="0" width="100%">
119+
<tr>
120+
<td style="width:50%" valign="top" align="center">
121+
<b>Search results:</b><br />
122+
<asp:GridView ID="ContactsGrid" runat="server" AutoGenerateColumns="False"
123+
CellPadding="4" DataKeyNames="ContactID" DataSourceID="SqlDataSource1"
124+
OnSelectedIndexChanged="ContactsGrid_SelectedIndexChanged" ForeColor="#333333" GridLines="None" AllowPaging="True" PageSize="7" OnPageIndexChanged="ContactsGrid_PageIndexChanged">
125+
<Columns>
126+
<asp:CommandField ShowSelectButton="True" ButtonType="Button" />
127+
<asp:BoundField DataField="ContactID" HeaderText="ContactID" SortExpression="ContactID" Visible="False" />
128+
<asp:BoundField DataField="FirstName" HeaderText="FirstName" SortExpression="FirstName" />
129+
<asp:BoundField DataField="LastName" HeaderText="LastName" SortExpression="LastName" />
130+
<asp:BoundField DataField="EmailAddress" HeaderText="EmailAddress" SortExpression="EmailAddress" />
131+
</Columns>
132+
<RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
133+
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
134+
<AlternatingRowStyle BackColor="White" ForeColor="#284775" />
135+
<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
136+
<EditRowStyle BackColor="#999999" />
137+
<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
138+
<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
139+
<EmptyDataTemplate>No data found.</EmptyDataTemplate>
140+
</asp:GridView>
141+
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:AdventureWorksConnectionString %>"
142+
SelectCommand="SELECT ContactID, FirstName, LastName, EmailAddress FROM Person.Contact WHERE (UPPER(FirstName) = UPPER(@FIRSTNAME))" >
143+
<SelectParameters>
144+
<asp:ControlParameter Name="FIRSTNAME" ControlId="TextBox1" Type="String" />
145+
</SelectParameters>
146+
</asp:SqlDataSource>
147+
</td>
148+
<td valign="top">
149+
<b>Contacts list:</b><br />
150+
<asp:ListBox ID="ListBox1" runat="server" Height="200px" Width="214px" /><br />
151+
<asp:Button ID="saveButton" runat="server" Text="Save state" OnClick="saveButton_Click" ToolTip="Save the current state of the list" />
152+
<asp:Button ID="recoverButton" runat="server" Text="Recover saved state" OnClick="recoverButton_Click" Enabled="false" ToolTip="Recover the last saved state" />
153+
<asp:Button ID="clearButton" runat="server" Text="Clear" OnClick="clearButton_Click" ToolTip="Remove all items from the list" /><br />
154+
<br />
155+
<asp:CheckBox ID="CheckBox1" runat="server" Checked="True" OnCheckedChanged="CheckBox1_CheckedChanged"
156+
Text="Show saved state" AutoPostBack="True" /></td>
157+
</tr>
158+
<tr>
159+
<td colspan="2">
160+
<br />
161+
<br />
162+
&nbsp;&nbsp;
163+
<hr />
164+
Message: <asp:Label ID="Message" runat="server" ForeColor="SteelBlue" />&nbsp;&nbsp;<br />
165+
<asp:Label ID="StateLabel" runat="server" Text="State:"></asp:Label>
166+
<asp:Label ID="SavedState" runat="server"/><br />
167+
</td>
168+
</tr>
169+
</table>
170+
</ContentTemplate>
171+
</asp:UpdatePanel>
172+
<asp:UpdateProgress ID="UpdateProgress1" runat="server">
173+
<ProgressTemplate>
174+
<asp:Image ID="Image1" runat="server" ImageUrl="..\images\spinner.gif" />&nbsp;Processing...
175+
</ProgressTemplate>
176+
</asp:UpdateProgress>
177+
</form>
178+
</body>
179+
</html>
180+
<!-- </Snippet4> -->
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<!-- <Snippet1> -->
2+
<%@ Page Language="C#" %>
3+
<%@ Register Namespace="SamplesCS" TagPrefix="Samples" %>
4+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
5+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
6+
7+
<html xmlns="http://www.w3.org/1999/xhtml" >
8+
<head runat="server">
9+
<title>CreateContentTemplateContainer Example</title>
10+
</head>
11+
<body>
12+
<form id="form1" runat="server">
13+
<div>
14+
<asp:ScriptManager ID="ScriptManager1"
15+
runat="server" />
16+
<Samples:CustomUpdatePanel ID="UpdatePanel1"
17+
UpdateMode="Conditional"
18+
GroupingText="This is an UpdatePanel."
19+
runat="server">
20+
<ContentTemplate>
21+
<asp:Calendar ID="Calendar1"
22+
runat="server" />
23+
</ContentTemplate>
24+
</Samples:CustomUpdatePanel>
25+
</div>
26+
</form>
27+
</body>
28+
</html>
29+
<!-- </Snippet1> -->
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// <snippet23>
2+
using System;
3+
4+
public class CharStructureSample
5+
{
6+
public static void Main()
7+
{
8+
char chA = 'A';
9+
char ch1 = '1';
10+
string str = "test string";
11+
12+
Console.WriteLine(chA.CompareTo('B')); //----------- Output: "-1" (meaning 'A' is 1 less than 'B')
13+
Console.WriteLine(chA.Equals('A')); //----------- Output: "True"
14+
Console.WriteLine(Char.GetNumericValue(ch1)); //----------- Output: "1"
15+
Console.WriteLine(Char.IsControl('\t')); //----------- Output: "True"
16+
Console.WriteLine(Char.IsDigit(ch1)); //----------- Output: "True"
17+
Console.WriteLine(Char.IsLetter(',')); //----------- Output: "False"
18+
Console.WriteLine(Char.IsLower('u')); //----------- Output: "True"
19+
Console.WriteLine(Char.IsNumber(ch1)); //----------- Output: "True"
20+
Console.WriteLine(Char.IsPunctuation('.')); //----------- Output: "True"
21+
Console.WriteLine(Char.IsSeparator(str, 4)); //----------- Output: "True"
22+
Console.WriteLine(Char.IsSymbol('+')); //----------- Output: "True"
23+
Console.WriteLine(Char.IsWhiteSpace(str, 4)); //----------- Output: "True"
24+
Console.WriteLine(Char.Parse("S")); //----------- Output: "S"
25+
Console.WriteLine(Char.ToLower('M')); //----------- Output: "m"
26+
Console.WriteLine('x'.ToString()); //----------- Output: "x"
27+
}
28+
}
29+
// </snippet23>

0 commit comments

Comments
 (0)