code in class
I make a datatable from an xml file, convert two strings into an array as milliseconds (int),
this goes Ok Also a text string comes out of the xml - this works.
(these are timein ,timeout and subtitle)
I need to store "stepper" and "stringArr" somewhere in memory to call it pretty fast without
accessing the XML over and over again to put subtitles in time in mediaelement.
Where to store the info for instant access?
public void arrayprov(string blabla)
{
DataSet ds = new DataSet();
ds.ReadXml(blabla);
DataTable DT = new DataTable();
DT = ds.Tables[0];
int subtlen = Int32.Parse(DT.Rows[0][8].ToString())-1;
double frate =double.Parse(DT.Rows[0][5].ToString());
DT = ds.Tables[1];
int[,] stepper = new int[subtlen, 2];
string[] stringArr= new string[subtlen]
for (int i = 0; i < subtlen; i++)
{
stepper[i, 0] = calcuul(DT.Rows[i][0].ToString(), frate);
stepper[i, 1] = calcuul(DT.Rows[i][1].ToString(), frate);
stringArr[i] = DT.Rows[i][10].ToString()
}
}
int calcuul(string cuul, double frates )
{
double dubbel= 1000 * double.Parse(cuul.Substring(6,2))/frates;
int milsec = (int)dubbel + 1000 * (Int32.Parse(cuul.Substring(4, 2)))
+ 60000 * (Int32.Parse(cuul.Substring(2, 2))) + 3600000 *
(Int32.Parse(cuul.Substring(0, 2)));
return milsec;
}