public void Init() { int w = (int)(sf * 640); int h = (int)(sf * 480); var center = Screen.PrimaryScreen.WorkingArea.Center; center.X -= w / 2; center.Y -= h / 2; Location = new Point(center); ClientSize = new Size(w, h); Maximizable = false; Minimizable = false; Resizable = false; ShowInTaskbar = false; AddComponentInfo(); AddComponentInfoN(); string imgprefix = "DWSIM.UI.Forms.Resources.Icons."; Title = "AboutDWSIM".Localize(); Icon = Eto.Drawing.Icon.FromResource(imgprefix + "DWSIM_ico.ico"); var layout = new PixelLayout(); string vtext = "Version".Localize() + " " + Assembly.GetExecutingAssembly().GetName().Version.Major.ToString() + "." + Assembly.GetExecutingAssembly().GetName().Version.Minor.ToString() + "." + Assembly.GetExecutingAssembly().GetName().Version.Build.ToString(); #if DEBUG vtext += "-" + File.GetLastWriteTimeUtc(Assembly.GetExecutingAssembly().Location).ToString(); #endif string crtext = Shared.AssemblyCopyright; layout.Add(new ImageView { Size = new Size((int)(sf * 100), (int)(sf * 100)), Image = new Bitmap(Eto.Drawing.Bitmap.FromResource(imgprefix + "DWSIM_ico.png")) }, 0, 0); layout.Add(new Label { Text = "DWSIM Simulator (Cross-Platform User Interface)", TextAlignment = TextAlignment.Left, Font = SystemFonts.Bold(null, FontDecoration.None) }, (int)(sf * 110), 0); layout.Add(new Label { Text = vtext, TextAlignment = TextAlignment.Left }, (int)(sf * 110), (int)(sf * 20)); layout.Add(new Label { Text = crtext, TextAlignment = TextAlignment.Left }, (int)(sf * 110), (int)(sf * 40)); string osinfo = "", clrinfo = "", meminfo = ""; if (Application.Instance.Platform.IsMac) { var osversion = Environment.OSVersion.Version.ToString(); switch (osversion) { case "11.0.0.0": osinfo = "Mac OS X Lion (v10.7.0)"; break; case "11.4.2.0": osinfo = "Mac OS X Lion (v10.7.5)"; break; case "12.0.0.0": osinfo = "OS X Mountain Lion (v10.8.0)"; break; case "13.0.0.0": osinfo = "OS X Mavericks (v10.9.0)"; break; case "13.4.0.0": osinfo = "OS X Mavericks (v10.9.5)"; break; case "14.0.0.0": osinfo = "OS X Yosemite (v10.10.0)"; break; case "14.5.0.0": osinfo = "OS X Yosemite (v10.10.5)"; break; case "15.0.0.0": osinfo = "OS X El Captain (v10.11.0)"; break; case "15.6.0.0": osinfo = "OS X El Captain (v10.11.6)"; break; case "16.0.0.0": osinfo = "macOS Sierra (v10.12.0)"; break; case "16.1.0.0": osinfo = "macOS Sierra (v10.12.1)"; break; case "16.3.0.0": osinfo = "macOS Sierra (v10.12.2)"; break; case "16.4.8.0": osinfo = "macOS Sierra (v10.12.3)"; break; case "16.5.3.0": osinfo = "macOS Sierra (v10.12.4)"; break; case "16.5.6.0": osinfo = "macOS Sierra (v10.12.5)"; break; case "16.7.1.2": osinfo = "macOS Sierra (v10.12.6)"; break; case "17.0.0.0": osinfo = "macOS High Sierra (v10.13.0)"; break; case "17.4.0.0": osinfo = "macOS High Sierra (v10.13.3)"; break; case "18.0.0.0": osinfo = "macOS Mojave (v10.14.0)"; break; case "18.2.0.0": osinfo = "macOS Mojave (v10.14.1-3)"; break; case "18.5.0.0": osinfo = "macOS Mojave (v10.14.4)"; break; case "18.6.0.0": osinfo = "macOS Mojave (v10.14.5)"; break; case "18.7.0.1": osinfo = "macOS Mojave (v10.14.6)"; break; case "19.0.0.0": osinfo = "macOS Catalina (v10.15)"; break; case "19.2.0.0": osinfo = "macOS Catalina (v10.15.2)"; break; case "19.3.0.0": osinfo = "macOS Catalina (v10.15.3)"; break; case "19.4.0.0": osinfo = "macOS Catalina (v10.15.4)"; break; case "19.5.0.0": osinfo = "macOS Catalina (v10.15.5)"; break; case "19.6.0.0": osinfo = "macOS Catalina (v10.15.7)"; break; case "20.0.0.0": osinfo = "macOS Big Sur (v11.0.0)"; break; case "20.1.0.0": osinfo = "macOS Big Sur (v11.0.1)"; break; case "20.3.0.0": osinfo = "macOS Big Sur (v11.1.0)"; break; default: osinfo = "macOS (v" + osversion + ")"; break; } } else { osinfo = Environment.OSVersion.ToString(); } clrinfo = SharedClasses.Utility.GetRuntimeVersion(); meminfo = (GC.GetTotalMemory(false) / 1024 / 1024).ToString("#") + " MB managed, " + (Environment.WorkingSet / 1024 / 1024).ToString("#") + " MB total"; var container1 = new DynamicLayout() { Padding = new Padding(10) }; container1.CreateAndAddDescriptionRow("DWSIM is released under the terms of the GNU General Public License (GPL) version 3."); container1.CreateAndAddTwoLabelsRow2("OS Info:", osinfo); container1.CreateAndAddTwoLabelsRow2("CLR Info:", clrinfo); container1.CreateAndAddTwoLabelsRow2("Memory Usage:", meminfo); var listcontainer = new GridView { DataStore = components, RowHeight = (int)(sf * 20) }; var listcontainern = new GridView { DataStore = componentsn, RowHeight = (int)(sf * 20) }; var col1 = new GridColumn { DataCell = new TextBoxCell { Binding = Binding.Property <ComponentInfo, string>(r => r.Name) }, HeaderText = "Name" }; col1.AutoSize = true; listcontainer.Columns.Add(col1); var col1a = new GridColumn { DataCell = new TextBoxCell { Binding = Binding.Property <ComponentInfo, string>(r => r.Version) }, HeaderText = "Version" }; col1a.AutoSize = true; listcontainer.Columns.Add(col1a); var col1b = new GridColumn { DataCell = new TextBoxCell { Binding = Binding.Property <ComponentInfo, string>(r => r.Year) }, HeaderText = "Year" }; col1b.AutoSize = true; listcontainer.Columns.Add(col1b); var col1c = new GridColumn { DataCell = new TextBoxCell { Binding = Binding.Property <ComponentInfo, string>(r => r.Copyright) }, HeaderText = "Copyright" }; col1c.AutoSize = true; listcontainer.Columns.Add(col1c); var col1d = new GridColumn { DataCell = new TextBoxCell { Binding = Binding.Property <ComponentInfo, string>(r => r.Website) }, HeaderText = "Website" }; col1d.AutoSize = true; listcontainer.Columns.Add(col1d); var col1e = new GridColumn { DataCell = new TextBoxCell { Binding = Binding.Property <ComponentInfo, string>(r => r.License) }, HeaderText = "License" }; col1e.AutoSize = true; listcontainer.Columns.Add(col1e); var col1f = new GridColumn { DataCell = new TextBoxCell { Binding = Binding.Property <ComponentInfo, string>(r => r.LicenseText) }, HeaderText = "License Text" }; col1f.AutoSize = true; listcontainer.Columns.Add(col1f); var col1n = new GridColumn { DataCell = new TextBoxCell { Binding = Binding.Property <ComponentInfo, string>(r => r.Name) }, HeaderText = "Name" }; col1n.AutoSize = true; listcontainern.Columns.Add(col1n); var col1an = new GridColumn { DataCell = new TextBoxCell { Binding = Binding.Property <ComponentInfo, string>(r => r.Version) }, HeaderText = "Version" }; col1an.AutoSize = true; listcontainern.Columns.Add(col1an); var col1fn = new GridColumn { DataCell = new TextBoxCell { Binding = Binding.Property <ComponentInfo, string>(r => r.LicenseText) }, HeaderText = "License Text" }; col1fn.AutoSize = true; listcontainern.Columns.Add(col1fn); string gpltext; using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("DWSIM.UI.Forms.Resources.TextFiles.gpl-3.0.txt")) using (StreamReader reader = new StreamReader(stream)) { gpltext = reader.ReadToEnd(); } var txt1 = new TextArea { Text = gpltext, ReadOnly = true, Font = Fonts.Monospace(10.0f) }; var t1 = new TableLayout(new TableRow(txt1)); var tab1 = new TabPage { Content = container1, Text = "General Information" }; var tab2 = new TabPage { Content = new Scrollable { Content = t1 }, Text = "GPLv3 License" }; var tab3 = new TabPage { Content = new Scrollable { Content = listcontainer }, Text = "External Components" }; var tab4 = new TabPage { Content = new Scrollable { Content = listcontainern }, Text = "NuGet Packages" }; var tabc = new TabControl(); tabc.Pages.Add(tab1); tabc.Pages.Add(tab2); tabc.Pages.Add(tab3); tabc.Pages.Add(tab4); var tablecontainer = new TableLayout { Padding = new Padding(10), Spacing = new Size(5, 5) }; tablecontainer.Rows.Add(new TableRow(layout)); tablecontainer.Rows.Add(new TableRow(tabc)); Content = tablecontainer; }
public void Init() { int w = 640; int h = 480; var center = Screen.PrimaryScreen.WorkingArea.Center; center.X -= w / 2; center.Y -= h / 2; Location = new Point(center); ClientSize = new Size(w, h); Maximizable = false; Minimizable = false; Resizable = false; ShowInTaskbar = false; AddComponentInfo(); string imgprefix = "DWSIM.UI.Forms.Resources.Icons."; Title = "AboutDWSIM".Localize(); Icon = Eto.Drawing.Icon.FromResource(imgprefix + "DWSIM_ico.ico"); var layout = new PixelLayout(); string vtext = "Version".Localize() + " " + Assembly.GetExecutingAssembly().GetName().Version.Major.ToString() + "." + Assembly.GetExecutingAssembly().GetName().Version.Minor.ToString(); var updfile = AppDomain.CurrentDomain.BaseDirectory + Path.DirectorySeparatorChar + "version.info"; if (File.Exists(updfile)) { int vinfo = 0; int.TryParse(File.ReadAllText(updfile), out vinfo); if (vinfo > 0) { vtext += " Update " + vinfo; } } string crtext = Shared.AssemblyCopyright; layout.Add(new ImageView { Size = new Size(100, 100), Image = new Bitmap(Eto.Drawing.Bitmap.FromResource(imgprefix + "DWSIM_ico.png")) }, 0, 0); layout.Add(new Label { Text = "DWSIM Simulator (Cross-Platform User Interface)", TextAlignment = TextAlignment.Left, Font = SystemFonts.Bold(null, FontDecoration.None) }, 110, 0); layout.Add(new Label { Text = vtext, TextAlignment = TextAlignment.Left }, 110, 20); layout.Add(new Label { Text = crtext, TextAlignment = TextAlignment.Left }, 110, 40); string osinfo = "", clrinfo = "", meminfo = ""; if (Application.Instance.Platform.IsMac) { var osversion = Environment.OSVersion.Version.ToString(); switch (osversion) { case "11.0.0.0": osinfo = "Mac OS X Lion (v10.7.0)"; break; case "11.4.2.0": osinfo = "Mac OS X Lion (v10.7.5)"; break; case "12.0.0.0": osinfo = "OS X Mountain Lion (v10.8.0)"; break; case "13.0.0.0": osinfo = "OS X Mavericks (v10.9.0)"; break; case "13.4.0.0": osinfo = "OS X Mavericks (v10.9.5)"; break; case "14.0.0.0": osinfo = "OS X Yosemite (v10.10.0)"; break; case "14.5.0.0": osinfo = "OS X Yosemite (v10.10.5)"; break; case "15.0.0.0": osinfo = "OS X El Captain (v10.11.0)"; break; case "15.6.0.0": osinfo = "OS X El Captain (v10.11.6)"; break; case "16.0.0.0": osinfo = "macOS Sierra (v10.12.0)"; break; case "16.1.0.0": osinfo = "macOS Sierra (v10.12.1)"; break; case "16.3.0.0": osinfo = "macOS Sierra (v10.12.2)"; break; case "16.4.0.0": osinfo = "macOS Sierra (v10.12.3)"; break; case "16.5.0.0": osinfo = "macOS Sierra (v10.12.4)"; break; case "16.6.0.0": osinfo = "macOS Sierra (v10.12.5)"; break; case "16.7.0.0": osinfo = "macOS Sierra (v10.12.6)"; break; case "17.0.0.0": osinfo = "macOS High Sierra (v10.13.0)"; break; default: osinfo = osversion; break; } } else { osinfo = Environment.OSVersion.ToString(); } clrinfo = SharedClasses.Utility.GetRuntimeVersion(); meminfo = (GC.GetTotalMemory(false) / 1024 / 1024).ToString("#") + " MB managed, " + (Environment.WorkingSet / 1024 / 1024).ToString("#") + " MB total"; var container1 = new DynamicLayout() { Padding = new Padding(10) }; container1.CreateAndAddTwoLabelsRow2("Main Developer:", "Daniel Medeiros ([email protected])"); container1.CreateAndAddTwoLabelsRow2("Contributors:", "Gregor Reichert, Gustavo León and others"); container1.CreateAndAddTwoLabelsRow2("Splash Screen Design:", "Wendel Marcus (www.behance.net/wendelmarcus)"); container1.CreateAndAddTwoLabelsRow2("OS Info:", osinfo); container1.CreateAndAddTwoLabelsRow2("CLR Info:", clrinfo); container1.CreateAndAddTwoLabelsRow2("Memory Usage:", meminfo); container1.CreateAndAddLabelRow("DWSIM is released under the terms of the GNU General Public License (GPL) version 3."); var listcontainer = new GridView { DataStore = components, RowHeight = 20 }; var col1 = new GridColumn { DataCell = new TextBoxCell { Binding = Binding.Property <ComponentInfo, string>(r => r.Name) }, HeaderText = "Name" }; col1.AutoSize = true; listcontainer.Columns.Add(col1); var col1a = new GridColumn { DataCell = new TextBoxCell { Binding = Binding.Property <ComponentInfo, string>(r => r.Version) }, HeaderText = "Version" }; col1a.AutoSize = true; listcontainer.Columns.Add(col1a); var col1b = new GridColumn { DataCell = new TextBoxCell { Binding = Binding.Property <ComponentInfo, string>(r => r.Year) }, HeaderText = "Year" }; col1b.AutoSize = true; listcontainer.Columns.Add(col1b); var col1c = new GridColumn { DataCell = new TextBoxCell { Binding = Binding.Property <ComponentInfo, string>(r => r.Copyright) }, HeaderText = "Copyright" }; col1c.AutoSize = true; listcontainer.Columns.Add(col1c); var col1d = new GridColumn { DataCell = new TextBoxCell { Binding = Binding.Property <ComponentInfo, string>(r => r.Website) }, HeaderText = "Website" }; col1d.AutoSize = true; listcontainer.Columns.Add(col1d); var col1e = new GridColumn { DataCell = new TextBoxCell { Binding = Binding.Property <ComponentInfo, string>(r => r.License) }, HeaderText = "License" }; col1e.AutoSize = true; listcontainer.Columns.Add(col1e); var col1f = new GridColumn { DataCell = new TextBoxCell { Binding = Binding.Property <ComponentInfo, string>(r => r.LicenseText) }, HeaderText = "License Text" }; col1f.AutoSize = true; listcontainer.Columns.Add(col1f); string gpltext; using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("DWSIM.UI.Forms.Resources.TextFiles.gpl-3.0.txt")) using (StreamReader reader = new StreamReader(stream)) { gpltext = reader.ReadToEnd(); } var txt1 = new TextArea { Text = gpltext, ReadOnly = true }; var t1 = new TableLayout(new TableRow(txt1)); var tab1 = new TabPage { Content = container1, Text = "General Information" }; var tab2 = new TabPage { Content = new Scrollable { Content = t1 }, Text = "DWSIM License" }; var tab3 = new TabPage { Content = new Scrollable { Content = listcontainer }, Text = "External Components" }; var tabc = new TabControl(); tabc.Pages.Add(tab1); tabc.Pages.Add(tab2); tabc.Pages.Add(tab3); var tablecontainer = new TableLayout { Padding = new Padding(10), Spacing = new Size(5, 5) }; tablecontainer.Rows.Add(new TableRow(layout)); tablecontainer.Rows.Add(new TableRow(tabc)); Content = tablecontainer; }
public void Init() { int w = 640; int h = 480; var center = Screen.PrimaryScreen.WorkingArea.Center; center.X -= w / 2; center.Y -= h / 2; Location = new Point(center); ClientSize = new Size(w, h); Maximizable = false; Minimizable = false; Resizable = false; ShowInTaskbar = false; AddComponentInfo(); string imgprefix = "DWSIM.UI.Forms.Resources.Icons."; Title = "AboutDWSIM".Localize(); Icon = Eto.Drawing.Icon.FromResource(imgprefix + "DWSIM_ico.ico"); var layout = new PixelLayout(); string vtext = "Version".Localize() + " " + Assembly.GetExecutingAssembly().GetName().Version.Major.ToString() + "." + Assembly.GetExecutingAssembly().GetName().Version.Minor.ToString(); var updfile = AppDomain.CurrentDomain.BaseDirectory + Path.DirectorySeparatorChar + "version.info"; if (File.Exists(updfile)) { int vinfo = 0; int.TryParse(File.ReadAllText(updfile), out vinfo); if (vinfo > 0) { vtext += " Update " + vinfo; } } string crtext = Shared.AssemblyCopyright; layout.Add(new ImageView { Size = new Size(100, 100), Image = new Bitmap(Eto.Drawing.Bitmap.FromResource(imgprefix + "DWSIM_ico.png")) }, 0, 0); layout.Add(new Label { Text = "DWSIM Simulator (Cross-Platform User Interface)", TextAlignment = TextAlignment.Left, Font = SystemFonts.Bold(null, FontDecoration.None) }, 110, 0); layout.Add(new Label { Text = vtext, TextAlignment = TextAlignment.Left }, 110, 20); layout.Add(new Label { Text = crtext, TextAlignment = TextAlignment.Left }, 110, 40); string osinfo = "", clrinfo = "", meminfo = ""; osinfo = Environment.OSVersion.ToString(); if (GlobalSettings.Settings.IsRunningOnMono()) { Type type = Type.GetType("Mono.Runtime"); if (type != null) { MethodInfo dispalayName = type.GetMethod("GetDisplayName", BindingFlags.NonPublic | BindingFlags.Static); if (dispalayName != null) { clrinfo = "Mono Framework, Version " + dispalayName.Invoke(null, null).ToString(); } } } else { clrinfo = "Microsoft .NET Framework, Runtime Version " + System.Runtime.InteropServices.RuntimeEnvironment.GetSystemVersion().ToString(); } meminfo = (GC.GetTotalMemory(false) / 1024 / 1024).ToString("#") + " MB managed, " + (Environment.WorkingSet / 1024 / 1024).ToString("#") + " MB total"; var container1 = new DynamicLayout() { Padding = new Padding(10) }; container1.CreateAndAddTwoLabelsRow2("Main Developer:", "Daniel Medeiros ([email protected])"); container1.CreateAndAddTwoLabelsRow2("Contributors:", "Gregor Reichert, Gustavo León and others"); container1.CreateAndAddTwoLabelsRow2("Splash Screen Design:", "Wendel Marcus (www.behance.net/wendelmarcus)"); container1.CreateAndAddTwoLabelsRow2("OS Info:", osinfo); container1.CreateAndAddTwoLabelsRow2("CLR Info:", clrinfo); container1.CreateAndAddTwoLabelsRow2("Memory Usage:", meminfo); container1.CreateAndAddLabelRow("DWSIM is released under the terms of the GNU General Public License (GPL) version 3."); var listcontainer = new GridView { DataStore = components, RowHeight = 20 }; var col1 = new GridColumn { DataCell = new TextBoxCell { Binding = Binding.Property <ComponentInfo, string>(r => r.Name) }, HeaderText = "Name" }; col1.AutoSize = true; listcontainer.Columns.Add(col1); var col1a = new GridColumn { DataCell = new TextBoxCell { Binding = Binding.Property <ComponentInfo, string>(r => r.Version) }, HeaderText = "Version" }; col1a.AutoSize = true; listcontainer.Columns.Add(col1a); var col1b = new GridColumn { DataCell = new TextBoxCell { Binding = Binding.Property <ComponentInfo, string>(r => r.Year) }, HeaderText = "Year" }; col1b.AutoSize = true; listcontainer.Columns.Add(col1b); var col1c = new GridColumn { DataCell = new TextBoxCell { Binding = Binding.Property <ComponentInfo, string>(r => r.Copyright) }, HeaderText = "Copyright" }; col1c.AutoSize = true; listcontainer.Columns.Add(col1c); var col1d = new GridColumn { DataCell = new TextBoxCell { Binding = Binding.Property <ComponentInfo, string>(r => r.Website) }, HeaderText = "Website" }; col1d.AutoSize = true; listcontainer.Columns.Add(col1d); var col1e = new GridColumn { DataCell = new TextBoxCell { Binding = Binding.Property <ComponentInfo, string>(r => r.License) }, HeaderText = "License" }; col1e.AutoSize = true; listcontainer.Columns.Add(col1e); var col1f = new GridColumn { DataCell = new TextBoxCell { Binding = Binding.Property <ComponentInfo, string>(r => r.LicenseText) }, HeaderText = "License Text" }; col1f.AutoSize = true; listcontainer.Columns.Add(col1f); string gpltext; using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("DWSIM.UI.Forms.Resources.TextFiles.gpl-3.0.txt")) using (StreamReader reader = new StreamReader(stream)) { gpltext = reader.ReadToEnd(); } var txt1 = new TextArea { Text = gpltext, ReadOnly = true }; var t1 = new TableLayout(new TableRow(txt1)); var tab1 = new TabPage { Content = container1, Text = "General Information" }; var tab2 = new TabPage { Content = new Scrollable { Content = t1 }, Text = "DWSIM License" }; var tab3 = new TabPage { Content = new Scrollable { Content = listcontainer }, Text = "External Components" }; var tabc = new TabControl(); tabc.Pages.Add(tab1); tabc.Pages.Add(tab2); tabc.Pages.Add(tab3); var tablecontainer = new TableLayout { Padding = new Padding(10), Spacing = new Size(5, 5) }; tablecontainer.Rows.Add(new TableRow(layout)); tablecontainer.Rows.Add(new TableRow(tabc)); Content = tablecontainer; }