public override string derelativizeLinkAccordingToKbaseDirectory(string path) { string retVal = path; // if it's a physical drive, we don't do this if (!path.Substring(1, 1).Equals(":")) retVal = new HyperlinkUtil(Universe.Instance.Path).Derelativize(path); return retVal; }
private void insertFileLink(string path) { if (path != null) { path = new HyperlinkUtil(Universe.Instance.Path).Relativize(path) + ""; path = System.Web.HttpUtility.UrlPathEncode(path); path = "<file://" + path + ">"; Paste(path); } }
private void InsertHyperlink() { if (!Enabled) return; OpenFileDialog fileDialog = new OpenFileDialog(); DialogResult result = fileDialog.ShowDialog(); if (result == DialogResult.OK) { string path = fileDialog.FileName; if (path != null) { path = new HyperlinkUtil(Universe.Instance.Path).Relativize(path) + ""; path = System.Web.HttpUtility.UrlPathEncode(path); path = "<file://" + path + ">"; Paste(path); } } }