Click here to Skip to main content
15,890,512 members
Home / Discussions / C#
   

C#

 
AnswerRe: Changing crystal report connection at runtime Pin
sathish s20-Aug-07 3:14
sathish s20-Aug-07 3:14 
GeneralRe: Changing crystal report connection at runtime Pin
-spy-20-Aug-07 4:46
-spy-20-Aug-07 4:46 
AnswerRe: Changing crystal report connection at runtime Pin
mjmcinto20-Aug-07 3:49
mjmcinto20-Aug-07 3:49 
GeneralRe: Changing crystal report connection at runtime Pin
-spy-20-Aug-07 4:45
-spy-20-Aug-07 4:45 
Questionproblem in xmlserialization for arraylist Pin
cyn820-Aug-07 0:41
cyn820-Aug-07 0:41 
AnswerRe: problem in xmlserialization for arraylist Pin
Hessam Jalali20-Aug-07 2:12
Hessam Jalali20-Aug-07 2:12 
GeneralRe: problem in xmlserialization for arraylist Pin
cyn820-Aug-07 15:09
cyn820-Aug-07 15:09 
GeneralRe: problem in xmlserialization for arraylist Pin
cyn820-Aug-07 16:51
cyn820-Aug-07 16:51 
hi,
now i've tried to create the MyData class. However, i'm stuck on how to change the codes in the form to do the serialization. below is some of the codes:
MyData Class:
<br />
[XmlRoot("MyData")]<br />
	public class MyData<br />
	{<br />
		public MyData()<br />
		{<br />
		}<br />
<br />
		public MyData(ArrayList shape, ArrayList color, ArrayList coord, ArrayList size, ArrayList gpd)<br />
		{<br />
			this.ShapeTypeList = shape;<br />
			this.ColorList = color;<br />
			this.CoordList = coord;<br />
			this.SizeList = size;<br />
			this.arrS = gpd;<br />
		}<br />
<br />
		public enum TypeOfShape<br />
		{<br />
			Square, Rect, Parallelogram, Trapezoid, Diamond, Triangle, RightAngleTriangle,Circle,Oval,Hexagon,Pentagon,None<br />
		}<br />
//		XmlSerializer serializ()<br />
//		{<br />
//			XmlSerializer s = new XmlSerializer( typeof(ArrayList),new Type[] {typeof(Coordinate),typeof(ColorL),typeof(SizeL), typeof(ArrSave)} );<br />
//			return s;<br />
//		}<br />
<br />
		XmlSerializer s = new XmlSerializer( typeof(ArrayList),new Type[] {typeof(Coordinate),typeof(ColorL),typeof(SizeL), typeof(ArrSave)} );<br />
		<br />
<br />
		ArrayList ShapeTypeList=new ArrayList ();<br />
		ArrayList ColorList=new ArrayList ();<br />
		ArrayList CoordList=new ArrayList();<br />
		ArrayList SizeList = new ArrayList();<br />
		ArrayList arrS = new ArrayList();<br />
		ArrayList PathList =new ArrayList();<br />
<br />
<br />
		<br />
<br />
		//[XmlArray("CoordinateData")]<br />
		[XmlElement("Coordinate",typeof(Coordinate))]<br />
		public ArrayList coordList<br />
		{<br />
			get{return CoordList;}<br />
			set{CoordList=value;}<br />
		} <br />
<br />
		public class Coordinate<br />
		{<br />
			public Coordinate(){}<br />
			public Point[] point<br />
			{<br />
				get{return point;}<br />
				set{point=value;}<br />
<br />
			}<br />
<br />
		}.....................<br />



MovePosition Function in Form:
private void MovePosition(int position,int BshapeNo,int sztotal,int szOrd)<br />
		{<br />
			if((TypeOfShape)ShapeTypeList[shapeNo]!=TypeOfShape.Circle&&(TypeOfShape)ShapeTypeList[shapeNo]!=TypeOfShape.Oval)<br />
			{<br />
				alDrawingObjects.Insert(position, new Polygon((Color)ColorList[shapeNo],  (Point[])CoordList[shapeNo], 5,(GraphicsPath)PathList[shapeNo] ));			<br />
			}<br />
<br />
			else if ((TypeOfShape)ShapeTypeList[shapeNo]==TypeOfShape.Circle||(TypeOfShape)ShapeTypeList[shapeNo]==TypeOfShape.Oval)<br />
			{	<br />
			<br />
				alDrawingObjects.Insert(position, new Ellipse((Color)ColorList[shapeNo],(Point[]) CoordList[shapeNo], (Size)SizeList[sizeOrder], 5) );<br />
				SizeList.Insert(sztotal,(Size)SizeList[sizeOrder]);<br />
				SizeList.RemoveAt(szOrd);<br />
			}<br />
<br />
			CoordList.Insert(position,  (Point[])CoordList[shapeNo]);<br />
			ColorList.Insert(position,(Color)ColorList[shapeNo]);<br />
			ShapeTypeList.Insert(position,(TypeOfShape)ShapeTypeList[shapeNo]);<br />
			PathList.Insert(position,(GraphicsPath)PathList[shapeNo]);<br />
			<br />
			alDrawingObjects.RemoveAt(BshapeNo);<br />
			CoordList.RemoveAt(BshapeNo);<br />
			ColorList.RemoveAt(BshapeNo);<br />
			ShapeTypeList.RemoveAt(BshapeNo);<br />
			PathList.RemoveAt(BshapeNo);<br />
<br />
			panel1.Invalidate();<br />
		}



In Save function in the form:
{<br />
						<br />
						TextWriter w = new StreamWriter( filename );<br />
						s.Serialize( w, ShapeTypeList );<br />
						s.Serialize( w, ColorList );<br />
						s.Serialize( w, CoordList);<br />
						s.Serialize( w, SizeList );<br />
<br />
						for(int i=0;i<PathList.Count;i++)<br />
						{<br />
							GraphicsPathData gpd = new GraphicsPathData((GraphicsPath)PathList[i]);<br />
							Stream gpdStream = GraphicsPathData.Serialize(gpd);<br />
							arrS.Add(gpdStream);<br />
					 <br />
						}<br />
						s.Serialize( w, arrS);<br />
<br />
						w.Close();<br />
					}


Please help!

Thanks for your help
QuestionLosing COM event handlers in C# [modified] Pin
Vitaly Tomilov20-Aug-07 0:14
Vitaly Tomilov20-Aug-07 0:14 
AnswerRe: Losing COM event handlers in C# Pin
Vitaly Tomilov20-Aug-07 1:28
Vitaly Tomilov20-Aug-07 1:28 
Questionunable to display MySQL DateTime DataType Values in Crystal Reports using C#.NET 2.0 XML Schema Pin
raju572520-Aug-07 0:08
raju572520-Aug-07 0:08 
QuestionCompatibility question Pin
Muammar©19-Aug-07 23:27
Muammar©19-Aug-07 23:27 
AnswerRe: Compatibility question [modified] Pin
Hessam Jalali19-Aug-07 23:55
Hessam Jalali19-Aug-07 23:55 
AnswerRe: Compatibility question Pin
Christian Graus19-Aug-07 23:57
protectorChristian Graus19-Aug-07 23:57 
AnswerRe: Compatibility question Pin
Mustafa Ismail Mustafa20-Aug-07 3:13
Mustafa Ismail Mustafa20-Aug-07 3:13 
QuestionWhat is the logic for WebService methods ? Pin
MehmetFurkan19-Aug-07 23:07
MehmetFurkan19-Aug-07 23:07 
AnswerRe: What is the logic for WebService methods ? Pin
Talal Sultan19-Aug-07 23:27
Talal Sultan19-Aug-07 23:27 
GeneralRe: What is the logic for WebService methods ? Pin
MehmetFurkan20-Aug-07 0:09
MehmetFurkan20-Aug-07 0:09 
GeneralRe: What is the logic for WebService methods ? Pin
Talal Sultan20-Aug-07 1:38
Talal Sultan20-Aug-07 1:38 
QuestionIs it possible to create an Access database with Pure C# Code Pin
Infernojericho19-Aug-07 23:04
Infernojericho19-Aug-07 23:04 
AnswerRe: Is it possible to create an Access database with Pure C# Code Pin
Christian Graus20-Aug-07 0:01
protectorChristian Graus20-Aug-07 0:01 
GeneralRe: Is it possible to create an Access database with Pure C# Code Pin
Syed Mujtaba Hassan20-Aug-07 2:51
Syed Mujtaba Hassan20-Aug-07 2:51 
AnswerRe: Is it possible to create an Access database with Pure C# Code Pin
Talal Sultan20-Aug-07 0:03
Talal Sultan20-Aug-07 0:03 
GeneralRe: Is it possible to create an Access database with Pure C# Code Pin
Infernojericho20-Aug-07 0:35
Infernojericho20-Aug-07 0:35 
GeneralRe: Is it possible to create an Access database with Pure C# Code Pin
Christian Graus20-Aug-07 0:45
protectorChristian Graus20-Aug-07 0:45 

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.