Class PythonFileViewModel
- Assembly
- Loehnert.Lisrt.Scripting.dll
View model for a python file.
public class PythonFileViewModel : TextFileViewModel, IViewAware, IChild, ICommandHandler<UndoCommandDefinition>, ICommandHandler<RedoCommandDefinition>, ICommandHandler<SaveFileCommandDefinition>, ICommandHandler<SaveFileAsCommandDefinition>, ICommandHandler, IProjectItemDocument, IPersistedDocument, IDocument, ILayoutItem, IScreen, IHaveDisplayName, IActivate, IDeactivate, IGuardClose, IClose, INotifyPropertyChangedEx, INotifyPropertyChanged, IPersistedElement, IHandle<TextEditorSettingsChangedEvent>, IHandle<CalledLineChangedEvent>, IHandle, ICanCommentOut
- Inheritance
-
PropertyChangedBaseViewAwareScreenPythonFileViewModel
- Implements
-
IViewAwareIChildIScreenIHaveDisplayNameIActivateIDeactivateIGuardCloseICloseINotifyPropertyChangedExIHandle<TextEditorSettingsChangedEvent>IHandle<CalledLineChangedEvent>IHandle
- Inherited Members
-
Screen.OnActivate()Screen.ParentScreen.IsActiveScreen.IsInitializedScreen.ActivatedScreen.AttemptingDeactivationScreen.DeactivatedViewAware.DefaultContextViewAware.ViewsViewAware.ViewAttachedPropertyChangedBase.Refresh()PropertyChangedBase.IsNotifyingPropertyChangedBase.PropertyChanged
Constructors
PythonFileViewModel(IProjectItem, IScriptShell, IEventAggregator, IIntelliSenseService)
Initializes a new instance of the PythonFileViewModel class.
public PythonFileViewModel(IProjectItem projectItem, IScriptShell parentShell, IEventAggregator eventAggregator, IIntelliSenseService intelliSenseService)
Parameters
projectItemIProjectItemPython project item.
parentShellIScriptShellShell for the view model.
eventAggregatorIEventAggregatorEvent aggregator for Caliburn.Micro.IHandle<TMessage>.
intelliSenseServiceIIntelliSenseServiceIntelliSense service, null for no IntelliSense.
Exceptions
- ArgumentNullException
Thrown when
projectItem,eventAggregatororparentShellis null.- ArgumentException
Thrown when
projectItemis not of type TextProjectItem.
PythonFileViewModel(IProjectItem, IScriptShell, IEventAggregator, IIntelliSenseService, ILockService, IUserManager, IMenuBuilder, IWindowManager)
Initializes a new instance of the PythonFileViewModel class.
public PythonFileViewModel(IProjectItem projectItem, IScriptShell parentShell, IEventAggregator eventAggregator, IIntelliSenseService intelliSenseService, ILockService lockService, IUserManager userManager, IMenuBuilder menuBuilder, IWindowManager windowManager)
Parameters
projectItemIProjectItemText based project item (TextProjectItem).
parentShellIScriptShellShell for the view model.
eventAggregatorIEventAggregatorEvent aggregator for Caliburn.Micro.IHandle<TMessage>.
intelliSenseServiceIIntelliSenseServiceIntelliSense service, null for no IntelliSense.
lockServiceILockServiceA service providing locks.
userManagerIUserManagerManager for users.
menuBuilderIMenuBuilderMenu builder to build the context menu.
windowManagerIWindowManagerWindow manager to show dialogs.
Exceptions
- ArgumentNullException
Thrown when
projectItem,eventAggregator,parentShell,lockServiceoruserManageris null.- ArgumentException
Thrown when
projectItemis not of type TextProjectItem.
Properties
BreakPoints
Gets the break points.
public BreakPointCollection BreakPoints { get; }
Property Value
CalledLine
Gets the line which was called by the call stack.
public int CalledLine { get; }
Property Value
Remarks
Value zero means not labeled. The called line is only visible in break mode and is usually labeled when a call-stack-call is clicked.
DefaultSettings
Gets the default settings.
protected override CodeEditorSettings DefaultSettings { get; }
Property Value
DisplayName
Gets or sets the display name.
public override string DisplayName { get; set; }
Property Value
ExecutingLine
Gets the executing line.
public int ExecutingLine { get; }
Property Value
Remarks
Value zero means not executed.
KnownVariables
Gets the known variables for auto complete.
public IEnumerable<KeyValuePair<string, object>> KnownVariables { get; }
Property Value
Methods
CommentOutSelectedLines()
Comments the selected lines out.
public void CommentOutSelectedLines()
Handle(CalledLineChangedEvent)
Handle the CalledLineChangedEvent message.
public void Handle(CalledLineChangedEvent message)
Parameters
messageCalledLineChangedEventMessage about the change of a called line which should be labeled.
Handle(TextEditorSettingsChangedEvent)
Handles the message for changed editor settings.
public override void Handle(TextEditorSettingsChangedEvent message)
Parameters
messageTextEditorSettingsChangedEventThe message.
OnDeactivate(bool)
Called when deactivating.
protected override void OnDeactivate(bool close)
Parameters
closeboolTrue, if the view is closed.
OnViewLoaded(object)
Called when an attached view's Loaded event fires.
protected override void OnViewLoaded(object view)
Parameters
viewobjectLoaded view.
Remarks
Registers with MahApps.Metro.Controls.Dialogs.DialogParticipation for the MetroDialogs and loads the text from file with DoLoad(string).
UnCommentSelectedLines()
Uncomments the selected lines.
public void UnCommentSelectedLines()