Created
March 24, 2016 20:30
-
-
Save laynor/f10de9a06119a36e55f9 to your computer and use it in GitHub Desktop.
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
import clr | |
clr.AddReference('Caliburn.Micro') | |
clr.AddReference('MesaGrid.Core') | |
clr.AddReferenceByName("PresentationFramework, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35") | |
clr.AddReferenceByName("PresentationCore, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35") | |
import Caliburn.Micro as caliburn | |
import com.mesaideas.MesaGrid.ViewModels as viewModels | |
import com.mesaideas.MesaGrid.Core as core | |
from System import TimeSpan | |
from System.Windows.Media import Colors | |
def getShell(): | |
caliburn.IoC.Get[viewModels.ShellViewModel]() | |
def reloadInit(): | |
execfile(core.SharedConstants.ProductUserDirectory + r'\init.py') | |
def message(string, timeout=5000, color=Colors.Red): | |
statusbar = caliburn.IoC.Get[viewModels.StatusBarViewModel]() | |
statusbar.Message(string, TimeSpan.FromMilliseconds(timeout), color) | |
def newCommand(name, action, guard): | |
return viewModels.Commands.SimpleCommand(name, '', action, guard) | |
def switchToDocument(name): | |
items = [item for item in getShell().Items if item.DisplayName == name] | |
if items: | |
getShell().ActiveItem = items[0] | |
def currentEditor(): | |
return getShell().ActiveItem | |
- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment