示例#1
0
        private void DeleteAnchorButton_Click(object sender, RoutedEventArgs e)
        {
            var index = AnchorsListBox.SelectedIndex;

            if (index < 0)
            {
                return;
            }

            var anchor = AnchorsCollection[index];

            if (!MessageBoxUtilities.Question($"Are you sure delete the anchor: {anchor.Name}?"))
            {
                return;
            }

            AnchorsCollection.Remove(anchor);
            CurrentScreen.Anchors.Remove(anchor);
        }
示例#2
0
        private void DeleteScreenButton_Click(object sender, RoutedEventArgs e)
        {
            var screen = GetSelectedScreen();

            if (!MessageBoxUtilities.Question($"Are you sure delete the screen: {screen.Name}?"))
            {
                return;
            }

            ScreensCollection.Remove(screen);
            Info.Screens.Remove(screen);

            var path = Path.Combine(Settings.Default.CurrentDirectory, screen.Name);

            File.Delete(path);

            Save();

            Load(Settings.Default.CurrentDirectory);
        }