public IEnumerable <string> GetFiles() { var files = new HashSetEx <string>(); string libdir = GetLibDirectory(); if (Directory.Exists(libdir)) { foreach (string fn in Directory.GetFiles(libdir, "*" + FileExtension)) { string ofn = Path.Combine(GetDirectory(), Path.GetFileName(fn)); if (File.Exists(ofn)) { files.Add(IOTool.NormalizePath(ofn)); yield return(ofn); } else { yield return(fn); } } } foreach (string fn in Directory.GetFiles(GetDirectory(), "*" + FileExtension)) { if (files.Contains(IOTool.NormalizePath(fn))) { continue; } yield return(fn); } }
protected override void PostprocessChildren(List <ITreeNode> children) { var node = children.Find(n => IOTool.NormalizePath(n.FileSystemPath) == IOTool.NormalizePath(Core.DataSamplesDirectory)); if (node != null) { children.Remove(node); if (!GlobalSettings.Pages.Tree().HideDataSamplesFolder) { children.Insert(0, new DataSamplesFolderTreeNode(this, Core.DataSamplesDirectory)); } } if (VersionInfo.DatabaseSamplesFolder != null && Directory.Exists(VersionInfo.DatabaseSamplesFolder)) { children.Insert(0, new DataSamplesFolderTreeNode(this, VersionInfo.DatabaseSamplesFolder)); } }
public void OpenAsNewWindow(AppObject appobj) { string winid = appobj.GetFileFriendlySignature() + "#dashboard#" + IOTool.NormalizePath(AddonFileName); if (MainWindow.Instance.HasContent(winid)) { MainWindow.Instance.ActivateContent(winid); return; } var pars = new DashboardInstanceParams { LayoutName = appobj.GetFileFriendlySignature() }; var win = CreateControl(pars) as DashboardFrame; if (win == null) { return; } win.SetSelectedObject(appobj); win.WinId = winid; MainWindow.Instance.OpenContent(win); }
protected override void GetConnectionKey(CacheKeyBuilder ckb) { base.GetConnectionKey(ckb); ckb.Add(IOTool.NormalizePath(FileName)); }