예제 #1
0
 private void thickToolStripMenuItem_Click(object sender, EventArgs e)
 {
     _selectedSize = PenSize.Thick;
     thickToolStripMenuItem.Checked  = true;
     thinToolStripMenuItem.Checked   = false;
     mediumToolStripMenuItem.Checked = false;
     UpdatePen();
 }
예제 #2
0
    public override int GetHashCode()
    {
        int hash = 1;

        if (Key.Length != 0)
        {
            hash ^= Key.GetHashCode();
        }
        if (Type != 0)
        {
            hash ^= Type.GetHashCode();
        }
        if (Name.Length != 0)
        {
            hash ^= Name.GetHashCode();
        }
        if (RoomKey.Length != 0)
        {
            hash ^= RoomKey.GetHashCode();
        }
        if (Msg.Length != 0)
        {
            hash ^= Msg.GetHashCode();
        }
        if (BeginPoint != 0D)
        {
            hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(BeginPoint);
        }
        if (EndPoint != 0D)
        {
            hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(EndPoint);
        }
        if (PenSize != 0)
        {
            hash ^= PenSize.GetHashCode();
        }
        if (Color != 0)
        {
            hash ^= Color.GetHashCode();
        }
        if (_unknownFields != null)
        {
            hash ^= _unknownFields.GetHashCode();
        }
        return(hash);
    }
예제 #3
0
    public override int GetHashCode()
    {
        int hash = 1;

        if (Key.Length != 0)
        {
            hash ^= Key.GetHashCode();
        }
        if (Type != 0)
        {
            hash ^= Type.GetHashCode();
        }
        if (Broadcast != false)
        {
            hash ^= Broadcast.GetHashCode();
        }
        if (Name.Length != 0)
        {
            hash ^= Name.GetHashCode();
        }
        if (Avatar.Length != 0)
        {
            hash ^= Avatar.GetHashCode();
        }
        if (Seat != 0)
        {
            hash ^= Seat.GetHashCode();
        }
        if (RoomKey.Length != 0)
        {
            hash ^= RoomKey.GetHashCode();
        }
        if (RoomName.Length != 0)
        {
            hash ^= RoomName.GetHashCode();
        }
        if (Message.Length != 0)
        {
            hash ^= Message.GetHashCode();
        }
        if (BeginPoint != 0D)
        {
            hash ^= BeginPoint.GetHashCode();
        }
        if (EndPoint != 0D)
        {
            hash ^= EndPoint.GetHashCode();
        }
        if (PenSize != 0)
        {
            hash ^= PenSize.GetHashCode();
        }
        if (Color != 0)
        {
            hash ^= Color.GetHashCode();
        }
        hash ^= users_.GetHashCode();
        hash ^= rooms_.GetHashCode();
        if (Code != 0)
        {
            hash ^= Code.GetHashCode();
        }
        if (Error.Length != 0)
        {
            hash ^= Error.GetHashCode();
        }
        if (Id != 0)
        {
            hash ^= Id.GetHashCode();
        }
        return(hash);
    }
예제 #4
0
 private void btnLargePen_Click(object sender, RoutedEventArgs e)
 {
     pen = PenSize.Large;
     canvas.EditingMode = InkCanvasEditingMode.Ink;
 }
예제 #5
0
        private void AddStrokeAsPoints(Stroke stroke, PenSize size)
        {
            int count = 0;

            StylusPointCollection spc = new StylusPointCollection();

            foreach (StylusPoint sp in stroke.StylusPoints)
            {
                int scale = 1;

                if (size == PenSize.Medium)
                {
                    scale = 2;
                }
                if (size == PenSize.Large)
                {
                    scale = 4;
                }

                double x = sp.X - (sp.X % scale) + 0.5;
                double y = sp.Y - (sp.Y % scale) + 0.5;

                StylusPoint point = new StylusPoint(x, y);
                if (!spc.Contains(point))
                {
                    spc.Add(point);
                }

                if ((size == PenSize.Medium) || (size == PenSize.Large))
                {
                    point = new StylusPoint(x + 1, y);
                    if (!spc.Contains(point))
                    {
                        spc.Add(point);
                    }
                    point = new StylusPoint(x, y + 1);
                    if (!spc.Contains(point))
                    {
                        spc.Add(point);
                    }
                    point = new StylusPoint(x + 1, y + 1);
                    if (!spc.Contains(point))
                    {
                        spc.Add(point);
                    }

                    if (size == PenSize.Large)
                    {
                        point = new StylusPoint(x + 2, y);
                        if (!spc.Contains(point))
                        {
                            spc.Add(point);
                        }
                        point = new StylusPoint(x + 3, y);
                        if (!spc.Contains(point))
                        {
                            spc.Add(point);
                        }
                        point = new StylusPoint(x + 2, y + 1);
                        if (!spc.Contains(point))
                        {
                            spc.Add(point);
                        }
                        point = new StylusPoint(x + 3, y + 1);
                        if (!spc.Contains(point))
                        {
                            spc.Add(point);
                        }
                        point = new StylusPoint(x, y + 2);
                        if (!spc.Contains(point))
                        {
                            spc.Add(point);
                        }
                        point = new StylusPoint(x + 1, y + 2);
                        if (!spc.Contains(point))
                        {
                            spc.Add(point);
                        }
                        point = new StylusPoint(x + 2, y + 2);
                        if (!spc.Contains(point))
                        {
                            spc.Add(point);
                        }
                        point = new StylusPoint(x + 3, y + 2);
                        if (!spc.Contains(point))
                        {
                            spc.Add(point);
                        }
                        point = new StylusPoint(x, y + 3);
                        if (!spc.Contains(point))
                        {
                            spc.Add(point);
                        }
                        point = new StylusPoint(x + 1, y + 3);
                        if (!spc.Contains(point))
                        {
                            spc.Add(point);
                        }
                        point = new StylusPoint(x + 2, y + 3);
                        if (!spc.Contains(point))
                        {
                            spc.Add(point);
                        }
                        point = new StylusPoint(x + 3, y + 3);
                        if (!spc.Contains(point))
                        {
                            spc.Add(point);
                        }
                    }
                }

                if (!spc.Contains(point))
                {
                    spc.Add(point);
                }

                Stroke st = new Stroke(spc);
                st.DrawingAttributes = inkDA;

                if (!canvas.Strokes.Contains(st))
                {
                    canvas.Strokes.Add(st);
                    count++;
                }
                spc = new StylusPointCollection();
            }
            ActionHistory.Add(Actions.AddStroke);
            UndoPoints.Add(count);
            dirty = true;
        }