74 lines
2.9 KiB
VB.net
74 lines
2.9 KiB
VB.net
Imports System
|
|
Imports System.ComponentModel
|
|
Imports System.Collections.Generic
|
|
Imports System.Diagnostics
|
|
Imports System.Text
|
|
|
|
Imports DevExpress.ExpressApp
|
|
Imports DevExpress.ExpressApp.Actions
|
|
Imports DevExpress.Persistent.Base
|
|
Imports DevExpress.ExpressApp.Templates
|
|
Imports DevExpress.ExpressApp.Editors
|
|
|
|
Public Class ActionToolTipforSysAdmin
|
|
Inherits DevExpress.ExpressApp.ViewController
|
|
|
|
Public Sub New()
|
|
MyBase.New()
|
|
|
|
'This call is required by the Component Designer.
|
|
InitializeComponent()
|
|
RegisterActions(components)
|
|
|
|
End Sub
|
|
Protected Overrides Sub OnActivated()
|
|
MyBase.OnActivated()
|
|
Dim _Container As IActionContainer
|
|
Dim _Action As DevExpress.ExpressApp.Actions.ActionBase
|
|
If Frame.Template IsNot Nothing Then
|
|
For Each _Container In Frame.Template.GetContainers
|
|
For Each _Action In _Container.Actions
|
|
_Action.ToolTip = "View Id: " & View.Id & Chr(13) + Chr(10) & "Action Id : " & _Action.Id & Chr(13) & Chr(10) & "Controller Id : " & _Action.Controller.Name
|
|
Next
|
|
Next
|
|
End If
|
|
If TryCast(Frame, NestedFrame) IsNot Nothing Then
|
|
If TryCast(Frame, NestedFrame).Controllers.Count > 0 Then
|
|
Dim _Controller As Controller
|
|
For Each _Controller In TryCast(Frame, NestedFrame).Controllers
|
|
For Each _Action In _Controller.Actions
|
|
_Action.ToolTip = "View Id: " & View.Id & Chr(13) + Chr(10) & "Action Id : " & _Action.Id & Chr(13) & Chr(10) & "Controller Id : " & _Action.Controller.Name
|
|
Next
|
|
Next
|
|
End If
|
|
End If
|
|
AddHandler View.ControlsCreated, AddressOf View_ControlsCreated
|
|
|
|
End Sub
|
|
Protected Overrides Sub OnDeactivated()
|
|
MyBase.OnDeactivated()
|
|
RemoveHandler View.ControlsCreated, AddressOf View_ControlsCreated
|
|
|
|
End Sub
|
|
Private Sub View_ControlsCreated(sender As Object, e As EventArgs)
|
|
If TryCast(View, DetailView) IsNot Nothing Then
|
|
Dim _ViewItem As ViewItem
|
|
Dim _ActionContainerViewItem As ActionContainerViewItem
|
|
For Each _ViewItem In TryCast(View, DetailView).Items
|
|
_ActionContainerViewItem = TryCast(_ViewItem, ActionContainerViewItem)
|
|
If _ActionContainerViewItem IsNot Nothing Then
|
|
AddHandler _ActionContainerViewItem.ControlCreated, AddressOf ActionContainerViewItem_ControlCreated
|
|
End If
|
|
Next
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub ActionContainerViewItem_ControlCreated(sender As Object, e As EventArgs)
|
|
For Each _Action In TryCast(sender, ActionContainerViewItem).Actions
|
|
_Action.ToolTip = "View Id: " & View.Id & Chr(13) + Chr(10) & "Action Id : " & _Action.Id & Chr(13) & Chr(10) & "Controller Id : " & _Action.Controller.Name
|
|
Next
|
|
End Sub
|
|
End Class
|
|
|
|
|