Class ScriptObjectBrowser
Displays a browsable object tree (objects, properties, items, and events) and supports drag-and-drop and event handler creation.
Inheritance
Namespace: Syncfusion.Scripting.Design
Assembly: Syncfusion.Scripting.Windows.dll
Syntax
public class ScriptObjectBrowser : Control
Constructors
ScriptObjectBrowser()
Initializes a new instance of the ScriptObjectBrowser control.
Declaration
public ScriptObjectBrowser()
Properties
BrowserTreeView
Gets the underlying TreeView used to display browsable objects and members.
Declaration
public TreeView BrowserTreeView { get; }
Property Value
| Type |
|---|
| System.Windows.Forms.TreeView |
ScriptLanguage
Gets or sets the current scripting language used for drag-and-drop string generation.
Declaration
public ScriptLanguages ScriptLanguage { get; set; }
Property Value
| Type |
|---|
| ScriptLanguages |
ScriptSite
Gets or sets the script site used to resolve event source instances.
Declaration
public IVsaSite ScriptSite { get; set; }
Property Value
| Type |
|---|
| Microsoft.Vsa.IVsaSite |
SelectedObject
Displays a browsable object tree (objects, properties, items, and events) and supports drag-and-drop and event handler creation.
Declaration
public ScriptObject SelectedObject { get; set; }
Property Value
| Type |
|---|
| ScriptObject |
Methods
BuildEventsList(TreeNode, EventInfo[])
Adds event nodes for events that are script-browsable.
Declaration
protected void BuildEventsList(TreeNode node, EventInfo[] events)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.TreeNode | node | The parent node. |
| System.Reflection.EventInfo[] | events | The list of events to add. |
BuildItemsCollection(TreeNode, ICollection)
Adds collection items as child nodes if the collection is marked as script-browsable.
Declaration
protected void BuildItemsCollection(TreeNode node, ICollection collection)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.TreeNode | node | The parent tree node. |
| System.Collections.ICollection | collection | The collection to enumerate. |
BuildPropertiesList(TreeNode, PropertyInfo[], Object)
Adds properties that are script-browsable as child nodes of the specified node.
Declaration
protected void BuildPropertiesList(TreeNode node, PropertyInfo[] properties, object value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.TreeNode | node | The parent node. |
| System.Reflection.PropertyInfo[] | properties | The list of properties to inspect. |
| System.Object | value | The object instance whose properties are evaluated. |
BuildTreeNodeItem(TreeNode, Object)
Populates the specified node with properties, collection items, and events from the given value.
Declaration
protected void BuildTreeNodeItem(TreeNode node, object value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.TreeNode | node | The tree node to populate. |
| System.Object | value | The object whose members are used to build the tree. |
Dispose(Boolean)
Clean up any resources being used.
Declaration
protected override void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | disposing |
IsBrowsableCollection(MemberInfo)
Determines whether the specified member is a script-browsable collection.
Declaration
protected bool IsBrowsableCollection(MemberInfo type)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Reflection.MemberInfo | type | The member to inspect. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if the member is a collection marked with ScriptBrowsableAttribute and PropertyType.Collection; otherwise, false. |
IsScriptBrowsable(MemberInfo)
Determines whether the specified member is marked with ScriptBrowsableAttribute.
Declaration
protected bool IsScriptBrowsable(MemberInfo type)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Reflection.MemberInfo | type | The member to inspect. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if the member has ScriptBrowsableAttribute; otherwise, false. |
IsScriptBrowsable(MemberInfo, out ScriptBrowsableAttribute[])
Determines whether the specified member is marked with ScriptBrowsableAttribute and returns the attribute(s).
Declaration
protected bool IsScriptBrowsable(MemberInfo type, out ScriptBrowsableAttribute[] attr)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Reflection.MemberInfo | type | The member to inspect. |
| ScriptBrowsableAttribute[] | attr | When this method returns, contains the retrieved ScriptBrowsableAttribute array, if present. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if the attribute is present; otherwise, false. |
OnNodeDoubleClick()
Raises the NodeDoubleClick event for the currently selected node when appropriate.
Declaration
protected virtual void OnNodeDoubleClick()
Events
NodeDoubleClick
Send when user is double click by tree node.
Declaration
public event NodeDoubleClickEventHandler NodeDoubleClick
Event Type
| Type |
|---|
| NodeDoubleClickEventHandler |