I have two different classes as follow and in my application I create two
diiferent objects of them and I want to srialize those two objects into one
XML file
because they are related ,Is there an suggestion on how to do that .Maybe I
need to combine these two classes and work on one class only ,right??
Thanks for your time.
Class1:
public class EnviroVars
{
private string m_reportServerName;
private string m_reportName;
public EnviroVars(){}
// Report Server Name property
public string RSName
{
get {return m_reportServerName;}
set {m_reportServerName=value;}
}
// Report Name property
public string ReportName
{
get {return m_reportName;}
set {m_reportName=value;}
}
}
================================================== ==========================
====
Class2:
public class ReportParams
{
private ParameterValue[] m_ReportParams;
private int m_MaxReportParas;
public ReportParams(int MaxReportParas)
{
m_MaxReportParas=MaxReportParas;
m_ReportParams=new ParameterValue[MaxReportParas];
}
//Here is the implementation of the indexer by array index
public ParameterValue this[int index]
{
get
{
// Check for out of bounds condition
if ( index < 0 || index > m_ReportParams.Length- 1 )
return null;
// Return employee based on index passed in
return m_ReportParams[index];
}
set
{
// Check for out of bounds condition
if ( index < 0 || index > m_MaxReportParas - 1 )
return;
// Add new Parameter
m_ReportParams[index]= value ;
}
}
}