/// <summary>
        /// Analyze projects belong to a solution
        /// </summary>
        /// <param name="idSoln"></param>
        /// <param name="solnPath"></param>
        /// <param name="errorText"></param>
        /// <returns></returns>
        public bool Analyzeprojects(ref string errorText)
        {
            errorText = "";
            Hashtable prjsdetailsinsoln = new Hashtable();
            string tmpxmlfileforsolndata;

            string tmpsolndata = @"c:\tempsoln.xml";
            string solnname = Path.GetFileNameWithoutExtension(_solnPath);

            if (Directory.Exists(@"C:\" + solnname))
            {
                Directory.Delete(@"C:\" + solnname, true);
            }
            Directory.CreateDirectory(@"C:\" + solnname);
            
            if (!System.IO.File.Exists(tmpsolndata))
            {
                System.IO.File.Create(tmpsolndata);
            }
            string solncontents = "";
            StreamReader solnreader = new StreamReader(_solnPath.Trim());

            while (solncontents != null)
            {
                solncontents = solnreader.ReadLine();
                if (solncontents != null)
                {
                    try
                    {
                        if (solncontents.StartsWith("Project"))
                        {
                            string[] prjprops = solncontents.Split(',');
                            string prjdispname = prjprops[0].Substring(prjprops[0].LastIndexOf("=") + 1).Replace("\"", "").Trim();
                            string prjpath1 = prjprops[1].ToString().Replace("\"", "").Trim();
                            prjsdetailsinsoln.Add(prjdispname, prjpath1);
                        }
                    }
                    catch (Exception ex)
                    {
                        errorText = ex.Message;
                        return false;
                    }
                }
            }

            IDictionaryEnumerator enprj = prjsdetailsinsoln.GetEnumerator();
            var lstCSFile = new List<string>();
            while (enprj.MoveNext())
            {
                // Init new project
                string strprjname = enprj.Key.ToString();
                var _project = new ProjStructure
                {
                    Name = strprjname,
                    Classes = new List<ClassStructure>()
                };
                _solStructure.Projects.Add(_project);
                //////////////////////// E ////////////////////////////
                if (enprj.Value.ToString().IndexOf("http://") == -1 && enprj.Value.ToString().EndsWith(".csproj"))
                {
                    string prjpath = _solnPath.Substring(0, _solnPath.LastIndexOf(@"\") + 1) + enprj.Value.ToString();
                    if (System.IO.File.Exists(prjpath))
                    {
                        StreamReader prjreader = new StreamReader(prjpath);
                        string prjcontents = prjreader.ReadToEnd();
                        prjreader.Close();
                        // Replace project
                        var indexStart = prjcontents.IndexOf("<Project");
                        var indexEnd = prjcontents.IndexOf(">", indexStart);
                        var oldProject = prjcontents.Substring(indexStart, indexEnd - indexStart + 1);
                        prjcontents = prjcontents.Replace(oldProject, "<Project>");
                        //Format Project File into XML file...
                        tmpxmlfileforsolndata = @"C:\" + solnname + "\\" + enprj.Key.ToString() + ".xml";
                        if (prjcontents.Length != 0)
                        {
                            StreamWriter solntoxmlconverter = new StreamWriter(tmpxmlfileforsolndata, false);
                            solntoxmlconverter.Write(prjcontents);
                            solntoxmlconverter.Close();
                        }
                        else
                        {
                            errorText = "Selected Project File is empty...";
                            return false;
                        }

                        ////To Load all items of the Project into the Treeview...
                        XPathDocument prjfile = new XPathDocument(tmpxmlfileforsolndata);
                        XPathNavigator nav = prjfile.CreateNavigator();

                        //TO Load all Class files of the selected Project...
                        XPathNodeIterator csfileiterator = nav.Select("/Project/ItemGroup/Compile");
                        lstCSFile.Clear();
                        LoadSelectedDetails("cs", csfileiterator, strprjname, ref lstCSFile);
                        if (lstCSFile.Count > 0)
                        {
                            // Loop through files with cs extension
                            for (int i = 0; i < lstCSFile.Count; i++)
                            {
                                //Get component of cs file include classes, methods
                                Dictionary<string, ClassStructure> dictClass = null;
                                if (GetCompsOfProjects(lstCSFile[i], ref dictClass, ref errorText))
                                {
                                    if (dictClass.Count > 0)
                                    {
                                        for (int j = 0; j < dictClass.Count; j++)
                                        {
                                            int index = -1;
                                            // Checking if obtained class which is exist on list of classes of project 
                                            if (!IsExistClass(_project.Classes, dictClass.Values.ElementAt(j), ref index))
                                            {
                                                dictClass.Values.ElementAt(j).ClassPath = lstCSFile[i];
                                                _project.Classes.Add(dictClass.Values.ElementAt(j));
                                            }
                                            else
                                            {
                                                // Obtained class is exist, just add methods of obtained class to class of project
                                                for (int k = 0; k < dictClass.Values.ElementAt(j).Methods.Count; k++)
                                                {
                                                    _project.Classes[index].Methods.Add(dictClass.Values.ElementAt(j).Methods[k]);
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            return true;
        }
 public ProjStructure BuildProject(PROJECT proj)
 {
     var projStr = new ProjStructure
     {
         Name = proj.TenProject,
         Classes = new List<ClassStructure>()
     };
     foreach (var _class in proj.CLASSES)
     {
         var classStr = BuildClass(_class);
         projStr.Classes.Add(classStr);
     }
     return projStr;
 }
 public void Insert_Project(int solnID, ProjStructure projStr)
 {
     var _proj = InsertPROJECTS(solnID, projStr.Name);
     if (_proj != null)
     {
         for (int i = 0; i < projStr.Classes.Count; i++)
         {
             Insert_Class(_proj.ID, projStr.Classes[i]);
         }
     }
 }