protected override SerializationFileSystemTree CreateTree(TreeRoot root, ISerializationFormatter formatter, bool useDataCache) { var tree = new TfsSerializationFileSystemTree(root.Name, root.Path, root.DatabaseName, Path.Combine(PhysicalRootPath, root.Name), formatter, useDataCache); tree.TreeItemChanged += metadata => { foreach (var watcher in ChangeWatchers) watcher(metadata, tree.DatabaseName); }; return tree; }
private static bool RootPathParentExists(IDataStore dataStore, TreeRoot include) { if (include.Path.IndexOf('/') < 0) return false; var rootPathParent = include.Path.TrimEnd('/'); rootPathParent = rootPathParent.Substring(0, rootPathParent.LastIndexOf('/')); if (rootPathParent.Equals("/")) rootPathParent = "/sitecore"; return dataStore.GetByPath(rootPathParent, include.DatabaseName).FirstOrDefault() != null; }
// note: we pass in these params (formatter, datacache) so that overriding classes may get access to private vars indirectly (can't get at them otherwise because this is called from the constructor) protected virtual SerializationFileSystemTree CreateTree(TreeRoot root, ISerializationFormatter formatter, bool useDataCache) { var tree = new SerializationFileSystemTree(root.Name, root.Path, root.DatabaseName, Path.Combine(PhysicalRootPath, root.Name), formatter, useDataCache); tree.TreeItemChanged += metadata => { foreach (var watcher in ChangeWatchers) { watcher(metadata, tree.DatabaseName); } }; return(tree); }
private static bool RootPathExists(IDataStore dataStore, TreeRoot include) { return dataStore.GetByPath(include.Path, include.DatabaseName).FirstOrDefault() != null; }
protected virtual SerializationFileSystemTree CreateTree(TreeRoot root) { var tree = new SerializationFileSystemTree(root.Name, root.Path, root.DatabaseName, Path.Combine(PhysicalRootPath, root.Name), _formatter, _useDataCache); tree.TreeItemChanged += metadata => { foreach (var watcher in ChangeWatchers) watcher(metadata, tree.DatabaseName); }; return tree; }