private void folder_MouseDown(object sender, EventArgs e)
 {
     cvsFile.Children.Clear();
     //string pathName = "";
     if (curPath == "L")
     {
         pathName = ".\\" + (sender as folderCtrl).lb.Content.ToString();
     }
     else
     {
         if (uPanName != null)
         {
             pathName = uPanName + (sender as folderCtrl).lb.Content.ToString();
         }
         else
         {
             cvsFile.Children.Clear();
             btnUPan.IsEnabled = false;
         }
     }
     foreach (string d in Directory.GetFileSystemEntries(pathName))
     {
         if (File.Exists(d))
         {
             if (strFilter != "")
             {
                 if (d.Length > strFilter.Length)
                 {
                     if (d.Substring(d.Length - strFilter.Length, strFilter.Length) != strFilter)
                         continue;
                 }
                 else
                     continue;
             }
             fileSelectItemCtrl ctrlItem = new fileSelectItemCtrl();
             cvsFile.Children.Add(ctrlItem);
             Canvas.SetTop(ctrlItem, (cvsFile.Children.Count - 1) * 40);
             ctrlItem.lb.Content = d;
             ctrlItem.MouseDown += new MouseButtonEventHandler(fileCtrl_MouseDown);
         }
     }
     if (cvsFile.Children.Count > 0)
     {
         fileSelectItemCtrl item = cvsFile.Children[0] as fileSelectItemCtrl;
         item.state = true;
         fileName = item.lb.Content.ToString();
         lbFileName.Content = valmoWin.dv.getCurDis("lanKey1023") + fileName;
         btnSelect.IsEnabled = true;
     }
     else
     {
         if (curPath == "L")
         {
             lbPath.Content = ".\\" + pathName;
         }
         else
         {
             if (uPanName == null)
             {
                 fileName = "";
                 lbFileName.Content = valmoWin.dv.getCurDis("lanKey1023") + "";
             }
             else
             {
                 fileName = "";
                 lbFileName.Content = valmoWin.dv.getCurDis("lanKey1023") + "";
             }
         }
         btnSelect.IsEnabled = false;
     }
     lbPath.Content = pathName;
 }
 private void folder_MouseDown(object sender, EventArgs e)
 {
     cvsFile.Children.Clear();
     ////cvsFile.clear();
     //string pathName = "";
     if (curPath == "L")
     {
         pathName = ".\\" + (sender as folderCtrl).lb.Content.ToString();
     }
     else
     {
         if (uPanName != null)
         {
             pathName = uPanName + (sender as folderCtrl).lb.Content.ToString();
         }
         else
         {
             cvsFile.Children.Clear();
             ////cvsFile.clear();
             btnUPan.IsEnabled = false;
         }
     }
     foreach (string d in Directory.GetFileSystemEntries(pathName))
     {
         if (File.Exists(d))
         {
             fileSelectItemCtrl ctrlItem = new fileSelectItemCtrl();
             cvsFile.Children.Add(ctrlItem);
             Canvas.SetTop(ctrlItem, (cvsFile.Children.Count - 1) * 40);
             ////cvsFile.add(ctrlItem);
             ////Canvas.SetTop(ctrlItem, (cvsFile.count - 1) * 40);
             ctrlItem.lb.Content = d;
             ctrlItem.MouseDown += new MouseButtonEventHandler(fileCtrl_MouseDown);
         }
     }
     lbPath.Content = pathName;
     //if (cvsFile.Children.Count > 0)
     //{
     //    fileSelectItemCtrl item = cvsFile.Children[0] as fileSelectItemCtrl;
     //    //item.state = true;
     //    if (curPath == "L")
     //    {
     //        lbPath.Content = ".\\" + item.lb.Content.ToString();
     //    }
     //    else
     //    {
     //        lbPath.Content = item.lb.Content.ToString();
     //    }
     //}
     //else
     //{
     //    if (curPath == "L")
     //    {
     //        lbPath.Content = ".\\" + pathName;
     //    }
     //    else
     //    {
     //        if (uPanName == null)
     //        {
     //            lbFileName.Content = "";
     //        }
     //        else
     //        {
     //            lbFileName.Content = pathName;
     //        }
     //    }
     //}
 }