コード例 #1
0
        private void htmlEditControl1_CancellableUserInteraction(object sender, Zoople.CancellableUserInteractionEventsArgs e)
        {
            if (e.InteractionType == "onexternaldrop")
            {
                if (e.OtherInfo.ToString() != "")
                {
                    try
                    {
                        Uri oURI = new Uri(e.OtherInfo.ToString());

                        if (oURI.IsFile)
                        {
                            FileInfo oFile = new FileInfo(oURI.LocalPath);

                            if (".jpg.gif.png.jpeg".Contains(oFile.Extension))
                            {
                                e.Cancel = true;
                                htmlEditControl1.InsertHTMLElement("img").SetAttribute("src", "data:image/jpeg;base64," + Base64fromImage(oURI.LocalPath));
                            }
                        }
                    }
                    catch
                    {
                        e.Cancel = false;
                    }
                }
            }
        }
コード例 #2
0
 private void OEdit_CancellableUserInteraction(object sender, Zoople.CancellableUserInteractionEventsArgs e)
 {
     if (e.InteractionType == "onkeydown")
     {
         if (e.Keys.Keycode == (int)Keys.S && e.Keys.Control)
         {
             e.Cancel = true;
             SaveDocument();
         }
         else
         {
             if (e.Keys.Keycode == (int)Keys.O && e.Keys.Control)
             {
                 e.Cancel = true;
                 OpenDocument();
             }
             else
             {
                 if (e.Keys.Keycode == (int)Keys.N && e.Keys.Control)
                 {
                     e.Cancel = true;
                     newToolStripButton_Click(this, null);
                 }
             }
         }
     }
 }