コード例 #1
0
                public IEditableUIControl HandleMouseDoubleClick(PointF point)
                {
                    // for double click, we need to give all our child controls a chance to consume

                    // see if any of our child controls contain the point
                    foreach (IUIControl control in ChildControls)
                    {
                        // if this control is editable
                        IEditableUIControl editableControl = control as IEditableUIControl;
                        if (editableControl != null)
                        {
                            // if it (or a child) consumes, return that
                            IEditableUIControl consumingControl = editableControl.HandleMouseDoubleClick(point);
                            if (consumingControl != null)
                            {
                                return(consumingControl);
                            }
                        }
                    }

                    // create a grabbable corner outside of the paragraph words
                    RectangleF frame = GetFrame( );

                    frame.Inflate(CornerExtensionSize, CornerExtensionSize);

                    if (frame.Contains(point))
                    {
                        // notify the caller we're consuming, and turn on edit mode
                        EditMode_Begin( );
                        return(this);
                    }

                    return(null);
                }
コード例 #2
0
ファイル: Note.cs プロジェクト: J3057/MobileApp
                public IEditableUIControl HandleMouseDoubleClick(PointF position)
                {
                    // let each child add itself and its children
                    foreach (IUIControl control in ChildControls)
                    {
                        IEditableUIControl editableControl = control as IEditableUIControl;
                        if (editableControl != null)
                        {
                            IEditableUIControl targetControl = editableControl.HandleMouseDoubleClick(position);

                            if (targetControl != null)
                            {
                                return(targetControl);
                            }
                        }
                    }

                    return(null);
                }