本文整理汇总了C#中RoleType.AddLink方法的典型用法代码示例。如果您正苦于以下问题:C# RoleType.AddLink方法的具体用法?C# RoleType.AddLink怎么用?C# RoleType.AddLink使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RoleType
的用法示例。
在下文中一共展示了RoleType.AddLink方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadRoleTypes
private void LoadRoleTypes( out int numErrors )
{
numErrors = 0;
XmlNodeList pTypesList = theDocument.SelectNodes(RTYPE_KEY, theManager);
if (pTypesList == null || pTypesList.Count == 0)
{
return; // nothing to do
}
else if (roleTypes == null)
{
roleTypes = new Dictionary<string,RoleType>(pTypesList.Count);
}
ArrayList labelRoleTypes = new ArrayList();
foreach (XmlNode node in pTypesList)
{
if (node.ChildNodes.Count == 0)
{
++numWarnings;
Common.WriteWarning("XBRLParser.Warning.NoChildrenForNode", errorList, node.OuterXml);
continue;
}
string id = null;
string uri = null;
if (!Common.GetAttribute(node, ID_TAG, ref id, errorList) ||
!Common.GetAttribute(node, RURI_TAG, ref uri, errorList))
{
++numErrors;
continue; // Couldn't find an attribute, just ignore it
}
RoleType rt = new RoleType( uri, id, this.schemaFile );
foreach (XmlNode child in node.ChildNodes)
{
if (child.NodeType == XmlNodeType.Comment) continue;
if (child.LocalName == DEF_TAG)
{
rt.SetDefinition(child.InnerText);
}
else
{
try
{
rt.AddLink(child.InnerText);
}
catch (ArgumentNullException)
{
Common.WriteWarning("XBRLParser.Warning.EmptyNode", errorList, child.OuterXml);
++numWarnings;
}
}
}
roleTypes[uri] = rt;
// if it's a label role type, then we want to union it
// with the other label roles that were set when we loaded
// the taxonomy label file.
if ( RoleTypeDefinesLabelUsage( rt ) )
{
labelRoleTypes.Add( rt.id );
}
}
MergeLanguagesAndLabelRoles( null, labelRoleTypes );
}
示例2: Test_WhereUsed
public void Test_WhereUsed()
{
RoleType rt = new RoleType( "uri", "id", "schemaFile" );
rt.AddLink( "link:one" );
rt.AddLink( "link:two" );
rt.AddLink( "link:Three" );
Assert.IsTrue( rt.UsedIn( "one" ) );
Assert.IsTrue( rt.UsedIn( "two" ) );
Assert.IsFalse( rt.UsedIn( "seven" ) );
}