All ReadOnly properties with the Set accessors deleted, no methods. The properties are natively returned as Integers but the VB code has been written to automatically
cast (and return) as Boolean, to make more C# friendly. Unfortunately I am unable to properly test this object, in a Windows domain, and my implementation involves
a decent amount of guesswork. Also, I recall the case-level (as opposed to application-level) designation not working properly within Summation itself. It is quite possible
I had been looking at the Permissionobject at that point with only Standard Security in place. Either way, there are three constructors,
depending on what variation is needed:
VB
'parameterless constructor, should General\Application level permissions for current user
Dim perm_General_CurrentUser As sw.Permission = New sw.Permission()
Dim hasPermission As Boolean = perm_General_CurrentUser.AddCaseAlerts
'with Boolean parameter, should check Case level (current case) permissions for current user
Dim testAtCaseLevel As Boolean = True
Dim perm_CaseLevel_CurrentUser As sw.Permission = New sw.Permission(testAtCaseLevel)
hasPermission = perm_CaseLevel_CurrentUser.AddCaseAlerts
'with Boolean and string parameters, check General or Case level permissions for given user
testAtCaseLevel = False
Dim perm_General_TempUser As sw.Permission = New sw.Permission(testAtCaseLevel, "Temp")
hasPermission = perm_General_TempUser.AddCaseAlerts
Permission.CasePaths
Holder for CasePath objects, contains only a Default Public Property Item and a Count
Property. See CasePath below for examples.
Permission.CasePaths.CasePath
A single CasePath as defined in the Administrator Console, only a handful of entry points available. Each method/property was originally
written so as to pass the index, as initialized in the constructor, directly to Summation. Then I later changed to share a single CasePath
object per instance instead, so that the Cases method would work properly. Tried to get the Categories
method to work also but had trouble interpreting the COM object that Summation was returning. Probably not too important since the Categories
are simply sub-folders of the main CasePath and the same info can be retrieved via some basic System.IO:
VB
Dim cp = New sw.Permission.CasePaths()
Dim casePathPaths As String = "All CasePaths:" & vbCrLf
Dim singleCasePath As String = ""
For index As Integer = 1 To cp.Count
singleCasePath = cp(index).FullName
Dim dirs As String() = Directory.GetDirectories(singleCasePath)
casePathPaths += "Casepath: " & singleCasePath & vbCrLf & GetCasePathCategories(dirs) & _
vbCrLf & vbCrLf
Next
MessageBox.Show(casePathPaths)
Using the two variants of the Cases:
VB
Dim casepathsObject As New sw.Permission.CasePaths()
Dim casepathsCount As Integer = casepathsObject.Count
Dim casepath As sw.Permission.CasePaths.CasePath
Dim casepathsInfo As String = ""
Dim thisCase As String = ""
Dim caseCount As Integer = 0
For index As Integer = 1 To casepathsCount
casepath = New sw.Permission.CasePaths.CasePath(index)
Dim theseCases As String = ""
thisCase = casepath.Cases("")
While thisCase <> ""
caseCount = caseCount + 1
theseCases += thisCase & vbCrLf
thisCase = casepath.Cases()
End While
casepathsInfo += "CASEPATH " & index & ": " & casepath.FullName & vbTab & caseCount & _
" case(s)" & vbCrLf & theseCases & vbCrLf & vbCrLf
caseCount = 0
Next
MessageBox.Show(casepathsInfo)
SystemInfo
All ReadOnly properties, for getting information on the current Summation system.
C#
string version = sw.SystemInfo.BlazeVersion;
string serialNumber = sw.SystemInfo.SerialNumber;
string[] parts = serialNumber.Split('-');
string rawType = parts[0];
int nodeCount = 0;
bool convertedOk = int.TryParse(parts[1], out nodeCount);
string summType = "";
switch (rawType)
{
case "20":
summType = "Blaze LG";
break;
case "21":
summType = "Blaze LG Gold Mobile";
break;
case "22":
summType = "iBlaze Mobile";
break;
case "23":
summType = "LG Gold " + nodeCount + " node network";
break;
case "24":
summType = "iBlaze " + nodeCount + " node network";
break;
case "26":
summType = "Enterprise Mobile";
break;
case "27":
summType = "Enterprise " + nodeCount + " node network";
break;
default:
summType = "Unknown, serial number: " + serialNumber;
break;
}
MessageBox.Show(String.Format("System info:\r\n{0}\r\nSerial Number: {1}\r\nType: {2}", version,
serialNumber, summType));
Undoc
Ad-hoc container created for any intrinsics that do not fall into one of the standard objects. If a method or property is a member of one of the existing objects
and was not displayed in the sumscript documentaion for unknown reasons e.g. OpenTranscript in Application,
it would generally be added to the .vb of that parent object. Undoc only has two methods at the moment, in relation to capturing the ImageRequested
event.
Utility
Handful of methods, primarily related to database maintenance, several would be unavailable (and not applicable) to the Enterprise version of Summation.
The below example should work as expected according to the documentation but I don't entirely trust a given utility to return False if problems are encountered - at the
least I found scenarios where some utilities would fail but still return True:
VB
Dim message As String = ""
If (sw.Utility.Check) Then
If (sw.Utility.Pack) Then
If (sw.Utility.Blaze) Then
message = "All utilities performed successfully"
Else
message = "Error during Blaze"
End If
Else
message = "Error during Pack"
End If
Else
message = "Error during Check"
End If
MessageBox.Show(message)
Views
The parent Views object serves as a holder of individual View objects, which themselves may be one of several
subtypes. The single trickiest part of implementing Views had to do with handling the 'Active View', where something like a Transcript can be
accessed either as a Transcript or as a View. I wound up removing the base ActiveView
and replacing it with variants, ActiveView_AsObject, ActiveView_AsTranscript,
ActiveView_AsView and ActiveView_AsDBGrid:
VB
Dim info As String
'ActiveView_AsObject checks the .Type on the Active View and returns Transcript OR View object
Dim viewObject As Object = sw.Views.ActiveView_AsObject()
Dim v As sw.OpenTranscripts.Transcript = TryCast(viewObject, sw.OpenTranscripts.Transcript)
If v Is Nothing Then
Dim view As sw.Views.View = sw.Views.ActiveView_AsView
info = view.Label
Else
info = v.Description
End If
Similar idea in C#, where we want to handle the Active View as a sw.OpenTranscripts.Transcript, if indeed it is Transcript:
C#
string info = "";
object av = sw.Views.ActiveView_AsObject;
if (av as sw.Views.View != null)
{
sw.Views.View vw = (sw.Views.View)av;
info = vw.Label;
}
else if (av as sw.OpenTranscripts.Transcript != null)
{
sw.OpenTranscripts.Transcript tran = (sw.OpenTranscripts.Transcript)av;
info = tran.Description;
}
And of course using the object returned by _AsTranscript or _AsDBGrid variants will result in an
exception if the Active View within Summation is not actually of the expected type:
C#
//runs correctly with People remote connection open and active
sw.DBGrid grid = sw.Views.ActiveView_AsDBGrid;
//else, Properties of grid object are filled with NullReferenceExceptions
bool clickOnGridUI = true;
//and the call to .MoveFirst results in a COMException
grid.MoveFirst(clickOnGridUI);
long count = grid.RecordCount;
grid.MoveLast(clickOnGridUI);
Individual Views can also be accessed by either their textual identifier or by their index (currently must be converted to a string first):
C#
sw.Views views = new sw.Views();
string cap = views["edocs"].Caption;
//OR via index, as String
string openViews = "Open Views:\r\n";
for (int i = 1; i <= sw.Views.Count; i++)
{
openViews += views[i.ToString()].Label + "\r\n";
}
Views.Layout
Represents the UI arrangement of windows/views within parent Summation window, for the most part layouts are physically stored as text files with a .lay extension. Example
iterates through each personal (current user) layout in the current case and saves each as a new Shared layout in that case:
C#
int layoutIndex = 1;
bool isShared = true;
short overwriteWithoutPrompt = 1;
string layoutDescription = sw.Views.Layout.Description(layoutIndex, !isShared);
while (layoutDescription != "")
{
sw.Views.Layout.Save("Shared " + layoutDescription, isShared, overwriteWithoutPrompt);
layoutIndex++;
layoutDescription = sw.Views.Layout.Description(layoutIndex, !isShared);
}
Views.View
An individual View, instantiated via a) the string representation of a number, b) one of the standard textual identifiers
(see note below re ViewType enum) or c) one of the ActiveView implementations described in the
Views object. Below example iterates through each open (non-Hidden) View and retrieves all available
Property info:
C#
string visibleViewPropertyInfo = "Properties for each non-Hidden View:\r\n";
sw.Views views = new sw.Views();
for (int i = 1; i <= sw.Views.Count; i++)
{
string viewId = i.ToString();
if (!views[viewId].Hidden)
{
sw.Views.View thisView = new sw.Views.View(viewId);
string label = thisView.Label;
visibleViewPropertyInfo += String.Format("\r\nViewId: {0} View Label: {1}\r\n",
viewId, thisView.Label);
Type thisType = thisView.GetType();
PropertyInfo[] propInfo = thisType.GetProperties();
foreach (PropertyInfo info in propInfo)
{
object val = null;
try
{
val = info.GetValue(thisView, null);
}
catch (Exception ex)
{
val = "Error retrieving value: " + ex.Message;
}
visibleViewPropertyInfo += String.Format("Name: {0}\tValue: {1}\r\n", info.Name, val);
}
}
}
I've added in two Enums regarding views, for ViewType and ViewDockState. The former can be used to
instantiate a View object, where the Enum will actually be turned into a String behind the scenes. This can help if you don't have all of
the standard view types memorized e.g. is the edoc view known as "edoc" or "edocs" (turns out either works):
C#
sw.Views.View edocView = new sw.Views.View("edoc");
//OR
sw.Views.View edocsView = new sw.Views.View(sw.Views.View.ViewType.eDoc);
The DockState property has been re-written to only take ViewDockState, the other Enum in the
View object, instead of the original string:
C#
sw.Views.View edocsView = new sw.Views.View(sw.Views.View.ViewType.eDoc);
//set
edocsView.DockState = sw.Views.View.ViewDockState.DockedBottom;
//get
string currDockState = edocsView.DockState.ToString();