Skip to content

Commit 0a4a574

Browse files
committed
Merge branch 'main' into release-waf-modules-refresh
2 parents f73ce4c + 17ec716 commit 0a4a574

File tree

157 files changed

+3577
-146
lines changed

Some content is hidden

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

157 files changed

+3577
-146
lines changed
103 KB
Loading
Lines changed: 85 additions & 0 deletions
Loading

learn-pr/dot-net-maui/build-mobile-and-desktop-apps/includes/6-exercise-create-phone-number-translator-app.md

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -26,49 +26,49 @@ using System.Text;
2626
namespace Phoneword;
2727
public static class PhonewordTranslator
2828
{
29-
public static string? ToNumber(string raw)
30-
{
31-
if (string.IsNullOrWhiteSpace(raw))
32-
return null;
33-
34-
raw = raw.ToUpperInvariant();
35-
36-
var newNumber = new StringBuilder();
37-
foreach (var c in raw)
38-
{
39-
if (" -0123456789".Contains(c))
40-
newNumber.Append(c);
41-
else
42-
{
43-
var result = TranslateToNumber(c);
44-
if (result != null)
45-
newNumber.Append(result);
46-
// Bad character?
47-
else
48-
return null;
49-
}
50-
}
51-
return newNumber.ToString();
52-
}
53-
54-
static bool Contains(this string keyString, char c)
55-
{
56-
return keyString.IndexOf(c) >= 0;
57-
}
58-
59-
static readonly string[] digits = {
60-
"ABC", "DEF", "GHI", "JKL", "MNO", "PQRS", "TUV", "WXYZ"
61-
};
62-
63-
static int? TranslateToNumber(char c)
64-
{
65-
for (int i = 0; i < digits.Length; i++)
66-
{
67-
if (digits[i].Contains(c))
68-
return 2 + i;
69-
}
70-
return null;
71-
}
29+
public static string? ToNumber(string raw)
30+
{
31+
if (string.IsNullOrWhiteSpace(raw))
32+
return null;
33+
34+
raw = raw.ToUpperInvariant();
35+
36+
var newNumber = new StringBuilder();
37+
foreach (var c in raw)
38+
{
39+
if (" -0123456789".Contains(c))
40+
newNumber.Append(c);
41+
else
42+
{
43+
var result = TranslateToNumber(c);
44+
if (result != null)
45+
newNumber.Append(result);
46+
// Bad character?
47+
else
48+
return null;
49+
}
50+
}
51+
return newNumber.ToString();
52+
}
53+
54+
static bool Contains(this string keyString, char c)
55+
{
56+
return keyString.IndexOf(c) >= 0;
57+
}
58+
59+
static readonly string[] digits = {
60+
"ABC", "DEF", "GHI", "JKL", "MNO", "PQRS", "TUV", "WXYZ"
61+
};
62+
63+
static int? TranslateToNumber(char c)
64+
{
65+
for (int i = 0; i < digits.Length; i++)
66+
{
67+
if (digits[i].Contains(c))
68+
return 2 + i;
69+
}
70+
return null;
71+
}
7272
}
7373
```
7474

@@ -190,7 +190,7 @@ public static class PhonewordTranslator
190190
private void OnTranslate(object sender, EventArgs e)
191191
{
192192
string enteredNumber = PhoneNumberText.Text;
193-
translatedNumber = Core.PhonewordTranslator.ToNumber(enteredNumber);
193+
translatedNumber = PhonewordTranslator.ToNumber(enteredNumber);
194194

195195
if (!string.IsNullOrEmpty(translatedNumber))
196196
{
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
### YamlMime:ModuleUnit
2+
uid: learn.philanthropies.describe-best-practices-datacenter-operations.datacenter-monitoring
3+
title: Datacenter monitoring
4+
metadata:
5+
title: Datacenter monitoring
6+
description: This content is a part of the Describe the best practices for datacenter operations.
7+
ms.date: 05/07/2025
8+
author: kiranchandratrey
9+
ms.author: elenasim
10+
ms.topic: unit
11+
durationInMinutes: 3
12+
content: |
13+
[!include[](includes/1-datacenter-monitoring.md)]
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
### YamlMime:ModuleUnit
2+
uid: learn.philanthropies.describe-best-practices-datacenter-operations.summary
3+
title: Summary
4+
metadata:
5+
title: Summary
6+
description: This content is a part of the Describe the best practices for datacenter operations.
7+
ms.date: 05/07/2025
8+
author: kiranchandratrey
9+
ms.author: elenasim
10+
ms.topic: unit
11+
durationInMinutes: 4
12+
content: |
13+
[!include[](includes/10-summary.md)]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
### YamlMime:ModuleUnit
2+
uid: learn.philanthropies.describe-best-practices-datacenter-operations.key-aspects-datacenter-monitoring
3+
title: Key aspects of datacenter monitoring
4+
metadata:
5+
title: Key Aspects of Datacenter Monitoring
6+
description: This content is a part of the Describe the best practices for datacenter operations.
7+
ms.date: 05/07/2025
8+
author: kiranchandratrey
9+
ms.author: elenasim
10+
ms.topic: unit
11+
durationInMinutes: 14
12+
content: |
13+
[!include[](includes/2-key-aspects-datacenter-monitoring.md)]
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
### YamlMime:ModuleUnit
2+
uid: learn.philanthropies.describe-best-practices-datacenter-operations.datacenter-maintenance
3+
title: Datacenter maintenance
4+
metadata:
5+
title: Datacenter Maintenance
6+
description: This content is a part of the Describe the best practices for datacenter operations.
7+
ms.date: 05/07/2025
8+
author: kiranchandratrey
9+
ms.author: elenasim
10+
ms.topic: unit
11+
durationInMinutes: 3
12+
content: |
13+
[!include[](includes/3-datacenter-maintenance.md)]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
### YamlMime:ModuleUnit
2+
uid: learn.philanthropies.describe-best-practices-datacenter-operations.key-aspects-datacenter-maintenance
3+
title: Key aspects of datacenter maintenance
4+
metadata:
5+
title: Key Aspects of Datacenter Maintenance
6+
description: This content is a part of the Describe the best practices for datacenter operations.
7+
ms.date: 05/07/2025
8+
author: kiranchandratrey
9+
ms.author: elenasim
10+
ms.topic: unit
11+
durationInMinutes: 5
12+
content: |
13+
[!include[](includes/4-key-aspects-datacenter-maintenance.md)]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
### YamlMime:ModuleUnit
2+
uid: learn.philanthropies.describe-best-practices-datacenter-operations.key-aspects-datacenter-maintenance-continued
3+
title: Key aspects of datacenter maintenance - continued
4+
metadata:
5+
title: Key Aspects of Datacenter Maintenance - continued
6+
description: This content is a part of the Describe the best practices for datacenter operations.
7+
ms.date: 05/07/2025
8+
author: kiranchandratrey
9+
ms.author: elenasim
10+
ms.topic: unit
11+
durationInMinutes: 3
12+
content: |
13+
[!include[](includes/5-key-aspects-datacenter-maintenance-continued.md)]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
### YamlMime:ModuleUnit
2+
uid: learn.philanthropies.describe-best-practices-datacenter-operations.reliability-resiliency-datacenters
3+
title: Reliability and resiliency in datacenters
4+
metadata:
5+
title: Reliability and Resiliency in Datacenters
6+
description: This content is a part of the Describe the best practices for datacenter operations.
7+
ms.date: 05/07/2025
8+
author: kiranchandratrey
9+
ms.author: elenasim
10+
ms.topic: unit
11+
durationInMinutes: 4
12+
content: |
13+
[!include[](includes/6-reliability-resiliency-datacenters.md)]

0 commit comments

Comments
 (0)