本文整理汇总了C#中System.Windows.Forms.ListView.Contains方法的典型用法代码示例。如果您正苦于以下问题:C# ListView.Contains方法的具体用法?C# ListView.Contains怎么用?C# ListView.Contains使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.ListView
的用法示例。
在下文中一共展示了ListView.Contains方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AdjustDisplayTimeUsingSeconds
public void AdjustDisplayTimeUsingSeconds(double seconds, ListView.SelectedIndexCollection selectedIndexes)
{
for (int i = 0; i < _paragraphs.Count; i++)
{
if (selectedIndexes == null || selectedIndexes.Contains(i))
{
double nextStartMilliseconds = _paragraphs[_paragraphs.Count - 1].EndTime.TotalMilliseconds + TimeCode.BaseUnit;
if (i + 1 < _paragraphs.Count)
nextStartMilliseconds = _paragraphs[i + 1].StartTime.TotalMilliseconds;
double newEndMilliseconds = _paragraphs[i].EndTime.TotalMilliseconds + (seconds * TimeCode.BaseUnit);
if (newEndMilliseconds > nextStartMilliseconds)
newEndMilliseconds = nextStartMilliseconds - 1;
if (seconds < 0)
{
if (_paragraphs[i].StartTime.TotalMilliseconds + 100 > newEndMilliseconds)
_paragraphs[i].EndTime.TotalMilliseconds = _paragraphs[i].StartTime.TotalMilliseconds + 100;
else
_paragraphs[i].EndTime.TotalMilliseconds = newEndMilliseconds;
}
else
{
_paragraphs[i].EndTime.TotalMilliseconds = newEndMilliseconds;
}
}
}
}
示例2: RecalculateDisplayTimes
public void RecalculateDisplayTimes(double maxCharactersPerSecond, ListView.SelectedIndexCollection selectedIndexes)
{
for (int i = 0; i < _paragraphs.Count; i++)
{
if (selectedIndexes == null || selectedIndexes.Contains(i))
{
Paragraph p = _paragraphs[i];
double duration = Utilities.GetOptimalDisplayMilliseconds(p.Text);
p.EndTime.TotalMilliseconds = p.StartTime.TotalMilliseconds + duration;
while (Utilities.GetCharactersPerSecond(p) > maxCharactersPerSecond)
{
duration++;
p.EndTime.TotalMilliseconds = p.StartTime.TotalMilliseconds + duration;
}
Paragraph next = GetParagraphOrDefault(i + 1);
if (next != null && p.StartTime.TotalMilliseconds + duration + Configuration.Settings.General.MinimumMillisecondsBetweenLines > next.StartTime.TotalMilliseconds)
{
p.EndTime.TotalMilliseconds = next.StartTime.TotalMilliseconds - Configuration.Settings.General.MinimumMillisecondsBetweenLines;
if (p.Duration.TotalMilliseconds <= 0)
p.EndTime.TotalMilliseconds = p.StartTime.TotalMilliseconds + 1;
}
}
}
}
示例3: AdjustDisplayTimeUsingPercent
public void AdjustDisplayTimeUsingPercent(double percent, ListView.SelectedIndexCollection selectedIndexes)
{
for (int i = 0; i < _paragraphs.Count; i++)
{
if (selectedIndexes == null || selectedIndexes.Contains(i))
{
double nextStartMilliseconds = _paragraphs[_paragraphs.Count - 1].EndTime.TotalMilliseconds + TimeCode.BaseUnit;
if (i + 1 < _paragraphs.Count)
nextStartMilliseconds = _paragraphs[i + 1].StartTime.TotalMilliseconds;
double newEndMilliseconds = _paragraphs[i].EndTime.TotalMilliseconds;
newEndMilliseconds = _paragraphs[i].StartTime.TotalMilliseconds + (((newEndMilliseconds - _paragraphs[i].StartTime.TotalMilliseconds) * percent) / 100);
if (newEndMilliseconds > nextStartMilliseconds)
newEndMilliseconds = nextStartMilliseconds - 1;
_paragraphs[i].EndTime.TotalMilliseconds = newEndMilliseconds;
}
}
}