Ejemplo n.º 1
0
        private void btnImport_Click(object sender, RoutedEventArgs e)
        {
            Microsoft.Win32.OpenFileDialog ofd = new Microsoft.Win32.OpenFileDialog();
            ofd.Title  = "Import Data from File";
            ofd.Filter = "Pathfinder Character Sheet|*.json|All Files|*.*";

            if (ofd.ShowDialog() ?? false == true)
            {
                string         filename = ofd.FileName;
                SentinelsSheet ps       = SentinelsSheet.LoadJsonFile(filename);
                LoadUserData(ps.Player ?? new UserData(true));
            }
        }
Ejemplo n.º 2
0
        private void btnImportData_Click(object sender, RoutedEventArgs e)
        {
            Microsoft.Win32.OpenFileDialog ofd = new Microsoft.Win32.OpenFileDialog();
            ofd.Title  = "Import Data from File";
            ofd.Filter = "Pathfinder Character Sheet|*.json|All Files|*.*";

            if (ofd.ShowDialog() ?? false == true)
            {
                string         filename = ofd.FileName;
                SentinelsSheet ps       = SentinelsSheet.LoadJsonFile(filename);
                ud = ps.Player ?? new UserData(true);
                if (!string.IsNullOrEmpty(ud.DisplayName))
                {
                    txtPlayerName.Text = ud.DisplayName;
                }
                else
                {
                    txtPlayerName.Text = "(not set)";
                }
            }
        }