当前位置: 首页>>代码示例>>C#>>正文


C# Flow类代码示例

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


Flow类属于命名空间,在下文中一共展示了Flow类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Test2

        public void Test2()
        {
            var dc = new DataContext();
            dc.AddTable("data", new[] {
                new Item { Name="1", Value = 2, G="1" },
                new Item { Name="2", Value = 3, G="1" },
                new Item { Name="3", Value = 4, G="2" }
            });

            var flow = new Flow { Orientation = FlowOrientation.Vertical };
            flow.AddTable<Item>("data");

            var rep = Report.CreateReport(flow, dc);
            var cells = ReportUtil.GetCellMatrix(rep);

            //RowNumber
            Assert.AreEqual(1, cells[0][0].Value);
            Assert.AreEqual(2, cells[1][0].Value);
            Assert.AreEqual(1, cells[2][0].Value);

            //G2
            Assert.AreEqual(1, cells[2][0].Value);

            //Accumulator
            Assert.AreEqual(2, cells[0][2].Value);
            Assert.AreEqual(5, cells[1][2].Value);
            //G2
            Assert.AreEqual(4, cells[2][2].Value);
        }
开发者ID:elea30,项目名称:codereports,代码行数:29,代码来源:CellDisplayModeTests.cs

示例2: DefineDemoQuerySteps

 private static Flow DefineDemoQuerySteps()
 {
     var retVal = new Flow();
     retVal.Add(new Step("10", "Enter the name of the connection string", "Plugin.ConsoleUI.PublishStringFromUI"));
     retVal.Add(new Step("20", "Get the connection string", "Plugin.DataHelper.PublishConnectionString",
                         new[] { new Parameter("String", "10", 0) }));
     retVal.Add(new Step("30", "Parse the connection string", "Plugin.DataHelper.ParseConnectionString",
                         new[] { new Parameter("Connection String", "20", 0), }));
     retVal.Add(new Step("40", "Build DB verification string", "Plugin.DataHelper.PublishSanitisedConnectionStringForVerification",
                         new[] { new Parameter("Connection String Parts", "30", 0), }));
     retVal.Add(new Step("50", "Confirm DB", "Plugin.ConsoleUI.Confirm",
                         new[] { new Parameter("String", "40", 0), }));
     retVal.Add(new Step("60", "Publish demo row action", "Plugin.Demo.Query.PublishRowActionForQuery1"));
     retVal.Add(new Step("80", "Get the query", "Plugin.DataHelper.PublishQuery",
                         new[]
                             {
                                 new Parameter("String", "60", 0),
                                 new Parameter("Configuration Info", "60", 0),
                             }));
     retVal.Add(new Step("90", "Run the query", "Plugin.DataHelper.PerformActionOnEveryRow",
                         new[]
                             {
                                 new Parameter("Row Action", "60", 0),
                                 new Parameter("Connection String", "20", 0),
                                 new Parameter("Query Definition", "80", 0),
                             }));
     return retVal;
 }
开发者ID:panos-parisis,项目名称:Hypatia,代码行数:28,代码来源:DemoFlowBuilder.cs

示例3: BiggestCountries

        public static Report BiggestCountries()
        {
            var dc = new DataContext();
            var data = new Dictionary<string, GdpItem>();
            var src = Pecunia.Services.GdpDataProvider.GetData();
            var lastYear = src.Max(a=>a.Year);
            foreach (var item in src)
            {
                GdpItem i;
                if (!data.TryGetValue(item.Country, out i))
                    data.Add(item.Country, i = new GdpItem { Country = item.Country });
                i.Process(lastYear, item);
            }

            var res = data.Values.ToArray();
            dc.AddTable("data", res);

            var table = TableGenerator.GetTable(typeof(GdpItem), "data");
            table.Columns.Last().SortIndex = 0;
            table.Columns.Last().SortDirection = SortDirection.Descending;
            for (var i = 0; i < 5; i++)
            {
                table.Columns[i + 2].HeaderText = (lastYear - 4 + i).ToString();
            }

            var flow = new Flow { Orientation = FlowOrientation.Vertical };
            flow.Add(table);

            return Report.CreateReport(flow, dc);
        }
开发者ID:borisdj,项目名称:dextop-pecunia,代码行数:30,代码来源:GdpYearColumns.cs

示例4: Test2

        public void Test2()
        {
            var dc = new DataContext();
            dc.AddTable("data", new[] {
                new Item { Col1="A", Col2 = 2 }
            });

            var flow = new Flow { Orientation = FlowOrientation.Vertical };
            var table = flow.AddTable<Item>("data");
            table.Columns.Single(a => a.DataField == "Col2").ConditionalFormatting = (value) => {
                if (!(value is int))
                    return null;
                var v = (int)value;
                if (v > 0)
                    return new Styling.CellStyle
                    {
                        FontStyle = new Styling.FontStyle
                        {
                            FontColor = Styling.Color.FromHtml("#00FF00")
                        }
                    };
                return null;
            };

            var rep = Report.CreateReport(flow, dc);
            var cells = ReportUtil.GetCellMatrix(rep);

            Assert.IsNull(cells[0][0].CustomStyle);
            Assert.IsNotNull(cells[0][1].CustomStyle);

            var html = HtmlReportWriter.RenderReport(rep, new DefaultHtmlReportTheme());
            Assert.IsTrue(html.Contains("style=\"color:"));
            Assert.IsTrue(html.Contains("#00FF00"));
        }
开发者ID:elea30,项目名称:codereports,代码行数:34,代码来源:ConditionalFormattingTest.cs

示例5: Get

			public Window Get(Flow.Data.FlowWindow window) {

				Window result = null;
				
				this.list.RemoveAll((info) => {
					
					var w = Flow.FlowSystem.GetWindow(info.id);
					return w == null || w.IsSocial() == false;
					
				});

				if (window.IsSocial() == false) return result;

				foreach (var item in this.list) {

					if (item.id == window.id) {

						result = item;
						break;

					}

				}

				if (result == null) {

					result = new Window(window);
					this.list.Add(result);

				}

				return result;

			}
开发者ID:Cyberbanan,项目名称:Unity3d.UI.Windows,代码行数:34,代码来源:SocialSettings.cs

示例6: Execute

        public void Execute(Flow steps)
        {
            string name = string.Empty;
            try
            {
                foreach (var step in steps.OrderedContents)
                {
                    name = step.ActionName;
                    logger.DebugFormat("*** {0} (type={1}) ***", step.Name, step.ActionName);

                    if (BeforeStepExecution != null)
                        BeforeStepExecution(step, EventArgs.Empty);

                    definitions[name].Execute(this, step);

                    if (AfterStepExecution != null)
                        AfterStepExecution(step, EventArgs.Empty);
                }
            }
            catch (KeyNotFoundException)
            {
                logger.ErrorFormat("Action [{0}] was not found in list", name);
                logger.Debug("Actions in list:");
                foreach (var action in definitions)
                    logger.DebugFormat("-> {0}", action.Key);
            }
        }
开发者ID:panos-parisis,项目名称:Hypatia,代码行数:27,代码来源:Context.cs

示例7: ODS_Flow_Inserting

    protected void ODS_Flow_Inserting(object sender, ObjectDataSourceMethodEventArgs e)
    {
        flow = (Flow)e.InputParameters[0];

        Controls_TextBox tbRefFlow = (Controls_TextBox)this.FV_Flow.FindControl("tbRefFlow");
        Controls_TextBox tbPartyFrom = (Controls_TextBox)this.FV_Flow.FindControl("tbPartyFrom");
        Controls_TextBox tbLocFrom = (Controls_TextBox)this.FV_Flow.FindControl("tbLocFrom");
        Controls_TextBox tbLocTo = (Controls_TextBox)this.FV_Flow.FindControl("tbLocTo");
        com.Sconit.Control.CodeMstrDropDownList ddlOrderTemplate = (com.Sconit.Control.CodeMstrDropDownList)(this.FV_Flow.FindControl("ddlOrderTemplate"));
        com.Sconit.Control.CodeMstrDropDownList ddlReceiptTemplate = (com.Sconit.Control.CodeMstrDropDownList)(this.FV_Flow.FindControl("ddlReceiptTemplate"));
        //com.Sconit.Control.CodeMstrDropDownList ddlHuTemplate = (com.Sconit.Control.CodeMstrDropDownList)(this.FV_Flow.FindControl("ddlHuTemplate"));
        
        com.Sconit.Control.CodeMstrDropDownList ddlCreateHuOption = (com.Sconit.Control.CodeMstrDropDownList)this.FV_Flow.FindControl("ddlCreateHuOption");

        if (tbRefFlow != null && tbRefFlow.Text.Trim() != string.Empty)
        {
            flow.ReferenceFlow = TheFlowMgr.CheckAndLoadFlow(tbRefFlow.Text.Trim()).Code;
        }

        if (tbPartyFrom != null && tbPartyFrom.Text.Trim() != string.Empty)
        {
            flow.PartyFrom = ThePartyMgr.LoadParty(tbPartyFrom.Text.Trim());
        }

        if (tbLocFrom != null && tbLocFrom.Text.Trim() != string.Empty)
        {
            flow.LocationFrom = TheLocationMgr.LoadLocation(tbLocFrom.Text.Trim());
        }
        if (tbLocTo != null && tbLocTo.Text.Trim() != string.Empty)
        {
            flow.LocationTo = TheLocationMgr.LoadLocation(tbLocTo.Text.Trim());
        }
        if (ddlOrderTemplate.SelectedIndex != -1)
        {
            flow.OrderTemplate = ddlOrderTemplate.SelectedValue;
        }
        if (ddlReceiptTemplate.SelectedIndex != -1)
        {
            flow.ReceiptTemplate = ddlReceiptTemplate.SelectedValue;
        }
        //if (ddlHuTemplate.SelectedIndex != -1)
        //{
        //    flow.HuTemplate = ddlHuTemplate.SelectedValue;
        //}
        if (ddlCreateHuOption.SelectedIndex != -1)
        {
            flow.CreateHuOption = ddlCreateHuOption.SelectedValue;
        }
        flow.CheckDetailOption = BusinessConstants.CODE_MASTER_CHECK_ORDER_DETAIL_OPTION_VALUE_NOT_CHECK;
        flow.Type = BusinessConstants.CODE_MASTER_FLOW_TYPE_VALUE_PRODUCTION;
        flow.AntiResolveHu = BusinessConstants.CODE_MASTER_ANTI_RESOLVE_HU_VALUE_NOT_RESOLVE;
        flow.BillSettleTerm = null;
        flow.PartyTo = flow.PartyFrom;
        flow.CreateUser = this.CurrentUser;
        flow.CreateDate = DateTime.Now;
        flow.LastModifyUser = this.CurrentUser;
        flow.LastModifyDate = DateTime.Now;
        flow.IsAsnUniqueReceipt = true;
    }
开发者ID:Novthirteen,项目名称:sconit_timesseiko,代码行数:59,代码来源:New.ascx.cs

示例8: QueueElement

 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="elem">Object to be queued</param>
 /// <param name="btime">Time it will take to finish it's buissines</param>
 /// <param name="term">Term created for calendar callback</param>
 public QueueElement(IQueueable elem, uint btime, uint timecame, Flow.Calendar.Term term, DESF.Flow.Event.Event ev)
 {
     _element = elem;
     _blockingTime = btime;
     _timeCame = timecame;
     _term = term;
     _event = ev;
 }
开发者ID:PJK,项目名称:Discrete-Event-Simulation-Framework,代码行数:14,代码来源:SimpleQueue.cs

示例9: ConnectingPolymorphicTypes

 public void ConnectingPolymorphicTypes()
 {
     StartPoint<B> s = new StartPoint<B>((IWritableQueue<B> q) => q.Send(new B()));
     EndPoint<A> e = new EndPoint<A>((A q) => { });
     Flow flow = new Flow();
     flow.AddNode(s);
     flow.AddNode(e);
     flow.ConnectNodes(s, e, 0);
 }
开发者ID:Teun,项目名称:BatchFlow,代码行数:9,代码来源:Exceptions.cs

示例10: InternalListOfStepsIsNeverNull

        public void InternalListOfStepsIsNeverNull()
        {
            // Arrange
            var x = new Flow();

            // Act

            // Assert
            Assert.AreEqual(0, x.Count);
        }
开发者ID:panos-parisis,项目名称:Hypatia,代码行数:10,代码来源:FlowTests.cs

示例11: CtorWorks

        public void CtorWorks()
        {
            // Arrange
            var x = new Flow();

            // Act

            // Assert
            Assert.IsNotNull(x);
        }
开发者ID:panos-parisis,项目名称:Hypatia,代码行数:10,代码来源:FlowTests.cs

示例12: ReadExistingFlow

 public Flow ReadExistingFlow(Flow steps)
 {
     if (File.Exists(FileName))
         using (var rd = new StreamReader(FileName, Encoding.UTF8))
         {
             string xml = rd.ReadToEnd();
             steps = xml.FromXml<Flow>();
         }
     return steps;
 }
开发者ID:panos-parisis,项目名称:Hypatia,代码行数:10,代码来源:FlowIO.cs

示例13: Teardown

        /// <summary>
        /// <see cref="ICase.Teardown"/>
        /// </summary>
        public void Teardown(Flow holder)
        {
            Flow backup = Flow.CurrentFlow;
            Flow.CurrentFlow = holder;

            TeardownInternal();

            Flow.CurrentFlow = backup;

            Dispose();  // EventSink.Dispose()
        }
开发者ID:jaykang920,项目名称:x2clr,代码行数:14,代码来源:Case.cs

示例14: TearDown

        /// <summary>
        /// Cleans up this case with the specified holding flow.
        /// </summary>
        public void TearDown(Flow holder)
        {
            Flow backup = Flow.CurrentFlow;
            Flow.CurrentFlow = holder;

            TearDown();

            Flow.CurrentFlow = backup;

            Dispose();
        }
开发者ID:gitter-badger,项目名称:x2clr,代码行数:14,代码来源:Case.cs

示例15: SetUp

        /// <summary>
        /// Initializes this case with the specified holding flow.
        /// </summary>
        public void SetUp(Flow holder)
        {
            Flow = holder;

            Flow backup = Flow.CurrentFlow;
            Flow.CurrentFlow = holder;

            SetUp();

            Flow.CurrentFlow = backup;
        }
开发者ID:gitter-badger,项目名称:x2clr,代码行数:14,代码来源:Case.cs


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