本文整理汇总了C#中Nikse.SubtitleEdit.Logic.Paragraph类的典型用法代码示例。如果您正苦于以下问题:C# Paragraph类的具体用法?C# Paragraph怎么用?C# Paragraph使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Paragraph类属于Nikse.SubtitleEdit.Logic命名空间,在下文中一共展示了Paragraph类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ParagraphEventArgs
/// <summary>
/// Initializes a new instance of the <see cref="ParagraphEventArgs"/> class.
/// </summary>
/// <param name="seconds">
/// The seconds.
/// </param>
/// <param name="p">
/// The p.
/// </param>
/// <param name="b">
/// The b.
/// </param>
/// <param name="mouseDownParagraphType">
/// The mouse down paragraph type.
/// </param>
public ParagraphEventArgs(double seconds, Paragraph p, Paragraph b, MouseDownParagraphType mouseDownParagraphType)
{
this.Seconds = seconds;
this.Paragraph = p;
this.BeforeParagraph = b;
this.MouseDownParagraphType = mouseDownParagraphType;
}
示例2: ParagraphEventArgs
public ParagraphEventArgs(double seconds, Paragraph p, Paragraph b, MouseDownParagraphType mouseDownParagraphType)
{
Seconds = seconds;
Paragraph = p;
BeforeParagraph = b;
MouseDownParagraphType = mouseDownParagraphType;
}
示例3: Constructor
public Paragraph Constructor(int startFrame, int endFrame, string text)
{
Paragraph target = new Paragraph(startFrame, endFrame, text);
return target;
// TODO: add assertions to method ParagraphTest.Constructor(Int32, Int32, String)
}
示例4: TestToStringNewParagraph
public void TestToStringNewParagraph()
{
string expectedOutput = "00:00:00,000 --> 00:00:00,000 ";
var paragraph = new Paragraph();
string actualOutput = paragraph.ToString();
Assert.AreEqual(expectedOutput, actualOutput);
}
示例5: GeneratePreview
private void GeneratePreview()
{
Subtitle subtitle = new Subtitle();
var p1 = new Paragraph("Line 1a." + Environment.NewLine + "Line 1b.", 1000, 3500);
string start1 = GetTimeCode(p1.StartTime, comboBoxTimeCode.Text);
string end1 = GetTimeCode(p1.EndTime, comboBoxTimeCode.Text);
var p2 = new Paragraph("Line 2a." + Environment.NewLine + "Line 2b.", 1000, 3500);
string start2 = GetTimeCode(p2.StartTime, comboBoxTimeCode.Text);
string end2 = GetTimeCode(p2.EndTime, comboBoxTimeCode.Text);
subtitle.Paragraphs.Add(p1);
subtitle.Paragraphs.Add(p2);
try
{
string newLine = comboBoxNewLine.Text.Replace(Configuration.Settings.Language.ExportCustomTextFormat.DoNotModify, EnglishDoNoModify);
string template = GetParagraphTemplate(textBoxParagraph.Text);
textBoxPreview.Text = GetHeaderOrFooter("Demo", subtitle, textBoxHeader.Text) +
GetParagraph(template, start1, end1, GetText(p1.Text, newLine), GetText("Linje 1a." + Environment.NewLine + "Line 1b.", newLine), 0, p1.Duration, comboBoxTimeCode.Text) +
GetParagraph(template, start2, end2, GetText(p2.Text, newLine), GetText("Linje 2a." + Environment.NewLine + "Line 2b.", newLine), 1, p2.Duration, comboBoxTimeCode.Text) +
GetHeaderOrFooter("Demo", subtitle, textBoxFooter.Text);
}
catch (Exception ex)
{
textBoxPreview.Text = ex.Message;
}
}
示例6: ParagraphEventArgs
public ParagraphEventArgs(double seconds, Paragraph p, Paragraph b, MouseDownParagraphType mouseDownParagraphType, bool movePreviousOrNext)
{
this.Seconds = seconds;
this.Paragraph = p;
this.BeforeParagraph = b;
this.MouseDownParagraphType = mouseDownParagraphType;
this.MovePreviousOrNext = movePreviousOrNext;
}
示例7: TestMethodAdjustOneSecond
public void TestMethodAdjustOneSecond()
{
var paragraph = new Paragraph();
paragraph.Adjust(0, 1);
int startSeconds = paragraph.StartTime.Seconds;
int endSeconds = paragraph.EndTime.Seconds;
Assert.AreEqual(1, startSeconds);
Assert.AreEqual(1, endSeconds);
}
示例8: SetTimeCodes
private static void SetTimeCodes(string fileName, ListViewItem item)
{
string name = Path.GetFileNameWithoutExtension(fileName);
var p = new Paragraph();
SetEndTimeAndStartTime(name, p);
item.SubItems.Add(p.StartTime.ToString());
item.SubItems.Add(p.EndTime.ToString());
item.SubItems.Add(p.Duration.ToShortString());
}
示例9: Constructor
public Paragraph Constructor(
string text,
double startTotalMilliseconds,
double endTotalMilliseconds
)
{
Paragraph target = new Paragraph(text, startTotalMilliseconds, endTotalMilliseconds);
return target;
// TODO: add assertions to method ParagraphTest.Constructor(String, Double, Double)
}
示例10: Create
public static Paragraph Create(Paragraph paragraph_paragraph1)
{
Paragraph paragraph = new Paragraph(paragraph_paragraph1);
return paragraph;
// TODO: Edit factory method of Paragraph
// This method should be able to configure the object in all possible ways.
// Add as many parameters as needed,
// and assign their values to each field by using the API.
}
示例11: Initialize
internal void Initialize(Paragraph paragraph)
{
_paragraph = paragraph;
labelPreview.Text = paragraph.Text;
labelTotalMillisecs.Text = string.Format("{0:#,##0.000}", paragraph.Duration.TotalMilliseconds / 1000);
numericUpDownDelay.Maximum = (decimal)((paragraph.Duration.TotalMilliseconds - 500) / 1000);
numericUpDownDelay.Minimum = 0;
numericUpDownDelay.Left = labelEndDelay.Left + labelEndDelay.Width + 5;
}
示例12: AddToListView
private void AddToListView(Paragraph p, string lineNumbers, string newText)
{
var item = new ListViewItem(string.Empty) { Tag = p, Checked = true };
var subItem = new ListViewItem.ListViewSubItem(item, lineNumbers);
item.SubItems.Add(subItem);
subItem = new ListViewItem.ListViewSubItem(item, newText.Replace(Environment.NewLine, Configuration.Settings.General.ListViewLineSeparatorString));
item.SubItems.Add(subItem);
listViewFixes.Items.Add(item);
}
示例13: AddFixToListView
private void AddFixToListView(Paragraph p, string before, string after)
{
if (_onlyListFixes)
{
var item = new ListViewItem(string.Empty) { Checked = true, Tag = p };
item.SubItems.Add(p.Number.ToString());
item.SubItems.Add(before.Replace(Environment.NewLine, Configuration.Settings.General.ListViewLineSeparatorString));
item.SubItems.Add(after.Replace(Environment.NewLine, Configuration.Settings.General.ListViewLineSeparatorString));
listViewFixes.Items.Add(item);
}
}
示例14: AllowFix
public bool AllowFix(Paragraph p)
{
if (_onlyListFixes)
return true;
string ln = p.Number.ToString();
foreach (ListViewItem item in listViewFixes.Items)
{
if (item.SubItems[1].Text == ln)
return item.Checked;
}
return false;
}
示例15: AddToListView
private void AddToListView(Paragraph p, string lineNumbers, string newText)
{
var item = new ListViewItem(string.Empty) { Tag = p, Checked = true };
var subItem = new ListViewItem.ListViewSubItem(item, lineNumbers.TrimEnd(','));
item.SubItems.Add(subItem);
subItem = new ListViewItem.ListViewSubItem(item, newText.Replace(Environment.NewLine, Configuration.Settings.General.ListViewLineSeparatorString));
item.SubItems.Add(subItem);
listViewFixes.Items.Add(item);
foreach (string number in lineNumbers.TrimEnd(',').Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries))
{
_isFixAllowedList.Add(Convert.ToInt32(number), true);
}
}