本文整理汇总了C#中umbraco.cms.presentation.Trees.XmlTree类的典型用法代码示例。如果您正苦于以下问题:C# XmlTree类的具体用法?C# XmlTree怎么用?C# XmlTree使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XmlTree类属于umbraco.cms.presentation.Trees命名空间,在下文中一共展示了XmlTree类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Render
public override void Render(ref XmlTree tree)
{
List<DocumentType> docTypes;
if (base.m_id == -1)
docTypes = DocumentType.GetAllAsList().FindAll(delegate(DocumentType dt) { return dt.MasterContentType == 0; });
else
docTypes = DocumentType.GetAllAsList().FindAll(delegate(DocumentType dt) { return dt.MasterContentType == base.m_id; });
foreach (DocumentType dt in docTypes)
{
XmlTreeNode xNode = XmlTreeNode.Create(this);
xNode.NodeID = dt.Id.ToString();
xNode.Text = dt.Text;
xNode.Action = "javascript:openNodeType(" + dt.Id + ");";
xNode.Icon = "settingDataType.gif";
xNode.OpenIcon = "settingDataType.gif";
xNode.Source = GetTreeServiceUrl(dt.Id);
xNode.HasChildren = dt.HasChildren;
if (dt.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);
}
}
}
开发者ID:elrute,项目名称:Triphulcas,代码行数:32,代码来源:loadNodeTypes.cs
示例2: 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);
}
}
}
开发者ID:phaniarveti,项目名称:Experiments,代码行数:31,代码来源:loadMediaTypes.cs
示例3: BaseTree_BeforeNodeRender
private void BaseTree_BeforeNodeRender(ref XmlTree sender, ref XmlTreeNode node, EventArgs e)
{
if (node.Menu == null || node.NodeType.ToLower() != "content") return;
node.Menu.Insert(3, new TranslationCreationAction());
node.Menu.Insert(3, ContextMenuSeperator.Instance);
node.Menu.Insert(5, ContextMenuSeperator.Instance);
}
开发者ID:purna,项目名称:Polyglot,代码行数:7,代码来源:MenuCustomisation.cs
示例4: 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);
}
}
}
开发者ID:elrute,项目名称:Triphulcas,代码行数:28,代码来源:loadCache.cs
示例5: Render
/// <summary>
/// Renders the specified tree item.
/// </summary>
/// <param name="Tree">The tree.</param>
public override void Render(ref XmlTree Tree)
{
//get documents to render
Document[] docs = Document.GetChildrenForTree(m_id);
var args = new TreeEventArgs(Tree);
OnBeforeTreeRender(docs, args);
foreach (Document dd in docs)
{
List<IAction> allowedUserOptions = GetUserActionsForNode(dd);
if (CanUserAccessNode(dd, allowedUserOptions))
{
XmlTreeNode node = CreateNode(dd, allowedUserOptions);
OnRenderNode(ref node, dd);
OnBeforeNodeRender(ref Tree, ref node, EventArgs.Empty);
if (node != null)
{
Tree.Add(node);
OnAfterNodeRender(ref Tree, ref node, EventArgs.Empty);
}
}
}
//args = new TreeEventArgs(Tree);
OnAfterTreeRender(docs, args);
}
开发者ID:jracabado,项目名称:justEdit-,代码行数:33,代码来源:BaseContentTree.cs
示例6: FileSystemTree_AfterNodeRender
void FileSystemTree_AfterNodeRender(ref XmlTree sender, ref XmlTreeNode node, EventArgs e)
{
if (node.TreeType == "scripts" && new Core().GetPossibleExtensions(Enums.TranslatorType.Script).Contains(Path.GetExtension(node.NodeID)))
{
sender.Remove(node);
}
}
开发者ID:Jeavon,项目名称:BundlingAndMinificationForTheMasses,代码行数:7,代码来源:StartUpHandlers.cs
示例7: Render
/// <summary>
/// Override the render method to add the recycle bin to the end of this tree
/// </summary>
/// <param name="Tree"></param>
public override void Render(ref XmlTree tree)
{
base.Render(ref tree);
XmlTreeNode recycleBin = CreateRecycleBin();
if (recycleBin != null)
tree.Add(recycleBin);
}
开发者ID:jracabado,项目名称:justEdit-,代码行数:11,代码来源:loadContent.cs
示例8: BaseTree_BeforeNodeRender
private void BaseTree_BeforeNodeRender(ref XmlTree sender, ref XmlTreeNode node, EventArgs e)
{
if (node.TreeType.ToLower() == "content")
{
try
{
Document document = new Document(Convert.ToInt32(node.NodeID));
//this changes the create action b/c of the UI.xml entry
if (CreateDocTypes.Contains(document.ContentType.Alias))
{
node.NodeType = "uNews";
}
if (RemoveCreateDocTypes.Contains(document.ContentType.Alias))
{
node.Menu.Remove(ActionNew.Instance);
}
}
catch (Exception e2)
{
}
}
}
开发者ID:kgiszewski,项目名称:uNews,代码行数:26,代码来源:uNewsEvents.cs
示例9: 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);
}
开发者ID:Narnoo,项目名称:Narnoo-ASP.NET-SDK,代码行数:30,代码来源:ApplicationTree.cs
示例10: 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);
}
}
开发者ID:phaniarveti,项目名称:Experiments,代码行数:25,代码来源:loadMemberGroups.cs
示例11: 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);
}
}
}
开发者ID:phaniarveti,项目名称:Experiments,代码行数:30,代码来源:loadNodeTypes.cs
示例12: 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);
}
开发者ID:kgiszewski,项目名称:uTools,代码行数:60,代码来源:uToolsTree.cs
示例13: 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);
}
}
}
}
开发者ID:jracabado,项目名称:justEdit-,代码行数:25,代码来源:loadTranslationTasks.cs
示例14: 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);
}
}
开发者ID:robgray,项目名称:f1speedguides,代码行数:28,代码来源:loadResultsQualifyingResults.cs
示例15: 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);
}
}
}
开发者ID:saciervo,项目名称:Umbraco-CMS,代码行数:30,代码来源:loadDictionary.cs
示例16: Render
public override void Render(ref XmlTree tree)
{
var users = new List<User>(User.getAll());
User currUser = UmbracoEnsuredPage.CurrentUser;
bool currUserIsAdmin = currUser.IsAdmin();
foreach (User u in users.OrderBy(x => x.Disabled))
{
if (!UmbracoConfig.For.UmbracoSettings().Security.HideDisabledUsersInBackoffice
|| (UmbracoConfig.For.UmbracoSettings().Security.HideDisabledUsersInBackoffice && !u.Disabled))
{
XmlTreeNode xNode = XmlTreeNode.Create(this);
// special check for ROOT user
if (u.Id == 0)
{
//if its the administrator, don't create a menu
xNode.Menu = null;
//if the current user is not the administrator, then don't add this node.
if (currUser.Id != 0)
continue;
}
// Special check for admins in general (only show admins to admins)
else if (!currUserIsAdmin && u.IsAdmin())
{
continue;
}
//xNode.IconClass = "umbraco-tree-icon-grey";
xNode.NodeID = u.Id.ToString();
xNode.Text = u.Name;
xNode.Action = "javascript:openUser(" + u.Id + ");";
xNode.Icon = "icon-user";
xNode.OpenIcon = "icon-user";
if (u.Disabled) {
xNode.Style.DimNode();
}
OnBeforeNodeRender(ref tree, ref xNode, EventArgs.Empty);
if (xNode != null)
{
tree.Add(xNode);
OnAfterNodeRender(ref tree, ref xNode, EventArgs.Empty);
}
}
}
}
开发者ID:phaniarveti,项目名称:Experiments,代码行数:59,代码来源:loadUsers.cs
示例17: Render
public override void Render(ref XmlTree tree)
{
base.Render(ref tree);
if (!string.IsNullOrEmpty(NodeKey))
{
return;
}
}
开发者ID:BarryFogarty,项目名称:ubootstrap,代码行数:8,代码来源:LoadLessFiles.cs
示例18: 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);
}
}
开发者ID:jakobloekke,项目名称:Belle,代码行数:9,代码来源:LegacyTestTree.cs
示例19: BaseTree_BeforeNodeRender
private void BaseTree_BeforeNodeRender(ref XmlTree sender, ref XmlTreeNode node, EventArgs e)
{
//LogHelper.Info<AddTranslationAction>(node.NodeType.ToLower());
switch (node.NodeType.ToLower())
{
case "content":
try
{
var document = ApplicationContext.Current.Services.ContentService.GetById(Convert.ToInt32(node.NodeID));
var translationDocType = ApplicationContext.Current.Services.ContentTypeService.GetContentType(document.ContentType.Alias + BabelFishCreateTranslation.PropertySuffix);
/*
LogHelper.Info<AddTranslationAction>("translationDocType=>" + (translationDocType == null).ToString());
LogHelper.Info<AddTranslationAction>("document.ContentType=>" + (document.ContentType == null).ToString());
LogHelper.Info<AddTranslationAction>("translationDocType.ParentId=>" + (translationDocType.ParentId).ToString());
LogHelper.Info<AddTranslationAction>("document.ContentType.Id=>" + (document.ContentType.Id).ToString());
LogHelper.Info<AddTranslationAction>("translationDocType.PropertyTypeExists=>" + translationDocType.PropertyTypeExists(BabelFishCreateTranslation.LanguagePropertyAlias).ToString());
*/
if (
translationDocType != null &&
document.ContentType != null &&
(translationDocType.ParentId == document.ContentType.Id) &&
translationDocType.PropertyTypeExists(BabelFishCreateTranslation.LanguagePropertyAlias))
{
node.Menu.Insert(7, ContextMenuSeperator.Instance);
node.Menu.Insert(8, ActionCreateTranslation.Instance);
}
//remove 'create' for 'BabelFishTranslationFolder'
if (document.ContentType.Alias == BabelFishCreateTranslation.BabelFishFolderDocTypeAlias)
{
node.Menu.Remove(ActionNew.Instance);
}
//remove 'create' for 'Translation' doctype
if (document.ContentType.Alias.EndsWith(BabelFishCreateTranslation.PropertySuffix))
{
node.Menu.Remove(ActionNew.Instance);
try
{
node.Icon = document.GetValue<string>(BabelFishCreateTranslation.LanguagePropertyAlias) + ".png";
}
catch {}
}
}
catch (Exception e2)
{
LogHelper.Error<AddTranslationAction>(e2.Message, e2);
}
break;
}
}
开发者ID:kgiszewski,项目名称:BabelFish,代码行数:57,代码来源:BabelFishEvents.cs
示例20: 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;
}
}
}
开发者ID:robgray,项目名称:f1speedguides,代码行数:56,代码来源:loadSeasonTemplates.cs
注:本文中的umbraco.cms.presentation.Trees.XmlTree类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论