public MainWindow() { InitializeComponent(); ld = LayoutDescriptionEx.GenerateDefault(); // We need big enough picture to perform tests Image randomImage = new Bitmap(300, 50); gm = new GraphicsManager(Graphics.FromImage(randomImage), ld); starPicture.Image = randomImage; mm = new MemoryManager(null); um = new UpdateManager(); try { LoadSettings(); } catch (Exception) { sm = new SettingsManager(); } if (sm == null || !sm.isValid()) { sm = new SettingsManager(); } timer = new System.Threading.Timer(UpdateStars, null, 1, Timeout.Infinite); oldCRC = 0; fileMenuItems = new ToolStripMenuItem[4]; fileMenuItems[0] = fileAToolStripMenuItem; fileMenuItems[1] = fileBToolStripMenuItem; fileMenuItems[2] = fileCToolStripMenuItem; fileMenuItems[3] = fileDToolStripMenuItem; IEnumerable <Type> types = Action.GetAllSubclasses(); componentsClasses = new List <Type>(); foreach (Type type in types) { MethodInfo info = type.GetMethod("DrawConfigs"); if (info == null) { continue; } componentsClasses.Add(type); } starPicture.Width = this.Width; starPicture.Height = this.Height; }
private void loadDefaultToolStripMenuItem_Click(object sender, EventArgs e) { ld = LayoutDescriptionEx.GenerateDefault(); InvalidateCache(); }
private void LoadDefaultLayoutNoInvalidate() { ld = LayoutDescriptionEx.GenerateDefault(); ld.Trim(); }