• 大小: 7.83MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-11-02
  • 语言: 其他
  • 标签: 绘图几何  

资源简介

Silverlight在线几何绘图,功能还行,非常好用!

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.xml.Linq;
using GuiLabs.Utils.Actions;

namespace DynamicGeometry
{
    public class Drawing
    {
        public Drawing(Canvas newCanvas)
        {
            ActionManager = new ActionManager();
            Behavior = new Dragger();

            Figures = new RootFigureList() { Drawing = this };

            OnAttachToCanvas += Drawing_OnAttachToCanvas;
            OnDetachFromCanvas += Drawing_OnDetachFromCanvas;
            Canvas = newCanvas;

            CoordinateSystem = new CoordinateSystem(this);
            CoordinateGrid = new CartesianGrid() { Drawing = this };
            Figures.Add(CoordinateGrid);
        }

        public IFigure this[string index]
        {
            get { return Figures[index]; }
        }

        void Drawing_OnAttachToCanvas(Canvas e)
        {
            e.SizeChanged += mCanvas_SizeChanged;
            Figures.OnAddingToCanvas(e);
        }

        void Drawing_OnDetachFromCanvas(Canvas e)
        {
            e.SizeChanged -= mCanvas_SizeChanged;
            Figures.OnRemovingFromCanvas(e);
        }

        #region Events

        public event EventHandlerchangedEventArgs> Selectionchanged;

        public class SelectionchangedEventArgs : EventArgs
        {
            public SelectionchangedEventArgs()
            {
                SelectedFigures = Enumerable.Empty();
            }

            public SelectionchangedEventArgs(IEnumerable selection)
                : this()
            {
                SelectedFigures = selection;
            }

            public SelectionchangedEventArgs(IFigure singleSelection)
                : this(singleSelection.AsEnumerable())
            {
            }

            public IEnumerable SelectedFigures { get; set; }
        }

        internal void ClearSelectedFigures()
        {
            foreach (IFigure figure in this.Figures)
            {
                if (figure.Selected)
                {
                    figure.Selected = false;
                }
            }
        }

        internal void RaiseSelectionchanged(SelectionchangedEventArgs args)
        {
            if (Selectionchanged != null)
            {
                Selectionchanged(this args);
            }
        }

        public class ConstructionStepCompleteEventArgs : EventArgs
        {
            public bool ConstructionComplete { get; set; }
            public Type FigureTypeNeeded { get; set; }
        }

        public event EventHandler ConstructionStepComplete;

        internal void RaiseConstructionStepComplete(ConstructionStepCompleteEventArgs args)
        {
            if (ConstructionStepComplete != null)
            {
                ConstructionStepCo

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       2066  2007-03-07 08:34  china-code.net.txt

     文件       2066  2007-03-07 08:34  Main\china-code.net.txt

    .......      1462  2009-06-13 19:12  Main\DynamicGeometryLibrary\Actions\AbstractAction.cs

    .......      9639  2009-06-13 19:12  Main\DynamicGeometryLibrary\Actions\ActionManager.cs

    .......      4471  2009-06-13 19:12  Main\DynamicGeometryLibrary\Actions\Actions.cs

     文件       2066  2007-03-07 08:34  Main\DynamicGeometryLibrary\Actions\china-code.net.txt

    .......       291  2009-06-13 19:12  Main\DynamicGeometryLibrary\Actions\GeometryAction.cs

     文件       2066  2007-03-07 08:34  Main\DynamicGeometryLibrary\Actions\History\china-code.net.txt

    .......       708  2009-06-13 19:12  Main\DynamicGeometryLibrary\Actions\History\IActionHistory.cs

    .......      5024  2009-06-13 19:12  Main\DynamicGeometryLibrary\Actions\History\SimpleHistory.cs

    .......      1488  2009-06-13 19:12  Main\DynamicGeometryLibrary\Actions\History\SimpleHistoryNode.cs

     文件      13457  2007-03-07 08:49  Main\DynamicGeometryLibrary\Actions\History\说明.html

    .......      1208  2009-06-13 19:12  Main\DynamicGeometryLibrary\Actions\IAction.cs

    .......      1813  2009-06-13 19:12  Main\DynamicGeometryLibrary\Actions\IMultiAction.cs

    .......       596  2009-06-13 19:12  Main\DynamicGeometryLibrary\Actions\Transaction.cs

    .......      2235  2009-06-13 19:12  Main\DynamicGeometryLibrary\Actions\Transactionbase.cs

     文件      13457  2007-03-07 08:49  Main\DynamicGeometryLibrary\Actions\说明.html

    .......      7344  2009-06-13 19:12  Main\DynamicGeometryLibrary\Behaviors\Behavior.cs

    .......      1507  2009-06-13 19:12  Main\DynamicGeometryLibrary\Behaviors\BehaviorOrderer.cs

     文件       2066  2007-03-07 08:34  Main\DynamicGeometryLibrary\Behaviors\china-code.net.txt

    .......      5832  2009-06-13 19:12  Main\DynamicGeometryLibrary\Behaviors\Dragger.cs

    .......      9773  2009-06-13 19:12  Main\DynamicGeometryLibrary\Behaviors\FigureCreator.cs

    .......      3990  2009-06-13 19:12  Main\DynamicGeometryLibrary\Behaviors\IconBuilder.cs

     文件      13457  2007-03-07 08:49  Main\DynamicGeometryLibrary\Behaviors\说明.html

     文件       2066  2007-03-07 08:34  Main\DynamicGeometryLibrary\Bin\china-code.net.txt

     文件       2066  2007-03-07 08:34  Main\DynamicGeometryLibrary\Bin\Debug\china-code.net.txt

     文件       2066  2007-03-07 08:34  Main\DynamicGeometryLibrary\Bin\Debug\de\china-code.net.txt

     文件      15208  2008-11-12 20:05  Main\DynamicGeometryLibrary\Bin\Debug\de\System.xml.Linq.resources.dll

     文件      13457  2007-03-07 08:49  Main\DynamicGeometryLibrary\Bin\Debug\de\说明.html

     文件     211968  2009-06-15 08:35  Main\DynamicGeometryLibrary\Bin\Debug\DynamicGeometry.dll

............此处省略1692个文件信息

评论

共有 条评论

相关资源