Skip to content

fix some spelling #3409

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace Microsoft.Toolkit.Parsers.Markdown.Inlines
public partial class EmojiInline
{
// Codes taken from https://gist.github.com/rxaviers/7360908
// Ignoring not implented symbols in Segoe UI Emoji font (e.g. :bowtie:)
// Ignoring not implemented symbols in Segoe UI Emoji font (e.g. :bowtie:)
private static readonly Dictionary<string, int> _emojiCodesDictionary = new Dictionary<string, int>
{
{ "smile", 0x1f604 },
Expand Down
4 changes: 2 additions & 2 deletions Microsoft.Toolkit.Parsers/Markdown/Inlines/HyperlinkInline.cs
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ internal static InlineParseResult ParseEmailAddress(string markdown, int minStar
// reddit (for example: '$' and '!').

// Special characters as per https://en.wikipedia.org/wiki/Email_address#Local-part allowed
char[] allowedchars = new char[] { '!', '#', '$', '%', '&', '\'', '*', '+', '-', '/', '=', '?', '^', '_', '`', '{', '|', '}', '~' };
char[] allowedChars = { '!', '#', '$', '%', '&', '\'', '*', '+', '-', '/', '=', '?', '^', '_', '`', '{', '|', '}', '~' };

int start = tripPos;
while (start > minStart)
Expand All @@ -334,7 +334,7 @@ internal static InlineParseResult ParseEmailAddress(string markdown, int minStar
if ((c < 'a' || c > 'z') &&
(c < 'A' || c > 'Z') &&
(c < '0' || c > '9') &&
!allowedchars.Contains(c))
!allowedChars.Contains(c))
{
break;
}
Expand Down
8 changes: 4 additions & 4 deletions Microsoft.Toolkit.Parsers/Markdown/Inlines/ImageInline.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ internal static InlineParseResult Parse(string markdown, int start, int end)

if (pos < end && markdown[pos] == '[')
{
int refstart = pos;
int refStart = pos;

// Find the reference ']' character
while (pos < end)
Expand All @@ -131,7 +131,7 @@ internal static InlineParseResult Parse(string markdown, int start, int end)
pos++;
}

reference = markdown.Substring(refstart + 1, pos - refstart - 1);
reference = markdown.Substring(refStart + 1, pos - refStart - 1);
}
else if (pos < end && markdown[pos] == '(')
{
Expand All @@ -156,10 +156,10 @@ internal static InlineParseResult Parse(string markdown, int start, int end)
if (imageDimensionsPos > 0)
{
// trying to find 'x' which separates image width and height
var dimensionsSepatorPos = markdown.IndexOf("x", imageDimensionsPos + 2, pos - imageDimensionsPos - 1, StringComparison.Ordinal);
var dimensionsSeparatorPos = markdown.IndexOf("x", imageDimensionsPos + 2, pos - imageDimensionsPos - 1, StringComparison.Ordinal);

// didn't find separator, trying to parse value as imageWidth
if (dimensionsSepatorPos == -1)
if (dimensionsSeparatorPos == -1)
{
var imageWidthStr = markdown.Substring(imageDimensionsPos + 2, pos - imageDimensionsPos - 2);

Expand Down
4 changes: 2 additions & 2 deletions Microsoft.Toolkit.Parsers/Markdown/Inlines/TextRunInline.cs
Original file line number Diff line number Diff line change
Expand Up @@ -354,10 +354,10 @@ internal static TextRunInline Parse(string markdown, int start, int end)
continue;
}

// Okay, we have an entity, but is it one we recognise?
// Okay, we have an entity, but is it one we recognize?
string entityName = markdown.Substring(sequenceStartIndex + 1, semicolonIndex - (sequenceStartIndex + 1));

// Unrecognised entity.
// Unrecognized entity.
if (_entities.ContainsKey(entityName) == false)
{
continue;
Expand Down
14 changes: 7 additions & 7 deletions Microsoft.Toolkit.Parsers/Markdown/MarkdownDocument.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ internal static List<MarkdownBlock> Parse(string markdown, int start, int end, i
var paragraphText = new StringBuilder();

// These are needed to parse underline-style header blocks.
int previousRealtStartOfLine = start;
int previousRealStartOfLine = start;
int previousStartOfLine = start;
int previousEndOfLine = start;

Expand Down Expand Up @@ -160,18 +160,18 @@ internal static List<MarkdownBlock> Parse(string markdown, int start, int end, i
else
{
int lastIndentation = 0;
string lastline = null;
string lastLine = null;

// Determines how many Quote levels were in the last line.
if (realStartOfLine > 0)
{
lastline = markdown.Substring(previousRealtStartOfLine, previousEndOfLine - previousRealtStartOfLine);
lastIndentation = lastline.Count(c => c == '>');
lastLine = markdown.Substring(previousRealStartOfLine, previousEndOfLine - previousRealStartOfLine);
lastIndentation = lastLine.Count(c => c == '>');
}

var currentEndOfLine = Common.FindNextSingleNewLine(markdown, nonSpacePos, end, out _);
var currentline = markdown.Substring(realStartOfLine, currentEndOfLine - realStartOfLine);
var currentIndentation = currentline.Count(c => c == '>');
var currentLine = markdown.Substring(realStartOfLine, currentEndOfLine - realStartOfLine);
var currentIndentation = currentLine.Count(c => c == '>');
var firstChar = markdown[realStartOfLine];

// This is a quote that doesn't start with a Quote marker, but carries on from the last line.
Expand Down Expand Up @@ -364,7 +364,7 @@ internal static List<MarkdownBlock> Parse(string markdown, int start, int end, i
}

// Repeat.
previousRealtStartOfLine = realStartOfLine;
previousRealStartOfLine = realStartOfLine;
previousStartOfLine = startOfLine;
previousEndOfLine = endOfLine;
startOfLine = startOfNextLine;
Expand Down
2 changes: 1 addition & 1 deletion Microsoft.Toolkit.Parsers/Rss/AtomParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public override IEnumerable<RssSchema> LoadFeed(XDocument doc)
}

/// <summary>
/// Retieves strong type for passed item.
/// Retrieves strong type for passed item.
/// </summary>
/// <param name="item">XElement to parse.</param>
/// <returns>Strong typed object.</returns>
Expand Down
26 changes: 13 additions & 13 deletions Microsoft.Toolkit.Parsers/Rss/RssHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ internal static class RssHelper
private const string ImagePattern = @"<img.*?src=[\""'](.+?)[\""'].*?>";

/// <summary>
/// String for regular xpression for hyperlink pattern.
/// String for regular expression for hyperlink pattern.
/// </summary>
private const string HiperlinkPattern = @"<a\s+(?:[^>]*?\s+)?href=""([^ ""]*)""";
private const string HyperlinkPattern = @"<a\s+(?:[^>]*?\s+)?href=""([^ ""]*)""";

/// <summary>
/// String for regular expression for height pattern.
Expand All @@ -45,7 +45,7 @@ internal static class RssHelper
/// <summary>
/// Regular expression for hyperlink pattern.
/// </summary>
private static readonly Regex RegexLinks = new Regex(HiperlinkPattern, RegexOptions.IgnoreCase);
private static readonly Regex RegexLinks = new Regex(HyperlinkPattern, RegexOptions.IgnoreCase);

/// <summary>
/// Regular expression for height pattern.
Expand Down Expand Up @@ -82,7 +82,7 @@ public static string SanitizeString(this string text)
}

/// <summary>
/// Get item date from xelement and element name.
/// Get item date from <see cref="XElement"/> and element name.
/// </summary>
/// <param name="item">XElement item.</param>
/// <param name="elementName">Name of element.</param>
Expand All @@ -93,7 +93,7 @@ public static DateTime GetSafeElementDate(this XElement item, string elementName
}

/// <summary>
/// Get item date from xelement, element name and namespace.
/// Get item date from <see cref="XElement"/>, element name and <see cref="XNamespace"/>.
/// </summary>
/// <param name="item">XElement item.</param>
/// <param name="elementName">Name of element.</param>
Expand All @@ -117,7 +117,7 @@ public static DateTime GetSafeElementDate(this XElement item, string elementName
}

/// <summary>
/// Get item string value for xelement and element name.
/// Get item string value for <see cref="XElement"/> and element name.
/// </summary>
/// <param name="item">XElement item.</param>
/// <param name="elementName">Name of element.</param>
Expand All @@ -133,7 +133,7 @@ public static string GetSafeElementString(this XElement item, string elementName
}

/// <summary>
/// Get item string values for xelement and element name.
/// Get item string values for <see cref="XElement"/> and element name.
/// </summary>
/// <param name="item">XElement item.</param>
/// <param name="elementName">Name of the element.</param>
Expand All @@ -144,9 +144,9 @@ public static IEnumerable<string> GetSafeElementsString(this XElement item, stri
}

/// <summary>
/// Get item string values for xelement, element name and namespace.
/// Get item string values for <see cref="XElement"/>, element name and namespace.
/// </summary>
/// <param name="item">XELement item.</param>
/// <param name="item">XElement item.</param>
/// <param name="elementName">Name of element.</param>
/// <param name="xNamespace">XNamespace namespace.</param>
/// <returns>Safe list of string values.</returns>
Expand All @@ -163,7 +163,7 @@ public static IEnumerable<string> GetSafeElementsString(this XElement item, stri
}

/// <summary>
/// Get item string value for xelement, element name and namespace.
/// Get item string value for <see cref="XElement"/>, element name and namespace.
/// </summary>
/// <param name="item">XElement item.</param>
/// <param name="elementName">Name of element.</param>
Expand Down Expand Up @@ -387,7 +387,7 @@ private static IEnumerable<string> GetImagesInHTMLString(string htmlString)
{ "AT", new[] { "+0200", "Azores" } },
{ "AWDT", new[] { "-0900", "Australian West Daylight" } },
{ "AWST", new[] { "-0800", "Australian West Standard" } },
{ "BAT", new[] { "-0300", "Bhagdad" } },
{ "BAT", new[] { "-0300", "Baghdad" } },
{ "BDST", new[] { "-0200", "British Double Summer" } },
{ "BET", new[] { "+1100", "Bering Standard" } },
{ "BST", new[] { "+0300", "Brazil Standard" } },
Expand All @@ -413,8 +413,8 @@ private static IEnumerable<string> GetImagesInHTMLString(string htmlString)
{ "GST", new[] { "-1000", "Guam Standard" } },
{ "HDT", new[] { "+0900", "Hawaii Daylight" } },
{ "HST", new[] { "+1000", "Hawaii Standard" } },
{ "IDLE", new[] { "-1200", "Internation Date Line East" } },
{ "IDLW", new[] { "+1200", "Internation Date Line West" } },
{ "IDLE", new[] { "-1200", "International Date Line East" } },
{ "IDLW", new[] { "+1200", "International Date Line West" } },
{ "IST", new[] { "-0530", "Indian Standard" } },
{ "IT", new[] { "-0330", "Iran" } },
{ "JST", new[] { "-0900", "Japan Standard" } },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public ParserNullException(string message)
/// Initializes a new instance of the <see cref="ParserNullException"/> class.
/// Constructor with additional message and inner exception.
/// </summary>
/// <param name="message">Additonal message.</param>
/// <param name="message">Additional message.</param>
/// <param name="innerException">Reference to inner exception.</param>
public ParserNullException(string message, Exception innerException)
: base(message, innerException)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public RequestFailedException()
/// Initializes a new instance of the <see cref="RequestFailedException"/> class.
/// Constructor with additional message.
/// </summary>
/// <param name="message">Additional messsage.</param>
/// <param name="message">Additional message.</param>
public RequestFailedException(string message)
: base(message)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public Task<AuthenticationResult> Authenticate(Uri requestUri, Uri callbackUri)
int numberForms = ApplicationForm.OpenForms.Count;
if (numberForms > 0)
{
return AutenticateForm(requestUri, callbackUri);
return this.AuthenticateForm(requestUri, callbackUri);
}
else if (Application.Current != null)
{
Expand Down Expand Up @@ -45,7 +45,7 @@ public async Task<AuthenticationResult> AuthenticateWindow(Uri requestUri, Uri c
return await taskCompletionSource.Task;
}

public async Task<AuthenticationResult> AutenticateForm(Uri requestUri, Uri callbackUri)
public async Task<AuthenticationResult> AuthenticateForm(Uri requestUri, Uri callbackUri)
{
PopupForm popupForm;
var taskCompletionSource = new TaskCompletionSource<AuthenticationResult>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ public void Store(string resource, PasswordCredential credential)
Type = CRED_TYPE.GENERIC,
Persist = CRED_PERSIST.LOCAL_MACHINE
};
NativeCredential ncred = NativeCredential.GetNativeCredential(cred);
NativeCredential userCredential = NativeCredential.GetNativeCredential(cred);

// Write the info into the CredMan storage.
bool written = CredWrite(ref ncred, 0);
bool written = CredWrite(ref userCredential, 0);
int lastError = Marshal.GetLastWin32Error();
if (!written)
{
Expand All @@ -52,14 +52,14 @@ public PasswordCredential Get(string key)
return null;
}

CriticalCredentialHandle critCred = new CriticalCredentialHandle(nCredPtr);
CriticalCredentialHandle credentialHandle = new CriticalCredentialHandle(nCredPtr);

Credential credential = critCred.GetCredential();
PasswordCredential passCred = new PasswordCredential();
passCred.UserName = credential.UserName;
passCred.Password = credential.CredentialBlob;

return passCred;
Credential credential = credentialHandle.GetCredential();
return new PasswordCredential
{
UserName = credential.UserName,
Password = credential.CredentialBlob
};
}

public void Remove(string key)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ internal struct NativeCredential
/// instance.</returns>
internal static NativeCredential GetNativeCredential(Credential cred)
{
NativeCredential ncred = new NativeCredential
return new NativeCredential
{
AttributeCount = 0,
Attributes = IntPtr.Zero,
Expand All @@ -79,7 +79,6 @@ internal static NativeCredential GetNativeCredential(Credential cred)
CredentialBlob = Marshal.StringToCoTaskMemUni(cred.CredentialBlob),
UserName = Marshal.StringToCoTaskMemUni(cred.UserName)
};
return ncred;
}
}

Expand Down Expand Up @@ -116,21 +115,20 @@ internal Credential GetCredential()
if (!IsInvalid)
{
// Get the Credential from the mem location
NativeCredential ncred = (NativeCredential)Marshal.PtrToStructure(handle, typeof(NativeCredential));
NativeCredential nativeCredential = (NativeCredential)Marshal.PtrToStructure(handle, typeof(NativeCredential));

// Create a managed Credential type and fill it with data from the native counterpart.
Credential cred = new Credential
return new Credential
{
CredentialBlobSize = ncred.CredentialBlobSize,
CredentialBlob = Marshal.PtrToStringUni(ncred.CredentialBlob, (int)ncred.CredentialBlobSize / 2),
UserName = Marshal.PtrToStringUni(ncred.UserName),
TargetName = Marshal.PtrToStringUni(ncred.TargetName),
TargetAlias = Marshal.PtrToStringUni(ncred.TargetAlias),
Type = ncred.Type,
Flags = ncred.Flags,
Persist = (CRED_PERSIST)ncred.Persist
CredentialBlobSize = nativeCredential.CredentialBlobSize,
CredentialBlob = Marshal.PtrToStringUni(nativeCredential.CredentialBlob, (int)nativeCredential.CredentialBlobSize / 2),
UserName = Marshal.PtrToStringUni(nativeCredential.UserName),
TargetName = Marshal.PtrToStringUni(nativeCredential.TargetName),
TargetAlias = Marshal.PtrToStringUni(nativeCredential.TargetAlias),
Type = nativeCredential.Type,
Flags = nativeCredential.Flags,
Persist = (CRED_PERSIST)nativeCredential.Persist
};
return cred;
}
else
{
Expand All @@ -139,14 +137,14 @@ internal Credential GetCredential()
}

// Perform any specific actions to release the handle in the ReleaseHandle method.
// Often, you need to use Pinvoke to make a call into the Win32 API to release the
// Often, you need to use PInvoke to make a call into the Win32 API to release the
// handle. In this case, however, we can use the Marshal class to release the unmanaged memory.
protected override bool ReleaseHandle()
{
// If the handle was set, free it. Return success.
if (!IsInvalid)
{
// NOTE: We should also ZERO out the memory allocated to the handle, before free'ing it
// NOTE: We should also ZERO out the memory allocated to the handle, before freeing it
// so there are no traces of the sensitive data left in memory.
CredFree(handle);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
namespace Microsoft.Toolkit.Services.PlatformSpecific.NetFramework
{
/// <summary>
/// Service WebView for winforms
/// Service WebView for windows forms
/// </summary>
public partial class PopupForm : Form
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ public UwpPasswordManager()
/// <inheritdoc/>
public Toolkit.Services.Core.PasswordCredential Get(string key)
{
var crendentials = RetrievePasswordCredential(key);
if (crendentials == null)
var credentials = RetrievePasswordCredential(key);
if (credentials == null)
{
return null;
}

return new Toolkit.Services.Core.PasswordCredential { Password = crendentials.Password, UserName = crendentials.UserName };
return new Toolkit.Services.Core.PasswordCredential { Password = credentials.Password, UserName = credentials.UserName };
}

private Windows.Security.Credentials.PasswordCredential RetrievePasswordCredential(string key)
Expand Down
Loading