C# adding list into list
- by gencay
I have a DocumentList.c as implemented below. And when I try to add a list into the instance of DocumentList object it adds but the others be the same
class DocumentList
{
public static List wordList;
public static string type;
public static string path;
public static double cos;
public static double dice;
public static double jaccard;
//public static string title;
public DocumentList(List wordListt, string typee, string pathh, double sm11, double sm22, double sm33)
{
type = typee;
wordList = wordListt;
path = pathh;
cos = sm11;
dice = sm22;
jaccard = sm33;
}
}
in main c#code fragment
public partial class Window1 : System.Windows.Window
{
static private List documentList = new List();
...
in a method I use as below.
DocumentList dt = new DocumentList(para1, para2, para3, para4, para5, para6);
documentList.Add(dt);
Now, When i add the first list it is ok it seems 1 item in documentList, but for the second one I get a list with 2 items but both the same..
I mean I cannot keep previous list item..