Skip to content

Instantly share code, notes, and snippets.

Created Mar 24, 2016
What would you like to do?
import clr
clr.AddReferenceByName("PresentationFramework, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35")
clr.AddReferenceByName("PresentationCore, Version=, 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():
def reloadInit():
execfile(core.SharedConstants.ProductUserDirectory + r'\')
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