本文整理汇总了C#中IProject.ExecuteRQL方法的典型用法代码示例。如果您正苦于以下问题:C# IProject.ExecuteRQL方法的具体用法?C# IProject.ExecuteRQL怎么用?C# IProject.ExecuteRQL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IProject
的用法示例。
在下文中一共展示了IProject.ExecuteRQL方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateContentClass
private ContentClass CreateContentClass(IProject project, XmlElement template)
{
XmlDocument creationResultNode = project.ExecuteRQL(template.NodeToString());
XmlNode guidTextNode = creationResultNode.FirstChild;
Guid newCCGuid;
if (guidTextNode == null || guidTextNode.NodeType != XmlNodeType.Element || guidTextNode.FirstChild == null ||
!Guid.TryParse(guidTextNode.FirstChild.Value.Trim(), out newCCGuid))
{
throw new SmartAPIException(Session.ServerLogin,
string.Format("Could not create content class '{0}'", Name));
}
var targetCC = new ContentClass(project, newCCGuid);
return targetCC;
}
示例2: CreateElement
/// <summary>
/// Create an element out of its XML representation (uses the attribute "elttype") to determine the element type and create the appropriate object.
/// </summary>
/// <param name="project"> Project containing the element </param>
/// <param name="elementGuid"> Guid of the element </param>
/// <param name="languageVariant">The language variant of the page element</param>
/// <exception cref="ArgumentException">if the "elttype" attribute of the XML node contains an unknown value</exception>
public static IPageElement CreateElement(IProject project, Guid elementGuid, ILanguageVariant languageVariant)
{
using (new LanguageContext(languageVariant))
{
XmlDocument xmlDoc = project.ExecuteRQL(string.Format(RETRIEVE_PAGE_ELEMENT, elementGuid.ToRQLString()));
var xmlNode = (XmlElement) xmlDoc.GetElementsByTagName("ELT")[0];
return CreateElement(project, xmlNode);
}
}
示例3: CreateInProject
public void CreateInProject(IProject project, Guid parentFolderGuid)
{
const string CREATE_STRING =
@"<PROJECT><EXPORTFOLDER action=""assign"" guid=""{0}""><EXPORTFOLDER action=""addnew"" name=""{1}"" type=""{2}"" {3} /></EXPORTFOLDER></PROJECT>";
XmlDocument reply =
project.ExecuteRQL(string.Format(CREATE_STRING, parentFolderGuid.ToRQLString(), Name, ((int) _type),
SaveParameters()));
reply.GetElementsByTagName("EXPORTFOLDER");
}
示例4: GetRQLRepresentation
private static XmlElement GetRQLRepresentation(IProject project, Guid ccElementGuid)
{
const string LOAD_ELEMENT = @"<TEMPLATE><ELEMENT action=""load"" guid=""{0}""/></TEMPLATE>";
return project.ExecuteRQL(LOAD_ELEMENT.RQLFormat(ccElementGuid)).GetSingleElement("ELEMENT");
}