コード例 #1
0
ファイル: Form1.cs プロジェクト: 15831944/Test3-1
        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.AddExtension    = true;
            openFileDialog.CheckFileExists = true;
            openFileDialog.CheckPathExists = true;
            openFileDialog.DefaultExt      = "ModelStencil";
            openFileDialog.Filter          = "ModelStencils|*.ModelStencil";
            openFileDialog.Multiselect     = false;
            openFileDialog.ShowHelp        = false;
            openFileDialog.ShowReadOnly    = false;
            openFileDialog.SupportMultiDottedExtensions = true;
            openFileDialog.FileName = System.IO.Path.GetFileName(path);
            openFileDialog.Title    = "Open ModelStencil";

            openFileDialog.InitialDirectory = System.IO.Path.GetFullPath(path);

            if (openFileDialog.ShowDialog(this) == DialogResult.OK)
            {
                modelStencil = OpenModelStencil(openFileDialog.FileName);

                editPropertiesToolStripMenuItem.Enabled = true;
                saveToolStripMenuItem.Enabled           = true;

                ResetFlowChart(true);
                SetStencil(modelStencil);
                SetControls(modelStencil);
            }
            path = openFileDialog.FileName;
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: 15831944/Test3-1
        static public ShapeTemplate GetShapeTemplate(ModelStencil stencil)
        {
            int i;

            if (stencil != null)
            {
                ElementTemplate[] elementTemplate = new ElementTemplate[stencil.Elements.Count];
                i = 0;

                foreach (Element element in stencil.Elements)
                {
                    elementTemplate[i] = Element(element);
                    i++;
                }

                ElementTemplate[] decorationTemplate = new ElementTemplate[stencil.Decorations.Count];
                i = 0;

                foreach (Element decoration in stencil.Decorations)
                {
                    decorationTemplate[i] = Element(decoration);
                    i++;
                }

                return(new ShapeTemplate(elementTemplate, decorationTemplate, null, stencil.FillMode, stencil.Tag));
            }

            else
            {
                return(null);
            }
        }
コード例 #3
0
ファイル: Form1.cs プロジェクト: 15831944/Test3-1
        private void SaveModelStencil(string fullpath, ModelStencil modelStencil)
        {
            SoapFormatter sf           = new SoapFormatter();
            StreamWriter  streamWriter = new StreamWriter(fullpath);
            Stream        stream       = streamWriter.BaseStream;

            sf.Serialize(stream, modelStencil);
            stream.Close();
        }
コード例 #4
0
ファイル: Form1.cs プロジェクト: 15831944/Test3-1
        private ModelStencil OpenModelStencil(string fullpath)
        {
            SoapFormatter sf           = new SoapFormatter();
            StreamReader  streamRdr    = new StreamReader(fullpath);
            Stream        stream       = streamRdr.BaseStream;
            ModelStencil  modelStencil = (ModelStencil)sf.Deserialize(stream);

            modelStencil.Tag = System.IO.Path.GetFileNameWithoutExtension(fullpath);
            return(modelStencil);
        }
コード例 #5
0
ファイル: Form1.cs プロジェクト: 15831944/Test3-1
        private void SetStencil(ModelStencil modelStencil)
        {
            toolStripStatusLabel1.Text = "";

            modelBox.Shape   = GetShapeTemplate(modelStencil);
            modelBox.Visible = true;

            foreach (Preview preview in previews)
            {
                preview.SetStencil(GetShapeTemplate(modelStencil));
            }

            flowChart1.Enabled = true;
        }
コード例 #6
0
ファイル: NetServer.cs プロジェクト: 15831944/Test3-1
        void TrimAnchorPoints(ModelStencil modelStencil)
        {
            ArrayList anchors      = modelStencil.Anchors;
            ArrayList validAnchors = new ArrayList();

            for (int i = 0; i < anchors.Count; i++)
            {
                Anchor anchor = (Anchor)(anchors[i]);
                if (ValidAnchor(anchor))
                {
                    validAnchors.Add(anchor);
                }
            }

            modelStencil.Anchors = validAnchors;
        }
コード例 #7
0
ファイル: Program.cs プロジェクト: 15831944/Test3-1
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            FlowChart flowchart = new FlowChart();

            Config config = new Config();

            if (config.TestUrl(new System.Uri("ipc://SysCAD.Service/Global")))
            {
                config.Syncxxx();

                Dictionary <String, Bitmap> modelThumbnails   = new Dictionary <String, Bitmap>();
                Dictionary <String, Bitmap> graphicThumbnails = new Dictionary <String, Bitmap>();

                foreach (String key in config.ModelStencils.Keys)
                {
                    ModelStencil stencil = config.ModelStencils[key];
                    flowchart.DocExtents   = flowchart.ClientToDoc(new System.Drawing.Rectangle(0, 0, 17, 17));
                    flowchart.ShadowsStyle = ShadowsStyle.None;
                    flowchart.BackColor    = System.Drawing.SystemColors.Window;
                    flowchart.AntiAlias    = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
                    RectangleF boxRect = flowchart.ClientToDoc(new System.Drawing.Rectangle(1, 1, 13, 13));
                    Box        box     = flowchart.CreateBox(boxRect.X, boxRect.Y, boxRect.Width, boxRect.Height);
                    box.Style      = BoxStyle.Shape;
                    box.Shape      = GetShapeTemplate(stencil);
                    box.FillColor  = System.Drawing.Color.FromArgb(150, System.Drawing.Color.BurlyWood);
                    box.FrameColor = System.Drawing.Color.FromArgb(255, System.Drawing.Color.BurlyWood);
                    box.Locked     = true;
                    modelThumbnails.Add(key, flowchart.CreateImage());
                    flowchart.DeleteObject(box);
                }

                Application.Run(new TestAppForm(modelThumbnails, config.ModelStencils));
            }
        }
コード例 #8
0
        public void LoadProject(ClientProtocol clientProtocol, Config config)
        {
            if (InvokeRequired)
            {
                BeginInvoke(new LoadProjectDelegate(LoadProject), new object[] { clientProtocol, config });
            }
            else
            {
                // Close the one selected.
                if (frmFlowChart != null)
                {
                    FileCloseProject();
                }

                clientProtocol.Connect("SysCAD10\nConnection: Client");
                config.Syncxxx();

                Refresh();

                frmFlowChart = new FrmFlowChart(this);

                SuspendLayout();
                frmFlowChart.SuspendLayout();
                frmFlowChart.FlowChart.SuspendLayout();
                NavigationTreeView.SuspendLayout();

                frmFlowChart.WindowState = System.Windows.Forms.FormWindowState.Maximized;

                frmFlowChart.MdiParent = this;
                frmFlowChart.Text      = clientProtocol.Name;

                frmFlowChart.SetProject(clientProtocol, config, NavigationTreeView);

                ovOverview.Document = frmFlowChart.FlowChart;

                frmFlowChart.FlowChart.SelectionChanged += new SelectionEvent(this.frmFlowChart_fcFlowChart_SelectionChanged);

                graphicPropertyGrid.LinkChanged += frmFlowChart.PropertyGridLinkChanged;
                graphicPropertyGrid.NodeChanged += frmFlowChart.PropertyGridNodeChanged;

                {
                    Dictionary <String, Bitmap> modelThumbnails = new Dictionary <String, Bitmap>();
                    //Dictionary<String, Bitmap> graphicThumbnails = new Dictionary<String, Bitmap>();

                    FlowChart thumbnailFlowchart = new FlowChart();

                    foreach (String key in frmFlowChart.State.Config.ModelStencils.Keys)
                    {
                        ModelStencil stencil = config.ModelStencils[key];
                        thumbnailFlowchart.DocExtents   = frmFlowChart.FlowChart.ClientToDoc(new System.Drawing.Rectangle(0, 0, 17, 17));
                        thumbnailFlowchart.ShadowsStyle = ShadowsStyle.None;
                        thumbnailFlowchart.BackColor    = System.Drawing.SystemColors.Window;
                        thumbnailFlowchart.AntiAlias    = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
                        RectangleF boxRect = thumbnailFlowchart.ClientToDoc(new System.Drawing.Rectangle(1, 1, 13, 13));
                        Box        box     = thumbnailFlowchart.CreateBox(boxRect.X, boxRect.Y, boxRect.Width, boxRect.Height);
                        box.Style      = BoxStyle.Shape;
                        box.Shape      = State.GetShapeTemplate(stencil, false, false);
                        box.FillColor  = System.Drawing.Color.FromArgb(220, 222, 184, 136);
                        box.FrameColor = System.Drawing.Color.FromArgb(255, 111, 92, 68);
                        box.Locked     = true;
                        modelThumbnails.Add(key, thumbnailFlowchart.CreateImage());
                        thumbnailFlowchart.DeleteObject(box);
                    }

                    stencilChooser1.PopulateTree(modelThumbnails, config.ModelStencils);
                }

                frmFlowChart.State.ProjectAttached = true;
                SetButtonStates();

                frmFlowChart.Show();

                this.NavigationTreeView.NodeSelectionChange     += new System.EventHandler(this.tvNavigation_NodeSelectionChange);
                this.NavigationTreeView.AfterNodePositionChange += new PureComponents.TreeView.TreeView.AfterNodePositionChangeEventHandler(this.tvNavigation_AfterNodePositionChange);
                this.NavigationTreeView.NodeMouseClick          += new PureComponents.TreeView.TreeView.NodeMouseClickEventHandler(this.tvNavigation_NodeMouseClick);

                NavigationTreeView.ClearNodeSelection();

                foreach (PureComponents.TreeView.Node node in NavigationTreeView.Nodes)
                {
                    node.Select();
                    node.Expand();
                    SelectSubNodes(node);
                }

                NavigationTreeView.ResumeLayout(true);
                frmFlowChart.FlowChart.ResumeLayout(true);
                frmFlowChart.ResumeLayout(true);
                ResumeLayout(true);

                frmFlowChart.ZoomToVisible();
            }
        }
コード例 #9
0
ファイル: NetServer.cs プロジェクト: 15831944/Test3-1
        void GetStencils()
        {
            {
                int iStencil = 0;
                LogNote("Srvr", 0, "ModelStencils:");
                String[] dirs = Directory.GetFiles(m_StencilPath, "*.modelstencil");
                for (int i = 0; i < dirs.GetLength(0); i++)
                {
                    String fullpath = dirs[i];

                    ////Create dummy ModelStencil for comparison...
                    //{
                    //  ModelStencil modelStencil = new ModelStencil();
                    //  modelStencil.Tag = "";
                    //  modelStencil.GroupName = "Control";
                    //  ArrayList elements = new ArrayList();
                    //  SysCAD.Protocol.Arc arc = new SysCAD.Protocol.Arc(0, 0, 100, 100, 10, 360);
                    //  elements.Add(arc);
                    //  modelStencil.Elements = elements;

                    //  modelStencil.Decorations = new ArrayList();
                    //  modelStencil.Anchors = new ArrayList();
                    //  modelStencil.FillMode = System.Drawing.Drawing2D.FillMode.Alternate;

                    //  SoapFormatter sf = new SoapFormatter();
                    //  StreamWriter streamWriter = new StreamWriter(fullpath+".new");
                    //  Stream stream = streamWriter.BaseStream;
                    //  sf.Serialize(stream, modelStencil);
                    //  stream.Close();
                    //}

                    SoapFormatter sf           = new SoapFormatter();
                    StreamReader  streamRdr    = new StreamReader(fullpath);
                    Stream        stream       = streamRdr.BaseStream;
                    ModelStencil  modelStencil = (ModelStencil)sf.Deserialize(stream);
                    modelStencil.Tag = Path.GetFileNameWithoutExtension(fullpath);

                    if (ConfirmModelStencil(modelStencil))
                    {
                        TrimAnchorPoints(modelStencil);
                        m_Config.ModelStencils.Add(Path.GetFileNameWithoutExtension(fullpath), modelStencil);
                    }

                    stream.Close();
                    //Console.WriteLine("  {0}] {1}", iStencil++, Path.GetFileNameWithoutExtension(fullpath));
                    LogNote("Srvr", 0, "  %i] %s", iStencil++, Path.GetFileNameWithoutExtension(fullpath));
                }

                Console.WriteLine("\n");
            }

            {
                int iStencil = 0;
                LogNote("Srvr", 0, "GraphicStencils:");
                String[] dirs = Directory.GetFiles(m_StencilPath, "*.graphicstencil");
                for (int i = 0; i < dirs.GetLength(0); i++)
                {
                    String fullpath = dirs[i];

                    ////Create dummy GraphicStencil for comparison...
                    //{
                    //  GraphicStencil graphicStencil = new GraphicStencil();
                    //  graphicStencil.Tag = "";
                    //  ArrayList elements = new ArrayList();
                    //  SysCAD.Protocol.Arc arc = new SysCAD.Protocol.Arc(0, 0, 100, 100, 10, 360);
                    //  elements.Add(arc);
                    //  graphicStencil.Elements = elements;

                    //  graphicStencil.Decorations = new ArrayList();

                    //  SoapFormatter sf = new SoapFormatter();
                    //  StreamWriter streamWriter = new StreamWriter(fullpath+".new");
                    //  Stream stream = streamWriter.BaseStream;
                    //  sf.Serialize(stream, graphicStencil);
                    //  stream.Close();
                    //}

                    SoapFormatter  sf             = new SoapFormatter();
                    Stream         stream         = (new StreamReader(fullpath)).BaseStream;
                    GraphicStencil graphicStencil = (GraphicStencil)sf.Deserialize(stream);
                    stream.Close();


                    graphicStencil.Tag = Path.GetFileNameWithoutExtension(fullpath);
                    m_Config.GraphicStencils.Add(Path.GetFileNameWithoutExtension(fullpath), graphicStencil);
                    //Console.WriteLine("  {0}] {1}", iStencil++, Path.GetFileNameWithoutExtension(fullpath));
                    LogNote("Srvr", 0, "  %i] %s", iStencil++, Path.GetFileNameWithoutExtension(fullpath));
                }
            }

            {
                int iStencil = 0;
                LogNote("Srvr", 0, "ThingStencils:");
                String[] dirs = Directory.GetFiles(m_StencilPath, "*.thingstencil");
                for (int i = 0; i < dirs.GetLength(0); i++)
                {
                    String fullpath = dirs[i];

                    ////Create dummy ThingStencil for comparison...
                    //{
                    //  ThingStencil thingStencil = new ThingStencil();
                    //  thingStencil.Tag = "a tank annotation";
                    //  thingStencil.Model = "Tank-1";
                    //  thingStencil.defaultSize.Width = 20.0;
                    //  thingStencil.defaultSize.Height = 20.0;
                    //  thingStencil.Xaml =
                    //      "            <!-- Saved from Aurora XAML Designer for WinFX - Mobiform Software Ltd. - Thursday, 4 January 2007 11:45:44 AM -."
                    //      "<Canvas xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\" Name=\"Canvas1\" Width=\"132\" Height=\"141\" Background=\"{x:Static Brushes.Transparent}\" xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\">"
                    //      "  <Ellipse Canvas.Left=\"6\" Canvas.Top=\"105\" Width=\"120\" Height=\"30\" Stroke=\"#FF716F64\" StrokeThickness=\"0.5\">"
                    //      "    <Ellipse.Fill>"
                    //      "      <LinearGradientBrush StartPoint=\"0,0\" EndPoint=\"0.03,1\">"
                    //      "        <GradientStop Color=\"#FFECE9D8\" Offset=\"0\" />"
                    //      "        <GradientStop Color=\"#FF716F64\" Offset=\"1\" />"
                    //      "      </LinearGradientBrush>"
                    //      "    </Ellipse.Fill>"
                    //      "  </Ellipse>"
                    //      "  <Rectangle Canvas.Left=\"6\" Canvas.Top=\"21\" Width=\"120\" Height=\"100\" Stroke=\"Gray\" StrokeThickness=\"0.5\">"
                    //      "    <Rectangle.Fill>"
                    //      "      <LinearGradientBrush StartPoint=\"0,1\" EndPoint=\"1,1\">"
                    //      "        <GradientStop Color=\"#FFECE9D8\" Offset=\"0\" />"
                    //      "        <GradientStop Color=\"#FF716F64\" Offset=\"1\" />"
                    //      "      </LinearGradientBrush>"
                    //      "    </Rectangle.Fill>"
                    //      "  </Rectangle>"
                    //      "  <Rectangle Canvas.Left=\"16\" Canvas.Bottom=\"21\" Width=\"100\" Height=\"100\" Fill=\"Blue\" Stroke=\"Black\">"
                    //      "  </Rectangle>"
                    //      "  <Rectangle Canvas.Left=\"16\" Canvas.Top=\"31\" Width=\"100\" Height=\"[[[[TAG]], 0, 3, 0, 85, Linear, Integer]]\" Stroke=\"Black\">"
                    //      "    <Rectangle.Fill>"
                    //      "      <LinearGradientBrush Opacity=\"1\" StartPoint=\"0,1\" EndPoint=\"1,1\">"
                    //      "        <GradientStop Color=\"Black\" Offset=\"0\" />"
                    //      "        <GradientStop Color=\"Black\" Offset=\"1\" />"
                    //      "        <GradientStop Color=\"#FF444444\" Offset=\"0.821339950372208\" />"
                    //      "      </LinearGradientBrush>"
                    //      "    </Rectangle.Fill>"
                    //      "  </Rectangle>"
                    //      "  <Ellipse Canvas.Left=\"2\" Canvas.Top=\"34\" Width=\"10\" Height=\"20\" Stroke=\"#FF716F64\" StrokeThickness=\"0.5\">"
                    //      "    <Ellipse.Fill>"
                    //      "      <LinearGradientBrush Opacity=\"1\" StartPoint=\"1,0\" EndPoint=\"1,1\">"
                    //      "        <GradientStop Color=\"#FFD4D0C8\" Offset=\"0\" />"
                    //      "        <GradientStop Color=\"White\" Offset=\"0.5\" />"
                    //      "        <GradientStop Color=\"#FF716F64\" Offset=\"1\" />"
                    //      "      </LinearGradientBrush>"
                    //      "    </Ellipse.Fill>"
                    //      "  </Ellipse>"
                    //      "  <Ellipse Canvas.Left=\"2\" Canvas.Top=\"63\" Width=\"10\" Height=\"20\" Stroke=\"#FF716F64\" StrokeThickness=\"0.5\">"
                    //      "    <Ellipse.Fill>"
                    //      "      <LinearGradientBrush Opacity=\"1\" StartPoint=\"1,0\" EndPoint=\"1,1\">"
                    //      "        <GradientStop Color=\"#FFD4D0C8\" Offset=\"0\" />"
                    //      "        <GradientStop Color=\"White\" Offset=\"0.5\" />"
                    //      "        <GradientStop Color=\"#FF716F64\" Offset=\"1\" />"
                    //      "      </LinearGradientBrush>"
                    //      "    </Ellipse.Fill>"
                    //      "  </Ellipse>"
                    //      "  <Ellipse Canvas.Left=\"56\" Canvas.Top=\"129\" Width=\"20\" Height=\"10\" Stroke=\"#FF716F64\">"
                    //      "    <Ellipse.Fill>"
                    //      "      <LinearGradientBrush Opacity=\"1\" StartPoint=\"0,1\" EndPoint=\"1,1\">"
                    //      "        <GradientStop Color=\"#FFD4D0C8\" Offset=\"0\" />"
                    //      "        <GradientStop Color=\"White\" Offset=\"0.5\" />"
                    //      "        <GradientStop Color=\"#FF716F64\" Offset=\"1\" />"
                    //      "      </LinearGradientBrush>"
                    //      "    </Ellipse.Fill>"
                    //      "  </Ellipse>"
                    //      "  <Ellipse Canvas.Left=\"120.5\" Canvas.Top=\"63\" Width=\"10\" Height=\"20\" Stroke=\"#FF716F64\" StrokeThickness=\"0.5\">"
                    //      "    <Ellipse.Fill>"
                    //      "      <LinearGradientBrush Opacity=\"1\" StartPoint=\"1,0\" EndPoint=\"1,1\">"
                    //      "        <GradientStop Color=\"#FFD4D0C8\" Offset=\"0\" />"
                    //      "        <GradientStop Color=\"White\" Offset=\"0.5\" />"
                    //      "        <GradientStop Color=\"#FF716F64\" Offset=\"1\" />"
                    //      "      </LinearGradientBrush>"
                    //      "    </Ellipse.Fill>"
                    //      "  </Ellipse>"
                    //      "  <Ellipse Canvas.Left=\"120.5\" Canvas.Top=\"34\" Width=\"10\" Height=\"20\" Stroke=\"#FF716F64\" StrokeThickness=\"0.5\">"
                    //      "    <Ellipse.Fill>"
                    //      "      <LinearGradientBrush Opacity=\"1\" StartPoint=\"1,0\" EndPoint=\"1,1\">"
                    //      "        <GradientStop Color=\"#FFD4D0C8\" Offset=\"0\" />"
                    //      "        <GradientStop Color=\"White\" Offset=\"0.5\" />"
                    //      "        <GradientStop Color=\"#FF716F64\" Offset=\"1\" />"
                    //      "      </LinearGradientBrush>"
                    //      "    </Ellipse.Fill>"
                    //      "  </Ellipse>"
                    //      "  <Ellipse Canvas.Left=\"56\" Canvas.Top=\"2\" Width=\"20\" Height=\"10\" Stroke=\"#FF716F64\">"
                    //      "    <Ellipse.Fill>"
                    //      "      <LinearGradientBrush Opacity=\"1\" StartPoint=\"0,1\" EndPoint=\"1,1\">"
                    //      "        <GradientStop Color=\"#FFD4D0C8\" Offset=\"0\" />"
                    //      "        <GradientStop Color=\"White\" Offset=\"0.5\" />"
                    //      "        <GradientStop Color=\"#FF716F64\" Offset=\"1\" />"
                    //      "      </LinearGradientBrush>"
                    //      "    </Ellipse.Fill>"
                    //      "  </Ellipse>"
                    //      "  <Ellipse Canvas.Left=\"6\" Canvas.Top=\"7\" Width=\"120\" Height=\"30\" Stroke=\"#FF716F64\" StrokeThickness=\"0.5\">"
                    //      "    <Ellipse.Fill>"
                    //      "      <RadialGradientBrush Opacity=\"1\" Center=\"0.490074441687345,0.5\" RadiusX=\"0.52\" RadiusY=\"0.599255583126551\" GradientOrigin=\"0.16,0.54\">"
                    //      "        <GradientStop Color=\"#FFECE9D8\" Offset=\"0\" />"
                    //      "        <GradientStop Color=\"#FF716F64\" Offset=\"1\" />"
                    //      "      </RadialGradientBrush>"
                    //      "    </Ellipse.Fill>"
                    //      "  </Ellipse>"
                    //      "</Canvas>";

                    //  SoapFormatter sf = new SoapFormatter();
                    //  StreamWriter streamWriter = new StreamWriter(fullpath+".new");
                    //  Stream stream = streamWriter.BaseStream;
                    //  sf.Serialize(stream, thingStencil);
                    //  stream.Close();
                    //}

                    SoapFormatter sf           = new SoapFormatter();
                    StreamReader  streamRdr    = new StreamReader(fullpath);
                    Stream        stream       = streamRdr.BaseStream;
                    ThingStencil  thingStencil = (ThingStencil)sf.Deserialize(stream);
                    thingStencil.Tag = Path.GetFileNameWithoutExtension(fullpath);
                    m_Config.ThingStencils.Add(Path.GetFileNameWithoutExtension(fullpath), thingStencil);
                    stream.Close();
                    //Console.WriteLine("  {0}] {1}", iStencil++, Path.GetFileNameWithoutExtension(fullpath));
                    LogNote("Srvr", 0, "  %i] %s", iStencil++, Path.GetFileNameWithoutExtension(fullpath));
                }
            }
        }
コード例 #10
0
ファイル: NetServer.cs プロジェクト: 15831944/Test3-1
 bool ConfirmModelStencil(ModelStencil modelstencil)
 {
     // TODO: check whether this stencil is to be included in the project.
     return(true);
 }
コード例 #11
0
ファイル: Form1.cs プロジェクト: 15831944/Test3-1
        private void SetControls(ModelStencil modelStencil)
        {
            foreach (Element element in modelStencil.Decorations)
            {
                if (element is Line)
                {
                    Line  line  = element as Line;
                    Arrow arrow = flowChart1.CreateArrow(GridFix(line.pointF1), GridFix(line.pointF2));
                    arrow.FrameColor = Color.LightSkyBlue;
                    arrow.ZTop();
                    arrow.Tag = line;
                }

                if (element is Bezier)
                {
                    Bezier bezier = element as Bezier;
                    Arrow  arrow  = flowChart1.CreateArrow(bezier.pointF1, bezier.pointF4);
                    arrow.FrameColor       = Color.LightSkyBlue;
                    arrow.SegmentCount     = 3;
                    arrow.ControlPoints[0] = GridFix(bezier.pointF1);
                    arrow.ControlPoints[1] = GridFix(bezier.pointF2);
                    arrow.ControlPoints[2] = GridFix(bezier.pointF3);
                    arrow.ControlPoints[3] = GridFix(bezier.pointF4);
                    arrow.ZTop();
                    arrow.Tag = bezier;
                }

                if (element is Arc)
                {
                    Arc arc = element as Arc;
                    Box box = flowChart1.CreateBox(GridFix(arc.x), GridFix(arc.y), (float)arc.w, (float)arc.h);
                    box.Style      = BoxStyle.Ellipse;
                    box.FillColor  = Color.Transparent;
                    box.FrameColor = Color.LightSkyBlue;
                    box.ZBottom();
                    box.Tag = arc;
                }
            }

            foreach (Element element in modelStencil.Elements)
            {
                if (element is Line)
                {
                    Line  line  = element as Line;
                    Arrow arrow = flowChart1.CreateArrow(GridFix(line.pointF1), GridFix(line.pointF2));
                    arrow.FrameColor = Color.LightGreen;
                    arrow.ZTop();
                    arrow.Tag = line;
                }

                if (element is Bezier)
                {
                    Bezier bezier = element as Bezier;
                    Arrow  arrow  = flowChart1.CreateArrow(bezier.pointF1, bezier.pointF4);
                    arrow.FrameColor       = Color.LightGreen;
                    arrow.SegmentCount     = 3;
                    arrow.ControlPoints[0] = GridFix(bezier.pointF1);
                    arrow.ControlPoints[1] = GridFix(bezier.pointF2);
                    arrow.ControlPoints[2] = GridFix(bezier.pointF3);
                    arrow.ControlPoints[3] = GridFix(bezier.pointF4);
                    arrow.ZTop();
                    arrow.Tag = bezier;
                }

                if (element is Arc)
                {
                    Arc arc = element as Arc;
                    Box box = flowChart1.CreateBox(GridFix(arc.x), GridFix(arc.y), (float)arc.w, (float)arc.h);
                    box.Style      = BoxStyle.Ellipse;
                    box.FillColor  = Color.Transparent;
                    box.FrameColor = Color.LightGreen;
                    box.ZBottom();
                    box.Tag = arc;
                }
            }

            foreach (Anchor anchor in modelStencil.Anchors)
            {
                foreach (SysCAD.Protocol.Point point in anchor.Positions)
                {
                    Box box = flowChart1.CreateBox(
                        GridFix(point.X) - 1.0F, GridFix(point.Y) - 1.0F, 2.0F, 2.0F);
                    box.Style        = BoxStyle.Rhombus;
                    box.FillColor    = Color.LightSalmon;
                    box.FrameColor   = Color.Salmon;
                    box.HandlesStyle = HandlesStyle.MoveOnly;
                    box.ToolTip      = anchor.Tag + " : " + anchor.Look;
                    box.ZTop();
                    box.Tag = point;
                }
            }
        }