Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/22/13 22:57:09 (11 years ago)
Author:
mkommend
Message:

#2006: Changed GhostFactory to not hold a reference to the View object and completely removed the TextEditor tool as it was not in use.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Netron/3.0.2672.12446/HeuristicLab.Netron-3.0.2672.12446/Ghosts.cs

    r4068 r9181  
    3535namespace HeuristicLab.Netron {
    3636  internal static class GhostsFactory {
    37     private static RectGhost mRectangular;
    38     private static LineGhost mLine;
    39     private static EllipticGhost mEllipse;
    40     private static MultiLineGhost mMultiLine;
    41     private static CurvedLineGhost mCurvedLine;
    42     private static PolygonGhost mPolygon;
    43 
    44     private static IView mView;
    45     public static IView View {
    46       get { return mView; }
    47       set { mView = value; }
    48     }
    49 
    5037    [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
    51     public static IGhost GetGhost(object pars, GhostTypes type) {
     38    public static IGhost GetGhost(object pars, GhostTypes type, IView View) {
    5239      Point[] points;
    5340      switch (type) {
    5441        case GhostTypes.Rectangle:
    55           if (mRectangular == null)
    56             mRectangular = new RectGhost(View);
     42          var mRectangular = new RectGhost(View);
    5743          points = (Point[])pars;
    5844          mRectangular.Start = points[0];
     
    6046          return mRectangular;
    6147        case GhostTypes.Ellipse:
    62           if (mEllipse == null)
    63             mEllipse = new EllipticGhost(View);
     48          var mEllipse = new EllipticGhost(View);
    6449          points = (Point[])pars;
    6550          mEllipse.Start = points[0];
     
    6752          return mEllipse;
    6853        case GhostTypes.Line:
    69           if (mLine == null)
    70             mLine = new LineGhost(View);
     54          var mLine = new LineGhost(View);
    7155          points = (Point[])pars;
    7256          mLine.Start = points[0];
     
    7458          return mLine;
    7559        case GhostTypes.MultiLine:
    76           if (mMultiLine == null)
    77             mMultiLine = new MultiLineGhost(View);
     60          var mMultiLine = new MultiLineGhost(View);
    7861          points = (Point[])pars;
    7962          mMultiLine.Points = points;
    8063          return mMultiLine;
    8164        case GhostTypes.CurvedLine:
    82           if (mCurvedLine == null)
    83             mCurvedLine = new CurvedLineGhost(View);
     65          var mCurvedLine = new CurvedLineGhost(View);
    8466          points = (Point[])pars;
    8567          mCurvedLine.Points = points;
    8668          return mCurvedLine;
    8769        case GhostTypes.Polygon:
    88           if (mPolygon == null)
    89             mPolygon = new PolygonGhost(View);
     70          var mPolygon = new PolygonGhost(View);
    9071          points = (Point[])pars;
    9172          mPolygon.Points = points;
Note: See TracChangeset for help on using the changeset viewer.