Ejemplo n.º 1
0
 /// <summary>
 /// 判断是否显示修改痕迹详细信息的逻辑,供外部调用。
 /// 现在供ZYTextChar、ZTTextBlock调用,ZYTextChar类中用于对自由文本的逻辑判断,ZYTextBlock类中用于结构化元素的逻辑判断
 /// </summary>
 /// <param name="ele"></param>
 /// <param name="x"></param>
 /// <param name="y"></param>
 /// <returns></returns>
 public static bool ShowModifyTipFormLogic(ZYTextElement ele, int x, int y)
 {
     //Add By wwj 2011-09-30 在三级检诊中对于被删除或新增的元素显示详细的修改人和修改时间
     if ((ele.Deleteted || ele.DeleterIndex != -1 || ele.CreatorIndex != -1) /*元素有变更*/ && ele.Bounds.Contains(x, y) /*鼠标点击的当前元素*/)
     {
         ZYTextSaveLogCollection saveLogs = ele.OwnerDocument.SaveLogs;
         if (saveLogs.Count > ele.DeleterIndex && saveLogs.Count > ele.CreatorIndex)
         {
             ZYTextSaveLog saveLog;
             if (ele.DeleterIndex != -1)
             {
                 saveLog = saveLogs[ele.DeleterIndex];
             }
             else
             {
                 saveLog = saveLogs[ele.CreatorIndex];
             }
             if (saveLog.Level > 0)
             {
                 ModifyTipForm modifyTipForm = new ModifyTipForm(ele, saveLog);
                 modifyTipForm.Show();
                 return(true);
             }
         }
     }
     return(false);
 }
Ejemplo n.º 2
0
        protected override void OnViewDoubleClick(System.Windows.Forms.MouseEventArgs e)
        {
            ZYTextElement curChar = myDocument.GetElementByPos(e.X, e.Y);

            if (ModifyTipForm.ShowModifyTipFormLogic(curChar, e.X, e.Y))
            {
                return;
            }

            if (bolLockingUI && !IsInActiveEditArea(this.Document.Content.CurrentElement))
            {
                return;
            }
            if (myDocument != null)
            {
                System.Drawing.Point p = new System.Drawing.Point(e.X, e.Y);
                if (p.X != -1 || p.Y != -1)
                {
                    myDocument.ViewMouseDoubleClick(p.X, p.Y, System.Windows.Forms.Control.MouseButtons);
                }
            }
            base.OnViewDoubleClick(e);
        }