(UTC)
Welcome, Guest. Please
Login
or
Register
News:
Board Index
Help
Search
Login
Register
The MindFusion Forums
›
Flow Diagramming Components
›
Windows Forms
› cut
(Moderator: Slavcho)
‹
Previous Topic
|
Next Topic
›
Pages:
1
[2]
3
Send Topic
Print
cut (Read 12413 times)
Stoyo
God Member
Offline
MindFusion support
Posts: 13230
Joined: Jul 20
th
, 2005
Re: cut
Reply #15 -
Sep 24
th
, 2008 at 7:30am
Print Post
Look for IconNode.cs in the samples folder and copy the SaveTo and LoadFrom method implementations to your class. Replace the IconNode properties related lines with
writer.Write(comment);
and
comment = reader.ReadString();
I hope that helps,
Stoyan
IP Logged
balajigcs
YaBB Newbies
Offline
I love YaBB 1G - SP1!
Posts: 32
Joined: Aug 18
th
, 2008
Re: cut
Reply #16 -
Sep 24
th
, 2008 at 9:24am
Print Post
Hi this is working..
and there is any way to findout the which node we copied.
Thanks & Regards,&&&&Balaji
IP Logged
Stoyo
God Member
Offline
MindFusion support
Posts: 13230
Joined: Jul 20
th
, 2005
Re: cut
Reply #17 -
Sep 24
th
, 2008 at 12:21pm
Print Post
You could handle the NodePasted event.
I hope that helps,
Stoyan
IP Logged
balajigcs
YaBB Newbies
Offline
I love YaBB 1G - SP1!
Posts: 32
Joined: Aug 18
th
, 2008
Re: cut
Reply #18 -
Sep 25
th
, 2008 at 5:12am
Print Post
Hi,
yes,this is working.. the nodePasted event is raised after Paint operation is over..
but,when I copied the node after that I need to know which node I copied.. There is any possible way to do this..
Thanks & Regards,&&&&Balaji
IP Logged
Stoyo
God Member
Offline
MindFusion support
Posts: 13230
Joined: Jul 20
th
, 2005
Re: cut
Reply #19 -
Sep 25
th
, 2008 at 7:01am
Print Post
Hi,
The copied nodes are the ones that are selected when you call the Copy / Cut methods. The selection changes when you paste items, so you should copy the contents of Diagram.Selection.Nodes into a new collection before calling Copy or Cut.
I hope that helps,
Stoyan
IP Logged
balajigcs
YaBB Newbies
Offline
I love YaBB 1G - SP1!
Posts: 32
Joined: Aug 18
th
, 2008
Re: cut
Reply #20 -
Sep 25
th
, 2008 at 8:07am
Print Post
Hi,
How to implement serialization for your custom Collection properties?.. Acutually for string type properties are changing properly only when I am using cut and paste.. but when i am using collection properties it is not working..
can u give me sample code for.. how to serialize and deserialize custon collection properties..
Thanks & Regards,&&&&Balaji
IP Logged
Stoyo
God Member
Offline
MindFusion support
Posts: 13230
Joined: Jul 20
th
, 2005
Re: cut
Reply #21 -
Sep 25
th
, 2008 at 12:55pm
Print Post
Have you defined your own collection class, or are using Flowchart.NET types such as DiagramNodeCollection?
IP Logged
balajigcs
YaBB Newbies
Offline
I love YaBB 1G - SP1!
Posts: 32
Joined: Aug 18
th
, 2008
Re: cut
Reply #22 -
Sep 25
th
, 2008 at 2:57pm
Print Post
Hi,
I am defining my own collection class.. like this way.
LimitCollection limit = new LimitCollection();[Data]
[Category("Limits")]
public LimitCollection Limit
{
get
{
return this.limit;
}
set
{
this.limit = value;
this.OnPropertyChanged();
}
}
the limitcollection class having the properties.. how can we serialize and deserialize the these collecion types..
Thanks & Regards,&&&&Balaji
IP Logged
Stoyo
God Member
Offline
MindFusion support
Posts: 13230
Joined: Jul 20
th
, 2005
Re: cut
Reply #23 -
Sep 25
th
, 2008 at 3:12pm
Print Post
You could use the BinaryWriter methods to save the number of items in the collection, and then loop over its items and save each piece of data. When loading, read the number of items, resize the collection, and loop to load each piece of data.
Another way to do that is to make your class implement ISerializable, create BinaryFormatter, and use the formatter's Serialize method.
I hope that helps,
Stoyan
IP Logged
balajigcs
YaBB Newbies
Offline
I love YaBB 1G - SP1!
Posts: 32
Joined: Aug 18
th
, 2008
Re: cut
Reply #24 -
Oct 20
th
, 2008 at 12:04pm
Print Post
Hi,
I am copying the two same nodes with different properties..
i am using the ,
methods like that for saving and loading the properties after copy paste operations..
protected override void LoadFrom(System.IO.BinaryReader reader, PersistContext context)
{
base.LoadFrom(reader, context);
FileStream flStream = new FileStream("Limits.dat",FileMode.Open, FileAccess.Read);
try
{
BinaryFormatter binFormatter = new BinaryFormatter();
this.Variables = (VariableCollection)binFormatter.Deserialize(flStream);
}
finally
{
flStream.Close();
}
}
protected override void SaveTo(System.IO.BinaryWriter writer, PersistContext context)
{
base.SaveTo(writer, context);
FileStream flStream = new FileStream("Limits.dat",FileMode.OpenOrCreate, FileAccess.Write);
try
{
BinaryFormatter binFormatter = new BinaryFormatter();
binFormatter.Serialize(flStream, this.Variables);
}
finally
{
flStream.Close();
}
}
but,after paste operation i am getting the two nodes with same properties.. means tha nodes with previously setted properties are not coming.. only for one node properties are coming for the both the nodes..
so,please rectify the problem..
Thanks & Regards,&&&&Balaji
IP Logged
Stoyo
God Member
Offline
MindFusion support
Posts: 13230
Joined: Jul 20
th
, 2005
Re: cut
Reply #25 -
Oct 20
th
, 2008 at 12:13pm
Print Post
Hi,
If you use FileStreams, you will have to provide distinct file names, otherwise SaveTo overwrites the file created for the first node when called for the second one.
I hope that helps,
Stoyan
IP Logged
balajigcs
YaBB Newbies
Offline
I love YaBB 1G - SP1!
Posts: 32
Joined: Aug 18
th
, 2008
Re: cut
Reply #26 -
Oct 20
th
, 2008 at 1:20pm
Print Post
thanks its working when i am using distict files...
but can u help me with simple how can i maintain like with single file.. or any other method do like that..
Thanks & Regards,&&&&Balaji
IP Logged
Stoyo
God Member
Offline
MindFusion support
Posts: 13230
Joined: Jul 20
th
, 2005
Re: cut
Reply #27 -
Oct 20
th
, 2008 at 1:47pm
Print Post
Try context.SaveObject(Variables) and Variables = context.ReadObject(). It should work as long as your VariableCollection class is [Serializable].
I hope that helps,
Stoyan
IP Logged
balajigcs
YaBB Newbies
Offline
I love YaBB 1G - SP1!
Posts: 32
Joined: Aug 18
th
, 2008
Re: cut
Reply #28 -
Oct 21
st
, 2008 at 5:04am
Print Post
hi,
In PersistContext.cs class having only SaveObject() methos is there but the ReadObject() methos is not there.. the ReadObject method only in xmlpersistcontext..
so,can u please tell some other way?
Thanks & Regards,&&&&Balaji
IP Logged
Stoyo
God Member
Offline
MindFusion support
Posts: 13230
Joined: Jul 20
th
, 2005
Re: cut
Reply #29 -
Oct 21
st
, 2008 at 8:59am
Print Post
Sorry, it's called LoadObject.
I hope that helps,
Stoyan
IP Logged
Pages:
1
[2]
3
Send Topic
Print
‹
Previous Topic
|
Next Topic
›
Forum Jump »
Board Index
» 10 most recent Posts
» 10 most recent Topics
General
News
Discussion
Flow Diagramming Components
News
Feature Suggestions
Windows Forms ««
WPF
Html Canvas & JavaScript
Blazor
ASP.NET MVC
ASP.NET
Java Swing
ActiveX
.NET MAUI and Xamarin
Android
Cocoa Touch
Bug Reports
Scheduling and Gantt Components
News
Feature Suggestions
Windows Forms
WPF
Silverlight
ASP.NET
Html & JavaScript
Java Swing
.NET Compact Framework
.NET MAUI and Xamarin
Bug Reports
Gauge and Chart Components
News
Feature Suggestions
Windows Forms
WPF
Silverlight
ASP.NET
Html Canvas & JavaScript
Java Swing
Xamarin
Bug Reports
Grid and Spreadsheet Components
News
Feature Suggestions
Windows Forms
WPF
Html & JavaScript
Java Swing
Bug Reports
Virtual Keyboard Components
News
Windows Forms
WPF
Avalonia
Java Swing
Html & JavaScript
Bug Reports
MindFusion.Reporting
News
Feature Suggestions
Windows Forms
WPF
Silverlight
Bug Reports
MindFusion.UI controls
Windows Forms
WPF
ASP.NET
Other MindFusion tools
News
Feature Suggestions
Discussion
Bug Reports
Archived Boards
Silverlight
Universal Windows Platform
« Board Index
‹ Board
The MindFusion Forums
» Powered by
YaBB 2.6.11
!
YaBB Forum Software
© 2000-2024. All Rights Reserved.