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

C#

 
Questiondeclaring xmlserializer where typeof is a class derived from arraylist Pin
cyn820-Aug-07 18:04
cyn820-Aug-07 18:04 
AnswerRe: declaring xmlserializer where typeof is a class derived from arraylist Pin
Hessam Jalali20-Aug-07 23:03
Hessam Jalali20-Aug-07 23:03 
AnswerRe: declaring xmlserializer where typeof is a class derived from arraylist Pin
Hessam Jalali20-Aug-07 23:11
Hessam Jalali20-Aug-07 23:11 
GeneralRe: declaring xmlserializer where typeof is a class derived from arraylist [modified] Pin
cyn821-Aug-07 17:01
cyn821-Aug-07 17:01 
GeneralRe: declaring xmlserializer where typeof is a class derived from arraylist Pin
Hessam Jalali22-Aug-07 0:22
Hessam Jalali22-Aug-07 0:22 
GeneralRe: declaring xmlserializer where typeof is a class derived from arraylist Pin
cyn822-Aug-07 0:29
cyn822-Aug-07 0:29 
GeneralRe: declaring xmlserializer where typeof is a class derived from arraylist Pin
Hessam Jalali22-Aug-07 3:21
Hessam Jalali22-Aug-07 3:21 
GeneralRe: declaring xmlserializer where typeof is a class derived from arraylist [modified] Pin
cyn822-Aug-07 21:48
cyn822-Aug-07 21:48 
THANK YOU!!! You are a LIFE SAVER!!!

Man, it is the people like you that makes this world a better place to live in:P

Your codes works like a charm.

However, there is a small problem, there seem to extra shape(exactly same shape) that is overlap on each shape. When i drag and drop on of the shape, the extra shape is temporary will be display at the original coordinate. But later if i want to drag the extra shape, it cannot be dragged and sometimes after i dragged a shape, all the extra shapes that is position on the saved shape original position will disappear. What you think that it is caused by?

Below are the codes in the Load function located in the form( ShapeTypeList,CoordList,SizeList are arraylist that contains the data for the shapes to be drawn on the form):
<br />
<br />
OpenFileDialog openFileDialog = new OpenFileDialog();<br />
			ArrayList arr =new ArrayList();<br />
			ArrayList ColorArr =new ArrayList();<br />
			if (openFileDialog.ShowDialog() == DialogResult.OK)<br />
			{<br />
				filename = openFileDialog.FileName;<br />
<br />
			ClearArrayList();<br />
				MyData deserializeData =MyData.Load(filename);<br />
				ShapeTypeList=deserializeData.ShapeTypeList;<br />
				CoordList=deserializeData.CoordList;<br />
				ColorArr=deserializeData.ColorList;<br />
				SizeList=deserializeData.SizeList;<br />
				arr=deserializeData.GraphicsPathData;<br />
<br />
				for(int j=0;j<ColorArr.Count;j++)<br />
				{<br />
					<br />
                    MyColor myC=(MyColor)ColorArr[j];<br />
					ColorList.Add(Color.FromArgb(myC.A,myC.R,myC.G,myC.B));<br />
<br />
				}<br />
<br />
				GraphicsPath myPath=new GraphicsPath();<br />
				int k=0;<br />
				for(int i=0;i<arr.Count;i++)<br />
				{<br />
					if((TypeOfShape)ShapeTypeList[i]==TypeOfShape.Oval||(TypeOfShape)ShapeTypeList[i]==TypeOfShape.Circle)<br />
					{<br />
						Point[] p=(Point[])CoordList[i];<br />
						Size s=(Size)SizeList[k];<br />
						myPath.AddEllipse(p[0].X,p[0].Y,s.Width,s.Height);<br />
						k++;<br />
					}<br />
<br />
					else<br />
					{<br />
						myPath.AddPolygon((Point[])CoordList[i]);<br />
					}<br />
<br />
					PathList.Add(myPath);<br />
				}<br />
<br />
				//this.Refresh();<br />
panel1.Invalidate();<br />
			}<br />
/////Should i insert a myPath.Dispose();?<br />
///////But if i did include it, it seems that there is an exception error.<br />


What should i do to solve this problem?

Thanks a millionSmile | :)






-- modified at 6:53 Thursday 23rd August, 2007
GeneralRe: declaring xmlserializer where typeof is a class derived from arraylist Pin
Hessam Jalali23-Aug-07 2:15
Hessam Jalali23-Aug-07 2:15 
GeneralRe: declaring xmlserializer where typeof is a class derived from arraylist Pin
cyn823-Aug-07 16:29
cyn823-Aug-07 16:29 
GeneralRe: declaring xmlserializer where typeof is a class derived from arraylist Pin
Hessam Jalali23-Aug-07 23:47
Hessam Jalali23-Aug-07 23:47 
QuestionHow to "ping" command on Mono by C#? Pin
bug_aonz20-Aug-07 17:49
bug_aonz20-Aug-07 17:49 
AnswerRe: How to "ping" command on Mono by C#? Pin
Vasudevan Deepak Kumar20-Aug-07 21:32
Vasudevan Deepak Kumar20-Aug-07 21:32 
GeneralRe: How to "ping" command on Mono by C#? Pin
bug_aonz21-Aug-07 16:44
bug_aonz21-Aug-07 16:44 
QuestionInstalled software List Pin
Jeeva Jose20-Aug-07 17:15
Jeeva Jose20-Aug-07 17:15 
AnswerRe: Installed software List Pin
Scott Dorman20-Aug-07 17:24
professionalScott Dorman20-Aug-07 17:24 
QuestionC# and MATLAB Pin
TriBerryPowerBar20-Aug-07 15:17
TriBerryPowerBar20-Aug-07 15:17 
AnswerRe: C# and MATLAB Pin
Scott Dorman20-Aug-07 17:23
professionalScott Dorman20-Aug-07 17:23 
QuestionUpdater block - downloading updates from a server Pin
steve_rm20-Aug-07 11:33
steve_rm20-Aug-07 11:33 
QuestionIP Control Pin
Demian Panello20-Aug-07 9:29
Demian Panello20-Aug-07 9:29 
AnswerRe: IP Control Pin
Demian Panello20-Aug-07 10:34
Demian Panello20-Aug-07 10:34 
QuestionLayout /map [modified] Pin
SpiveyC#20-Aug-07 7:49
SpiveyC#20-Aug-07 7:49 
AnswerRe: Layout /map Pin
Christian Graus20-Aug-07 11:00
protectorChristian Graus20-Aug-07 11:00 
QuestionValidation and closing a dialog Pin
Marc Clifton20-Aug-07 6:03
mvaMarc Clifton20-Aug-07 6:03 
AnswerRe: Validation and closing a dialog Pin
Eduard Keilholz20-Aug-07 6:10
Eduard Keilholz20-Aug-07 6:10 

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.