News:

BB code in posts seems to be working again!
I haven't turned on every single tag, so please let me know if there are any that are used/needed but not activated.

Main Menu

Need the Event For Connector in Visio while Source or Destinitaion changes.

Started by chitta_pk, January 21, 2009, 06:32:14 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

chitta_pk

Hi ,
I am Developing an Window Application in C#.net.
I have added "Microsoft Office Visio 12.0 Drawing Control" in my ToolBox.

I need to prepare AuditLog for all the shapes(added , deleted or connected to other shapes)

I am getting events for Shape added or deleted from the default event list provided properties of the Drawing Page.

But I am not getting Event for Connector. I have to audit for each action of Connector like (if I change the source or destinition of connector  or connected to some other shape).

Kindly Suggest.

Regards
Chitta ranjan


aledlund

The issue your facing is that it is a cell changed event that you are looking for (and they happen a lot). One technique is to separate you event handling from general handling and then have a separate event class for forumula changed (the sdk shows an example of this).

I use something like this to track custom properties and 1d shapes (connectors and shapes configured as 1d)



Public Sub AddFormulaModifiedEventHandler(vsoDoc As Visio.Document)
   
    Dim objEvent As Visio.Event
    Dim vsoDocEvents As Visio.EventList

   ' Have Visio send send notification of formula changed events
    ' to mvsoFormEventSink.
   
    Set mvsoFormEventSink = New clsFormulaModifiedEventSink
   
    Set mvsoFormEventSink.pVsoApp = Visio.Application
    Set mvsoFormEventSink.pvisDoc = Visio.Application.ActiveDocument
   
    Set vsoDocEvents = vsoDoc.EventList
   
    Set objEvent = vsoDocEvents.AddAdvise( _
        Visio.VisEventCodes.visEvtFormula + Visio.VisEventCodes.visEvtMod, _
        mvsoFormEventSink, _
        "", _
        "")
   
    ' Filter which formula changed events get to vsoEventSink.
    ' Reduce the list to only the events during which the value
    ' of a custom property or 1d shapes is modified.
   
    Dim intCellFilter(1 To 14) As Integer
   
    ' do the custom properties section
    intCellFilter(1) = Visio.visSectionProp
    intCellFilter(2) = Visio.visRowFirst
    intCellFilter(3) = Visio.visCustPropsValue
    intCellFilter(4) = Visio.visSectionProp
    intCellFilter(5) = Visio.visRowLast
    intCellFilter(6) = Visio.visCustPropsValue
    intCellFilter(7) = True
   
    ' do the 1d section
    intCellFilter(8) = Visio.visSectionObject
    intCellFilter(9) = Visio.visRowFirst
    intCellFilter(10) = Visio.vis1DBeginX
    intCellFilter(11) = Visio.visSectionObject
    intCellFilter(12) = Visio.visRowLast
    intCellFilter(13) = Visio.vis1DEndY
    intCellFilter(14) = True
   
    objEvent.SetFilterSRC intCellFilter


End Sub




Browser ID: smf (possibly_robot)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 152 (show)
Files included: 34 - 1306KB. (show)
Memory used: 1069KB.
Tokens: post-login.
Cache hits: 14: 0.00175s for 26,746 bytes (show)
Cache misses: 4: (show)
Queries used: 16.

[Show Queries]