本文整理汇总了C#中Reference.Parse方法的典型用法代码示例。如果您正苦于以下问题:C# Reference.Parse方法的具体用法?C# Reference.Parse怎么用?C# Reference.Parse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Reference
的用法示例。
在下文中一共展示了Reference.Parse方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TryGetReferenceInformation
public static bool TryGetReferenceInformation(string fileName,
ref Dictionary<string, string> referenceByElementId, out string err)
{
if (referenceByElementId == null)
{
referenceByElementId = new Dictionary<string, string>();
}
err = null;
//assuming local file
if (File.Exists(fileName))
{
Reference reference = new Reference();
reference.loadingTaxonomy = null;
reference.PromptUser = false;
int numErrors;
reference.Load(fileName, out numErrors);
if (numErrors == 0)
{
reference.Parse(out numErrors);
}
if (numErrors > 0)
{
err = "Failed to load reference file " + fileName;
return false;
}
if (reference.ReferencesTable != null)
{
string formatStr = TraceUtility.FormatStringResource("XBRLUserControls.ElementBuilder.ReferenceNum");
foreach (ReferenceLocator refLocator in reference.ReferencesTable.Values)
{
if (refLocator.References != null && refLocator.References.Count > 0)
{
StringBuilder sbReference = new StringBuilder();
int refCount = 1;
foreach (DictionaryEntry de in refLocator.References)
{
sbReference.Append(string.Format(formatStr, refCount));
string key = de.Key as String;
int index = key.LastIndexOf(" ");
if (index >= 0)
{
key = key.Substring(0, index);
}
sbReference.Append(key);
sbReference.Append(Environment.NewLine);
ArrayList arRef = de.Value as ArrayList;
if (arRef[0] is string)
{
foreach (string refItem in arRef)
{
sbReference.Append(" -").Append(refItem);
}
}
else
{
if (arRef[0] is System.Collections.DictionaryEntry)
{
foreach (System.Collections.DictionaryEntry refItem in arRef)
{
sbReference.Append(" -").Append(refItem.Key).Append(": ").
Append(refItem.Value).Append(Environment.NewLine);
}
}
}
sbReference.Append(Environment.NewLine);
refCount++;
}
referenceByElementId[refLocator.href] = sbReference.ToString();
}
}
}
}
else
{
err = "Reference file does not exist " + fileName;
}
return err == null;
}
示例2: LoadReferences
private void LoadReferences( out int numErrors )
{
numErrors = 0;
if ( dependantTaxonomies.Count == 0 )
{
int errs = LoadDependantTaxonomies(this.schemaPath);
numErrors += errs;
numRefErrors += errs;
}
if ( referenceFile == null )
{
referenceFile = GetLinkbaseReference( TARGET_LINKBASE_URI + REFERENCE_ROLE );
}
int errors = 0;
if ( referenceTable == null )
{
referenceTable = new Hashtable();
}
if ( referenceFile != null )
{
foreach ( string refFile in referenceFile )
{
Reference reference = new Reference();
reference.OwnerHandle = OwnerHandle;
reference.loadingTaxonomy = this.GetLoadingTaxonomy();
reference.PromptUser = this.PromptUser;
if ( refFile != null )
{
reference.Load( refFile, out numErrors );
if (IsAucentExtension && skipAucentExtensions && !this.innerTaxonomy &&
reference.IsDocumentCreatedByRivet())
{
//if this is a top level aucent extension taxonomy and ...
//if the skipAucentExtensions is set to true ... we want to load just the no rivet created files...
//as we will merge the rivet created files later....
continue ;
}
if ( reference.ErrorList.Count > 0 )
{
for ( int i = 0; i < reference.ErrorList.Count; i++ )
Common.WriteError( "XBRLParser.Error.Exception", validationErrors,
SchemaFile + ": REFERENCE_ROLE Error: " + reference.ErrorList[i] );
}
reference.Parse( out errors );
if ( errors > 0 )
{
numErrors += errors;
errorList.AddRange( reference.ErrorList );
numRefErrors += errors;
}
LinkbaseFileInfo refLinkbaseInfo = new LinkbaseFileInfo();
refLinkbaseInfo.LinkType = LinkbaseFileInfo.LinkbaseType.Reference;
refLinkbaseInfo.Filename = refFile;
refLinkbaseInfo.XSDFileName = schemaFile;
this.linkbaseFileInfos.Add(refLinkbaseInfo);
}
if ( reference.ReferencesTable != null )
{
IDictionaryEnumerator enumer = reference.ReferencesTable.GetEnumerator();
foreach( ReferenceLocator otherRL in reference.ReferencesTable.Values )
{
if (referenceTable.Contains(otherRL.HRef))
{
//TODO: add merge code similar to label locators
int i = 0; ++i;
ReferenceLocator rl = (ReferenceLocator)referenceTable[otherRL.HRef];
rl.Merge( otherRL );
}
else
{
referenceTable[otherRL.HRef] = otherRL;
}
}
}
}
}
if ( !innerTaxonomy )
{
//append the references to the root level referenceTable
foreach ( Taxonomy t in dependantTaxonomies )
{
if ( t.referenceTable != null && t.referenceTable.Count > 0 )
{
errors = 0;
// now append the references
IDictionaryEnumerator enumer = t.referenceTable.GetEnumerator();
while ( enumer.MoveNext() )
{
//.........这里部分代码省略.........