Skip to content

Commit 684a2c8

Browse files
committed
domain rebrand
1 parent ab8ec7a commit 684a2c8

File tree

7 files changed

+89
-89
lines changed

7 files changed

+89
-89
lines changed

Mdoc-ReleaseCheckCI.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pr:
99

1010
# Variable 'needRunReleaseMdoc' was defined in the Variables tab
1111
# Variable 'params' was defined in the Variables tab
12-
# Agent Queue 'Azure Pipelines' was used with unrecognized Agent Specification, vmImage property must be specified to determine image - https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops&tabs=yaml#software
12+
# Agent Queue 'Azure Pipelines' was used with unrecognized Agent Specification, vmImage property must be specified to determine image - https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops&tabs=yaml#software
1313
variables:
1414
solution: 'apidoctools.sln'
1515
buildConfiguration: 'Release'

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# `mdoc`
22

33
This repository contains the source for the .NET API Reference toolchain ([used
4-
by docs.microsoft.com](https://docs.microsoft.com/en-us/teamblog/announcing-unified-dotnet-experience-on-docs#built-with-open-source-in-mind))
4+
by learn.microsoft.com](https://learn.microsoft.com/en-us/teamblog/announcing-unified-dotnet-experience-on-docs#built-with-open-source-in-mind))
55

66
## Contribution Guide
77

azure-pipelines.lgtm.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# ASP.NET Core (.NET Framework)
22
# Build and test ASP.NET Core projects targeting the full .NET Framework.
33
# Add steps that publish symbols, save build artifacts, and more:
4-
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core
4+
# https://learn.microsoft.com/azure/devops/pipelines/languages/dotnet-core
55

66
pr: none
77
trigger: none

azure-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# ASP.NET Core (.NET Framework)
22
# Build and test ASP.NET Core projects targeting the full .NET Framework.
33
# Add steps that publish symbols, save build artifacts, and more:
4-
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core
4+
# https://learn.microsoft.com/azure/devops/pipelines/languages/dotnet-core
55

66
trigger:
77
- '*'

mdoc/Mono.Documentation/Util/AttachedEntitiesHelper.cs

Lines changed: 83 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using System.Linq;
44
using Mono.Cecil;
@@ -55,7 +55,7 @@ private static IEnumerable<AttachedEventReference> GetAttachedEvents(TypeDefinit
5555

5656
private static bool IsAttachedEvent(FieldDefinition field, Dictionary<string, IEnumerable<MethodDefinition>> methods)
5757
{
58-
// https://docs.microsoft.com/en-us/dotnet/framework/wpf/advanced/attached-events-overview
58+
// https://learn.microsoft.com/en-us/dotnet/framework/wpf/advanced/attached-events-overview
5959
if (!field.Name.EndsWith(EventConst))
6060
return false;
6161
var addMethodName = $"Add{GetEventName(field.Name)}Handler";
@@ -92,11 +92,11 @@ private static bool AreAttachedEventMethodParameters(Collection<ParameterDefinit
9292
return false;
9393
return
9494
// The first parameter is DependencyObject
95-
(IsAssignableTo(parameters[0].ParameterType, Consts.DependencyObjectFullName) ||
96-
IsAssignableTo(parameters[0].ParameterType, Consts.DependencyObjectFullNameWinRT) ||
97-
IsAssignableTo(parameters[0].ParameterType, Consts.DependencyObjectFullNameWinUI))
98-
99-
// The second parameter is the handler to add/remove
95+
(IsAssignableTo(parameters[0].ParameterType, Consts.DependencyObjectFullName) ||
96+
IsAssignableTo(parameters[0].ParameterType, Consts.DependencyObjectFullNameWinRT) ||
97+
IsAssignableTo(parameters[0].ParameterType, Consts.DependencyObjectFullNameWinUI))
98+
99+
// The second parameter is the handler to add/remove
100100
&& IsAttachedEventHandler(parameters[1].ParameterType);
101101
}
102102

@@ -119,18 +119,18 @@ private static IEnumerable<AttachedPropertyReference> GetAttachedProperties(Type
119119
yield return new AttachedPropertyReference(field);
120120
}
121121

122-
foreach (var property in type.Properties.Where(t => t.PropertyType.FullName == Consts.DependencyPropertyFullName
123-
|| t.PropertyType.FullName == Consts.DependencyPropertyFullNameWindowsXaml
124-
|| t.PropertyType.FullName == Consts.DependencyPropertyFullNameMicrosoftXaml))
125-
{
126-
if (IsAttachedProperty(property, methods))
127-
yield return new AttachedPropertyReference(property);
122+
foreach (var property in type.Properties.Where(t => t.PropertyType.FullName == Consts.DependencyPropertyFullName
123+
|| t.PropertyType.FullName == Consts.DependencyPropertyFullNameWindowsXaml
124+
|| t.PropertyType.FullName == Consts.DependencyPropertyFullNameMicrosoftXaml))
125+
{
126+
if (IsAttachedProperty(property, methods))
127+
yield return new AttachedPropertyReference(property);
128128
}
129129
}
130130

131131
private static bool IsAttachedProperty(FieldDefinition field, Dictionary<string, IEnumerable<MethodDefinition>> methods)
132132
{
133-
// https://docs.microsoft.com/en-us/dotnet/framework/wpf/advanced/attached-properties-overview
133+
// https://learn.microsoft.com/en-us/dotnet/framework/wpf/advanced/attached-properties-overview
134134
// https://github.com/mono/api-doc-tools/issues/63#issuecomment-328995418
135135
if (!field.Name.EndsWith(PropertyConst, StringComparison.Ordinal))
136136
return false;
@@ -155,30 +155,30 @@ private static bool IsAttachedProperty(FieldDefinition field, Dictionary<string,
155155
&& ((methods.ContainsKey(getMethodName) && methods[getMethodName].Any(IsAttachedPropertyGetMethod))
156156
|| (methods.ContainsKey(setMethodName) && methods[setMethodName].Any(IsAttachedPropertySetMethod)));
157157

158-
}
159-
158+
}
159+
160160
private static bool IsAttachedProperty(PropertyDefinition property, Dictionary<string, IEnumerable<MethodDefinition>> methods)
161-
{
162-
161+
{
162+
163163
if (!property.Name.EndsWith(PropertyConst, StringComparison.Ordinal))
164164
return false;
165-
var propertyName = GetPropertyName(property.Name);
165+
var propertyName = GetPropertyName(property.Name);
166166
var getMethodName = $"Get{propertyName}";
167167
var setMethodName = $"Set{propertyName}";
168168

169169
var hasExistingProperty = property?.DeclaringType?.Properties.Any(p => p.Name.Equals(propertyName, StringComparison.Ordinal) && GetCheckVisible(p.Resolve()));
170170
var hasExistingField = property?.DeclaringType?.Fields.Any(f => f.Name.Equals(propertyName, StringComparison.Ordinal) && GetCheckVisible(f.Resolve()));
171171

172-
return !hasExistingProperty.IsTrue() && !hasExistingField.IsTrue() &&
173-
// Class X has a static field of type DependencyProperty [Name]Property
174-
(property.PropertyType.FullName == Consts.DependencyPropertyFullName || property.PropertyType.FullName == Consts.DependencyPropertyFullNameWindowsXaml
175-
|| property.PropertyType.FullName == Consts.DependencyPropertyFullNameMicrosoftXaml)
176-
177-
178-
// Class X also has static methods with the following names: Get[Name] or Set[Name]
172+
return !hasExistingProperty.IsTrue() && !hasExistingField.IsTrue() &&
173+
// Class X has a static field of type DependencyProperty [Name]Property
174+
(property.PropertyType.FullName == Consts.DependencyPropertyFullName || property.PropertyType.FullName == Consts.DependencyPropertyFullNameWindowsXaml
175+
|| property.PropertyType.FullName == Consts.DependencyPropertyFullNameMicrosoftXaml)
176+
177+
178+
// Class X also has static methods with the following names: Get[Name] or Set[Name]
179179
&& ((methods.ContainsKey(getMethodName) && methods[getMethodName].Any(IsAttachedPropertyGetMethod))
180-
|| (methods.ContainsKey(setMethodName) && methods[setMethodName].Any(IsAttachedPropertySetMethod)));
181-
180+
|| (methods.ContainsKey(setMethodName) && methods[setMethodName].Any(IsAttachedPropertySetMethod)));
181+
182182
}
183183

184184
private static bool IsAttachedPropertyGetMethod(MethodDefinition method)
@@ -190,7 +190,7 @@ private static bool IsAttachedPropertyGetMethod(MethodDefinition method)
190190

191191
// The Get method takes one argument of type DependencyObject(or something IsAssignableTo(DependencyObject),
192192
&& (IsAssignableTo(method.Parameters[0].ParameterType, Consts.DependencyObjectFullName) ||
193-
IsAssignableTo(method.Parameters[0].ParameterType, Consts.DependencyObjectFullNameWinRT) ||
193+
IsAssignableTo(method.Parameters[0].ParameterType, Consts.DependencyObjectFullNameWinRT) ||
194194
IsAssignableTo(method.Parameters[0].ParameterType, Consts.DependencyObjectFullNameWinUI));
195195
}
196196

@@ -200,15 +200,15 @@ private static bool IsAttachedPropertySetMethod(MethodDefinition method)
200200

201201
// The first has type DependencyObject(or IsAssignableTo…),
202202
&& (IsAssignableTo(method.Parameters[0].ParameterType, Consts.DependencyObjectFullName) ||
203-
IsAssignableTo(method.Parameters[0].ParameterType, Consts.DependencyObjectFullNameWinRT) ||
204-
IsAssignableTo(method.Parameters[0].ParameterType, Consts.DependencyObjectFullNameWinUI) ||
203+
IsAssignableTo(method.Parameters[0].ParameterType, Consts.DependencyObjectFullNameWinRT) ||
204+
IsAssignableTo(method.Parameters[0].ParameterType, Consts.DependencyObjectFullNameWinUI) ||
205205
IsAssignableTo(method.Parameters[0].ParameterType, Consts.DependencyPropertyFullNameIInputElement) ||
206206
IsAssignableTo(method.Parameters[0].ParameterType, Consts.DependencyPropertyFullNameObject))
207-
208-
// the second has type dp.PropertyType (or IsAssignableTo…).
209-
// && IsAssignableTo(method.Parameters[1].ParameterType, "")
210-
211-
// It returns void.
207+
208+
// the second has type dp.PropertyType (or IsAssignableTo…).
209+
// && IsAssignableTo(method.Parameters[1].ParameterType, "")
210+
211+
// It returns void.
212212
&& method.ReturnType.FullName == Consts.VoidFullName;
213213
}
214214
#endregion
@@ -222,58 +222,58 @@ private static bool IsAssignableTo(TypeReference type, string targetTypeName)
222222
return type.FullName == targetTypeName;
223223

224224
return type.FullName == targetTypeName || IsAssignableTo(typeDefenition.BaseType, targetTypeName);
225-
}
226-
227-
private static bool GetCheckVisible(IMemberDefinition member)
228-
{
229-
if (member == null)
230-
throw new ArgumentNullException("member");
231-
PropertyDefinition prop = member as PropertyDefinition;
232-
if (prop != null)
233-
return ChkPropertyVisible(prop);
234-
FieldDefinition field = member as FieldDefinition;
235-
if (field != null)
236-
return ChkFieldVisible(field);
237-
return false;
238-
}
239-
225+
}
226+
227+
private static bool GetCheckVisible(IMemberDefinition member)
228+
{
229+
if (member == null)
230+
throw new ArgumentNullException("member");
231+
PropertyDefinition prop = member as PropertyDefinition;
232+
if (prop != null)
233+
return ChkPropertyVisible(prop);
234+
FieldDefinition field = member as FieldDefinition;
235+
if (field != null)
236+
return ChkFieldVisible(field);
237+
return false;
238+
}
239+
240240
private static bool ChkPropertyVisible(PropertyDefinition property)
241-
{
242-
MethodDefinition method;
243-
bool get_visible = false;
244-
bool set_visible = false;
245-
246-
if ((method = property.GetMethod) != null &&
247-
(DocUtils.IsExplicitlyImplemented(method) ||
248-
(!method.IsPrivate && !method.IsAssembly && !method.IsFamilyAndAssembly)))
249-
get_visible = true;
250-
251-
if ((method = property.SetMethod) != null &&
252-
(DocUtils.IsExplicitlyImplemented(method) ||
253-
(!method.IsPrivate && !method.IsAssembly && !method.IsFamilyAndAssembly)))
254-
set_visible = true;
255-
256-
if ((set_visible == false) && (get_visible == false))
257-
return false;
258-
else
259-
return true;
241+
{
242+
MethodDefinition method;
243+
bool get_visible = false;
244+
bool set_visible = false;
245+
246+
if ((method = property.GetMethod) != null &&
247+
(DocUtils.IsExplicitlyImplemented(method) ||
248+
(!method.IsPrivate && !method.IsAssembly && !method.IsFamilyAndAssembly)))
249+
get_visible = true;
250+
251+
if ((method = property.SetMethod) != null &&
252+
(DocUtils.IsExplicitlyImplemented(method) ||
253+
(!method.IsPrivate && !method.IsAssembly && !method.IsFamilyAndAssembly)))
254+
set_visible = true;
255+
256+
if ((set_visible == false) && (get_visible == false))
257+
return false;
258+
else
259+
return true;
260260
}
261261

262262
private static bool ChkFieldVisible(FieldDefinition field)
263-
{
264-
TypeDefinition declType = (TypeDefinition)field.DeclaringType;
265-
266-
if (declType.IsEnum && field.Name == "value__")
267-
return false; // This member of enums aren't documented.
268-
269-
return field.IsPublic || field.IsFamily || field.IsFamilyOrAssembly;
270-
263+
{
264+
TypeDefinition declType = (TypeDefinition)field.DeclaringType;
265+
266+
if (declType.IsEnum && field.Name == "value__")
267+
return false; // This member of enums aren't documented.
268+
269+
return field.IsPublic || field.IsFamily || field.IsFamilyOrAssembly;
270+
271271
}
272272

273-
}
274-
internal static class NBoolExtensions
275-
{
276-
public static bool IsTrue (this Nullable<bool> value) =>
277-
value.HasValue && value.Value;
273+
}
274+
internal static class NBoolExtensions
275+
{
276+
public static bool IsTrue (this Nullable<bool> value) =>
277+
value.HasValue && value.Value;
278278
}
279279
}

mdoc/Test/AttachedEventsAndProperties/AttachedEventExample.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public static void RemoveDragOverHandler(DependencyObject element, DragEventHand
1717
}
1818
#endregion
1919

20-
#region docs.microsoft.com example
20+
#region learn.microsoft.com example
2121
public static readonly RoutedEvent NeedsCleaningEvent;
2222
public static void AddNeedsCleaningHandler(DependencyObject d, RoutedEventHandler handler)
2323
{

mdoc/Test/AttachedEventsAndProperties/AttachedPropertyExample.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace AttachedEventsAndProperties
55
{
66
public static class AttachedPropertyExample
77
{
8-
#region modified docs.microsoft.com example
8+
#region modified learn.microsoft.com example
99

1010
public static readonly DependencyProperty IsBubbleSourceProperty = DependencyProperty.RegisterAttached(
1111
"IsBubbleSource",

0 commit comments

Comments
 (0)