Project options.
Inheritance: ObservableObject
Example #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="XProject"/> class.
 /// </summary>
 public XProject()
     : base()
 {
     _options        = XOptions.Create();
     _styleLibraries = ImmutableArray.Create <XLibrary <ShapeStyle> >();
     _groupLibraries = ImmutableArray.Create <XLibrary <XGroup> >();
     _databases      = ImmutableArray.Create <XDatabase>();
     _templates      = ImmutableArray.Create <XContainer>();
     _documents      = ImmutableArray.Create <XDocument>();
 }
Example #2
0
        /// <summary>
        /// Creates a new <see cref="XOptions"/> instance.
        /// </summary>
        /// <returns>The new instance of the <see cref="XOptions"/> class.</returns>
        public static XOptions Create()
        {
            var options = new XOptions()
            {
                SnapToGrid          = true,
                SnapX               = 15.0,
                SnapY               = 15.0,
                HitThreshold        = 7.0,
                MoveMode            = XMoveMode.Point,
                DefaultIsStroked    = true,
                DefaultIsFilled     = false,
                DefaultIsClosed     = true,
                DefaultIsSmoothJoin = true,
                DefaultFillRule     = XFillRule.EvenOdd,
                TryToConnect        = false,
                CloneStyle          = false
            };

            options.SelectionStyle =
                ShapeStyle.Create(
                    "Selection",
                    0x7F, 0x33, 0x33, 0xFF,
                    0x4F, 0x33, 0x33, 0xFF,
                    1.0);

            options.HelperStyle =
                ShapeStyle.Create(
                    "Helper",
                    0xFF, 0x00, 0x00, 0x00,
                    0xFF, 0x00, 0x00, 0x00,
                    1.0);

            options.PointStyle =
                ShapeStyle.Create(
                    "Point",
                    0xFF, 0x00, 0x00, 0x00,
                    0xFF, 0x00, 0x00, 0x00,
                    1.0);

            options.PointShape = RectanglePointShape(options.PointStyle);

            return(options);
        }
Example #3
0
        private void Remove(XOptions options)
        {
            if (options == null)
                return;

            if (options.PointShape != null)
            {
                Remove(options.PointShape);
            }

            if (options.PointStyle != null)
            {
                Remove(options.PointStyle);
            }

            if (options.SelectionStyle != null)
            {
                Remove(options.SelectionStyle);
            }

            if (options.HelperStyle != null)
            {
                Remove(options.HelperStyle);
            }
        }
Example #4
0
 public void Inherits_From_ObservableObject()
 {
     var target = new XOptions();
     Assert.True(target is ObservableObject);
 }
Example #5
0
        /// <summary>
        /// Creates a new <see cref="XOptions"/> instance.
        /// </summary>
        /// <returns>The new instance of the <see cref="XOptions"/> class.</returns>
        public static XOptions Create()
        {
            var options = new XOptions()
            {
                SnapToGrid = true,
                SnapX = 15.0,
                SnapY = 15.0,
                HitThreshold = 7.0,
                MoveMode = XMoveMode.Point,
                DefaultIsStroked = true,
                DefaultIsFilled = false,
                DefaultIsClosed = true,
                DefaultIsSmoothJoin = true,
                DefaultFillRule = XFillRule.EvenOdd,
                TryToConnect = false,
                CloneStyle = false
            };

            options.SelectionStyle =
                ShapeStyle.Create(
                    "Selection",
                    0x7F, 0x33, 0x33, 0xFF,
                    0x4F, 0x33, 0x33, 0xFF,
                    1.0);

            options.HelperStyle =
                ShapeStyle.Create(
                    "Helper",
                    0xFF, 0x00, 0x00, 0x00,
                    0xFF, 0x00, 0x00, 0x00,
                    1.0);

            options.PointStyle =
                ShapeStyle.Create(
                    "Point",
                    0xFF, 0x00, 0x00, 0x00,
                    0xFF, 0x00, 0x00, 0x00,
                    1.0);

            options.PointShape = RectanglePointShape(options.PointStyle);

            return options;
        }