コード例 #1
0
        /// <summary>
        /// Creates and returns a Path using the supplied Path style, Corner style, Pen, Brush, Target and Source positions, Intermedaite positions (if any) and Magnitude factor.
        /// </summary>
        public static Drawing CreatePath(EPathStyle PathStyle, EPathCorner CornerStyle, Pen PathPen, Brush PathBrush,
                                         Point TargetPosition, Point SourcePosition, IEnumerable <Point> IntermediatePositions = null, double Magnitude = 1.0)
        {
            var Line = new LineGeometry(TargetPosition, SourcePosition);

            // PENDING: Create intermediate segments

            var Result = new GeometryDrawing(PathBrush, PathPen, Line);

            return(Result);
        }
コード例 #2
0
        /// <summary>
        /// Constructor.
        /// </summary>
        public VisualConnectorsFormat(SimplePresentationElement DefaultTailVariant, string DefaultTailPlug,
                                      SimplePresentationElement DefaultHeadVariant, string DefaultHeadPlug,
                                      Brush LineBrush, DashStyle LineDash = null,
                                      double LineThickness = DEFAULT_LINE_THICKNESS, double Opacity = 1.0, Brush BackgroundBrush = null,
                                      EPathStyle PathStyle = EPathStyle.SinglelineStraight, EPathCorner PathCorner = EPathCorner.Rounded,
                                      PenLineCap LineCap   = PenLineCap.Round, PenLineJoin LineJoin = PenLineJoin.Round)
            : base(BackgroundBrush, LineBrush, LineThickness, Opacity, LineDash, LineCap, LineJoin)
        {
            General.ContractRequiresNotNull(DefaultHeadVariant, DefaultTailVariant, LineBrush);
            General.ContractRequiresNotAbsent(DefaultHeadPlug, DefaultTailPlug);

            this.HeadPlugs = new EditableDictionary <SimplePresentationElement, string>(__HeadPlugs.TechName, this);
            this.HeadPlugs.Add(DefaultHeadVariant, DefaultHeadPlug);

            this.TailPlugs = new EditableDictionary <SimplePresentationElement, string>(__TailPlugs.TechName, this);
            this.TailPlugs.Add(DefaultTailVariant, DefaultTailPlug);

            this.PathStyle  = PathStyle;
            this.PathCorner = PathCorner;
        }
コード例 #3
0
 public static void SetPathStyle(VisualConnector Instance, EPathStyle Value)
 {
     SetValue(Instance, __PathStyle.TechName, Value);
 }