private void ListBox_MouseUp(object sender, MouseButtonEventArgs e)
        {
            System.Windows.Controls.ListView listView = sender as System.Windows.Controls.ListView;
            FamilyFileInfo familyFileInfo             = (FamilyFileInfo)listView.SelectedItem;

            EventLoadfamily.familyPath = familyFileInfo.FilePath;
            this.m_exEvent.Raise();
        }
Пример #2
0
        public static Dictionary <string, ObservableCollection <FamilyFileInfo> > GetInfo(string folderPath)
        {
            Dictionary <string, ObservableCollection <FamilyFileInfo> > dictionary = new Dictionary <string, ObservableCollection <FamilyFileInfo> >();
            List <string> list = FilesScaner.DirSearch(folderPath, ".rfa");

            foreach (string current in list)
            {
                FamilyFileInfo familyFileInfo = new FamilyFileInfo();
                familyFileInfo.FilePath = current;
                familyFileInfo.Title    = Path.GetFileName(current);
                string text  = current.Substring(0, current.Length - 3) + "jpg";
                bool   flag  = File.Exists(text);
                bool   flag2 = !flag;
                if (flag2)
                {
                    text = current.Substring(0, current.Length - 3) + "png";
                    flag = File.Exists(text);
                }
                bool flag3 = flag;
                if (flag3)
                {
                    familyFileInfo.ImagePath = text;
                }
                string text2 = Path.GetDirectoryName(current).Split(new char[]
                {
                    '\\'
                }).Last <string>();
                familyFileInfo.FolderTitle = text2;
                bool flag4 = dictionary.ContainsKey(text2);
                bool flag5 = flag4;
                if (flag5)
                {
                    ObservableCollection <FamilyFileInfo> observableCollection = dictionary[text2];
                    observableCollection.Add(familyFileInfo);
                }
                else
                {
                    dictionary.Add(text2, new ObservableCollection <FamilyFileInfo>
                    {
                        familyFileInfo
                    });
                }
            }
            return(dictionary);
        }