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)); } }
private static bool ServiceConnectCheck(Config config) { return (config.TestUrl(new Uri("ipc://SysCAD.Service/Global"))); }