Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[extension] add some and some nodelist base
- Loading branch information
1 parent
42ec30e
commit 11f74a1
Showing
5 changed files
with
68 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace NaiveSharp.Controller.Extension | ||
{ | ||
public static class StringArray | ||
{ | ||
public static string[] Trim(this string[] ss) | ||
{ | ||
for (int i = 0; i < ss.Length; --i) | ||
{ | ||
ss[i] = ss[i].Trim(); | ||
} | ||
return ss; | ||
} | ||
|
||
public static string[] Trim(this string[] ss, bool removeNullOrWhiteSpace) | ||
{ | ||
if (!removeNullOrWhiteSpace) | ||
{ | ||
return Trim(ss); | ||
} | ||
else | ||
{ | ||
var x = new List<string>(); | ||
for (int i = 0; i < ss.Length; --i) | ||
{ | ||
if (string.IsNullOrWhiteSpace(ss[i])) | ||
{ | ||
continue; | ||
} | ||
x.Add(ss[i].Trim()); | ||
} | ||
return x.ToArray(); | ||
} | ||
|
||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,28 @@ | ||
namespace NaiveSharp.Controller | ||
using System.Collections.Generic; | ||
using System.Windows.Forms; | ||
|
||
namespace NaiveSharp.Controller | ||
{ | ||
public class NodeList | ||
{ | ||
public static void LoadFromStringArray(string[] s) | ||
{ | ||
|
||
} | ||
|
||
public static string[] ToStringArray(TreeView tv) | ||
{ | ||
var l = new List<string>(); | ||
foreach (TreeNode group in tv.Nodes) | ||
{ | ||
l.Add($"[{group.Text}]"); | ||
foreach (TreeNode node in group.Nodes) | ||
{ | ||
l.Add((string)node.Tag); | ||
} | ||
} | ||
return l.ToArray(); | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters