Check if diagram is modified


Author
Message
Cristian Cojocaru
Cristian Cojocaru
Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)
Group: Forum Members
Posts: 14, Visits: 24
Is there a method to know if the diagram is been modified by the user?

I want to enable or disable a button in relation to the diagram: if a shape is changed or added I want to enable the button, otherwise let it disabled.



Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K
Hi,

It depends on what changes you are interested in. If you are interested in any change of the drawing document, you can check the value of its IsModified property.

If you are interested only in moving, resizing and rotating of shapes, then you can subscribe to the NodeBoundsChanged event of the drawing document's even sink service:

document.EventSinkService.NodeBoundsChanged += OnNodeBoundsChanged;
private void OnNodeBoundsChanged(NNodeEventArgs args)
{
}


If you are interested in any property change then you should subscribe to the NodePropertyChanged event of the drawing documents even sink service:

document.EventSinkService.NodePropertyChanged += OnNodePropertyChanged;
private void OnNodePropertyChanged(NNodePropertyEventArgs args)
{
    string changedPropertyName = args.PropertyName;
}



Best Regards,
Nevron Support Team


Cristian Cojocaru
Cristian Cojocaru
Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)
Group: Forum Members
Posts: 14, Visits: 24
I tried like you said and the event doesn't fire Sad

I put the following code:


private void main_Load(object sender, EventArgs e)
{
nDrawingDocument1.EventSinkService.NodePropertyChanged += OnNodePropertyChanged;
}


private void OnNodePropertyChanged(NNodePropertyEventArgs args)
{
string changedPropertyName = args.PropertyName;
Messagebox.Show(changedPropertyName);
}


And the messagebox doesn't apprear...  any help? my code is wrong?

Cristian Cojocaru
Cristian Cojocaru
Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)
Group: Forum Members
Posts: 14, Visits: 24
Sorry, I just screwed up my code... I made it working like support team wrote up here, so I solved my problem, thank you again! +1

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search