本文整理汇总了C#中System.UriParser.CheckSetIsSimpleFlag方法的典型用法代码示例。如果您正苦于以下问题:C# UriParser.CheckSetIsSimpleFlag方法的具体用法?C# UriParser.CheckSetIsSimpleFlag怎么用?C# UriParser.CheckSetIsSimpleFlag使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.UriParser
的用法示例。
在下文中一共展示了UriParser.CheckSetIsSimpleFlag方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FetchSyntax
//
private static void FetchSyntax(UriParser syntax, string lwrCaseSchemeName, int defaultPort)
{
if (syntax.SchemeName.Length != 0)
throw new InvalidOperationException(SR.GetString(SR.net_uri_NeedFreshParser, syntax.SchemeName));
lock (m_Table)
{
syntax.m_Flags &= ~UriSyntaxFlags.V1_UnknownUri;
UriParser oldSyntax = null;
m_Table.TryGetValue(lwrCaseSchemeName, out oldSyntax);
if (oldSyntax != null)
throw new InvalidOperationException(SR.GetString(SR.net_uri_AlreadyRegistered, oldSyntax.SchemeName));
m_TempTable.TryGetValue(syntax.SchemeName, out oldSyntax);
if (oldSyntax != null)
{
// optimization on schemeName, will try to keep the first reference
lwrCaseSchemeName = oldSyntax.m_Scheme;
m_TempTable.Remove(lwrCaseSchemeName);
}
syntax.OnRegister(lwrCaseSchemeName, defaultPort);
syntax.m_Scheme = lwrCaseSchemeName;
syntax.CheckSetIsSimpleFlag();
syntax.m_Port = defaultPort;
m_Table[syntax.SchemeName] = syntax;
}
}
示例2: FetchSyntax
private static void FetchSyntax(UriParser syntax, string lwrCaseSchemeName, int defaultPort)
{
if (syntax.SchemeName.Length != 0)
{
throw new InvalidOperationException(SR.GetString("net_uri_NeedFreshParser", new object[] { syntax.SchemeName }));
}
lock (m_Table)
{
syntax.m_Flags &= ~UriSyntaxFlags.V1_UnknownUri;
UriParser parser = (UriParser) m_Table[lwrCaseSchemeName];
if (parser != null)
{
throw new InvalidOperationException(SR.GetString("net_uri_AlreadyRegistered", new object[] { parser.SchemeName }));
}
parser = (UriParser) m_TempTable[syntax.SchemeName];
if (parser != null)
{
lwrCaseSchemeName = parser.m_Scheme;
m_TempTable.Remove(lwrCaseSchemeName);
}
syntax.OnRegister(lwrCaseSchemeName, defaultPort);
syntax.m_Scheme = lwrCaseSchemeName;
syntax.CheckSetIsSimpleFlag();
syntax.m_Port = defaultPort;
m_Table[syntax.SchemeName] = syntax;
}
}