本文整理汇总了C#中GLib.List.FindIndex方法的典型用法代码示例。如果您正苦于以下问题:C# List.FindIndex方法的具体用法?C# List.FindIndex怎么用?C# List.FindIndex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GLib.List
的用法示例。
在下文中一共展示了List.FindIndex方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetAll
public List<DriveInfo> GetAll(bool readyDrivesOnly)
{
List<DriveInfo> drives = new List<DriveInfo> ();
VolumeMonitor volmon = GLib.VolumeMonitor.Default;
foreach (Mount m in volmon.Mounts) {
DriveInfo d = new DriveInfo();
FillDriveInfoFromMount(d, m,
(m.Volume != null) ? m.Volume.GetIdentifier (G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE) : string.Empty);
drives.Add(d);
}
if (!readyDrivesOnly) {
foreach (Volume v in volmon.Volumes) {
if (drives.FindIndex(di => (v.GetIdentifier(G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE) == di.Device)) == -1) {
// Volume is unmounted or else it would have been referenced via volmon.Mounts
DriveInfo d = new DriveInfo();
d.device = v.GetIdentifier(G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE);
d.driveType = GuessDriveType(null, v.Icon, v.Drive);
drives.Add(d);
}
}
foreach (Drive dr in volmon.ConnectedDrives) {
if (dr.IsMediaRemovable && !dr.HasMedia) {
DriveInfo d = new DriveInfo();
d.device = dr.GetIdentifier(G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE);
d.driveType = GuessDriveType(null, dr.Icon, dr);
drives.Add(d);
}
}
}
return drives;
}