• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Run类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Run的典型用法代码示例。如果您正苦于以下问题:C# Run类的具体用法?C# Run怎么用?C# Run使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Run类属于命名空间,在下文中一共展示了Run类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
        }
开发者ID:aspose-words,项目名称:Aspose.Words-for-.NET,代码行数:29,代码来源:ExFont.cs


示例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;
            }
开发者ID:aspose-words,项目名称:Aspose.Words-for-.NET,代码行数:10,代码来源:ExtractContentUsingDocumentVisitor.cs


示例3: TicGenerator

 public TicGenerator(Run run, SpectrumCache spectrumCache)
 {
     this.run = run;
     this.spectrumCache = spectrumCache;
     spectrumExtractor = new SpectrumExtractor(run, spectrumCache);
     ticCache = new TicCache();
 }
开发者ID:pol,项目名称:MassSpecStudio,代码行数:7,代码来源:TicGenerator.cs


示例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);
        }
开发者ID:Jaykul,项目名称:pickles,代码行数:25,代码来源:BodyExtensions.cs


示例5: GenerateRun

 protected Run GenerateRun(RunProperties runProperties, string text)
 {
     SetFontRunProperties(runProperties);
     var run = new Run() { RunProperties = runProperties };
     run.AppendChild(new Text(text));
     return run;
 }
开发者ID:kateEvstratenko,项目名称:Bank,代码行数:7,代码来源:BaseDocService.cs


示例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;
        }
开发者ID:Rezura,项目名称:LiveSplit,代码行数:34,代码来源:ShitSplitRunFactory.cs


示例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;
        }
开发者ID:scintillating7,项目名称:BitSetsNet,代码行数:35,代码来源:RLEBitset.cs


示例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;
        }
开发者ID:PrototypeAlpha,项目名称:LiveSplit,代码行数:27,代码来源:SplittyRunFactory.cs


示例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;
			}
		}
开发者ID:kannan-ar,项目名称:MariGold.OpenXHTML,代码行数:30,代码来源:DocxRunStyle.cs


示例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;
        }
开发者ID:aspose-words,项目名称:Aspose.Words-for-.NET,代码行数:7,代码来源:FieldsHelper.cs


示例11: AveragedSpectrumExtractor

 public AveragedSpectrumExtractor(Run run, SpectrumCache spectrumCache)
 {
     this.run = run;
     this.spectrumCache = spectrumCache;
     rtToTimePointConverter = new RtToTimePointConverter(run, spectrumCache);
     spectrumExtractor = new SpectrumExtractor(run, spectrumCache);
 }
开发者ID:pol,项目名称:MassSpecStudio,代码行数:7,代码来源:AveragedSpectrumExtractor.cs


示例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;
 }
开发者ID:trongthien18,项目名称:unity-framework,代码行数:7,代码来源:Run.cs


示例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;
 }
开发者ID:trongthien18,项目名称:unity-framework,代码行数:7,代码来源:Run.cs


示例14: Coroutine

 public static Run Coroutine(IEnumerator aCoroutine)
 {
     var tmp = new Run();
     tmp.action = _Coroutine(tmp, aCoroutine);
     tmp.Start();
     return tmp;
 }
开发者ID:trongthien18,项目名称:unity-framework,代码行数:7,代码来源:Run.cs


示例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();
        }
开发者ID:etyemy,项目名称:DNA_Final_Project_2016,代码行数:61,代码来源:DOCExportHandler.cs


示例16: EachFrame

 public static Run EachFrame(System.Action aAction)
 {
     var tmp = new Run();
     tmp.action = _RunEachFrame(tmp, aAction);
     tmp.Start();
     return tmp;
 }
开发者ID:trongthien18,项目名称:race-of-dragons,代码行数:7,代码来源:Run.cs


示例17: CloneElementCorrect

        public void CloneElementCorrect()
        {
            var initial = new Run();
            var cloned = initial.CloneElement();

            Assert.False(ReferenceEquals(initial, cloned));
        }
开发者ID:AlexanderByndyu,项目名称:TabulaRasa,代码行数:7,代码来源:OpenXmlElementExtensionsTests.cs


示例18: Every

 public static Run Every(float aInitialDelay, float aDelay, System.Action aAction)
 {
     var tmp = new Run();
     tmp.action = _RunEvery(tmp, aInitialDelay, aDelay, aAction);
     tmp.Start();
     return tmp;
 }
开发者ID:trongthien18,项目名称:race-of-dragons,代码行数:7,代码来源:Run.cs


示例19: GenerateReportBug

        public static string GenerateReportBug(DBO.BugReport bugReport)
        {
            string docName = System.Web.HttpContext.Current.Server.MapPath("~/download/")+"test.docx";
            using (WordprocessingDocument package = WordprocessingDocument.Create( docName, WordprocessingDocumentType.Document))
            {
                Run run = new Run();

             //besoin de le faire si c'est une creation
                package.AddMainDocumentPart();
                 foreach (string str in bugReport.Comment)
                {
                    run.Append(new Text(str), new Break());
                }
                // Création du document.
                package.MainDocumentPart.Document =
                    new Document(
                        new Body(
                            new Paragraph(
                                new Run(
                                    new Text("Rapport de bug"))),
                                    new Run(
                                        new Text ("Titre :" + bugReport.Title),
                                        new Break(),
                                        new Text ("Personnable responble :" + bugReport.Responsable),
                                        new Break(),
                                        new Text ("Statut :" + bugReport.Statut),
                                        new Break (),
                                        new Text ("commentaire:")
                                        ),run));

                // Enregistrer le contenu dans le document
                package.MainDocumentPart.Document.Save();
                return docName;
            }
        }
开发者ID:yoan-durand,项目名称:TP,代码行数:35,代码来源:GenerateDocx.cs


示例20: _RunEvery

 private static IEnumerator _RunEvery(Run aRun, float aInitialDelay, float aSeconds, System.Action aAction)
 {
     aRun.isDone = false;
     if (aInitialDelay > 0f)
         yield return new WaitForSeconds(aInitialDelay);
     else
     {
         int FrameCount = Mathf.RoundToInt(-aInitialDelay);
         for (int i = 0; i < FrameCount; i++)
             yield return null;
     }
     while (true)
     {
         if (!aRun.abort && aAction != null)
             aAction();
         else
             break;
         if (aSeconds > 0)
             yield return new WaitForSeconds(aSeconds);
         else
         {
             int FrameCount = Mathf.Max(1, Mathf.RoundToInt(-aSeconds));
             for (int i = 0; i < FrameCount; i++)
                 yield return null;
         }
     }
     aRun.isDone = true;
 }
开发者ID:trongthien18,项目名称:race-of-dragons,代码行数:28,代码来源:Run.cs



注:本文中的Run类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# RunFonts类代码示例发布时间:2022-05-24
下一篇:
C# Ruleset类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap