IGLib
1.7.2
The IGLib base library EXTENDED - with other lilbraries and applications.
|
Hosts all general utility methods to access and modify the shell. Use this static class to manage the workspace, open documents, evaluate code and manage or dump to the sinks. More...
Static Public Member Functions | |
static void | UpdateProgress (int progress) |
Update the progress in the staus bar. More... | |
static EvaluatorResult | Evaluate (string input) |
Evaluates a piece of code. More... | |
static EvaluatorResult | EvaluateFile (string filePath) |
Evaluates all the code in a file. More... | |
static bool | TryEvaluateFile (string filePath) |
Evaluates all the code in a file. More... | |
static IEnumerable< IDocument > | GetDocuments () |
Gets all available documents including sinks. More... | |
static IDocument | GetDocument (Uri uri) |
Gets or creates specific document and opens it. More... | |
static IDocument | GetDocument (Uri uri, bool suppressOpen) |
Gets or creates specific document and opens it. More... | |
static IEnumerable< ITextDocument > | GetTextDocuments () |
Gets all available text documents. More... | |
static ITextDocument | GetTextDocument (string filePath) |
Gets or creates specific text document and opens it. More... | |
static bool | TryOpen (string filePath) |
Tries to open a file as a document. More... | |
static void | Open (string filePath) |
Opens a file as a document. More... | |
static IEnumerable< ISink > | GetSinks () |
Gets all available sinks. More... | |
static ISink | GetSink (Uri uri) |
Gets a specific sink based on the URI. If the sink URI exists or can be created the sink is opened. More... | |
static ISink | GetSink (Uri uri, bool suppressOpen) |
Gets a specific sink based on the uri. More... | |
static ISink | GetSink (string sinkName) |
Gets the first sink with a certain title. More... | |
static void | Dump (this object o, Uri sink=null) |
Dumps an object to the specified sink. More... | |
static void | Dump (this object o, string description, Uri sink=null) |
Dumps an object to the specified sink. More... | |
static void | DumpGrid (this IEnumerable data, string sinkName=null) |
Dumps data to a table. More... | |
static void | DumpXhtml (this object o, string description=null, int depth=3, string sinkName=null) |
Dumps the object to a XHTML sink. More... | |
static ITool | GetTool (Uri uri) |
Gets a specific tool based on the URI. If the tool URI exists or can be created the tool is opened. More... | |
static ITool | GetTool (Uri uri, bool suppressOpen) |
Gets a specific tool based on the uri. More... | |
static void | OpenWorkspace () |
Opens a default workspace. More... | |
static Task | OpenWorkspace (string cshellFile) |
Opens a workspace based on a .cshell file. More... | |
static Task | CloseWorkspace () |
Closes the current workspace. More... | |
static void | UpdateProgress (int progress) |
Update the progress in the staus bar. More... | |
static EvaluatorResult | Evaluate (string input) |
Evaluates a piece of code. More... | |
static EvaluatorResult | EvaluateFile (string filePath) |
Evaluates all the code in a file. More... | |
static bool | TryEvaluateFile (string filePath) |
Evaluates all the code in a file. More... | |
static IEnumerable< IDocument > | GetDocuments () |
Gets all available documents including sinks. More... | |
static IDocument | GetDocument (Uri uri) |
Gets or creates specific document and opens it. More... | |
static IDocument | GetDocument (Uri uri, bool suppressOpen) |
Gets or creates specific document and opens it. More... | |
static IEnumerable< ITextDocument > | GetTextDocuments () |
Gets all available text documents. More... | |
static ITextDocument | GetTextDocument (string filePath) |
Gets or creates specific text document and opens it. More... | |
static bool | TryOpen (string filePath) |
Tries to open a file as a document. More... | |
static void | Open (string filePath) |
Opens a file as a document. More... | |
static IEnumerable< ISink > | GetSinks () |
Gets all available sinks. More... | |
static ISink | GetSink (Uri uri) |
Gets a specific sink based on the URI. If the sink URI exists or can be created the sink is opened. More... | |
static ISink | GetSink (Uri uri, bool suppressOpen) |
Gets a specific sink based on the uri. More... | |
static ISink | GetSink (string sinkName) |
Gets the first sink with a certain title. More... | |
static void | Dump (this object o, Uri sink=null) |
Dumps an object to the specified sink. More... | |
static void | Dump (this object o, string description, Uri sink=null) |
Dumps an object to the specified sink. More... | |
static void | DumpGrid (this IEnumerable data, string sinkName=null) |
Dumps data to a table. More... | |
static void | DumpXhtml (this object o, string description=null, int depth=3, string sinkName=null) |
Dumps the object to a XHTML sink. More... | |
static ITool | GetTool (Uri uri) |
Gets a specific tool based on the URI. If the tool URI exists or can be created the tool is opened. More... | |
static ITool | GetTool (Uri uri, bool suppressOpen) |
Gets a specific tool based on the uri. More... | |
static void | OpenWorkspace () |
Opens a default workspace. More... | |
static Task | OpenWorkspace (string cshellFile) |
Opens a workspace based on a .cshell file. More... | |
static Task | CloseWorkspace () |
Closes the current workspace. More... | |
Properties | |
static IRepl | Repl [get] |
Gets the interface to modify the REPL window. More... | |
static IOutput | Output [get] |
Gets the interface to modify the console output window. More... | |
static ITextDocument | TextDocument [get] |
Gets the current text document. More... | |
static Uri | DefaultSinkUri [get, set] |
Gets or sets the URI of the default sink. More... | |
static Workspace | Workspace [get] |
Gets the instance of the currently open workspace, if no workspace is open returns null. More... | |
Static Private Member Functions | |
static ISink | GetGridSink (string sinkName, bool suppressOpen=false) |
Gets a grid sink based on the sink name. More... | |
static IXhtmlSink | GetXhtmlSink (string sinkName, bool suppressOpen=false) |
Gets a XHTML sink. More... | |
static ISink | GetGridSink (string sinkName, bool suppressOpen=false) |
Gets a grid sink based on the sink name. More... | |
static IXhtmlSink | GetXhtmlSink (string sinkName, bool suppressOpen=false) |
Gets a XHTML sink. More... | |
Static Private Attributes | |
static readonly Lazy< IShell > | shellLazy = new Lazy<IShell>(() => IoC.Get<IShell>(), true) |
static readonly Lazy< IRepl > | replLazy = new Lazy<IRepl>(() => IoC.Get<IRepl>(), true) |
static readonly Lazy< IOutput > | outputLazy = new Lazy<IOutput>(()=>IoC.Get<IOutput>(), true) |
static Uri | defaultSinkUri = new Uri(Constants.SinkXhtml) |
static Workspace | workspace = null |
static readonly object | instanceLock = new object() |
Hosts all general utility methods to access and modify the shell. Use this static class to manage the workspace, open documents, evaluate code and manage or dump to the sinks.
|
inlinestatic |
Update the progress in the staus bar.
progress | The progress between 0 and 100. |
|
inlinestatic |
Evaluates a piece of code.
input | The code to evaluate. |
Referenced by IG.Lib.Ig.Eval().
|
inlinestatic |
Evaluates all the code in a file.
filePath | The path to the file. Can be relative to the root path of the workspace, e.g. "subfolder/file.csx" |
References CShell.ScriptingEngine.Evaluate(), and CShell.Workspace.ScriptingEngine.
Referenced by CShell.Shell.TryEvaluateFile().
|
inlinestatic |
Evaluates all the code in a file.
filePath | The path to the file. Can be relative to the root path of the workspace, e.g. "subfolder/file.csx" |
true
if the evaluation succeeded, otherwise false
.References CShell.Shell.EvaluateFile(), and CShell.EvaluatorResult.HasErrors.
Referenced by IG.Lib.Ig.TryEvalFile().
|
inlinestatic |
Gets all available documents including sinks.
References CShell.Shell.shellLazy.
Referenced by CShell.Shell.GetDocument().
|
inlinestatic |
Gets or creates specific document and opens it.
uri | The URI of the document. Can be a file path URI. |
Referenced by CShell.Framework.Results.OpenDocumentResult.Execute(), CShell.Shell.GetDocument(), CShell.Shell.GetTextDocument(), and CShell.Modules.Shell.ViewModels.ShellViewModel.LoadLayout().
|
inlinestatic |
Gets or creates specific document and opens it.
uri | The URI of the document. Can be a file path URI. |
suppressOpen | true if the document should not be opened. |
References CShell.Shell.GetDocuments(), and CShell.Shell.shellLazy.
|
inlinestatic |
Gets all available text documents.
References CShell.Shell.shellLazy.
|
inlinestatic |
Gets or creates specific text document and opens it.
filePath | The path to the file. Can be relative to the root path of the workspace, e.g. "subfolder/file.csx" |
References CShell.Shell.GetDocument().
|
inlinestatic |
Tries to open a file as a document.
filePath | The path to the file. Can be relative to the root path of the workspace, e.g. "subfolder/file.csx" |
true
if the file was found, otherwise false
.
|
inlinestatic |
Opens a file as a document.
filePath | The path to the file. Can be relative to the root path of the workspace, e.g. "subfolder/file.csx" |
ArgumentNullException | If the file path is null or empty. |
FileNotFoundException | If the file doesn't exist. |
References CShell.Framework.Results.Show.Document().
|
inlinestatic |
Gets all available sinks.
References CShell.Shell.shellLazy.
Referenced by CShell.Shell.GetSink().
|
inlinestatic |
Gets a specific sink based on the URI. If the sink URI exists or can be created the sink is opened.
uri | The sink URI. |
Referenced by CShell.Shell.Dump(), CShell.Shell.GetGridSink(), CShell.Sinks.Plotting.GetPlotSink(), CShell.Shell.GetSink(), CShell.Shell.GetXhtmlSink(), and CShell.Modules.Shell.ViewModels.ShellViewModel.LoadLayout().
|
inlinestatic |
Gets a specific sink based on the uri.
uri | The sink URI. |
suppressOpen | If set to true sink will not be opened, but just created. |
References CShell.Shell.GetSinks(), and CShell.Shell.shellLazy.
|
inlinestatic |
Gets the first sink with a certain title.
sinkName | Name of the sink. |
References CShell.Shell.GetSinks().
|
inlinestatic |
Dumps an object to the specified sink.
o | The object to dump. |
sink | The sink URI. If no sink URI is specified the default sink is used. |
Referenced by CShell.Shell.Dump().
|
inlinestatic |
Dumps an object to the specified sink.
o | The object to dump. |
description | A description of the object. Can be null. |
sink | The sink URI. If no sink URI is specified the default sink is used. |
References CShell.Shell.DefaultSinkUri, and CShell.Shell.GetSink().
|
inlinestaticprivate |
Gets a grid sink based on the sink name.
sinkName | Name of the sink. |
suppressOpen | If set to true the grid is not opened. |
References CShell.Shell.GetSink(), and CShell.Constants.SinkGrid.
Referenced by CShell.Shell.DumpGrid().
|
inlinestatic |
Dumps data to a table.
data | The data. |
sinkName | Name of the sink. |
References CShell.Shell.GetGridSink().
|
inlinestaticprivate |
Gets a XHTML sink.
sinkName | Name of the sink. |
suppressOpen | If set to true the sink is not opened. |
References CShell.Shell.GetSink(), and CShell.Constants.SinkXhtml.
Referenced by CShell.Shell.DumpXhtml().
|
inlinestatic |
Dumps the object to a XHTML sink.
o | The object to dump. |
description | A description of the object. |
depth | If it's a nested type how many sub-types should be printed. |
sinkName | Name of the sink. |
References CShell.Shell.GetXhtmlSink().
|
inlinestatic |
Gets a specific tool based on the URI. If the tool URI exists or can be created the tool is opened.
uri | The tool URI. |
Referenced by CShell.Shell.GetTool(), and CShell.Modules.Shell.ViewModels.ShellViewModel.LoadLayout().
|
inlinestatic |
Gets a specific tool based on the uri.
uri | The tool URI. |
suppressOpen | If set to true tool will not be opened, but just created. |
References CShell.Shell.shellLazy.
|
inlinestatic |
Opens a default workspace.
References CShell.Constants.CShellDefaultFilePath.
Referenced by CShell.Framework.Results.OpenWorkspaceResult.Execute(), and CShell.Shell.OpenWorkspace().
|
inlinestatic |
Opens a workspace based on a .cshell file.
cshellFile | The file path to the .cshell file. |
References CShell.Shell.Workspace.
|
inlinestatic |
Closes the current workspace.
Referenced by CShell.Framework.Results.CloseWorkspaceResult.Execute().
|
inlinestatic |
Update the progress in the staus bar.
progress | The progress between 0 and 100. |
|
inlinestatic |
Evaluates a piece of code.
input | The code to evaluate. |
|
inlinestatic |
Evaluates all the code in a file.
filePath | The path to the file. Can be relative to the root path of the workspace, e.g. "subfolder/file.csx" |
References CShell.ScriptingEngine.Evaluate(), and CShell.Workspace.ScriptingEngine.
|
inlinestatic |
Evaluates all the code in a file.
filePath | The path to the file. Can be relative to the root path of the workspace, e.g. "subfolder/file.csx" |
true
if the evaluation succeeded, otherwise false
.References CShell.Shell.EvaluateFile(), and CShell.EvaluatorResult.HasErrors.
|
inlinestatic |
Gets all available documents including sinks.
References CShell.Shell.shellLazy.
|
inlinestatic |
Gets or creates specific document and opens it.
uri | The URI of the document. Can be a file path URI. |
References CShell.Shell.GetDocument().
|
inlinestatic |
Gets or creates specific document and opens it.
uri | The URI of the document. Can be a file path URI. |
suppressOpen | true if the document should not be opened. |
References CShell.Shell.GetDocuments(), and CShell.Shell.shellLazy.
|
inlinestatic |
Gets all available text documents.
References CShell.Shell.shellLazy.
|
inlinestatic |
Gets or creates specific text document and opens it.
filePath | The path to the file. Can be relative to the root path of the workspace, e.g. "subfolder/file.csx" |
References CShell.Shell.GetDocument().
|
inlinestatic |
Tries to open a file as a document.
filePath | The path to the file. Can be relative to the root path of the workspace, e.g. "subfolder/file.csx" |
true
if the file was found, otherwise false
.
|
inlinestatic |
Opens a file as a document.
filePath | The path to the file. Can be relative to the root path of the workspace, e.g. "subfolder/file.csx" |
ArgumentNullException | If the file path is null or empty. |
FileNotFoundException | If the file doesn't exist. |
References CShell.Framework.Results.Show.Document().
|
inlinestatic |
|
inlinestatic |
Gets a specific sink based on the URI. If the sink URI exists or can be created the sink is opened.
uri | The sink URI. |
References CShell.Shell.GetSink().
|
inlinestatic |
Gets a specific sink based on the uri.
uri | The sink URI. |
suppressOpen | If set to true sink will not be opened, but just created. |
References CShell.Shell.GetSinks(), and CShell.Shell.shellLazy.
|
inlinestatic |
Gets the first sink with a certain title.
sinkName | Name of the sink. |
References CShell.Shell.GetSinks().
|
inlinestatic |
Dumps an object to the specified sink.
o | The object to dump. |
sink | The sink URI. If no sink URI is specified the default sink is used. |
References CShell.Shell.Dump().
|
inlinestatic |
Dumps an object to the specified sink.
o | The object to dump. |
description | A description of the object. Can be null. |
sink | The sink URI. If no sink URI is specified the default sink is used. |
References CShell.Shell.DefaultSinkUri, and CShell.Shell.GetSink().
|
inlinestaticprivate |
Gets a grid sink based on the sink name.
sinkName | Name of the sink. |
suppressOpen | If set to true the grid is not opened. |
References CShell.Shell.GetSink(), and CShell.Constants.SinkGrid.
|
inlinestatic |
Dumps data to a table.
data | The data. |
sinkName | Name of the sink. |
References CShell.Shell.GetGridSink().
|
inlinestaticprivate |
Gets a XHTML sink.
sinkName | Name of the sink. |
suppressOpen | If set to true the sink is not opened. |
References CShell.Shell.GetSink(), and CShell.Constants.SinkXhtml.
|
inlinestatic |
Dumps the object to a XHTML sink.
o | The object to dump. |
description | A description of the object. |
depth | If it's a nested type how many sub-types should be printed. |
sinkName | Name of the sink. |
References CShell.Shell.GetXhtmlSink().
|
inlinestatic |
Gets a specific tool based on the URI. If the tool URI exists or can be created the tool is opened.
uri | The tool URI. |
References CShell.Shell.GetTool().
|
inlinestatic |
Gets a specific tool based on the uri.
uri | The tool URI. |
suppressOpen | If set to true tool will not be opened, but just created. |
References CShell.Shell.shellLazy.
|
inlinestatic |
Opens a default workspace.
References CShell.Constants.CShellDefaultFilePath, and CShell.Shell.OpenWorkspace().
|
inlinestatic |
Opens a workspace based on a .cshell file.
cshellFile | The file path to the .cshell file. |
References CShell.Shell.Workspace.
|
inlinestatic |
Closes the current workspace.
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticget |
Gets the interface to modify the REPL window.
Referenced by IG.Lib.Ig.Clear().
|
staticget |
Gets the interface to modify the console output window.
|
staticget |
Gets the current text document.
|
staticgetset |
Gets or sets the URI of the default sink.
Referenced by CShell.Shell.Dump().
|
staticget |
Gets the instance of the currently open workspace, if no workspace is open returns null.
Referenced by CShell.Modules.Workspace.Module.AddReferenceFromFile(), CShell.Modules.Workspace.Module.AddReferenceFromGac(), CShell.Modules.Shell.ViewModels.ShellViewModel.Closing(), CShell.Framework.Results.RunCodeResult.Execute(), CShell.Modules.Workspace.ViewModels.RootFolderSettingsViewModel.Ok(), CShell.Modules.Editors.ViewModels.EditorViewModel.OnViewLoaded(), CShell.Shell.OpenWorkspace(), CShell.Modules.Repl.ViewModels.OutputViewModel.OutputViewModel(), CShell.Modules.Workspace.ViewModels.RootFolderSettingsViewModel.RootFolderSettingsViewModel(), and CShell.Modules.Workspace.ViewModels.WorkspaceViewModel.WorkspaceViewModel().