Exemplo n.º 1
0
        /// <summary>
        /// Determines if two cells have identical settings.
        /// </summary>
        /// <param name="cell">Cell to compare with.</param>
        /// <returns><b>true</b> if cells are equal.</returns>
        public bool Equals(TableCell cell)
        {
            // do not override exising Equals method. It is used to compare elements in a list,
            // and will cause problems in the designer.
            return(cell != null &&
                   Fill.Equals(cell.Fill) &&
                   TextFill.Equals(cell.TextFill) &&
                   HorzAlign == cell.HorzAlign &&
                   VertAlign == cell.VertAlign &&
                   Border.Equals(cell.Border) &&
                   Font.Equals(cell.Font) &&
                   Formats.Equals(cell.Formats) &&
                   Highlight.Equals(cell.Highlight) &&
                   Restrictions == cell.Restrictions &&
                   Hyperlink.Equals(cell.Hyperlink) &&
                   Padding == cell.Padding &&
                   AllowExpressions == cell.AllowExpressions &&
                   Brackets == cell.Brackets &&
                   HideZeros == cell.HideZeros &&
                   HideValue == cell.HideValue &&
                   Angle == cell.Angle &&
                   RightToLeft == cell.RightToLeft &&
                   WordWrap == cell.WordWrap &&
                   Underlines == cell.Underlines &&
                   Trimming == cell.Trimming &&
                   FontWidthRatio == cell.FontWidthRatio &&
                   FirstTabOffset == cell.FirstTabOffset &&
                   ParagraphOffset == cell.ParagraphOffset &&
                   TabWidth == cell.TabWidth &&
                   Clip == cell.Clip &&
                   Wysiwyg == cell.Wysiwyg &&
                   LineHeight == cell.LineHeight &&
                   Style == cell.Style &&
                   EvenStyle == cell.EvenStyle &&
                   HoverStyle == cell.HoverStyle &&
                   HasHtmlTags == cell.HasHtmlTags &&
                   NullValue == cell.NullValue &&
                   ProcessAt == cell.ProcessAt &&
                   Printable == cell.Printable &&
                   Exportable == cell.Exportable &&
                   CellDuplicates == cell.CellDuplicates &&
                   // events
                   BeforePrintEvent == cell.BeforePrintEvent &&
                   AfterPrintEvent == cell.AfterPrintEvent &&
                   AfterDataEvent == cell.AfterDataEvent
                   &&
                   Cursor == cell.Cursor &&
                   ClickEvent == cell.ClickEvent &&
                   MouseDownEvent == cell.MouseDownEvent &&
                   MouseMoveEvent == cell.MouseMoveEvent &&
                   MouseUpEvent == cell.MouseUpEvent &&
                   MouseEnterEvent == cell.MouseEnterEvent &&
                   MouseLeaveEvent == cell.MouseLeaveEvent

                   );
        }
Exemplo n.º 2
0
        // Helper that returns true if passed caretPosition and backspacePosition cross a hyperlink end boundary
        // (under the assumption that caretPosition and backSpacePosition are adjacent insertion positions).
        public static bool IsHyperlinkBoundaryCrossed(TextPointer caretPosition, TextPointer backspacePosition, ref Hyperlink backspacePositionHyperlink)
        {
            Hyperlink caretPositionHyperlink = GetHyperlinkAncestor(caretPosition);

            backspacePositionHyperlink = GetHyperlinkAncestor(backspacePosition);

            return((caretPositionHyperlink == null && backspacePositionHyperlink != null) || (caretPositionHyperlink != null && backspacePositionHyperlink != null && !caretPositionHyperlink.Equals(backspacePositionHyperlink)));
        }