using Rhino.Display;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Rhino.Geometry;

namespace EmreIstikam001.component.TehranOffice.Components.ÇİZİM_YARDIMCILARI.DetailSymbol
{
    public class DetailSymbolConduit : DisplayConduit
    {
        private GeometryData geometryData = new GeometryData();
        private int ThicknessPreview = 2;
        private  enum LineTypePreview
        {
            Continuse= 65535,
            Dashed = 61680,
            Dotted = 49344,
            Dash_Dot = 57536,
            Long_Dash = 64512
        }

        public void UpdateGeometry(GeometryData newData)
        {
            geometryData = newData;
            Enabled = geometryData != null && (geometryData.DashedCurves.Count > 0 ||
                                               geometryData.Curves.Count > 0 ||
                                               geometryData.TextCurves.Count > 0 ||
                                               geometryData.Leaders.Count > 0 ||
                                               geometryData.FilletRectangles.Count > 0);
        }

        public void Disable()
        {
            Enabled = false;
        }

        protected override void DrawOverlay(DrawEventArgs e)
        {
            if (geometryData == null)
                return;

            //Draw Dashed curves
            if (geometryData.DashedCurves != null)
            {
                foreach (var curve in geometryData.DashedCurves)
                {
                    Line tempLine = new Line(curve.PointAtStart, curve.PointAtEnd);
                    e.Display.DrawPatternedLine(tempLine, Color.Green, (int)LineTypePreview.Dashed, ThicknessPreview);
                }
            }

            // Draw curves
            if (geometryData.DashedCurves != null)
            {
                
                foreach (var curve in geometryData.Curves)
                {
                    e.Display.DrawCurve(curve, Color.Green, ThicknessPreview);
                }
            }

            // Draw fillet rectangles
            foreach (var curve in geometryData.FilletRectangles)
            {
                e.Display.DrawCurve(curve, Color.Green, ThicknessPreview);
            }

            // Draw leaders
            foreach (var leader in geometryData.Leaders)
            {
                Line leaderShow = new Line(leader.Points3D[1], leader.Points3D[0]);
                Line leaderShow2 = new Line(leader.Points3D[1], leader.Points3D[2]);
                e.Display.DrawArrow(leaderShow, Color.Green,20,0);
                //e.Display.DrawLine(leaderShow, Color.Green, ThicknessPreview);
                e.Display.DrawLine(leaderShow2, Color.Green, ThicknessPreview);
            }

            // Draw texts
            //foreach (var text in geometryData.Texts)
            //{
            //    e.Display.DrawText(text, Color.Green);
            //}

            if (geometryData.TextCurves != null)
            {

                foreach (var curve in geometryData.TextCurves)
                {
                    e.Display.DrawCurve(curve, Color.Green, ThicknessPreview);
                }
            }

        }
    }
}



is it possible to create a general class for preview every thing is in the Rhino.Display.DisplayPipeline ?
the class should have a generic input and based on the type of input shows different overloads relevent to that spicific type.
for example if the generic input is line the Line oveloads should be activated to select from them based on what are the other inputs are.


/// <summary>Draws a single line object.</summary>
/// <param name="line">Line to draw.</param>
/// <param name="color">Color to draw line in.</param>
/// <since>5.0</since>
public void DrawLine(Line line, Color color) => this.DrawLine(line.From, line.To, color, 1);

/// <summary>Draws a single line object.</summary>
/// <param name="line">Line to draw.</param>
/// <param name="color">Color to draw line in.</param>
/// <param name="thickness">Thickness (in pixels) of line.</param>
/// <since>5.0</since>
public void DrawLine(Line line, Color color, int thickness)
{
  this.DrawLine(line.From, line.To, color, thickness);
}

/// <summary>Draws a single line object.</summary>
/// <param name="from">Line from point.</param>
/// <param name="to">Line to point.</param>
/// <param name="color">Color to draw line in.</param>
/// <since>5.0</since>
public void DrawLine(Point3d from, Point3d to, Color color)
{
  this.DrawLine(from, to, color, 1);
}

/// <summary>Draws a single line object.</summary>
/// <param name="from">Line from point.</param>
/// <param name="to">Line to point.</param>
/// <param name="color">Color to draw line in.</param>
/// <param name="thickness">Thickness (in pixels) of line.</param>
/// <since>5.0</since>
public void DrawLine(Point3d from, Point3d to, Color color, int thickness)
{
  UnsafeNativeMethods.CRhinoDisplayPipeline_DrawLine(this.m_ptr, from, to, color.ToArgb(), thickness);
}

/// <summary>
/// Draws a single line object .This version of line drawing will draw the
/// segments of the line that extend beyond the near and far planes of the
/// view frustum with depths on those planes
/// </summary>
/// <param name="from">Line from point.</param>
/// <param name="to">Line to point.</param>
/// <param name="color">Color to draw line in.</param>
/// <param name="thickness">Thickness (in pixels) of line.</param>
/// <since>7.1</since>
public void DrawLineNoClip(Point3d from, Point3d to, Color color, int thickness)
{
  UnsafeNativeMethods.CRhinoDisplayPipeline_DrawLineNoClip(this.m_ptr, from, to, color.ToArgb(), thickness);
}

/// <summary>Draws a single dotted line.</summary>
/// <param name="line">Line to draw.</param>
/// <param name="color">Color of line.</param>
/// <since>5.0</since>
public void DrawDottedLine(Line line, Color color)
{
  this.DrawDottedLine(line.From, line.To, color);
}

/// <summary>Draws a single line with specified pattern.</summary>
/// <param name="line">Line to draw.</param>
/// <param name="color">Color of line.</param>
/// <param name="pattern">Pattern of the line (like 0x00001111 for dotted line).</param>
/// <param name="thickness">Thickness (in pixels) of lines.</param>
/// <since>6.0</since>
public void DrawPatternedLine(Line line, Color color, int pattern, int thickness)
{
  this.DrawPatternedLine(line.From, line.To, color, pattern, thickness);
}

/// <summary>Draws a single dotted line.</summary>
/// <param name="from">Line start point.</param>
/// <param name="to">Line end point.</param>
/// <param name="color">Color of line.</param>
/// <since>5.0</since>
public void DrawDottedLine(Point3d from, Point3d to, Color color)
{
  this.DrawPatternedLine(from, to, color, 4369, 1);
}

/// <summary>Draws a single line with specified pattern.</summary>
/// <param name="from">Line start point.</param>
/// <param name="to">Line end point.</param>
/// <param name="color">Color of line.</param>
/// <param name="pattern">Pattern of the line (like 0x00001111 for dotted line).</param>
/// <param name="thickness">Thickness (in pixels) of lines.</param>
/// <since>6.0</since>
public void DrawPatternedLine(
  Point3d from,
  Point3d to,
  Color color,
  int pattern,
  int thickness)
{
  UnsafeNativeMethods.CRhinoDisplayPipeline_DrawPatternedLine(this.m_ptr, from, to, color.ToArgb(), pattern, thickness);
}