private void DefaultViewSettings() { var tmpSetting = new ViewSetting(); for (int i = 0; i < 16; i++) { tmpSetting.Settings.Add(new DataSetting()); } tmpSetting.Settings[0].Group = "x:Test"; subViewCtrl.LoadViewSettingFile(tmpSetting); var tmp = new ViewFileName(); this.Text = makeWindowTitle(tmp); }
public MainForm(string[] args) { InitializeComponent(); this.Text = AssemblyProduct; subViewCtrl = new SubViewControl(); mainPanel.Controls.Add(subViewCtrl); subViewCtrl.Dock = DockStyle.Fill; if (IsValidRequestCommandLine(args)) { subViewCtrl.SetTargetVersionName(string.Empty); subViewCtrl.LoadViewSettingFile(new ViewSetting()); subViewCtrl.RunRemoteServerAsync(); } else { CommMainCtrl.CommunicationMode mode; if (Enum.TryParse <CommMainCtrl.CommunicationMode>(Properties.Settings.Default.CommMode, out mode)) { subViewCtrl.Config.CommMode = mode; } CommInstructions.RmAddr range; if (Enum.TryParse <CommInstructions.RmAddr>(Properties.Settings.Default.RmRange, out range)) { subViewCtrl.Config.RmRange = range; } subViewCtrl.Config.BaudRate = Properties.Settings.Default.BaudRate; subViewCtrl.Config.SerialPortName = Properties.Settings.Default.SerialPortName; System.Net.IPAddress clientAddress; if (System.Net.IPAddress.TryParse(Properties.Settings.Default.ClientAddress, out clientAddress)) { subViewCtrl.Config.ClientAddress = clientAddress; } subViewCtrl.Config.ClientPort = Properties.Settings.Default.ClientPort; System.Net.IPAddress serverAddress; if (System.Net.IPAddress.TryParse(Properties.Settings.Default.ServerAddress, out serverAddress)) { subViewCtrl.Config.ServerAddress = serverAddress; } subViewCtrl.Config.ServerPort = Properties.Settings.Default.ServerPort; if (Properties.Settings.Default.PassNumber <= UInt32.MaxValue) { subViewCtrl.Config.PassNumber = Properties.Settings.Default.PassNumber; } if (!loadViewFile(Properties.Settings.Default.PathViewFileName)) { pathViewFileName = null; DefaultViewSettings(); } else { pathViewFileName = Properties.Settings.Default.PathViewFileName; } } }