本文整理汇总了C#中UsingsBag类的典型用法代码示例。如果您正苦于以下问题:C# UsingsBag类的具体用法?C# UsingsBag怎么用?C# UsingsBag使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UsingsBag类属于命名空间,在下文中一共展示了UsingsBag类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: VisitNamespaceBody
protected void VisitNamespaceBody (UsingsBag.Namespace nspace)
{
foreach (object member in nspace.members) {
if (member is MemberCore) {
((MemberCore)member).Accept (this);
} else {
((UsingsBag.Namespace)member).Accept (this);
}
}
}
示例2: VisitNamespaceUsings
protected void VisitNamespaceUsings (UsingsBag.Namespace nspace)
{
foreach (object u in nspace.usings) {
if (u is UsingsBag.Using) {
((UsingsBag.Using)u).Accept (this);
} else {
((UsingsBag.AliasUsing)u).Accept (this);
}
}
}
示例3: Visit
public override void Visit (UsingsBag.Namespace nspace)
{
NamespaceDeclaration nDecl = null;
if (nspace.Name != null) {
nDecl = new NamespaceDeclaration ();
nDecl.AddChild (new CSharpTokenNode (Convert (nspace.NamespaceLocation), "namespace".Length), NamespaceDeclaration.Roles.Keyword);
nDecl.AddChild (new Identifier (nspace.Name.Name, Convert (nspace.Name.Location)), NamespaceDeclaration.Roles.Identifier);
nDecl.AddChild (new CSharpTokenNode (Convert (nspace.OpenBrace), 1), NamespaceDeclaration.Roles.LBrace);
AddToNamespace (nDecl);
namespaceStack.Push (nDecl);
}
VisitNamespaceUsings (nspace);
VisitNamespaceBody (nspace);
if (nDecl != null) {
nDecl.AddChild (new CSharpTokenNode (Convert (nspace.CloseBrace), 1), NamespaceDeclaration.Roles.RBrace);
if (!nspace.OptSemicolon.IsNull)
nDecl.AddChild (new CSharpTokenNode (Convert (nspace.OptSemicolon), 1), NamespaceDeclaration.Roles.Semicolon);
namespaceStack.Pop ();
}
}
示例4: Visit
public override void Visit (UsingsBag.AliasUsing u)
{
DomUsing domUsing = new DomUsing ();
domUsing.Region = ConvertRegion (u.UsingLocation, u.SemicolonLocation);
domUsing.ValidRegion = ConvertRegion (currentNamespace.Peek ().OpenBrace, currentNamespace.Peek ().CloseBrace);
domUsing.Add (u.Identifier.Value, new DomReturnType (ConvertToString (u.Nspace)));
Unit.Add (domUsing);
}
示例5: Visit
public override void Visit (UsingsBag.ExternAlias u)
{
var ud = new ExternAliasDeclaration ();
ud.AddChild (new CSharpTokenNode (Convert (u.ExternLocation), "extern".Length), ExternAliasDeclaration.Roles.Keyword);
ud.AddChild (new CSharpTokenNode (Convert (u.AliasLocation), "alias".Length), ExternAliasDeclaration.AliasRole);
ud.AddChild (Identifier.Create (u.Identifier.Value, Convert (u.Identifier.Location)), ExternAliasDeclaration.Roles.Identifier);
ud.AddChild (new CSharpTokenNode (Convert (u.SemicolonLocation), 1), UsingAliasDeclaration.Roles.Semicolon);
AddToNamespace (ud);
}
示例6: Visit
public virtual void Visit (UsingsBag.ExternAlias externAlias)
{
}
示例7: Visit
public override void Visit (UsingsBag.Using u)
{
UsingDeclaration ud = new UsingDeclaration ();
ud.AddChild (new CSharpTokenNode (Convert (u.UsingLocation), "using".Length), UsingDeclaration.Roles.Keyword);
ud.AddChild (ConvertToType (u.NSpace), UsingDeclaration.ImportRole);
ud.AddChild (new CSharpTokenNode (Convert (u.SemicolonLocation), 1), UsingDeclaration.Roles.Semicolon);
AddToNamespace (ud);
}
示例8: Visit
public override void Visit (UsingsBag.Namespace nspace)
{
string oldNamespace = currentNamespaceName;
currentNamespace.Push (nspace);
if (nspace.Name != null) { // no need to push the global namespace
DomUsing domUsing = new DomUsing ();
domUsing.IsFromNamespace = true;
domUsing.Region = domUsing.ValidRegion = ConvertRegion (nspace.OpenBrace, nspace.CloseBrace);
string name = ConvertToString (nspace.Name);
domUsing.Add (name);
Unit.Add (domUsing);
currentNamespaceName = string.IsNullOrEmpty (currentNamespaceName) ? name : currentNamespaceName + "." + name;
}
VisitNamespaceUsings (nspace);
VisitNamespaceBody (nspace);
currentNamespace.Pop ();
currentNamespaceName = oldNamespace;
}