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
projectItem
IProjectItemPython project item.
parentShell
IScriptShellShell for the view model.
eventAggregator
IEventAggregatorEvent aggregator for Caliburn.Micro.IHandle<TMessage>.
intelliSenseService
IIntelliSenseServiceIntelliSense service, null for no IntelliSense.
Exceptions
- ArgumentNullException
Thrown when
projectItem
,eventAggregator
orparentShell
is null.- ArgumentException
Thrown when
projectItem
is 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
projectItem
IProjectItemText based project item (TextProjectItem).
parentShell
IScriptShellShell for the view model.
eventAggregator
IEventAggregatorEvent aggregator for Caliburn.Micro.IHandle<TMessage>.
intelliSenseService
IIntelliSenseServiceIntelliSense service, null for no IntelliSense.
lockService
ILockServiceA service providing locks.
userManager
IUserManagerManager for users.
menuBuilder
IMenuBuilderMenu builder to build the context menu.
windowManager
IWindowManagerWindow manager to show dialogs.
Exceptions
- ArgumentNullException
Thrown when
projectItem
,eventAggregator
,parentShell
,lockService
oruserManager
is null.- ArgumentException
Thrown when
projectItem
is 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
message
CalledLineChangedEventMessage 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
message
TextEditorSettingsChangedEventThe message.
OnDeactivate(bool)
Called when deactivating.
protected override void OnDeactivate(bool close)
Parameters
close
boolTrue, if the view is closed.
OnViewLoaded(object)
Called when an attached view's Loaded event fires.
protected override void OnViewLoaded(object view)
Parameters
view
objectLoaded 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()