Пример #1
0
        private void LoadImage()
        {
            IOpenFile openFile = this.ServiceLocator.Resolve <IOpenFile>();

            openFile.Filter.Add("Image Files", "*.jpg;*.png;*.bmp;*.gif"); openFile.ShowDialog(false);
            string file = openFile.FileName;

            if (string.IsNullOrEmpty(file))
            {
                return;
            }

            RawImage = new Bitmap(file);
        }
Пример #2
0
 public Tour_LogJson JsonImport()
 {
     _openFileDialog.Title  = "Open a JSON TourPlanner File you want to import";
     _openFileDialog.Filter = "Json Files (*.json) | *.json";
     _openFileDialog.ShowDialog();
     if (!_openFileDialog.FileName.Equals(""))
     {
         StreamReader streamReader = new StreamReader(_openFileDialog.FileName);
         string       json         = streamReader.ReadToEnd();
         streamReader.Close();
         return(JsonConvert.DeserializeObject <Tour_LogJson>(json));
     }
     return(null);
 }
Пример #3
0
        private void ConfigureNewGame()
        {
            IOpenFile openFile = this.ServiceLocator.Resolve <IOpenFile>();

            openFile.Filter.Add("Text", "*.txt");

            openFile.ShowDialog(false);
            string file = openFile.FileName;

            TextReader reader = new StreamReader(file);

            for (int i = 0; i < _buzzwords.Length; i++)
            {
                _buzzwords[i] = reader.ReadLine();
            }

            this.IsHost = true;
        }