本文整理汇总了C#中ICSharpCode.NRefactory.Ast.NamespaceDeclaration.AcceptChildren方法的典型用法代码示例。如果您正苦于以下问题:C# NamespaceDeclaration.AcceptChildren方法的具体用法?C# NamespaceDeclaration.AcceptChildren怎么用?C# NamespaceDeclaration.AcceptChildren使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICSharpCode.NRefactory.Ast.NamespaceDeclaration
的用法示例。
在下文中一共展示了NamespaceDeclaration.AcceptChildren方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: VisitNamespaceDeclaration
public override object VisitNamespaceDeclaration(NamespaceDeclaration namespaceDeclaration, object data)
{
CSharpLanguage.VisitorData data2 = (CSharpLanguage.VisitorData) data;
data2.CurrentNamespaces.Push(namespaceDeclaration.Name);
namespaceDeclaration.AcceptChildren(this, data2);
data2.CurrentNamespaces.Pop();
return null;
}
示例2: VisitNamespaceDeclaration
public override object VisitNamespaceDeclaration (NamespaceDeclaration node, object data)
{
if (!String.IsNullOrEmpty (Namespace))
throw CreateException (node, "Nested namespaces are not supported");
string prevNamespace = Namespace;
//var prevUsings = Usings;
Namespace = node.Name;
//Usings = new HashSet<string> ();
node.AcceptChildren (this, null);
Namespace = prevNamespace;
//Usings = prevUsings;
return null;
}
示例3: TrackedVisitNamespaceDeclaration
public override object TrackedVisitNamespaceDeclaration(NamespaceDeclaration namespaceDeclaration, object data)
{
return namespaceDeclaration.AcceptChildren(this, data);
}
示例4: VisitNamespaceDeclaration
public override object VisitNamespaceDeclaration(NamespaceDeclaration namespaceDeclaration, object data)
{
CodeNamespace currentNamespace = new CodeNamespace(namespaceDeclaration.Name);
//namespaces.Add(currentNamespace);
// add imports from mother namespace
foreach (CodeNamespaceImport import in ((CodeNamespace)namespaceDeclarations.Peek()).Imports) {
currentNamespace.Imports.Add(import);
}
namespaceDeclarations.Push(currentNamespace);
namespaceDeclaration.AcceptChildren(this, data);
namespaceDeclarations.Pop();
codeCompileUnit.Namespaces.Add(currentNamespace);
// Nested namespaces are not allowed in CodeDOM
return null;
}
示例5: VisitNamespaceDeclaration
public virtual object VisitNamespaceDeclaration(NamespaceDeclaration namespaceDeclaration, object data)
{
Debug.Assert((namespaceDeclaration != null));
return namespaceDeclaration.AcceptChildren(this, data);
}
示例6: VisitNamespaceDeclaration
public virtual bool VisitNamespaceDeclaration(NamespaceDeclaration namespaceDeclaration, object d)
{
if ((namespaceDeclaration == null)) {
return SetFailure();
}
if ((d == null)) {
return SetFailure();
}
if(namespaceDeclaration.GetType() != d.GetType()) {return SetFailure();}
var data = (NamespaceDeclaration)d;
if (!IsMatch(namespaceDeclaration, data)) {
return SetFailure();
}
return namespaceDeclaration.AcceptChildren(this, d);
}
示例7: TrackedVisitNamespaceDeclaration
public override object TrackedVisitNamespaceDeclaration(NamespaceDeclaration namespaceDeclaration, object data)
{
currentNamespaceDeclaration = namespaceDeclaration;
codeBuilder.AppendLineIfPreviousLineIsCode();
AppendIndentedLine("module " + namespaceDeclaration.Name);
IncreaseIndent();
namespaceDeclaration.AcceptChildren(this, data);
DecreaseIndent();
AppendIndentedLine("end");
return null;
}