Profile Picture

Check if diagram is modified

Posted By Cristianf 10 Years Ago
Author
Message
Cristianf
Problem Posted 10 Years Ago
View Quick Profile
Forum Newbie

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
Last Active: 9 Years Ago
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
This post has been flagged as an answer
Posted 10 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)

Group: Forum Members
Last Active: Last Year
Posts: 3,039, Visits: 3,746
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



Cristianf
Posted 10 Years Ago
View Quick Profile
Forum Newbie

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
Last Active: 9 Years Ago
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?


Cristianf
Posted 10 Years Ago
View Quick Profile
Forum Newbie

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
Last Active: 9 Years Ago
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




Similar Topics


Reading This Topic