本文整理汇总了C#中OS.runCommand方法的典型用法代码示例。如果您正苦于以下问题:C# OS.runCommand方法的具体用法?C# OS.runCommand怎么用?C# OS.runCommand使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OS
的用法示例。
在下文中一共展示了OS.runCommand方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BuildDirectoryDrawList
private List<LSItem> BuildDirectoryDrawList(Folder f, int recItteration, int indentOffset, OS os)
{
var list = new List<LSItem>();
var commandSeperationDelay = 0.019;
for (var index1 = 0; index1 < f.folders.Count; ++index1)
{
var myIndex = index1;
var lsItem = new LSItem
{
DisplayName = "/" + f.folders[index1].name,
Clicked = () =>
{
var num = 0;
for (var index = 0; index < os.navigationPath.Count - recItteration; ++index)
{
Action action = () => os.runCommand("cd ..");
if (num > 0)
os.delayer.Post(ActionDelayer.Wait(num*commandSeperationDelay), action);
else
action();
++num;
}
Action action1 = () => os.runCommand("cd " + f.folders[myIndex].name);
if (num > 0)
os.delayer.Post(ActionDelayer.Wait(num*commandSeperationDelay), action1);
else
action1();
},
indent = indentOffset
};
list.Add(lsItem);
indentOffset += 30;
if (os.navigationPath.Count - 1 >= recItteration && os.navigationPath[recItteration] == index1)
list.AddRange(BuildDirectoryDrawList(f.folders[index1], recItteration + 1, indentOffset, os));
indentOffset -= 30;
}
for (var index1 = 0; index1 < f.files.Count; ++index1)
{
var myIndex = index1;
var lsItem = new LSItem
{
DisplayName = f.files[index1].name,
Clicked = () =>
{
var num = 0;
for (var index = 0; index < os.navigationPath.Count - recItteration; ++index)
{
Action action = () => os.runCommand("cd ..");
if (num > 0)
os.delayer.Post(ActionDelayer.Wait(num*commandSeperationDelay), action);
else
action();
++num;
}
Action action1 = () => os.runCommand("cat " + f.files[myIndex].name);
if (num > 0)
os.delayer.Post(ActionDelayer.Wait(num*commandSeperationDelay), action1);
else
action1();
},
indent = indentOffset
};
list.Add(lsItem);
}
if (f.folders.Count == 0 && f.files.Count == 0)
{
var lsItem = new LSItem
{
IsEmtyDisplay = true,
indent = indentOffset
};
list.Add(lsItem);
}
return list;
}