void Load_Click(object sender, RoutedEventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); if (ofd.ShowDialog().Value) { foreach(string coli in SplitOnSctpHostColi(File.ReadAllText(ofd.FileName))) { try { SctpHostVM sctphost = new SctpHostVM(); sctphost.Load(coli); SctpHostWindow sctpHostWnd = new SctpHostWindow(sctphost); sctpHostWnd.Show(); } catch { continue; } } } }
public SctpHostWindow(SctpHostVM sctpHost) { InitializeComponent(); try{ sctphost = sctpHost; this.DataContext = sctphost; defaultBrush = AssocFilterLabel.Background; AssocFilterLabel.Background = defaultBrush; EndpointFilterLabel.Background = defaultBrush; this.Title = "sctphost parser - CPid="+ sctphost.CpId + " RPUid=" + sctphost.RpuId; } catch { Close(); } }