public void Load(ObservableCollection<GenericCommand> targetCollection)
        {
            targetCollection.Add(new GenericCommand(AppendXNAProcessorReference) { DisplayName = "Append XNA Content Processor Reference" });
            targetCollection.Add(new GenericCommand(AppendPackageReference) { DisplayName = "Append Package Reference" });

            targetCollection.Add(new GenericCommand(
               (p) => OpenInWindowsExplorer(editorApplication.SelectionForProperties.First((item) => IsItemModifiableWithPropertiesForFileSystem(item))),
                (p) => editorApplication.SelectionForProperties.FirstOrDefault((item) => IsItemModifiableWithPropertiesForFileSystem(item)) != null) { DisplayName = "Open in Windows Explorer" });

            targetCollection.Add(new GenericCommand(
                ResetProperties,
                (prop) => editorApplication.SelectionForProperties.All((item) => IsItemModifiableWithPropertiesForFileSystem(item))) { DisplayName = "Reset Properties" });

            targetCollection.Add(new GenericCommand(
                DeleteElements,
                (p) => editorApplication.SelectionForProperties.All((item) => CanDeleteItem(item))) { DisplayName = "Remove Reference" });


            targetCollection.Add(new GenericCommand(_ => editorApplication.Refresh()) { DisplayName = "Refresh View" });

            targetCollection.Add(new GenericCommand(EditIgnoreList) { DisplayName = "Edit Ignore List" });

            targetCollection.Add(rebuildSelectionCommand = new GenericCommand(
                RebuildSelection,
                (p) => editorApplication.Builder.CanBuild && editorApplication.SelectionForProperties.FirstOrDefault((item) => item is EditorContentFile || item is EditorUIContentFile) != null) { DisplayName = "Rebuild Selection" });

            editorApplication.Builder.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(Builder_PropertyChanged);
        }
        public SearchBindingProvider(EditorUIApplication editor)
        {
            if (editor == null)
                throw new ArgumentNullException("editor");

            this.editor = editor;

            SearchAndStopCommand = new GenericCommand(_ =>
            {
                if (searching)
                    Stop();
                else
                    Search();
            });
        }
        public EditorUIApplication(MainWindow mainWindow)
        {
            this.mainWindow = mainWindow;

            dispatcher = mainWindow.Dispatcher;

            Search = new SearchBindingProvider(this);

            NewFile = new GenericCommand((p) => ActionNewFile(p));

            OpenFile = new GenericCommand((p) => ActionOpenFile(p));

            SaveAsFile = new GenericCommand((p) => ActionSaveAsFile(p));
            SaveFile = new GenericCommand((p) => ActionSaveFile(p));

            Quit = new GenericCommand((p) => ActionQuit(p));

            About = new GenericCommand((p) => ActionAbout(p));

            LoadContextCommands();

            Builder.PropertyChanged += new PropertyChangedEventHandler(Builder_PropertyChanged);

            Build = new GenericCommand((p) => { Builder.ActionBuild(); }, (p) => Builder.CanBuild);
            Rebuild = new GenericCommand((p) => { Builder.ActionRebuildAll(); }, (p) => Builder.CanBuild);
            CancelBuild = new GenericCommand((p) => { Builder.ActionCancelBuild(); }, (p) => !Builder.CanBuild);

            OpenRecent = new GenericCommand(ActionOpenRecent);

            LoadApplicationSettings();

            Build_OutputCommands = new ObservableCollection<GenericCommand>();
            Build_OutputCommands.Add(new GenericCommand(Build_Action_CopySelection, (item) => SelectedBuildMessage != null) { DisplayName = "Copy Selection" });
            Build_OutputCommands.Add(new GenericCommand(Build_Action_CopyAll) { DisplayName = "Copy All" });
            Build_OutputCommands.Add(new GenericCommand(Build_Action_SaveAll) { DisplayName = "Save to file" });

            SelectedBuildMessage = new BuildMessage();
            Builder.BuildOutput.CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(BuildOutput_CollectionChanged);
        }