C# adding list into list
        Posted  
        
            by 
                gencay
            
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by gencay
        
        
        
        Published on 2010-12-27T22:41:26Z
        Indexed on 
            2010/12/27
            22:54 UTC
        
        
        Read the original article
        Hit count: 338
        
c#
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..
© Stack Overflow or respective owner