本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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]));
}
示例5: Visit
public virtual void Visit (UsingAliasNamespace uan)
{
}
示例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;
}