public IContentTreeNodeProvider GetProviderForTreeNode(TreeNode treeNode) { var allProviders = GetAllTreeNodeProviders().Where(a => a.GetType().AssemblyQualifiedName.StartsWith(treeNode.Type.Split(',')[0])).ToArray(); var provider = allProviders.FirstOrDefault(); provider.Controller = treeNode.ControllerName; return provider; }
public TreeNode Create(TreeNode treeNode) { var db = databaseRetriever.GetDatabase(); db.TreeNodes.Insert(treeNode); TouchLegacyFilestorePathToInvalidateAnyCachesThatAreListeningForChanges(); Thread.Sleep(1500); return treeNode; }
public void Create(TreeNode treeNode) { lock (_lockObject) { var list = xmlFileSerializationHelper.DeserializeListFromPath<TreeNode>(GetXmlFilePath()); list.Add(treeNode); xmlFileSerializationHelper.SerializeListToPath(list, GetXmlFilePath()); } }
public void Update(TreeNode treeNode) { lock(_lockObject) { var list = xmlFileSerializationHelper.DeserializeListFromPath<TreeNode>(GetXmlFilePath()); list.Remove(list.Where(a => a.TreeNodeId == treeNode.TreeNodeId).FirstOrDefault()); list.Add(treeNode); xmlFileSerializationHelper.SerializeListToPath(list, GetXmlFilePath()); } }
public void Update(TreeNode treeNode) { dataModelDataContext.Update(treeNode); }
public TreeNode Create(TreeNode treeNode) { dataModelDataContext.Create(treeNode); Thread.Sleep(1500); return treeNode; }
public void Update(TreeNode treeNode) { var db = databaseRetriever.GetDatabase(); db.TreeNodes.UpdateByTreeNodeId(treeNode); TouchLegacyFilestorePathToInvalidateAnyCachesThatAreListeningForChanges(); }
private TreeNodeSummary GetTreeNodeSummaryForTreeNode(TreeNode treeNode) { var provider = treeNodeProviderContext.GetProviderByTypeName(treeNode.Type); if (provider == null) throw new Exception(string.Format("Content tree node provider for type: {0} not found.", treeNode.Type)); var treeNodeExtension = provider.GetAll().Where(a => a.TreeNodeId == treeNode.Id).FirstOrDefault(); if (treeNodeExtension == null) return null; var treeNodeSummary = new TreeNodeSummary() { Name = treeNodeExtension.Name, Id = treeNode.Id, UrlSegment = treeNodeExtension.UrlSegment, HasChildren = treeNodeRepository.GetAll().Where(a => a.ParentTreeNodeId == treeNode.Id).Any(), ControllerToUseForModification = provider.ControllerToUseForModification, ActionToUseForModification = provider.ActionToUseForModification, ControllerToUseForCreation = provider.ControllerToUseForCreation, ActionToUseForCreation = provider.ActionToUseForCreation, RouteValuesForModification = new { TreeNodeId = treeNode.Id }, RouteValuesForCreation = new { ParentTreeNodeId = treeNode.Id }, ParentTreeNodeId = treeNode.ParentTreeNodeId, Sequence = treeNodeExtension.Sequence, Type = treeNode.Type, MayHaveChildNodes = provider.MayHaveChildNodes, Hidden = treeNodeExtension.Hidden, IconUrl = treeNodeExtension.IconUrl, LastModifyBy = treeNodeExtension.LastModifyBy, LastModifyDate = treeNodeExtension.LastModifyDate, Active = !treeNodeExtension.Inactive }; return treeNodeSummary; }
public TreeNode Create(TreeNode treeNode) { dataModelDataContext.Create(treeNode); return treeNode; }