예제 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public bool OnCopyLocationAsHyperlink(object unused)
        {
            CheckDisposed();

            if (m_currentContext != null)
            {
                Clipboard.SetDataObject(m_currentContext.ToString(), true);
            }
            return(true);
        }
예제 #2
0
        public void HandleIncomingLink(FwLink link)
        {
            CheckDisposed();

            FwXWindow fwxwnd = null;
            string    server = link.Server.Replace(".", Environment.MachineName);

            // = FwLink.RestoreServerFromURL(link.Server).Replace(".", Environment.MachineName);
            Debug.Assert(server != null && server != String.Empty);
            string database = link.Database;

            Debug.Assert(database != null && database != String.Empty);
            string key = MakeKey(server, database);

            if (!m_caches.ContainsKey(key))
            {
                // Add command line info.
                Dictionary <string, List <String> > oldTable = m_commandLineArgs;              // Save original args.
                m_commandLineArgs = new Dictionary <string, List <String> >();
                List <String> list = new List <String>();
                list.Add(server);
                m_commandLineArgs.Add("c", list);
                list = new List <String>();
                list.Add(database);
                m_commandLineArgs.Add("db", list);
                list = new List <String>();
                list.Add(link.ToString());
                m_commandLineArgs.Add("link", list);
                Form frm = ActiveForm;
                fwxwnd = (FwXWindow)NewMainWindow(null, false);
                AdjustNewWindowPosition(fwxwnd, frm);
                m_commandLineArgs = oldTable;                 // Restore oringinal args.
            }
            else
            {
                FdoCache cache = m_caches[key];
                // Get window that uses the given DB.
                foreach (FwXWindow wnd in m_rgMainWindows)
                {
                    if (wnd.Cache == cache)
                    {
                        fwxwnd = wnd;
                        break;
                    }
                }
            }
            fwxwnd.Mediator.SendMessage("FollowLink", link);
            bool topmost = fwxwnd.TopMost;

            fwxwnd.TopMost = true;
            fwxwnd.TopMost = topmost;
            fwxwnd.Activate();
        }