/// <summary> /// Builds a context descriptor with the given parameters that will provide a url link to the correct area in FLEx. /// </summary> internal static ContextDescriptor GenerateContextDescriptor(string filePath, string guid, string label) { var appId = "FLEx"; var directory = Path.GetDirectoryName(filePath); var lastDirectory = Path.GetFileName(directory); if (lastDirectory == "Scripture") { appId = "TE"; } // figure out here which we need. var fwAppArgs = new FwAppArgs(appId, "current", "", "default", guid); // Add the "label" information which the Chorus Notes browser extracts to identify the object in the UI. // This is just for a label and we can't have & or = in the value. So replace them if they occur. fwAppArgs.AddProperty("label", label.Replace("&", " and ").Replace("=", " equals ")); // The FwUrl has all the query part encoded. // Chorus needs it unencoded so it can extract the label. var fwUrl = fwAppArgs.ToString(); var hostLength = fwUrl.IndexOf("?", StringComparison.Ordinal); var host = fwUrl.Substring(0, hostLength); var query = HttpUtilityFromMono.UrlDecode(fwUrl.Substring(hostLength + 1)); var url = host + "?" + query; return(new ContextDescriptor(label, url)); }
/// <summary> /// /// </summary> /// <returns></returns> public bool OnCopyLocationAsHyperlink(object unused) { CheckDisposed(); if (m_currentContext != null) { FdoCache cache = (FdoCache)m_mediator.PropertyTable.GetValue("cache"); var args = new FwAppArgs(FwUtils.ksFlexAbbrev, cache.ProjectId.Handle, cache.ProjectId.ServerName, m_currentContext.ToolName, m_currentContext.TargetGuid); ClipboardUtils.SetDataObject(args.ToString(), true); } return(true); }
/// <summary> /// /// </summary> /// <returns></returns> public bool OnCopyLocationAsHyperlink(object unused) { CheckDisposed(); if (m_currentContext != null) { LcmCache cache = m_propertyTable.GetValue <LcmCache>("cache"); var args = new FwAppArgs(cache.ProjectId.Handle, m_currentContext.ToolName, m_currentContext.TargetGuid); ClipboardUtils.SetDataObject(args.ToString(), true); } return(true); }