StrokesPlus.net Forum
»
General Discussion
»
Scripts
»
Get information about wrapper objects?
Rank: Advanced Member
Groups: Approved
Joined: 10/26/2020(UTC) Posts: 50 Location: Darmstadt Thanks: 15 times Was thanked: 2 time(s) in 2 post(s)
|
Hi Rob,
on some occasions, I need to use specific Windows classes for my scripts. For this S+ provides some wrapper objects like clr, forms, drawing, ... But my problem is that I cannot find a list of wrapper objects and which classes & namespace they give access to. How can I find out about that? Just as an example, I know that forms let me use classes within System.Windows.Forms.* and drawing gives access to System.Drawing.* - but what about, let´s say, System.Windows.Input? I tried wrapper input but it does not exist. As said, these are just examples, I would really like to have a documentation that I can rely on. Isn´t it existing (yet) or is it me having not searched hard enough?
|
|
|
|
Rank: Administration
Groups: Translators, Members, Administrators Joined: 1/11/2018(UTC) Posts: 1,359 Location: Tampa, FL Thanks: 28 times Was thanked: 419 time(s) in 356 post(s)
|
When you click Script Help, the first page ( .NET and ClearScript) shows the objects. However, in the next update I will be removing the entry for windows - System.Windows since that is a WPF namespace and S+ is a WinForms application, so the windows object is essentially empty. Also will update sysinfo to fully qualify the namespace as shown below. Code:clr = mscorlib, System, System.Core
drawing = System.Drawing
forms = System.Windows.Forms
net = System.Net
http = System.Net.Http
host = ExtendedHostFunctions (see ClearScript help)
clip = System.Windows.Forms.Clipboard
sysinfo = System.Windows.Forms.SystemInformation
speech = System.Speech
The scope of these namespaces is essentially limited to the classes contained in the primary DLL for the namespace. For example, forms is the System.Windows.Forms.dll, as listed here (right below the namespace): https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.cursors?view=netframework-4.6.2Or for mscorlib for the clr.Microsoft.Win32 class in mscorlib.dll: https://docs.microsoft.com/en-us/dotnet/api/microsoft.win32.registry?view=netframework-4.6.2So if it's not listed, there's no wrapper for it exposed to the script engine. Each type library included increases the load time and memory usage (multiplied by the number of script engines active), so I try to keep it to the basics (except speech, that was an early special request).
|
|
|
|
StrokesPlus.net Forum
»
General Discussion
»
Scripts
»
Get information about wrapper objects?
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The StrokesPlus.net Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close