Exemple #1
0
 public SmileyPart(string smileyType, ChatMessagePart parent = null)
     : base(parent)
 {
     smiley = getEmoji(smileyType);
     if (smiley == null)
         smiley = getEmoji(smileyType);
 }
Exemple #2
0
 public override ChatMessagePart MouseMove(PointF location, MouseEventArgs e)
 {
     if (parts == null)
     {
         MouseMoveInternal(location, e);
         return(this);
     }
     else
     {
         return(MouseForwarding(location, e, new ChatMessagePart.ForwardingDelegate(
                                    delegate(ChatMessagePart part, PointF loc, MouseEventArgs ev) {
             ChatMessagePart tmp = part.MouseMove(loc, ev);
             if (previousHover != tmp)
             {
                 if (previousHover != null)
                 {
                     previousHover.MouseLeave(loc, ev);
                 }
                 if (tmp != null)
                 {
                     tmp.MouseEnter(loc, ev);
                 }
             }
             previousHover = tmp;
         })));
     }
 }
Exemple #3
0
        public override ChatMessagePart MouseMove(PointF location, MouseEventArgs e)
        {
            if (parts == null)
            {
                MouseMoveInternal(location, e);
                return this;
            }
            else
            {
                return MouseForwarding(location, e, new ChatMessagePart.ForwardingDelegate(
                    delegate (ChatMessagePart part, PointF loc, MouseEventArgs ev) {
                        ChatMessagePart tmp = part.MouseMove(loc, ev);
                        if (previousHover != tmp)
                        {
                            if (previousHover != null)
                            {
                                previousHover.MouseLeave(loc, ev);
                            }
                            if (tmp != null)
                            {
                                tmp.MouseEnter(loc, ev);
                            }

                        }
                        previousHover = tmp;
                    }));
            }
        }
Exemple #4
0
 public override ChatMessagePart MouseLeave(PointF location, MouseEventArgs e)
 {
     if (previousHover != null) {
         previousHover.MouseLeave (location, e);
     }
     return previousHover = null;
 }
Exemple #5
0
 public override ChatMessagePart MouseLeave(PointF location, MouseEventArgs e)
 {
     if (previousHover != null)
     {
         previousHover.MouseLeave(location, e);
     }
     return(previousHover = null);
 }
Exemple #6
0
 public SmileyPart(string smileyType, ChatMessagePart parent = null)
     : base(parent)
 {
     smiley = getEmoji(smileyType);
     if (smiley == null)
     {
         smiley = getEmoji(smileyType);
     }
 }
 public ChatMessagePart(ChatMessagePart parent = null, Font font = null)
 {
     this.parent = parent;
     this.parts = null;
     if (font == null && parent != null)
         this.Font = parent.Font;
     else
         this.Font = font;
 }
Exemple #8
0
 public TextPart(XmlElement element, ChatMessagePart parent = null, Font font = null)
     : base(parent, font)
 {
     stf = StringFormat.GenericTypographic;
     stf.FormatFlags |= StringFormatFlags.NoClip;
     formatFlags = TextFormatFlags.Default | TextFormatFlags.TextBoxControl | TextFormatFlags.NoPadding | TextFormatFlags.NoPrefix | TextFormatFlags.NoClipping;
     Text = XML = element.InnerText;
     PreParse(element);
     InitText();
 }
Exemple #9
0
 public TextPart(XmlElement element, ChatMessagePart parent = null, Font font = null)
     : base(parent, font)
 {
     stf              = StringFormat.GenericTypographic;
     stf.FormatFlags |= StringFormatFlags.NoClip;
     formatFlags      = TextFormatFlags.Default | TextFormatFlags.TextBoxControl | TextFormatFlags.NoPadding | TextFormatFlags.NoPrefix | TextFormatFlags.NoClipping;
     Text             = XML = element.InnerText;
     PreParse(element);
     InitText();
 }
Exemple #10
0
        public LinkPart(ChatMessagePart parent=null,Font font = null)
            : base(parent,font)
        {
            if (font == null)
                defaultFont = new Font(parent.Font, parent.Font.Style | FontStyle.Underline);
            else
                defaultFont = new Font(font, font.Style | FontStyle.Underline);

            formatFlags = TextFormatFlags.Default | TextFormatFlags.TextBoxControl | TextFormatFlags.NoPadding | TextFormatFlags.NoPrefix;

            clickedFont = defaultFont;
        }
Exemple #11
0
 public ChatMessagePart(ChatMessagePart parent = null, Font font = null)
 {
     this.parent = parent;
     this.parts  = null;
     if (font == null && parent != null)
     {
         this.Font = parent.Font;
     }
     else
     {
         this.Font = font;
     }
 }
Exemple #12
0
 public ChatMessage(ChatLogControl parent, User user, string xml)
 {
     this.parent = parent;
     this.user = user;
     stf = StringFormat.GenericTypographic;
     stf.FormatFlags |= StringFormatFlags.NoClip | StringFormatFlags.NoWrap;
     stf.FormatFlags |= StringFormatFlags.LineLimit;
     stf.LineAlignment = StringAlignment.Center;
     XmlDocument doc = new XmlDocument();
     doc.LoadXml("<body>" + xml + "</body>");
     XmlElement root = (XmlElement)doc.FirstChild;
     this.root = new RootPart(this,(XmlElement)root, new Font("Arial", 16));
     if (user != null)
         Nick = user.ID;
 }
Exemple #13
0
        public LinkPart(ChatMessagePart parent = null, Font font = null)
            : base(parent, font)
        {
            if (font == null)
            {
                defaultFont = new Font(parent.Font, parent.Font.Style | FontStyle.Underline);
            }
            else
            {
                defaultFont = new Font(font, font.Style | FontStyle.Underline);
            }

            formatFlags = TextFormatFlags.Default | TextFormatFlags.TextBoxControl | TextFormatFlags.NoPadding | TextFormatFlags.NoPrefix;

            clickedFont = defaultFont;
        }
Exemple #14
0
        public ChatMessage(ChatLogControl parent, User user, string xml)
        {
            this.parent       = parent;
            this.user         = user;
            stf               = StringFormat.GenericTypographic;
            stf.FormatFlags  |= StringFormatFlags.NoClip | StringFormatFlags.NoWrap;
            stf.FormatFlags  |= StringFormatFlags.LineLimit;
            stf.LineAlignment = StringAlignment.Center;
            XmlDocument doc = new XmlDocument();

            doc.LoadXml("<body>" + xml + "</body>");
            XmlElement root = (XmlElement)doc.FirstChild;

            this.root = new RootPart(this, (XmlElement)root, new Font("Arial", 16));
            if (user != null)
            {
                Nick = user.ID;
            }
        }
Exemple #15
0
 public override ChatMessagePart MouseEnter(PointF location, MouseEventArgs e)
 {
     return previousHover = null;
 }
Exemple #16
0
 public ChatMessagePart(XmlElement xml, ChatMessagePart parent = null, Font font = null)
     : this(parent, font)
 {
     ParseXml(xml);
 }
Exemple #17
0
 private static ChatMessagePart CreateInstance(Type type, string element, ChatMessagePart parent)
 {
     return((ChatMessagePart)type.GetConstructor(new Type[] { typeof(string), typeof(ChatMessagePart), typeof(Font) }).Invoke(new object[] { element, parent, null }));
 }
Exemple #18
0
 public override ChatMessagePart MouseEnter(PointF location, MouseEventArgs e)
 {
     return(previousHover = null);
 }
Exemple #19
0
 public TextPart(string text, ChatMessagePart parent = null, Font font = null)
     : base(parent, font)
 {
     Text = XML = text;
     InitText();
 }
 public ChatMessagePart(XmlElement xml, ChatMessagePart parent = null, Font font = null)
     : this(parent, font)
 {
     ParseXml(xml);
 }
 private static ChatMessagePart CreateInstance(Type type, string element, ChatMessagePart parent)
 {
     return (ChatMessagePart)type.GetConstructor(new Type[] { typeof(string), typeof(ChatMessagePart), typeof(Font) }).Invoke(new object[] { element, parent, null });
 }
Exemple #22
0
 public LinkPart(string text, ChatMessagePart parent = null, Font font = null)
     : this(parent, font)
 {
     Text = text;
     link = text;
 }
Exemple #23
0
 public ContainerPart(XmlElement xml, ChatMessagePart parent = null, Font font = null)
     : base(xml, parent,font)
 {
 }
Exemple #24
0
 public LinkPart(string text, ChatMessagePart parent = null, Font font = null)
     : this(parent, font)
 {
     Text = text;
     link = text;
 }
Exemple #25
0
 public TextPart(string text, ChatMessagePart parent = null, Font font = null)
     : base(parent, font)
 {
     Text = XML = text;
     InitText();
 }
Exemple #26
0
 public ContainerPart(XmlElement xml, ChatMessagePart parent = null, Font font = null)
     : base(xml, parent, font)
 {
 }