private void Save_Executed(object sender, ExecutedRoutedEventArgs e)
 {
     if (App.AuthorName == null || App.AuthorId == null)
     {
         if (MessageBox.Show(
                 "Flipnote Studio user data is missing or was corrupted.\n" +
                 "Do you want to set up the user data?\n" +
                 "Clicking \"No\" will abort the saving attempt.",
                 "Error", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
         {
             if (new FlipnoteUserIdGetterWindow().ShowDialog() != true)
             {
                 return;
             }
         }
         else
         {
             return;
         }
     }
     if (Flipnote == null)
     {
         Flipnote = Flipnote.New(App.AuthorName, App.AuthorId, FramesList.List.ItemsSource as List <DecodedFrame>);
     }
     else
     {
         Flipnote = Flipnote.New(App.AuthorName, App.AuthorId, FramesList.List.ItemsSource as List <DecodedFrame>);
         /// what the hell did I want to do here differently???
     }
     Flipnote.AnimationHeader.Flags         = AHFlags;
     Flipnote.SoundHeader.CurrentFramespeed = (byte)(8 - PlayBackSpeed.Value);
     Flipnote.Save(Flipnote.Filename);
     MessageBox.Show("Flipnote saved!");
 }
        private void FileSelector_ConfirmRequest(object sender)
        {
            var path = System.IO.Path.Combine(FileSelector.Path, FileSelector.Filename);

            if (File.Exists(path))
            {
                var meta = Flipnote.ReadMetadata(path);
                Window.CheckIdentityPage.AuthorName = meta.CurrentAuthorName;
                Window.CheckIdentityPage.AuthorId   = meta.CurrentAuthorId;
                Window.CheckIdentityPage.Source     = this;
                Window.GoToCheckIdentityPage();
            }
            else
            {
                MessageBox.Show("An error occured.");
            }
        }
        private void Open_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            var ofd = new OpenFileDialog
            {
                Filter           = "Para Para Manga Koubou (*.ppm)|*.ppm",
                Multiselect      = false,
                InitialDirectory = App.Path
            };

            if (ofd.ShowDialog() == true)
            {
                Flipnote = new Flipnote(ofd.FileName);

                AHFlags = Flipnote.AnimationHeader.Flags;
                UpdateProperties();
                PlayBackSpeed.Value = 8 - Flipnote.SoundHeader.CurrentFramespeed;
                // This stores the flipnote frames
                // Ok, ok, it's not the best practice, but at least it works.
                // Maybe I'll change this in the future.
                FramesList.List.ItemsSource = Flipnote.GetDecodedFrameList();
                FramesList.List.Items.Refresh();
                FramesList.List.SelectedIndex = 0;
            }
        }