本文整理汇总了C#中umbraco.cms.presentation.Trees.XmlTree.Add方法的典型用法代码示例。如果您正苦于以下问题:C# XmlTree.Add方法的具体用法?C# XmlTree.Add怎么用?C# XmlTree.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类umbraco.cms.presentation.Trees.XmlTree
的用法示例。
在下文中一共展示了XmlTree.Add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Render
public override void Render(ref XmlTree tree)
{
// Create tree node to allow sending a newsletter
var sendNewsletter = XmlTreeNode.Create(this);
sendNewsletter.Text = "Send Newsletter";
sendNewsletter.Icon = "docPic.gif";
sendNewsletter.Action = "javascript:openSendNewsletter()";
// Add the node to the tree
tree.Add(sendNewsletter);
// Create tree node to allow viewing previously sent newsletters
var previousNewsletters = XmlTreeNode.Create(this);
previousNewsletters.Text = "Previous Newsletters";
previousNewsletters.Icon = "docPic.gif";
previousNewsletters.Action = "javascript:openPreviousNewsletters()";
// Add the node to the tree
tree.Add(previousNewsletters);
}
示例2: Populate
public override void Populate(ref XmlTree tree, int keyId)
{
var reader =
Application.SqlHelper.ExecuteReader(
@"
SELECT Res.RaceResultId, D.Name
FROM Result Res INNER JOIN DriverContract DC ON Res.DriverContractId = DC.DriverContractId
INNER JOIN Driver D ON DC.DriverId = D.DriverId
WHERE Res.ResultType=1 AND Res.RaceId = @raceId
ORDER BY [Time]",
Application.SqlHelper.CreateParameter("@raceId", keyId));
while (reader.Read())
{
var qNode = XmlTreeNode.Create(_baseTree);
qNode.NodeID = reader.GetInt("RaceResultId").ToString();
qNode.Text = reader.GetString("Name");
qNode.Icon = "medal_silver_3.png";
qNode.NodeType = "qualiResults";
qNode.Action = "javascript:openQualificationResult(" + reader.GetInt("RaceResultId") + ")";
qNode.Menu.Clear();
qNode.Menu.Add(ActionDelete.Instance);
tree.Add(qNode);
}
}
示例3: Render
public override void Render(ref XmlTree tree)
{
foreach (Task t in Task.GetTasks(currentUser(), false)) {
if (t.Type.Alias == "toTranslate") {
XmlTreeNode xNode = XmlTreeNode.Create(this);
xNode.Menu.Clear();
xNode.NodeID = t.Id.ToString();
xNode.Text = t.Node.Text;
xNode.Action = "javascript:openTranslationTask(" + t.Id.ToString() + ")";
xNode.Icon = ".sprTreeSettingLanguage";
xNode.OpenIcon = ".sprTreeSettingLanguage";
OnBeforeNodeRender(ref tree, ref xNode, EventArgs.Empty);
if (xNode != null)
{
tree.Add(xNode);
OnAfterNodeRender(ref tree, ref xNode, EventArgs.Empty);
}
}
}
}
示例4: Render
public override void Render(ref XmlTree tree)
{
var docTypes = Service.GetContentTypeChildren(base.m_id);
foreach (var docType in docTypes)
{
var hasChildren = Service.HasChildren(docType.Id);
XmlTreeNode xNode = XmlTreeNode.Create(this);
xNode.NodeID = docType.Id.ToString(CultureInfo.InvariantCulture);
xNode.Text = TranslateTreeNames.GetTranslatedName(docType.Name);
xNode.Action = "javascript:openNodeType(" + docType.Id + ");";
xNode.Icon = "icon-item-arrangement";
xNode.OpenIcon = "icon-item-arrangement";
xNode.Source = GetTreeServiceUrl(docType.Id);
xNode.HasChildren = hasChildren;
if (hasChildren)
{
xNode.Icon = "icon-item-arrangement";
xNode.OpenIcon = "icon-item-arrangement";
}
OnBeforeNodeRender(ref tree, ref xNode, EventArgs.Empty);
if (xNode != null)
{
tree.Add(xNode);
OnAfterNodeRender(ref tree, ref xNode, EventArgs.Empty);
}
}
}
示例5: Render
public override void Render(ref XmlTree tree)
{
var mediaTypes = Service.GetMediaTypeChildren(base.m_id);
foreach (var mediaType in mediaTypes)
{
var hasChildren = Service.MediaTypeHasChildren(mediaType.Id);
XmlTreeNode xNode = XmlTreeNode.Create(this);
xNode.NodeID = mediaType.Id.ToString(CultureInfo.InvariantCulture);
xNode.Text = mediaType.Name;
xNode.Action = string.Format("javascript:openMediaType({0});", mediaType.Id);
xNode.Icon = "settingDataType.gif";
xNode.OpenIcon = "settingDataType.gif";
xNode.Source = GetTreeServiceUrl(mediaType.Id);
xNode.HasChildren = hasChildren;
if (hasChildren)
{
xNode.Icon = "settingMasterDataType.gif";
xNode.OpenIcon = "settingMasterDataType.gif";
}
OnBeforeNodeRender(ref tree, ref xNode, EventArgs.Empty);
if (xNode != null)
{
tree.Add(xNode);
OnAfterNodeRender(ref tree, ref xNode, EventArgs.Empty);
}
}
}
示例6: Render
public override void Render(ref XmlTree tree)
{
Hashtable ht = Cache.ReturnCacheItemsOrdred();
foreach (string key in ht.Keys)
{
//each child will need to load a CacheItem instead of a Cache tree so
//we'll create a loadCacheItem object in order to get it's serivce url and alias properties
loadCacheItem loadCacheItemTree = new loadCacheItem(this.app);
int itemCount = ((ArrayList)ht[key]).Count;
XmlTreeNode xNode = XmlTreeNode.Create(loadCacheItemTree);
xNode.NodeID = key;
xNode.Text = key + " (" + itemCount + ")";
xNode.Action = string.Empty;
xNode.Source = loadCacheItemTree.GetTreeServiceUrl(key);
xNode.Icon = "developerCacheTypes.gif";
xNode.OpenIcon = "developerCacheTypes.gif";
xNode.HasChildren = itemCount > 0;
OnBeforeNodeRender(ref tree, ref xNode, EventArgs.Empty);
if (xNode != null)
{
tree.Add(xNode);
OnAfterNodeRender(ref tree, ref xNode, EventArgs.Empty);
}
}
}
示例7: Render
public override void Render(ref XmlTree tree)
{
Dictionary.DictionaryItem[] tmp;
if (this.id == this.StartNodeID)
tmp = Dictionary.getTopMostItems;
else
tmp = new Dictionary.DictionaryItem(this.id).Children;
foreach (Dictionary.DictionaryItem di in tmp)
{
XmlTreeNode xNode = XmlTreeNode.Create(this);
xNode.NodeID = di.id.ToString(); //dictionary_ + id..
xNode.Text = di.key;
xNode.Action = string.Format("javascript:openDictionaryItem({0});", di.id);
xNode.Icon = "settingDataType.gif";
xNode.OpenIcon = "settingDataType.gif";
xNode.NodeType = "DictionaryItem"; //this shouldn't be like this, it should be this.TreeAlias but the ui.config file points to this name.
xNode.Source = this.GetTreeServiceUrl(di.id);
xNode.HasChildren = di.hasChildren;
OnBeforeNodeRender(ref tree, ref xNode, EventArgs.Empty);
if (xNode != null)
{
tree.Add(xNode);
OnAfterNodeRender(ref tree, ref xNode, EventArgs.Empty);
}
}
}
示例8: Render
public override void Render(ref XmlTree tree)
{
foreach(string role in Roles.GetAllRoles()) {
// MemberGroup[] MemberGroups = MemberGroup.GetAll;
// for (int i = 0; i < MemberGroups.Length; i++)
// {
XmlTreeNode xNode = XmlTreeNode.Create(this);
xNode.NodeID = role;
xNode.Text = role;
xNode.Action = "javascript:openMemberGroup('" + HttpContext.Current.Server.UrlEncode(role.Replace("'", "\\'")) + "');";
xNode.Icon = "icon-users";
if (!Member.IsUsingUmbracoRoles())
{
xNode.Menu = null;
}
OnBeforeNodeRender(ref tree, ref xNode, EventArgs.Empty);
if (xNode != null)
{
tree.Add(xNode);
}
OnAfterNodeRender(ref tree, ref xNode, EventArgs.Empty);
}
}
示例9: Render
/// <summary>
/// Renders the specified tree.
/// </summary>
/// <param name="tree">The application tree.</param>
public override void Render(ref XmlTree tree)
{
// render the folders/files
//base.Render(ref tree);
// the NodeKey is empty for the root, but contains the folder name for sub-folders.
if (string.IsNullOrEmpty(this.NodeKey))
{
// - add configuration node
XmlTreeNode confNode = XmlTreeNode.Create(this);
confNode.NodeID = "ConfigurationFile";
confNode.Action = "javascript:openuImageResizerConfig();";
confNode.Text = "Configuration";
confNode.Icon = "../../plugins/uImageResizer/ConfigFileIcon.gif";
confNode.OpenIcon = confNode.Icon;
tree.Add(confNode);
//// - add docs node
//XmlTreeNode docsNode = XmlTreeNode.Create(this);
//docsNode.NodeID = "GettingStarted";
//docsNode.Action = "javascript:openuImageResizerGettingStarted();";
//docsNode.Text = "Getting Started";
//docsNode.Icon = "../../plugins/uImageResizer/DocumentationIcon.gif";
//docsNode.OpenIcon = docsNode.Icon;
//tree.Add(docsNode);
// - add support node
XmlTreeNode supportNode = XmlTreeNode.Create(this);
supportNode.NodeID = "Support";
supportNode.Action = "javascript:openuImageResizerSupport();";
supportNode.Text = "Support and Service";
supportNode.Icon = "../../plugins/uImageResizer/SupportIcon.gif";
supportNode.OpenIcon = supportNode.Icon;
tree.Add(supportNode);
// - add licenses node
XmlTreeNode licenseNode = XmlTreeNode.Create(this);
licenseNode.NodeID = "Licenses";
licenseNode.Action = "javascript:openuImageResizerLicensing();";
licenseNode.Text = "Info on licensing";
licenseNode.Icon = "../../plugins/uImageResizer/LicensesIcon.gif";
licenseNode.OpenIcon = licenseNode.Icon;
tree.Add(licenseNode);
}
}
示例10: Render
public override void Render(ref XmlTree tree)
{
XmlTreeNode xNode;
xNode = XmlTreeNode.Create(this);
xNode.Text = "Log";
xNode.Icon = "doc.gif";
xNode.NodeType = "uTool";
xNode.Action = "javascript:openuToolTab('/umbraco/plugins/uTools/log.aspx')";
tree.Add(xNode);
xNode = XmlTreeNode.Create(this);
xNode.Text = "Data Types";
xNode.Icon = "developerDatatype.gif";
xNode.NodeType = "uTool";
xNode.Action = "javascript:openuTool('datatype.aspx')";
tree.Add(xNode);
xNode = XmlTreeNode.Create(this);
xNode.Text = "Document Types";
xNode.Icon = "settingDatatype.gif";
xNode.NodeType = "uTool";
xNode.Action = "javascript:openuTool('doctype.aspx')";
tree.Add(xNode);
//xNode = XmlTreeNode.Create(this);
//xNode.Text = "Content";
//xNode.Icon = "docPic.gif";
//xNode.NodeType = "uTool";
//xNode.Action = "javascript:openuTool('content.aspx')";
//tree.Add(xNode);
xNode = XmlTreeNode.Create(this);
xNode.Text = "Templates";
xNode.Icon = "settingTemplate.gif";
xNode.NodeType = "uTool";
xNode.Action = "javascript:openuTool('template.aspx')";
tree.Add(xNode);
xNode = XmlTreeNode.Create(this);
xNode.Text = "Macros";
xNode.Icon = "developerMacro.gif";
xNode.NodeType = "uTool";
xNode.Action = "javascript:openuTool('macro.aspx')";
tree.Add(xNode);
xNode = XmlTreeNode.Create(this);
xNode.Text = "Content Cache Viewer";
xNode.Icon = "settingXML.gif";
xNode.NodeType = "uTool";
xNode.Action = "javascript:openuTool('cache.aspx')";
tree.Add(xNode);
xNode = XmlTreeNode.Create(this);
xNode.Text = "Media Cache Viewer";
xNode.Icon = "mediaPhoto.gif";
xNode.NodeType = "uTool";
xNode.Action = "javascript:openuTool('mediacache.aspx')";
tree.Add(xNode);
}
示例11: Render
///
/// Override the render method to create the newsletter tree
///
///
public override void Render(ref XmlTree Tree)
{
Tree.treeCollection.Clear();
var nodeWorkout = XmlTreeNode.Create(this);
nodeWorkout.NodeID = "Workout" + Guid.NewGuid();
nodeWorkout.Text = "Workout";
nodeWorkout.Icon = "b_user.png";
nodeWorkout.Action = string.Format("javascript:openRepository({0});", 1355);
Tree.Add(nodeWorkout);
var nodeExercise = XmlTreeNode.Create(this);
nodeExercise.NodeID = "Exercise" + Guid.NewGuid();
nodeExercise.Text = "Exercise";
nodeExercise.Icon = "b_user.png";
nodeExercise.Action = string.Format("javascript:openRepository({0});", 1355);
Tree.Add(nodeExercise);
}
示例12: Render
public override void Render(ref XmlTree tree)
{
for (var i = 0; i < 10; i++)
{
var node = XmlTreeNode.Create(this);
node.Text = "Node " + i;
tree.Add(node);
}
}
示例13: Render
public override void Render(ref XmlTree tree)
{
if (this.NodeKey == string.Empty)
{
var seasons = _repository.GetAll().OrderBy(s => s.Year);
foreach (var season in seasons) {
var node = XmlTreeNode.Create(this);
node.NodeID = season.Id.ToString();
node.Text = season.Name;
node.Icon = "calendar.png";
node.Action = "javascript:openSeasonTemplates(" + season.Id + ")";
node.NodeType = "season";
TreeService treeService = new TreeService(-1, TreeAlias, ShowContextMenu, IsDialog, DialogMode, app, string.Format("Season-{0}", season.Id));
node.Source = season.Races.Count() > 0 ? treeService.GetServiceUrl() : "";
node.Menu.Clear();
node.Menu.AddRange(new List<IAction> { ActionNew.Instance, ActionDelete.Instance, ContextMenuSeperator.Instance, ActionRefresh.Instance });
tree.Add(node);
}
} else {
string keyType = this.NodeKey.Split(new string[] { "-" }, StringSplitOptions.RemoveEmptyEntries)[0];
int keyId = int.Parse(this.NodeKey.Split(new string[] { "-" }, StringSplitOptions.RemoveEmptyEntries)[1]);
switch (keyType) {
case "Season":
var season = _repository.GetById(keyId);
if (season != null) {
foreach (var race in season.Races)
{
var node = XmlTreeNode.Create(this);
node.NodeID = race.Id.ToString();
node.Text = race.Circuit.Name;
node.Icon = "map_go.png";
node.NodeType = "seasonRace";
node.Action = "javascript:openSeasonRace(" + race.Id + "," + season.Id + ")";
node.Menu.Clear();
if (race.GetQualificationResults().Count() == 0 && race.GetRaceResults().Count() == 0)
node.Menu.Add(ActionDelete.Instance);
tree.Add(node);
}
}
break;
}
}
}
示例14: Render
public override void Render(ref XmlTree tree)
{
var circuits = _repository.GetAll();
foreach(var circuit in circuits) {
XmlTreeNode xNode = XmlTreeNode.Create(this);
xNode.NodeID = circuit.Id.ToString();
xNode.Text = circuit.Name + " - " + circuit.Country;
xNode.Icon = "map.png";
xNode.Action = "javascript:openCircuits(" + circuit.Id + ")";
tree.Add(xNode);
}
}
示例15: Render
///
/// Override the render method to create the newsletter tree
///
///
public override void Render(ref XmlTree Tree)
{
Tree.treeCollection.Clear();
var node = XmlTreeNode.Create(this);
node.NodeID = "Topic" + Guid.NewGuid();
node.Text = "Topic";
node.Icon = "b_user.png";
node.Action = string.Format("javascript:openTopic({0});", 1355);
var data = GetTreeServiceUrl(node.NodeID);
Tree.Add(node);
}