-
-
Notifications
You must be signed in to change notification settings - Fork 300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CodeEditor related changes and ko language added #215
Closed
Closed
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
1edbefb
1. In startUp, a codeEditor document is not opened because of its _Vi…
diluculo c571aa5
In opening a file that is already open, just activate the tab.
diluculo 96b3948
Add Recent Files menu
diluculo 9744511
Merge pull request #1 from tgjones/master
diluculo 0d0dee7
Update from original
diluculo 28a5336
RecentFiles menu for persisted documents added
diluculo 99a0c41
Implement enabled state of Recent Files Menu
diluculo 14eadae
Clean up codes
diluculo 0cbde43
Shortcut for SaveAll menu added
diluculo dcb9160
Change name of FileRecentFilesCommandText.
diluculo 0d0cbc8
Resx Files changed
diluculo 02cb982
ko-KR language pack added
diluculo c87f661
Gemini.Demo.TextEditor: TextWrapping and AcceptsReturn added
diluculo 41e1c65
Change ko-KR to ko
diluculo 2c56f46
"Async" removed in Run() method of SaveAllFilesCommandHandler.cs
diluculo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/Gemini/Modules/Shell/Commands/RecentFilesCommandDefinition.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using Gemini.Framework.Commands; | ||
using Gemini.Properties; | ||
|
||
namespace Gemini.Modules.Shell.Commands | ||
{ | ||
[CommandDefinition] | ||
public class RecentFilesCommandDefinition : CommandDefinition | ||
{ | ||
public const string CommandName = "File.RecentFiles"; | ||
|
||
public override string Name | ||
{ | ||
get { return CommandName; } | ||
} | ||
|
||
public override string Text | ||
{ | ||
get { return Resources.FileOpenRecentCommandText; } | ||
} | ||
|
||
public override string ToolTip | ||
{ | ||
get { return Resources.FileOpenRecentCommandToolTip; } | ||
} | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
src/Gemini/Modules/Shell/Commands/RecentFilesCommandHandler.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using Gemini.Framework.Commands; | ||
using Gemini.Framework.Services; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel.Composition; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Gemini.Modules.Shell.Commands | ||
{ | ||
[CommandHandler] | ||
public class RecentFilesCommandHandler : CommandHandlerBase<RecentFilesCommandDefinition> | ||
{ | ||
private readonly IShell _shell; | ||
|
||
[ImportingConstructor] | ||
public RecentFilesCommandHandler(IShell shell) | ||
{ | ||
_shell = shell; | ||
} | ||
|
||
public override void Update(Command command) | ||
{ | ||
command.Enabled = (_shell.RecentFiles.Items.Count > 0); | ||
} | ||
|
||
public override Task Run(Command command) | ||
{ | ||
return null; | ||
} | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
src/Gemini/Modules/Shell/Commands/SaveAllFilesCommandDefinition.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using Gemini.Framework.Commands; | ||
using Gemini.Properties; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel.Composition; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows.Input; | ||
|
||
namespace Gemini.Modules.Shell.Commands | ||
{ | ||
[CommandDefinition] | ||
public class SaveAllFilesCommandDefinition : CommandDefinition | ||
{ | ||
public const string CommandName = "File.SaveAllFiles"; | ||
|
||
public override string Name | ||
{ | ||
get { return CommandName; } | ||
} | ||
|
||
public override string Text | ||
{ | ||
get { return Resources.FileSaveAllCommandText; } | ||
} | ||
|
||
public override string ToolTip | ||
{ | ||
get { return Resources.FileSaveAllCommandToolTip; } | ||
} | ||
|
||
public override Uri IconSource | ||
{ | ||
get { return new Uri("pack://application:,,,/Gemini;component/Resources/Icons/Saveall.png"); } | ||
} | ||
|
||
|
||
// TODO: there is a bug in case of multiple modifiers | ||
//[Export] | ||
//public static CommandKeyboardShortcut KeyGesture = new CommandKeyboardShortcut<SaveFileCommandDefinition>(new KeyGesture(Key.S, ModifierKeys.Control | ModifierKeys.Shift)); | ||
} | ||
} |
52 changes: 52 additions & 0 deletions
52
src/Gemini/Modules/Shell/Commands/SaveAllFilesCommandHandler.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
using Gemini.Framework; | ||
using Gemini.Framework.Commands; | ||
using Gemini.Framework.Services; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel.Composition; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Gemini.Modules.Shell.Commands | ||
{ | ||
[CommandHandler] | ||
public class SaveAllFilesCommandHandler : CommandHandlerBase<SaveAllFilesCommandDefinition> | ||
{ | ||
private readonly IShell _shell; | ||
|
||
[ImportingConstructor] | ||
public SaveAllFilesCommandHandler(IShell shell) | ||
{ | ||
_shell = shell; | ||
} | ||
|
||
public override async Task Run(Command command) | ||
{ | ||
var tasks = new List<Task<Tuple<IPersistedDocument, bool>>>(); | ||
|
||
foreach (var document in _shell.Documents) | ||
{ | ||
var persistedDocument = document as IPersistedDocument; | ||
if (persistedDocument == null) continue; | ||
|
||
// skip if the file is new | ||
if (!persistedDocument.IsNew) | ||
{ | ||
tasks.Add(DoSaveAsync(persistedDocument)); | ||
} | ||
} | ||
|
||
// TODO: display "Item(s) saved" in statusbar | ||
} | ||
|
||
// http://stackoverflow.com/questions/19431494/how-to-use-await-in-a-loop | ||
private async Task<Tuple<IPersistedDocument, bool>> DoSaveAsync(IPersistedDocument persistedDocument) | ||
{ | ||
var filePath = persistedDocument.FilePath; | ||
await persistedDocument.Save(filePath); | ||
|
||
return Tuple.Create(persistedDocument, true); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One nitpick, remove the async and return TaskUtility.Completed here, otherwise the compiler will give warnings.