Click here to Skip to main content
15,921,062 members
Home / Discussions / C#
   

C#

 
AnswerRe: DataAdapter.Fill() Pin
Marek Grzenkowicz5-Aug-07 22:04
Marek Grzenkowicz5-Aug-07 22:04 
AnswerRe: DataAdapter.Fill() Pin
N a v a n e e t h5-Aug-07 22:49
N a v a n e e t h5-Aug-07 22:49 
AnswerRe: DataAdapter.Fill() Pin
Nouman Bhatti6-Aug-07 2:12
Nouman Bhatti6-Aug-07 2:12 
QuestionFind Out the executed page??? Pin
mimimimilaw5-Aug-07 21:08
mimimimilaw5-Aug-07 21:08 
QuestionCalling unmanaged DLL-methodes (winmm.dll) Pin
J. Holzer5-Aug-07 20:32
J. Holzer5-Aug-07 20:32 
AnswerRe: Calling unmanaged DLL-methodes (winmm.dll) Pin
m@u5-Aug-07 21:29
m@u5-Aug-07 21:29 
AnswerRe: Calling unmanaged DLL-methodes (winmm.dll) Pin
originSH5-Aug-07 21:57
originSH5-Aug-07 21:57 
QuestionODBC how to connect reomte SQL Server Pin
jason_mf5-Aug-07 20:16
jason_mf5-Aug-07 20:16 
AnswerRe: ODBC how to connect reomte SQL Server Pin
Guffa5-Aug-07 20:29
Guffa5-Aug-07 20:29 
QuestionCrystal Report working with generic collections Pin
Developer6115-Aug-07 20:01
Developer6115-Aug-07 20:01 
Question.NET dll and VB 6 ocx Pin
MozhdehQeraati5-Aug-07 19:34
MozhdehQeraati5-Aug-07 19:34 
QuestionDatabase to xml Pin
pavya_Cool5-Aug-07 19:22
pavya_Cool5-Aug-07 19:22 
AnswerRe: Database to xml Pin
aamironline5-Aug-07 20:57
aamironline5-Aug-07 20:57 
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 

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.