Click here to Skip to main content
15,895,746 members
Home / Discussions / C#
   

C#

 
GeneralRe: Database to xml Pin
pavya_Cool5-Aug-07 21:02
pavya_Cool5-Aug-07 21:02 
GeneralRe: Database to xml Pin
blackjack21505-Aug-07 21:45
blackjack21505-Aug-07 21:45 
GeneralRe: Database to xml Pin
T.EDY5-Aug-07 22:14
T.EDY5-Aug-07 22:14 
GeneralRe: Database to xml Pin
pavya_Cool5-Aug-07 22:32
pavya_Cool5-Aug-07 22:32 
Questionserialize a graphicspath? Pin
cyn85-Aug-07 18:59
cyn85-Aug-07 18:59 
AnswerRe: serialize a graphicspath? Pin
Hessam Jalali5-Aug-07 20:25
Hessam Jalali5-Aug-07 20:25 
GeneralRe: serialize a graphicspath? Pin
cyn86-Aug-07 19:29
cyn86-Aug-07 19:29 
GeneralRe: serialize a graphicspath? Pin
Hessam Jalali6-Aug-07 21:16
Hessam Jalali6-Aug-07 21:16 
The thing you are doing is going to work and is ok
and Yes if you are using arrays you must know what data is where
for preventing this you can use HashTable and use Enum or string names for keys

these are wrote down here are just suggestions

how about to create a GraphicsPathDataCollection Class and pass those GraphicsPaths to it and Serialize/ Deserialize the GraphicsPathDataCollection and take back your array of GraphicsPath after Deserializing.

this needs some coding but is the correct way because you have a collection and maybe some other time you simply modify it for other use (like import and export...)

there is an easier way too just like you did, but you can put all your GraphicsPathData inside a ArrayList not their serialized streams then Serialize the Array because as you know serializing is not such a fast job exeptionaly if you use SoapFormatter and in this way lots of resources going to be wasted.

and one another thing if you are using .Net2.0 why we don't use List<> instead of ArrayList if all of our data are the same!.



enum myPhases {gpData /*and other things you need to serialize */};

HashTable tableMustbeSerialized=new HashTable();




List<GraphicsPath> gpList; //your Graphicspaths
List<GraphicsPathData> gpdList=new List<GraphicsPathData>();

foreach(GraphicsPath gp in gpList)
gpdList.Add(new GraphicsPathData(gp));

.
.
.
//other things must be Serialized

tableMustbeSerialized.Add(myPhases.gpData ,gpdList);
.
.
.
//add other Data too

formatter.Serialize(myStream, tableMustbeSerialized);
myStream.Close();




and of course after deserializing it can be easier retrieved





object deserializedObject;

HashTable myData=deserializedObject as HashTable;

List<GraphicsPathData> gpdList=myData[myPhases.gpData] as List<GraphicsPathData>;







if you need help I'm here Smile | :)

good luck


QuestionUnable to find entry point in DLL Pin
dashprasannajit5-Aug-07 18:30
dashprasannajit5-Aug-07 18:30 
Questiondatagridvew Pin
Sonia Gupta5-Aug-07 18:18
Sonia Gupta5-Aug-07 18:18 
QuestionRe: datagridvew Pin
T.EDY5-Aug-07 18:31
T.EDY5-Aug-07 18:31 
AnswerRe: datagridvew Pin
Sonia Gupta5-Aug-07 18:47
Sonia Gupta5-Aug-07 18:47 
AnswerRe: datagridvew Pin
Brady Kelly5-Aug-07 23:25
Brady Kelly5-Aug-07 23:25 
Questionregistering COM component as Out proc sever Pin
KrunalC5-Aug-07 17:44
KrunalC5-Aug-07 17:44 
AnswerRe: registering COM component as Out proc sever Pin
KrunalC5-Aug-07 19:50
KrunalC5-Aug-07 19:50 
GeneralRe: registering COM component as Out proc sever Pin
Dave Kreskowiak6-Aug-07 4:12
mveDave Kreskowiak6-Aug-07 4:12 
QuestionChecking last index of the array giving me a problem. VS2005 C# Pin
foolios5-Aug-07 16:47
foolios5-Aug-07 16:47 
AnswerRe: Checking last index of the array giving me a problem. VS2005 C# Pin
Hessam Jalali5-Aug-07 19:25
Hessam Jalali5-Aug-07 19:25 
Questionpassing parameter from one windows form to another one Pin
dinakatina5-Aug-07 14:47
dinakatina5-Aug-07 14:47 
AnswerRe: passing parameter from one windows form to another one Pin
Christian Graus5-Aug-07 14:55
protectorChristian Graus5-Aug-07 14:55 
QuestionThreading passing parameters to thread Pin
Muhammad Nauman Yousuf5-Aug-07 12:29
Muhammad Nauman Yousuf5-Aug-07 12:29 
AnswerRe: Threading passing parameters to thread Pin
Luc Pattyn5-Aug-07 13:15
sitebuilderLuc Pattyn5-Aug-07 13:15 
GeneralRe: Threading passing parameters to thread Pin
Muhammad Nauman Yousuf6-Aug-07 8:10
Muhammad Nauman Yousuf6-Aug-07 8:10 
AnswerRe: Threading passing parameters to thread Pin
justintimberlake5-Aug-07 17:52
justintimberlake5-Aug-07 17:52 
QuestionHow to load data from database using threading and progressbar Pin
vkuttyp5-Aug-07 8:48
professionalvkuttyp5-Aug-07 8:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.