• R/O
  • SSH
  • HTTPS

somali: Commit


Commit MetaInfo

Revision95 (tree)
Time2010-11-28 15:24:47
Authorjuan

Log Message

mod ExplorerForm with able to open dirTree

Change Summary

Incremental Difference

--- trunk/Somali/BaseClass/SomaliActionArgs.cs (revision 94)
+++ trunk/Somali/BaseClass/SomaliActionArgs.cs (revision 95)
@@ -14,6 +14,9 @@
1414 OpenDir,
1515 OpenFile,
1616 JumpLine,
17+ ExpandExplorerNode,
18+ ApplyPreferences,
19+
1720 }
1821
1922 public class SomaliActionArgs : EventArgs
@@ -30,6 +33,12 @@
3033 get { return this._arg; }
3134 }
3235
36+ private Type _argType;
37+ public Type ArgType
38+ {
39+ get { return this._argType; }
40+ }
41+
3342 private string _path;
3443 public string Path
3544 {
@@ -36,8 +45,8 @@
3645 get { return this._path; }
3746 }
3847
39- private int _lineNum;
40- public int LineNumber
48+ private ulong _lineNum;
49+ public ulong LineNumber
4150 {
4251 get { return this._lineNum; }
4352 }
@@ -49,7 +58,11 @@
4958 {
5059 this._actionID = actionID;
5160 this._arg = arg;
61+ this._argType = (arg == null ? null : arg.GetType());
5262
63+ this._path = String.Empty;
64+ this._lineNum = 0UL;
65+
5366 switch ( actionID )
5467 {
5568 case SomaliAction.OpenSolution:
@@ -56,20 +69,12 @@
5669 case SomaliAction.OpenDir:
5770 case SomaliAction.OpenFile:
5871 this._path = arg.ToString();
59- this._lineNum = 0;
6072 break;
6173 case SomaliAction.JumpLine:
62- this._path = String.Empty;
63- Int32.TryParse( arg.ToString(), out this._lineNum );
74+ UInt64.TryParse( arg.ToString(), out this._lineNum );
6475 break;
65- case SomaliAction.ShowExplorer:
66- case SomaliAction.ShowOutlineAnalizer:
67- case SomaliAction.Exit:
68- default:
69- this._path = String.Empty;
70- this._lineNum = 0;
71- break;
7276 }
7377 }
78+
7479 }
7580 }
--- trunk/Somali/Models/OutlineModel.cs (nonexistent)
+++ trunk/Somali/Models/OutlineModel.cs (revision 95)
@@ -0,0 +1,18 @@
1+using System;
2+using System.Collections.Generic;
3+using System.Linq;
4+using System.Text;
5+
6+namespace Somali.Models
7+{
8+ class OutlineModel : Somali.Base.Model
9+ {
10+ private Dictionary<string, int> _outlineMap = null;
11+ public Dictionary<string, int> OutlineMap
12+ {
13+ get { return this._outlineMap; }
14+ set { this._outlineMap = value; }
15+ }
16+
17+ }
18+}
--- trunk/Somali/Models/ExplorerModel.cs (revision 94)
+++ trunk/Somali/Models/ExplorerModel.cs (revision 95)
@@ -7,11 +7,11 @@
77 {
88 class ExplorerModel : Somali.Base.Model
99 {
10- private System.Windows.Forms.TreeNode _fileTree;
11- public System.Windows.Forms.TreeNode Filetree
10+ private System.Windows.Forms.TreeNode _explorerTree = null;
11+ public System.Windows.Forms.TreeNode ExplorerTree
1212 {
13- get { return this._fileTree; }
14- set { this._fileTree = value; }
13+ get { return this._explorerTree; }
14+ set { this._explorerTree = value; }
1515 }
1616
1717 }
--- trunk/Somali/Forms/ExplorerForm.Designer.cs (revision 94)
+++ trunk/Somali/Forms/ExplorerForm.Designer.cs (revision 95)
@@ -38,6 +38,7 @@
3838 this.refleshToolButton = new System.Windows.Forms.ToolStripButton();
3939 this.togglePlusButton = new System.Windows.Forms.ToolStripButton();
4040 this.toggleMinusButton = new System.Windows.Forms.ToolStripButton();
41+ this.explorerTreeIcons = new System.Windows.Forms.ImageList( this.components );
4142 this.contextMenuExplorer.SuspendLayout();
4243 this.toolPanelExplorer.SuspendLayout();
4344 this.exploreToolStrip.SuspendLayout();
@@ -48,10 +49,15 @@
4849 this.treeExplorer.ContextMenuStrip = this.contextMenuExplorer;
4950 this.treeExplorer.Dock = System.Windows.Forms.DockStyle.Fill;
5051 this.treeExplorer.Font = new System.Drawing.Font( "メイリオ", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128)) );
52+ this.treeExplorer.ImageIndex = 2;
53+ this.treeExplorer.ImageList = this.explorerTreeIcons;
5154 this.treeExplorer.Location = new System.Drawing.Point( 0, 25 );
5255 this.treeExplorer.Name = "treeExplorer";
56+ this.treeExplorer.SelectedImageIndex = 0;
5357 this.treeExplorer.Size = new System.Drawing.Size( 276, 374 );
5458 this.treeExplorer.TabIndex = 0;
59+ this.treeExplorer.NodeMouseDoubleClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler( this.treeExplorer_NodeMouseDoubleClick );
60+ this.treeExplorer.BeforeExpand += new System.Windows.Forms.TreeViewCancelEventHandler( this.treeExplorer_BeforeExpand );
5561 //
5662 // contextMenuExplorer
5763 //
@@ -86,7 +92,7 @@
8692 this.toggleMinusButton} );
8793 this.exploreToolStrip.Location = new System.Drawing.Point( 3, 0 );
8894 this.exploreToolStrip.Name = "exploreToolStrip";
89- this.exploreToolStrip.Size = new System.Drawing.Size( 103, 25 );
95+ this.exploreToolStrip.Size = new System.Drawing.Size( 72, 25 );
9096 this.exploreToolStrip.TabIndex = 0;
9197 //
9298 // refleshToolButton
@@ -116,6 +122,15 @@
116122 this.toggleMinusButton.Size = new System.Drawing.Size( 23, 22 );
117123 this.toggleMinusButton.Text = "展開";
118124 //
125+ // explorerTreeIcons
126+ //
127+ this.explorerTreeIcons.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject( "explorerTreeIcons.ImageStream" )));
128+ this.explorerTreeIcons.TransparentColor = System.Drawing.Color.Transparent;
129+ this.explorerTreeIcons.Images.SetKeyName( 0, "folder.png" );
130+ this.explorerTreeIcons.Images.SetKeyName( 1, "folder_page.png" );
131+ this.explorerTreeIcons.Images.SetKeyName( 2, "page_error.png" );
132+ this.explorerTreeIcons.Images.SetKeyName( 3, "page_white_text.png" );
133+ //
119134 // ExplorerForm
120135 //
121136 this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 12F );
@@ -128,6 +143,7 @@
128143 | WeifenLuo.WinFormsUI.Docking.DockAreas.DockTop)
129144 | WeifenLuo.WinFormsUI.Docking.DockAreas.DockBottom)));
130145 this.Font = new System.Drawing.Font( "MS UI Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128)) );
146+ this.HideOnClose = true;
131147 this.Icon = ((System.Drawing.Icon)(resources.GetObject( "$this.Icon" )));
132148 this.Name = "ExplorerForm";
133149 this.Text = "SolutionExplorer";
@@ -151,5 +167,6 @@
151167 private System.Windows.Forms.ToolStripButton refleshToolButton;
152168 private System.Windows.Forms.ToolStripButton togglePlusButton;
153169 private System.Windows.Forms.ToolStripButton toggleMinusButton;
170+ private System.Windows.Forms.ImageList explorerTreeIcons;
154171 }
155172 }
\ No newline at end of file
--- trunk/Somali/Forms/ExplorerForm.cs (revision 94)
+++ trunk/Somali/Forms/ExplorerForm.cs (revision 95)
@@ -12,6 +12,14 @@
1212 {
1313 public partial class ExplorerForm : WeifenLuo.WinFormsUI.Docking.DockContent, IActionColleague
1414 {
15+ public enum NodeIcon : int
16+ {
17+ FolderClose = 0,
18+ FolderOpen,
19+ FileError,
20+ FilePlain,
21+ }
22+
1523 private IActionMediator _mediator;
1624 public void SetMediator( IActionMediator mediator )
1725 {
@@ -32,13 +40,20 @@
3240 }
3341 #endregion
3442
35- public void Reflesh() { }
43+ public WeifenLuo.WinFormsUI.Docking.DockState DefaultDockState
44+ {
45+ get { return WeifenLuo.WinFormsUI.Docking.DockState.DockLeft; }
46+ }
47+ public void Reflesh()
48+ {
49+ this.treeExplorer.Refresh();
50+ }
3651 public void Bind( Model model )
3752 {
3853 ExplorerModel exModel;
3954 if ( model.TryGetModelImpl( out exModel ) )
4055 {
41- BindExplorerTree( exModel.Filetree );
56+ BindExplorerTree( exModel.ExplorerTree );
4257 }
4358 }
4459 public void Initialize() { }
@@ -62,5 +77,15 @@
6277 }
6378 }
6479
80+ private void treeExplorer_NodeMouseDoubleClick( object sender, TreeNodeMouseClickEventArgs e )
81+ {
82+
83+ }
84+
85+ private void treeExplorer_BeforeExpand( object sender, TreeViewCancelEventArgs e )
86+ {
87+ this._mediator.DispatchAction( new SomaliActionArgs( SomaliAction.ExpandExplorerNode, e.Node ) );
88+ }
89+
6590 }
6691 }
--- trunk/Somali/Forms/OutlineForm.cs (revision 94)
+++ trunk/Somali/Forms/OutlineForm.cs (revision 95)
@@ -5,16 +5,38 @@
55 using System.Drawing;
66 using System.Text;
77 using System.Windows.Forms;
8+using Somali.Base;
9+using Somali.Models;
810
911 namespace Somali
1012 {
11- public partial class OutlineForm : WeifenLuo.WinFormsUI.Docking.DockContent
13+ public partial class OutlineForm : WeifenLuo.WinFormsUI.Docking.DockContent, IActionColleague
1214 {
15+ private IActionMediator _mediator;
16+ public void SetMediator( IActionMediator mediator )
17+ {
18+ this._mediator = mediator;
19+ }
20+
1321 public OutlineForm()
1422 {
1523 InitializeComponent();
1624 }
1725
26+ public WeifenLuo.WinFormsUI.Docking.DockState DefaultDockState
27+ {
28+ get { return WeifenLuo.WinFormsUI.Docking.DockState.Float; }
29+ }
30+ public void Reflesh() { }
31+ public void Bind( Model model )
32+ {
33+ OutlineModel exModel;
34+ if ( model.TryGetModelImpl( out exModel ) )
35+ {
36+ }
37+ }
38+ public void Initialize() { }
39+
1840 private void buttonClose_Click(object sender, EventArgs e)
1941 {
2042 this.Close();
--- trunk/Somali/Forms/MainForm.cs (revision 94)
+++ trunk/Somali/Forms/MainForm.cs (revision 95)
@@ -48,6 +48,11 @@
4848 {
4949 get { return this.dockPanelMain; }
5050 }
51+
52+ public DockState DefaultDockState
53+ {
54+ get { return DockState.Unknown; }
55+ }
5156 #endregion
5257
5358 public SomaliForm()
@@ -119,7 +124,7 @@
119124 #region analyze
120125 private void outlineMenuItem_Click( object sender, EventArgs e )
121126 {
122-
127+ this._mediator.DispatchAction( new SomaliActionArgs( SomaliAction.ShowOutlineAnalizer ) );
123128 }
124129 #endregion
125130
--- trunk/Somali/EnvControl/CentralMediator.cs (revision 94)
+++ trunk/Somali/EnvControl/CentralMediator.cs (revision 95)
@@ -16,6 +16,7 @@
1616
1717 private PreferencesSecretary prefSec;
1818 private LayoutSecretary layoutSec;
19+ private ResourceSecretary resSec;
1920 private DockPanel _mainDockPanel;
2021
2122 private SomaliForm _mainForm;
@@ -34,6 +35,7 @@
3435
3536 prefSec = new PreferencesSecretary();
3637 layoutSec = new LayoutSecretary( this._mainForm, this._mainDockPanel );
38+ resSec = new ResourceSecretary();
3739
3840 InitializeActionMap();
3941
@@ -55,6 +57,8 @@
5557 this._actionMap.Add( SomaliAction.Exit, ExitApplication );
5658 this._actionMap.Add( SomaliAction.OpenDir, OpenDirectory );
5759 this._actionMap.Add( SomaliAction.ShowExplorer, ShowExplorer );
60+ this._actionMap.Add( SomaliAction.ShowOutlineAnalizer, ShowOutline );
61+ this._actionMap.Add( SomaliAction.ExpandExplorerNode, ExpandExplorerNode );
5862 }
5963
6064 private void InitializeColleagues()
@@ -87,36 +91,20 @@
8791 }
8892 }
8993
90- private void InitializeExplorer( TreeNode root )
94+ private void ShowColleague<T>( Model model )
95+ where T : DockContent, IDockContent, IActionColleague, new()
9196 {
92- ExplorerForm frmExplore = layoutSec.GetFormIfExists( typeof( ExplorerForm ) ) as ExplorerForm;
93- if ( frmExplore == null )
97+ T colleague;
98+ if ( layoutSec.GetDockFormImpl( out colleague ) )
9499 {
95- frmExplore = new ExplorerForm( root );
96- frmExplore.Show( this._mainDockPanel, DockState.DockLeft );
100+ colleague.SetMediator( this );
101+ colleague.Bind( model );
102+ DockState ds = (colleague.DockState != DockState.Unknown && colleague.DockState != DockState.Hidden)
103+ ? colleague.DockState : colleague.DefaultDockState;
104+ colleague.Show( this._mainDockPanel, ds );
97105 }
98- else
99- {
100- ExplorerModel model = new ExplorerModel();
101- model.Filetree = root;
102- frmExplore.Bind( model );
103- frmExplore.Show( this._mainDockPanel );
104- }
105106 }
106107
107- private void InitializeOutline()
108- {
109- OutlineForm frmOutline = layoutSec.GetFormIfExists( typeof( OutlineForm ) ) as OutlineForm;
110- if ( frmOutline == null )
111- {
112- frmOutline = new OutlineForm();
113- frmOutline.Show( this._mainDockPanel, new Rectangle( 150, 150, 580, 350 ) );
114- }
115- else
116- {
117- frmOutline.Show();
118- }
119- }
120108
121109 }
122110 }
--- trunk/Somali/EnvControl/LayoutSecretary.cs (revision 94)
+++ trunk/Somali/EnvControl/LayoutSecretary.cs (revision 95)
@@ -211,8 +211,8 @@
211211 /// 指定したTypeのDockContentを取得
212212 /// </summary>
213213 /// <param name="formType">DockContentを継承するオブジェクトのType</param>
214- /// <returns>DockPanelに存在すればDockContentを返却します。<br/>存在しない場合は、nullを返却します。</returns>
215- public IDockContent GetFormIfExists( Type formType )
214+ /// <returns>DockPanelに存在すればDockContentを返却します。存在しない場合は、nullを返却します。</returns>
215+ public IDockContent GetDockFormIfExists( Type formType )
216216 {
217217 DockContentCollection dc = this._dockPanel.Contents;
218218 foreach ( IDockContent d in dc )
@@ -226,5 +226,84 @@
226226 return null;
227227 }
228228
229+ /// <summary>
230+ /// 指定したTypeのDockContentを取得
231+ /// </summary>
232+ /// <typeparam name="T"></typeparam>
233+ /// <returns>DockPanelに存在すればDockContentを返却します。存在しない場合は、nullを返却します。</returns>
234+ public T GetDockFormIfExists<T>()
235+ where T : class, IDockContent
236+ {
237+ DockContentCollection dc = this._dockPanel.Contents;
238+ foreach ( IDockContent d in dc )
239+ {
240+ if ( d.GetType().Equals( typeof( T ) ) )
241+ {
242+ return (T)d;
243+ }
244+ }
245+ return null;
246+ //return default( T );
247+ }
248+
249+ /// <summary>
250+ /// IDockContentを継承するFormを取得
251+ /// </summary>
252+ /// <typeparam name="T"></typeparam>
253+ /// <param name="dockForm"></param>
254+ /// <returns>true:取得成功<br/>false:取得失敗</returns>
255+ /// <remarks>DockPanelに存在しないFormの場合、outにはnullを設定します。</remarks>
256+ public bool TryGetDockForm<T>( out T dockForm )
257+ where T : class, IDockContent
258+ {
259+ try
260+ {
261+ dockForm = GetDockFormIfExists<T>();
262+ //dockForm = (T)GetDockFormIfExists( typeof( T ) );
263+ if ( dockForm != null )
264+ {
265+ return true;
266+ }
267+ else
268+ {
269+ return false;
270+ }
271+ }
272+ catch ( Exception )
273+ {
274+ dockForm = default( T );
275+ return false;
276+ }
277+ }
278+
279+ /// <summary>
280+ /// IDockContentを継承するFormの実装インスタンスを取得
281+ /// </summary>
282+ /// <typeparam name="T"></typeparam>
283+ /// <param name="dockForm"></param>
284+ /// <returns>true:取得成功<br/>false:取得失敗</returns>
285+ /// <remarks>DockPanelに存在しないFormの場合、outにはdockFormの新しいインスタンスを設定します。</remarks>
286+ public bool GetDockFormImpl<T>( out T dockForm )
287+ where T : class, IDockContent, new()
288+ {
289+ try
290+ {
291+ if ( TryGetDockForm( out dockForm ) )
292+ {
293+ return true;
294+ }
295+ else
296+ {
297+ dockForm = new T();
298+ return true;
299+ }
300+ }
301+ catch ( Exception )
302+ {
303+ dockForm = default( T );
304+ return false;
305+ }
306+ }
307+
229308 }
230309 }
--- trunk/Somali/EnvControl/CentralMediator.Action.cs (revision 94)
+++ trunk/Somali/EnvControl/CentralMediator.Action.cs (revision 95)
@@ -1,5 +1,6 @@
11 using System;
22 using Somali.Base;
3+using Somali.Models;
34
45 namespace Somali.EnvControl
56 {
@@ -12,15 +13,25 @@
1213
1314 private void OpenDirectory( SomaliActionArgs e )
1415 {
15- // TODO:UtilでFileIOをおこなってよいのか?MVCに沿っていない
16- InitializeExplorer( Util.GetDirectoryTree( e.Path ) );
16+ ExplorerModel model = new ExplorerModel();
17+ model.ExplorerTree = resSec.GetExplorerTree( e.Path );
18+ ShowColleague<ExplorerForm>( model );
1719 }
1820
1921 private void ShowExplorer( SomaliActionArgs e )
2022 {
21- InitializeExplorer( null );
23+ ShowColleague<ExplorerForm>( new ExplorerModel() );
2224 }
2325
26+ private void ShowOutline( SomaliActionArgs e )
27+ {
28+ this._mainDockPanel.DefaultFloatWindowSize = new System.Drawing.Size( 580, 300 );
29+ ShowColleague<OutlineForm>( new OutlineModel() );
30+ }
2431
32+ private void ExpandExplorerNode( SomaliActionArgs e )
33+ {
34+ resSec.ExpandExplorerNode( (System.Windows.Forms.TreeNode)e.Arg );
35+ }
2536 }
2637 }
--- trunk/Somali/EnvControl/ResourceSecretary.cs (nonexistent)
+++ trunk/Somali/EnvControl/ResourceSecretary.cs (revision 95)
@@ -0,0 +1,102 @@
1+using System;
2+using System.Collections.Generic;
3+using System.Linq;
4+using System.Text;
5+using System.Windows.Forms;
6+using System.IO;
7+
8+namespace Somali.EnvControl
9+{
10+ class ResourceSecretary : Somali.Base.BaseSecretary
11+ {
12+ private string _explrDirPath = String.Empty;
13+ private TreeNode _explrTree = null;
14+
15+ public ResourceSecretary()
16+ {
17+ }
18+
19+ public TreeNode GetExplorerTree( string dirPath )
20+ {
21+
22+ //try
23+ //{
24+ // Directory.GetFiles( dirPath, "*", SearchOption.AllDirectories );
25+ //}
26+ //catch ( UnauthorizedAccessException e )
27+ //{
28+ // MessageBox.Show( "参照権限がありません。\n" + e.Message );
29+ // return null;
30+ //}
31+
32+ DirectoryInfo dirInfo = new DirectoryInfo( dirPath );
33+ TreeNode root = new TreeNode( dirInfo.Name );
34+ root.ImageIndex = (int)ExplorerForm.NodeIcon.FolderClose;
35+ root.SelectedImageIndex = (int)ExplorerForm.NodeIcon.FolderOpen;
36+ root.Nodes.Add( "dummy" );
37+
38+ this._explrDirPath = dirInfo.Parent != null ? dirInfo.Parent.FullName : String.Empty;
39+ this._explrTree = root;
40+ return root;
41+ }
42+
43+ public void ExpandExplorerNode( TreeNode treeNode )
44+ {
45+ if ( treeNode == null )
46+ {
47+ throw new ArgumentNullException();
48+ }
49+
50+ if ( this._explrTree.TreeView.Equals( treeNode.TreeView ) )
51+ {
52+ ExpandNode( this._explrDirPath, treeNode );
53+ }
54+ else
55+ {
56+ throw new ArgumentException();
57+ }
58+ }
59+
60+ private void ExpandNode( string dirPath, TreeNode treeNode )
61+ {
62+ treeNode.Nodes.Clear();
63+
64+ string path = dirPath + (dirPath.Equals( String.Empty ) ? String.Empty : @"\") + treeNode.FullPath;
65+ DirectoryInfo dirInfo = new DirectoryInfo( path );
66+ if ( dirInfo.Exists )
67+ {
68+ try
69+ {
70+ DirectoryInfo[] subDir = dirInfo.GetDirectories();
71+ foreach ( DirectoryInfo di in subDir )
72+ {
73+ if ( (di.Attributes & FileAttributes.Hidden) != FileAttributes.Hidden )
74+ {
75+ TreeNode node = treeNode.Nodes.Add( di.Name );
76+ node.ImageIndex = (int)ExplorerForm.NodeIcon.FolderClose;
77+ node.SelectedImageIndex = (int)ExplorerForm.NodeIcon.FolderOpen;
78+
79+ node.Nodes.Add( "dummy" );
80+ }
81+ }
82+
83+ FileInfo[] files = dirInfo.GetFiles();
84+ foreach ( FileInfo fi in files )
85+ {
86+ if ( (fi.Attributes & FileAttributes.Hidden) != FileAttributes.Hidden )
87+ {
88+ TreeNode node = treeNode.Nodes.Add( fi.Name );
89+ // TODO:拡張子によるアイコンの変更
90+ node.ImageIndex = node.SelectedImageIndex = (int)ExplorerForm.NodeIcon.FilePlain;
91+ }
92+ }
93+ }
94+ catch ( UnauthorizedAccessException e )
95+ {
96+ MessageBox.Show( "参照権限がありません。\n" + e.Message );
97+ }
98+ }
99+ }
100+
101+ }
102+}
--- trunk/Somali/BaseInterface/IActionColleague.cs (revision 94)
+++ trunk/Somali/BaseInterface/IActionColleague.cs (revision 95)
@@ -4,6 +4,8 @@
44 {
55 interface IActionColleague
66 {
7+ WeifenLuo.WinFormsUI.Docking.DockState DefaultDockState { get; }
8+
79 void SetMediator( IActionMediator mediator );
810 //void UpdateUI();
911 void Reflesh();
--- trunk/Somali/Util/Util.IO.cs (revision 94)
+++ trunk/Somali/Util/Util.IO.cs (revision 95)
@@ -75,32 +75,6 @@
7575 }
7676 #endregion
7777
78- public static TreeNode GetDirectoryTree( string dirPath )
79- {
80- // TODO:権限のないフォルダが含まれているとエラーとなる
81- IEnumerable<FileInfo> fileList = Directory.GetFiles( dirPath, "*.*",
82- SearchOption.AllDirectories ).Select( x => new FileInfo( x ) );
8378
84- var query = from f in fileList
85- orderby f.FullName
86- group f by f.DirectoryName;
87-
88- List<TreeNode> dir = new List<TreeNode>();
89- foreach ( var item in query )
90- {
91- //Console.WriteLine( "フォルダ名:{0}", item.Key );
92- List<TreeNode> files = new List<TreeNode>();
93- foreach ( var f in item )
94- {
95- //Console.WriteLine( "{0}:{1}", f.CreationTime, f.Name );
96- files.Add( new TreeNode( f.Name ) );
97- }
98- dir.Add( new TreeNode( item.Key, files.ToArray() ) );
99- }
100-
101- TreeNode root = new TreeNode( Directory.GetParent( dirPath ).Name, dir.ToArray() );
102- return root;
103- }
104-
10579 }
10680 }
Show on old repository browser