/// <summary> /// データと背景画像を再読み込みする /// </summary> public void Reload() { Maidata = new Maidata(uriData); if (Maidata.title.Length > 0) Text = Maidata.title; LastUpdate = Maidata.LastUpdate; this.image.Source = Maidata.BackgroundImage; if (!File.Exists(Maidata.UriTrack.LocalPath) || !File.Exists(uriSwf.LocalPath)) { Visibility = System.Windows.Visibility.Collapsed; } }
/// <summary> /// コンストラクタ /// maidataを元にウィンドウを生成させる /// </summary> /// <param name="maidata"></param> public Editor(Maidata maidata) : this() { this.maidata = maidata; this.defaultMaidata = maidata.Clone(); this.Icon = maidata.BackgroundImage; LoadHighlightingDefinition(); CreateTabs(); ReflectTitle(); BindCommands(); }
private void ImportMediaFile(string path) { var uri = new Uri(path, UriKind.Absolute); Settings.importDir = Path.GetDirectoryName(uri.LocalPath); var filename = Path.GetFileNameWithoutExtension(uri.LocalPath); var uriImportDir = new Uri(uriDataDir, String.Format("./{0}/", filename)); var uriTrack = new Uri(uriImportDir, App.FILE_TRACK); var uriData = new Uri(uriImportDir, App.FILE_DATA); var uriSwf = new Uri(uriImportDir, fileSwf); try { Directory.CreateDirectory(uriImportDir.LocalPath); var md = new Maidata(uriData); md.Save(); if (File.Exists(uriSwf.LocalPath)) { File.Delete(uriSwf.LocalPath); } File.Copy(uriBaseSwf.LocalPath, uriSwf.LocalPath); if (!File.Exists(uriTrack.LocalPath)) { File.Copy(path, uriTrack.LocalPath); } } catch (Exception ex) { MessageBox.Show(ex.Message, "エラーが発生しました", MessageBoxButton.OK, MessageBoxImage.Error); } ReloadButtons(); }
private void SaveMaidata() { foreach (var tb in this.GetChildren<TextBox>()) { textBox_ReflectValue(tb); } foreach (var tb in this.GetChildren<TextEditor>()) { textEditor_ReflectValue(tb); } IsChanged = !maidata.Equals(defaultMaidata); if (!IsChanged) return; maidata.Save(); defaultMaidata = maidata.Clone(); ReflectTitle(); }
public Player(Maidata maidata) : this() { browser.Source = maidata.UriSwf; }