public override void Reload()
 {
     if (this.Item is FileMetadata file)
     {
         this.TextBox.Text = YenconFormatRecognition.Load(file.Path).ToString();
         this.Text         = this.Item.Name;
         this.Loaded       = true;
     }
 }
 public override void SaveAs(PathString filename)
 {
     if (this.Item is FileMetadata file)
     {
         try {
             var t = YenconFormatRecognition.GetYenconType(file.Path);
             YenconFormatRecognition.Save(filename, _conv.ToYencon(this.TextBox.Text), t);
         } catch (Exception e) {
             this.Logger.Exception(e);
             MessageBox.Show(this,
                             e.Message,
                             this.Item.Name,
                             MessageBoxButtons.OK,
                             MessageBoxIcon.Error
                             );
         }
     }
 }
Example #3
0
		public static YSection Load(string filename)
		{
#if RELEASE
			try {
#endif
				_last_type = YenconFormatRecognition.GetYenconType(filename);
				if (_last_type == YenconType.Text) {
					return _txt_cnvtr.Load(filename);
				} else if (_last_type == YenconType.Binary) {
					return _bin_cnvtr.Load(filename);
				} else {
					return null;
				}
#if RELEASE
			} catch (Exception e) {
				Program.ShowError(e);
				return null;
			}
#endif
		}