private void ClickAddMemory(object sender, RoutedEventArgs e) { Models.Application app = AppList.SelectedItem as Models.Application; Models.AppVersion version = (sender as Button).DataContext as Models.AppVersion; version.Memories.Add(new Models.Memory() { Type = app.Mask.Memory }); }
private void ClickRemoveApp(object sender, RoutedEventArgs e) { if (AppList.SelectedItem == null) { return; } Models.Application app = AppList.SelectedItem as Models.Application; General.Applications.Remove(app); }
private void ClickRemoveVersion(object sender, RoutedEventArgs e) { if (AppList.SelectedItem == null || VersionList.SelectedItem == null) { return; } Models.Application app = AppList.SelectedItem as Models.Application; Models.AppVersion ver = VersionList.SelectedItem as Models.AppVersion; app.Versions.Remove(ver); }
private void ClickCopyVersion(object sender, RoutedEventArgs e) { if (AppList.SelectedItem == null || VersionList.SelectedItem == null) { return; } Models.Application app = AppList.SelectedItem as Models.Application; Models.AppVersion ver = VersionList.SelectedItem as Models.AppVersion; Models.AppVersion copy = new Models.AppVersion(ver); app.Versions.Add(copy); }
private void ClickAddVersion(object sender, RoutedEventArgs e) { Models.Application app = AppList.SelectedItem as Models.Application; Models.AppVersion newVer = new Models.AppVersion() { Name = app.Name }; if (app.Versions.Count > 0) { Models.AppVersion ver = app.Versions.OrderByDescending(v => v.Number).ElementAt(0); newVer.Number = ver.Number + 1; } newVer.Dynamics.Add(new Models.Dynamic.DynamicMain()); app.Versions.Add(newVer); }