本文整理汇总了C#中ILine.GetReferencePath方法的典型用法代码示例。如果您正苦于以下问题:C# ILine.GetReferencePath方法的具体用法?C# ILine.GetReferencePath怎么用?C# ILine.GetReferencePath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ILine
的用法示例。
在下文中一共展示了ILine.GetReferencePath方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetOutline
private static void GetOutline(ILine line, List<ILine> OutputLines, ProcessedFile pf)
{
var statement = line as IOpenBraceStatement;
if (statement == null)
{
if (line.IsReference())
{
var refStatement = new ReferenceStatement(
Line: line,
ClientSideReference: line.GetReferencePath()
);
//var refStatement = line.ToReferenceStatement();
pf.References[refStatement.ClientSideReference] = refStatement;
OutputLines.Add(refStatement);
}
else
{
OutputLines.Add(line);
}
return;
}
bool recurse = true;
if (statement.IsInterface())
{
//var interfaceStatement = statement.ToInterface();
var interfaceStatement = new Interface(
OpenBraceStatementBase: statement,
LiveStatementBase: statement.LiveStatementBase,
Line: statement.Line,
Name: statement.GetInterfaceName()
);
pf.Interfaces[interfaceStatement.Name] = interfaceStatement;
interfaceStatement.Process();
statement = interfaceStatement as IOpenBraceStatement;
recurse = false;
}
else if (statement.IsFunction())
{
//var functionStatement = statement.ToFunction();
var functionStatement = new StaticFunction(
OpenBraceStatementBase: statement,
LiveStatementBase: statement.LiveStatementBase,
Line: statement.Line,
Name: statement.GetFunctionName()
);
string functionName = functionStatement.GetFullName();
pf.Functions[functionName] = functionStatement;
}
else if (statement.IsClass())
{
var classStatement = new Class(
OpenBraceStatementBase: statement,
LiveStatementBase: statement.LiveStatementBase,
Line: statement.Line,
Name: statement.GetClassName()
);
pf.Classes[classStatement.Name] = classStatement;
statement = classStatement;
}
else if (statement.IsModule())
{
//var moduleStatement = statement.ToModule();
var moduleStatement = new Module(
OpenBraceStatementBase: statement,
LiveStatementBase: statement.LiveStatementBase,
Line: statement.Line,
FullName: statement.FrontTrimmedLiveStatement.Trim('{').Trim()
);
pf.Modules[moduleStatement.FullName] = moduleStatement;
statement = moduleStatement;
}
OutputLines.Add(statement);
if (statement.Children != null && recurse)
{
var newc = new List<ILine>();
foreach (var childLine in statement.Children)
{
GetOutline(childLine, newc, pf);
}
statement.Children = newc;
}
}