本文整理汇总了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);
}
示例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;
}
示例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);
}
示例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"));
}
示例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;
}
示例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);
}
}
示例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;
}
示例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;
}
示例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);
}
示例10: InternalListOfStepsIsNeverNull
public void InternalListOfStepsIsNeverNull()
{
// Arrange
var x = new Flow();
// Act
// Assert
Assert.AreEqual(0, x.Count);
}
示例11: CtorWorks
public void CtorWorks()
{
// Arrange
var x = new Flow();
// Act
// Assert
Assert.IsNotNull(x);
}
示例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;
}
示例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()
}
示例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();
}
示例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;
}