本文整理汇总了C#中Mono.CSharp.UsingAliasNamespace类的典型用法代码示例。如果您正苦于以下问题:C# UsingAliasNamespace类的具体用法?C# UsingAliasNamespace怎么用?C# UsingAliasNamespace使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UsingAliasNamespace类属于Mono.CSharp命名空间,在下文中一共展示了UsingAliasNamespace类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Visit
public override void Visit(UsingAliasNamespace uan)
{
var ud = new UsingAliasDeclaration();
var loc = LocationsBag.GetLocations(uan);
ud.AddChild(new CSharpTokenNode(Convert(uan.Location), UsingAliasDeclaration.UsingKeywordRole), UsingAliasDeclaration.UsingKeywordRole);
ud.AddChild(Identifier.Create(uan.Alias.Value, Convert(uan.Alias.Location)), UsingAliasDeclaration.AliasRole);
if (loc != null)
ud.AddChild(new CSharpTokenNode(Convert(loc [0]), Roles.Assign), Roles.Assign);
if (uan.NamespaceExpression != null)
ud.AddChild(ConvertToType(uan.NamespaceExpression), UsingAliasDeclaration.ImportRole);
if (loc != null && loc.Count > 1)
ud.AddChild(new CSharpTokenNode(Convert(loc [1]), Roles.Semicolon), Roles.Semicolon);
AddToNamespace(ud);
}
开发者ID:0xb1dd1e,项目名称:NRefactory,代码行数:15,代码来源:CSharpParser.cs
示例2: AddUsing
public void AddUsing(UsingAliasNamespace un)
{
if (DeclarationFound){
Compiler.Report.Error (1529, un.Location, "A using clause must precede all other namespace elements except extern alias declarations");
}
AddAlias (un);
}
开发者ID:exodrifter,项目名称:mcs-ICodeCompiler,代码行数:8,代码来源:namespace.cs
示例3: AddAlias
void AddAlias(UsingAliasNamespace un)
{
if (clauses == null) {
clauses = new List<UsingClause> ();
} else {
foreach (var entry in clauses) {
var a = entry as UsingAliasNamespace;
if (a != null && a.Alias.Value == un.Alias.Value) {
Compiler.Report.SymbolRelatedToPreviousError (a.Location, "");
Compiler.Report.Error (1537, un.Location,
"The using alias `{0}' appeared previously in this namespace", un.Alias.Value);
}
}
}
clauses.Add (un);
}
开发者ID:exodrifter,项目名称:mcs-ICodeCompiler,代码行数:17,代码来源:namespace.cs
示例4: case_19
void case_19()
#line 476 "cs-parser.jay"
{
var lt = (LocatedToken) yyVals[-3+yyTop];
if (lang_version != LanguageVersion.ISO_1 && lt.Value == "global") {
report.Warning (440, 2, lt.Location,
"An alias named `global' will not be used when resolving `global::'. The global namespace will be used instead");
}
var un = new UsingAliasNamespace (new SimpleMemberName (lt.Value, lt.Location), (ATypeNameExpression) yyVals[-1+yyTop], GetLocation (yyVals[-4+yyTop]));
current_namespace.AddUsing (un);
lbag.AddLocation (un, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop]));
}
开发者ID:segaman,项目名称:NRefactory,代码行数:13,代码来源:cs-parser.cs
示例5: Visit
public virtual void Visit (UsingAliasNamespace uan)
{
}
开发者ID:KAW0,项目名称:Alter-Native,代码行数:3,代码来源:visit.cs
示例6: AddAlias
void AddAlias (UsingAliasNamespace un)
{
if (clauses == null) {
clauses = new List<UsingNamespace> ();
} else {
foreach (var entry in clauses) {
var a = entry as UsingAliasNamespace;
if (a != null && a.Alias.Equals (un.Alias)) {
Compiler.Report.SymbolRelatedToPreviousError (a.Location, "");
Compiler.Report.Error (1537, un.Location,
"The using alias `{0}' appeared previously in this namespace", un.Alias.GetSignatureForError ());
}
}
}
clauses.Add (un);
resolved = false;
}
开发者ID:robert-j,项目名称:mono-fork,代码行数:19,代码来源:namespace.cs
注:本文中的Mono.CSharp.UsingAliasNamespace类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论