本文整理汇总了C#中DocProject.FindPropertyEnumeration方法的典型用法代码示例。如果您正苦于以下问题:C# DocProject.FindPropertyEnumeration方法的具体用法?C# DocProject.FindPropertyEnumeration怎么用?C# DocProject.FindPropertyEnumeration使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DocProject
的用法示例。
在下文中一共展示了DocProject.FindPropertyEnumeration方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FormatField
private static string FormatField(DocProject docProject, string content /*deprecate*/, string fieldname, string fieldtype/*deprecate*/, string fieldvalue/*deprecate*/)
{
DocDefinition docDef = docProject.GetDefinition(fieldname);
// hyperlink to enumerators
if (docDef is DocEnumeration)
{
// hyperlink to enumeration definition
// replace it with hyperlink
DocSchema docSchema = docProject.GetSchemaOfDefinition(docDef);
string relative = @"../../";
string hyperlink = relative + docSchema.Name.ToLower() + @"/lexical/" + docDef.Name.ToLower() + ".htm";
string format = "<a href=\"" + hyperlink + "\">" + fieldvalue + "</a>";
return format;// content.Replace(fieldname, format);
}
else if (docDef is DocEntity || docDef is DocType)//fieldvalue != null && fieldvalue.StartsWith("Ifc") && docProject.GetDefinition(fieldvalue) != null)
{
// replace it with hyperlink
DocSchema docSchema = docProject.GetSchemaOfDefinition(docDef);
string relative = @"../../";
string hyperlink = relative + docSchema.Name.ToLower() + @"/lexical/" + docDef.Name.ToLower() + ".htm";
string format = "<a href=\"" + hyperlink + "\">" + fieldvalue + "</a>";
return format;// content.Replace(fieldname, format);
}
else //if (docDef == null)
{
// hyperlink to property set definition
DocSchema docSchema = null;
DocObject docObj = docProject.FindPropertySet(fieldvalue, out docSchema);
if (docObj is DocPropertySet)
{
string relative = @"../../";
string hyperlink = relative + docSchema.Name.ToLowerInvariant() + @"/pset/" + docObj.Name.ToLower() + ".htm"; // case-sensitive on linux -- need to make schema all lowercase
string format = "<a href=\"" + hyperlink + "\">" + fieldvalue + "</a>";
return format;// content.Replace(fieldname, format);
}
else
{
docObj = docProject.FindPropertyEnumeration(fieldvalue, out docSchema);
if(docObj is DocPropertyEnumeration)
{
string relative = @"../../";
string hyperlink = relative + docSchema.Name.ToLowerInvariant() + @"/pset/" + docObj.Name.ToLower() + ".htm"; // case-sensitive on linux -- need to make schema all lowercase
string format = "<a href=\"" + hyperlink + "\">" + fieldvalue + "</a>";
return format;// content.Replace(fieldname, format);
}
else
{
docObj = docProject.FindQuantitySet(fieldvalue, out docSchema);
if (docObj is DocQuantitySet)
{
string relative = @"../../";
string hyperlink = relative + docSchema.Name.ToLowerInvariant() + @"/qset/" + docObj.Name.ToLower() + ".htm"; // case-sentive on linux -- need to make schema all lowercase
string format = "<a href=\"" + hyperlink + "\">" + fieldvalue + "</a>";
return format;// content.Replace(fieldname, format);
}
}
}
if (docObj == null)
{
// simple replace -- hyperlink may markup value later
return fieldvalue;// content.Replace(fieldname, fieldvalue);
}
}
/*
else
{
// simple replace -- hyperlink may markup value later
return content.Replace(fieldname, fieldvalue);
}*/
return content;
}