Is there a better way to define a job list in c# then using XML? -
i want add dynamically import function program.
my first thought add bunch of functions handle import , user can define functions has used @ point.
here example:
the first text
:
myfirstval myfirstobject;mysecondobject;mythirdobject
the first job list:
- split
text
new line
string1[]
string1[0]
value1
- split
string1[0]
;
string2[]
- put each string in
string2[]
inlist<string>
the first result:
value1
= myfirstval
list<string>[0]
= myfirstobject
list<string>[1]
= mysecondobject
list<string>[2]
= mythirdobject
the second text
:
myfirstval;myfirstobject,mysecondobject,mythirdobject
the second job list:
- split
text
;
string1[]
string1[0]
value1
- split
string1[0]
,
string2[]
- put each string in
string2[]
inlist<string>
with joblist same result seen in first example.
so thinking putting these job lists in xml file, user can create custom file , use same importer. in shouldn't problem, need use conditions , don't know how represent them in xml.
the third text
:
a_myfirstval a_myfirstobject;a_mysecondobject;a_mythirdobject b_mysecondval;b_mythirdval;b_myfourthval
the third job list:
- split
text
new line
string1[]
string1[0]
value1
- for each string in
string1[]
withoutstring1[0]
- -- if string starts a_
- -- -- split string
;
string2[]
- -- -- put each string in
string2[]
inlist<string>
- -- else if string starts b_
- -- -- split string
;
string3[]
- -- --
string3[0]
value2
- -- --
string3[1]
value3
- -- --
string3[2]
value4
the third result:
value1
= myfirstval
list<string>[0]
= myfirstobject
list<string>[1]
= mysecondobject
list<string>[2]
= mythirdobject
value2
= mysecondval
value3
= mythirdval
value4
= myfourthval
maybe can tell me how or name different solution.
thanks!
Comments
Post a Comment