コード例 #1
0
        public MainWindow()
        {
            InitializeComponent();

            mListPersonInfos                = new ObservableCollection <PersonInfo>();
            mListThemes                     = new ObservableCollection <string>();
            mListColors                     = new ObservableCollection <ColorInfo>();
            mRootDir                        = new DirInfo();
            this.Loaded                    += MainWindow_Loaded;
            ComboThemes.SelectionChanged   += (s, e) => ChangeTheme();
            CbThemes.SelectionChanged      += (s, e) => ChangeTheme();
            ListBoxColors.SelectionChanged += (s, e) => ChangeTheme();
        }
コード例 #2
0
 private void InitDirInfo(DirInfo parent, DirectoryInfo dir)
 {
     if (dir != null && parent != null)
     {
         DirectoryInfo[] children = dir.GetDirectories();
         for (int i = 0; i < children.Length; i++)
         {
             DirInfo dirInfo = new DirInfo();
             dirInfo.Name     = children[i].Name;
             dirInfo.FullPath = children[i].FullName;
             InitDirInfo(dirInfo, children[i]);
             parent.Children.Add(dirInfo);
         }
     }
 }