static void Main(string[] args) { try { Console.WriteLine("Begin UView..."); // always show accelerator underlines SystemParametersInfo(SPI_SETKEYBOARDCUES, 0, 1, 0); //- create the Form //var editor = new MainForm(); var editor = new View.MainEditor(); #region AddDemo //var designer = f.Designer as UDesigner; //f.Size = new Size(1200, 800); ////- add some tabpages //Console.WriteLine("I'm trying to add some Surfaces..."); //designer.AddDesignSurface<Display>(480, 320, AlignmentModeEnum.SnapLines, new Size(1, 1)); ////designer.AddDesignSurface<Display>(640, 480, AlignmentModeEnum.SnapLines, new Size(1, 1)); ////var display3 = designer.AddDesignSurface<Display>(640, 480, AlignmentModeEnum.SnapLines, new Size(1, 1)); ////designer.AddDesignSurface<Form>(640, 480, AlignmentModeEnum.Grid, new Size(8, 8)); //Console.WriteLine("Surfaces added!"); // ////- Add controls to the Forms using IToolboxUser //Console.WriteLine("for each Surface I'm trying to add some Controls..."); //int n = 0; //foreach (IDesignSurfaceBase surf in designer.DesignSurfaceManager.DesignSurfaces) //{ // //- use the IToolboxUser interface to add a Button to the root component // //CreateControlsUsingTheToolbox(surf); // //- create others control via DesignSurfaces // CreateControlsUsingTheDesignSurface(surf, ++n); //} //Console.WriteLine("Controls added!"); // ////- the Tabcontrl.SelectedIndex doesn't raise the event OnSelectedIndexChanged //designer.TabControlHostingDesignSurfaces.SelectedIndexChanged += (s, e) => //{ // Console.WriteLine("First TabPage selected!"); //}; //designer.TabControlHostingDesignSurfaces.SelectedIndex = 0; ////- therefore raise it by hand with Reflection //RaiseEventViaReflection(designer.TabControlHostingDesignSurfaces); //display3.UseGrid(new Size(16, 16)); #endregion editor.ShowDialog(); } catch (Exception ex) { Console.WriteLine("Exception (strike a key to quit!): " + ex.Message); if (null != ex.InnerException) { Console.WriteLine("Inner Exception : " + ex.InnerException.Message); } Console.ReadLine(); } }
public SolutionDialog(MainEditor editor) { _editor = editor; InitializeComponent(); }