Esempio n. 1
0
 /// <summary>
 /// 设置复制,剪切,粘贴的可用性
 /// </summary>
 /// <param name="idoc"></param>
 /// <param name="designPopMenu"></param>
 public void SetDesignContextMenuEnable()
 {
     copyToolStripMenuItem.Enabled  = idoc2.queryCommandEnabled("Copy");
     cutToolStripMenuItem.Enabled   = idoc2.queryCommandEnabled("Cut");
     pasteToolStripMenuItem.Enabled = idoc2.queryCommandEnabled("Paste");
     //inslinkToolStripMenuItem.Enabled = idoc2.queryCommandEnabled("Copy");
 }
Esempio n. 2
0
 public override bool CanUndo()
 {
     if (IDoc2 == null)
     {
         return(false);
     }
     return((bool)IDoc2.queryCommandEnabled("Undo"));
     //return true;
 }
Esempio n. 3
0
        public static void ExecuteCommandHtmlDoc(IHTMLDocument2 htmlDoc, HtmlCommand command, object data)
        {
            try
            {
                if (htmlDoc.IsNull())
                {
                    return;
                }

                // ensure command is valid and enabled
                if (!htmlDoc.queryCommandSupported(command.Name()))
                {
                    return;
                }

                if (!htmlDoc.queryCommandEnabled(command.Name()))
                {
                    return;
                }

                htmlDoc.execCommand(command.Name(), false, data);
            }
            catch (RemotingException) { }
            catch (UnauthorizedAccessException) { }
        }
Esempio n. 4
0
        public static object QueryValueHtmlDoc(IHTMLDocument2 htmlDoc, HtmlCommand command)
        {
            try
            {
                if (htmlDoc.IsNull())
                {
                    return(null);
                }

                // ensure command is valid and enabled
                if (!htmlDoc.queryCommandSupported(command.Name()))
                {
                    return(null);
                }

                if (!htmlDoc.queryCommandEnabled(command.Name()))
                {
                    return(null);
                }

                return(htmlDoc.queryCommandValue(command.Name()));
            }
            catch (RemotingException) { }
            catch (UnauthorizedAccessException) { }

            return(null);
        }
Esempio n. 5
0
        public bool IsCommandEnabled(string name)
        {
            IHTMLDocument2 doc = (IHTMLDocument2)Browser.Document;

            if (doc == null)
            {
                return(false);
            }

            return(doc.queryCommandEnabled(name));
        }
        private bool IsCommandEnabled(string wCmd)
        {
            IHTMLDocument2 _doc2 = m_webBrowser.Document.DomDocument as IHTMLDocument2;

            if (_doc2 != null)
            {
                return(_doc2.queryCommandEnabled(wCmd));
            }

            return(false);
        }
Esempio n. 7
0
 private bool pIsCmdEnabled(string Cmd)
 {
     if (BrowserView.Document != null)
     {
         IHTMLDocument2 doc2 = (mshtml.IHTMLDocument2)BrowserView.Document.DomDocument;
         if (doc2 != null)
         {
             return(doc2.queryCommandEnabled(Cmd));
         }
     }
     return(false);
 }
Esempio n. 8
0
 /// <summary>
 /// Determine the status of the Undo command in the document editor.
 /// </summary>
 /// <returns>whether or not an undo operation is currently valid</returns>
 public bool CanUndo()
 {
     return(doc.queryCommandEnabled("Undo"));
 }
Esempio n. 9
0
 public bool CanExecuteCommand(NoteEditorCommand command)
 {
     return(htmlDoc.queryCommandEnabled(command.Value));
 }
Esempio n. 10
0
 public bool queryCommandEnabled(string cmdID)
 {
     return(_innerDoc2.queryCommandEnabled(cmdID));
 }