本文整理汇总了C#中Run类的典型用法代码示例。如果您正苦于以下问题:C# Run类的具体用法?C# Run怎么用?C# Run使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Run类属于命名空间,在下文中一共展示了Run类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateFormattedRun
public void CreateFormattedRun()
{
//ExStart
//ExFor:Document.#ctor
//ExFor:Font
//ExFor:Font.Name
//ExFor:Font.Size
//ExFor:Font.HighlightColor
//ExFor:Run
//ExFor:Run.#ctor(DocumentBase,String)
//ExFor:Story.FirstParagraph
//ExSummary:Shows how to add a formatted run of text to a document using the object model.
// Create an empty document. It contains one empty paragraph.
Document doc = new Document();
// Create a new run of text.
Run run = new Run(doc, "Hello");
// Specify character formatting for the run of text.
Aspose.Words.Font f = run.Font;
f.Name = "Courier New";
f.Size = 36;
f.HighlightColor = Color.Yellow;
// Append the run of text to the end of the first paragraph
// in the body of the first section of the document.
doc.FirstSection.Body.FirstParagraph.AppendChild(run);
//ExEnd
}
示例2: VisitRun
/// <summary>
/// Called when a Run node is encountered in the document.
/// </summary>
public override VisitorAction VisitRun(Run run)
{
AppendText(run.Text);
// Let the visitor continue visiting other nodes.
return VisitorAction.Continue;
}
示例3: TicGenerator
public TicGenerator(Run run, SpectrumCache spectrumCache)
{
this.run = run;
this.spectrumCache = spectrumCache;
spectrumExtractor = new SpectrumExtractor(run, spectrumCache);
ticCache = new TicCache();
}
示例4: GenerateParagraph
public static void GenerateParagraph(this Body body, string text, string styleId)
{
var paragraph = new Paragraph
{
RsidParagraphAddition = "00CC1B7A",
RsidParagraphProperties = "0016335E",
RsidRunAdditionDefault = "0016335E"
};
var paragraphProperties = new ParagraphProperties();
var paragraphStyleId = new ParagraphStyleId {Val = styleId};
paragraphProperties.Append(paragraphStyleId);
var run1 = new Run();
var text1 = new Text();
text1.Text = text;
run1.Append(text1);
paragraph.Append(paragraphProperties);
paragraph.Append(run1);
body.Append(paragraph);
}
示例5: GenerateRun
protected Run GenerateRun(RunProperties runProperties, string text)
{
SetFontRunProperties(runProperties);
var run = new Run() { RunProperties = runProperties };
run.AppendChild(new Text(text));
return run;
}
示例6: Create
public IRun Create(IComparisonGeneratorsFactory factory)
{
var run = new Run(factory);
var reader = new StreamReader(Stream);
var line = reader.ReadLine();
var titleInfo = line.Split('|');
run.CategoryName = titleInfo[0].Substring(1);
run.AttemptCount = int.Parse(titleInfo[1]);
TimeSpan totalTime = TimeSpan.Zero;
while ((line = reader.ReadLine()) != null)
{
if (line.Length > 0)
{
var majorSplitInfo = line.Split('|');
totalTime += TimeSpanParser.Parse(majorSplitInfo[1]);
while (!reader.EndOfStream && reader.Read() == '*')
{
line = reader.ReadLine();
run.AddSegment(line);
}
var newTime = new Time(run.Last().PersonalBestSplitTime);
newTime.GameTime = totalTime;
run.Last().PersonalBestSplitTime = newTime;
}
else
{
break;
}
}
return run;
}
示例7: CreateFrom
/// <summary>
/// Creates a RLEBitset from a BitArray.
/// </summary>
/// <param name="bits">a BitArray</param>
/// <returns>an RLEBitset</returns>
public static IBitset CreateFrom(BitArray bits)
{
RLEBitset rtnVal = new RLEBitset();
rtnVal._Length = bits.Length;
Run currRun = new Run();
for (int i = 0; i < bits.Count; i++)
{
if (bits.Get(i) == true)
{
currRun.StartIndex = i;
currRun.EndIndex = i;
for (int j = i + 1; j < bits.Count; j++)
{
if (bits.Get(j))
{
currRun.EndIndex = j;
}
else
{
break;
}
}
i = currRun.EndIndex; //move the counter to the end of the run we just found
rtnVal._RunArray.Add(currRun);
currRun = new Run();
}
}
return rtnVal;
}
示例8: Create
public IRun Create(IComparisonGeneratorsFactory factory)
{
var run = new Run(factory);
var json = JSON.FromStream(Stream);
run.GameName = json.run_name as string;
run.AttemptCount = json.run_count;
var timingMethod = (int)(json.timer_type) == 0
? TimingMethod.RealTime
: TimingMethod.GameTime;
var segments = json.splits as IEnumerable<dynamic>;
foreach (var segment in segments)
{
var segmentName = segment.name as string;
var pbSplitTime = parseTime((int?)segment.pb_split, timingMethod);
var bestSegment = parseTime((int?)segment.split_best, timingMethod);
var parsedSegment = new Segment(segmentName, pbSplitTime, bestSegment);
run.Add(parsedSegment);
}
return run;
}
示例9: Process
internal void Process(Run element, DocxNode node)
{
RunProperties properties = element.RunProperties;
if (properties == null)
{
properties = new RunProperties();
}
//Order of assigning styles to run property is important. The order should not change.
CheckFonts(node, properties);
string color = node.ExtractStyleValue(DocxColor.color);
if (!string.IsNullOrEmpty(color))
{
DocxColor.ApplyColor(color, properties);
}
CheckFontStyle(node, properties);
ProcessBackGround(node, properties);
ProcessVerticalAlign(node, properties);
if (element.RunProperties == null && properties.HasChildren)
{
element.RunProperties = properties;
}
}
示例10: VisitRun
public override VisitorAction VisitRun(Run run)
{
// Remove the run if it is between the FieldStart and FieldSeparator of the field being converted.
CheckDepthAndRemoveNode(run);
return VisitorAction.Continue;
}
示例11: AveragedSpectrumExtractor
public AveragedSpectrumExtractor(Run run, SpectrumCache spectrumCache)
{
this.run = run;
this.spectrumCache = spectrumCache;
rtToTimePointConverter = new RtToTimePointConverter(run, spectrumCache);
spectrumExtractor = new SpectrumExtractor(run, spectrumCache);
}
示例12: OnDelegate
public static Run OnDelegate(SimpleEvent aDelegate, System.Action aAction)
{
var tmp = new Run();
tmp.action = _RunOnDelegate(tmp, aDelegate, aAction);
tmp.Start();
return tmp;
}
示例13: Lerp
public static Run Lerp(float aDuration, System.Action<float> aAction)
{
var tmp = new Run();
tmp.action = _RunLerp(tmp, aDuration, aAction);
tmp.Start();
return tmp;
}
示例14: Coroutine
public static Run Coroutine(IEnumerator aCoroutine)
{
var tmp = new Run();
tmp.action = _Coroutine(tmp, aCoroutine);
tmp.Start();
return tmp;
}
示例15: saveDOC
//Main class function, export the mutationList to DOCX file, sets file name to patient's testName.
public static void saveDOC(Patient patient, List<Mutation> mutationList, bool includePersonalDetails)
{
WordprocessingDocument myDoc = null;
string fullPath = Properties.Settings.Default.ExportSavePath + @"\" + patient.TestName;
if (includePersonalDetails)
fullPath += "_withDetails";
fullPath += ".docx";
try
{
myDoc = WordprocessingDocument.Create(fullPath, WordprocessingDocumentType.Document);
}
catch(IOException )
{
throw ;
}
MainDocumentPart mainPart = myDoc.AddMainDocumentPart();
mainPart.Document = new Document();
Body body = new Body();
Paragraph paragraph = new Paragraph();
Run run_paragraph = new Run();
paragraph.Append(run_paragraph);
//add paragraph for each detail of the patient.
body.Append(generateParagraph("Test Name",true));
body.Append(generateParagraph(patient.TestName,false));
//add personal details of the patien, if includePersonalDetails=true
if (includePersonalDetails)
{
body.Append(generateParagraph("ID", true));
body.Append(generateParagraph(patient.PatientID, false));
body.Append(generateParagraph("First Name", true));
body.Append(generateParagraph(patient.FName, false));
body.Append(generateParagraph("Last Name", true));
body.Append(generateParagraph(patient.LName, false));
}
body.Append(generateParagraph("Pathological Number", true));
body.Append(generateParagraph(patient.PathoNum, false));
body.Append(generateParagraph("Run Number", true));
body.Append(generateParagraph(patient.RunNum, false));
body.Append(generateParagraph("Tumour Site", true));
body.Append(generateParagraph(patient.TumourSite, false));
body.Append(generateParagraph("Disease Level", true));
body.Append(generateParagraph(patient.DiseaseLevel, false));
body.Append(generateParagraph("Backgroud", true));
body.Append(generateParagraph(patient.Background, false));
body.Append(generateParagraph("Previous Treatment", true));
body.Append(generateParagraph(patient.PrevTreatment, false));
body.Append(generateParagraph("Current Treatment", true));
body.Append(generateParagraph(patient.CurrTreatment, false));
body.Append(generateParagraph("Conclusion", true));
body.Append(generateParagraph(patient.Conclusion, false));
//Add related mutation of the patient.
CreateTable(body, mutationList);
mainPart.Document.Append(body);
mainPart.Document.Save();
myDoc.Close();
}