示例#1
0
        public EditorGrid(Song song, EditorWindow parent)
        {
            InitializeComponent();

            if (song == null)
                throw new ArgumentNullException("song");

            this.parent = parent;

            this.song = song;

            var tnp = (Nodes.TreeNodeProvider)FindResource("treeNodeProvider");
            tnp.Song = song;

            if (song.CheckSingleFontSize())
            {
                SingleFontSize = true;
            }

            song.PropertyChanged += (sender, args) =>
            {
                if (args.PropertyName == "Formatting")
                    OnPropertyChanged("SingleFontSize");
            };

            this.StructureTree.IsEnabled = false;
            this.OrderListBox.IsEnabled = false;

            this.PreviewControl.FinishedLoading += (sender, args) => InitSelection();
        }
示例#2
0
        public EditorDocument(Song song, EditorWindow parent)
        {
            Song = song;

            Grid = new EditorGrid(song, parent);
            Grid.PreviewControl.ShowChords = parent.ShowChords;

            Song.IsUndoEnabled = true;
        }
示例#3
0
		public static EditorWindow ShowEditorWindow()
		{
			foreach (Window win in instance.openedWindows)
			{
				if (win is EditorWindow)
				{
					if (win.WindowState == WindowState.Minimized)
						win.WindowState = WindowState.Normal;

					win.Focus();
					return win as EditorWindow;
				}
			}

			EditorWindow editor = new EditorWindow();
			instance.openedWindows.Add(editor);
			editor.Closed += delegate { instance.openedWindows.Remove(editor); };
			editor.Show();
			return editor;
		}