public void AddHist(int nBins, Color color, ListFunction allDataFunc, string xAxis) { graphs.Add(new HistogramPrototype(nBins, color, xAxis)); void function(GraphDataPacket ds) { ds.AddSet(allDataFunc()); } updatingFunctions.AddFunction(function); }
public void AddLeaderBoard(IEnumerable <LeaderBarPrototype> leaderBars, ListFunction function) { graphs.Add(new LeaderBoardPrototype(leaderBars)); void newFunction(GraphDataPacket ds) { ds.AddSet(function()); } updatingFunctions.AddFunction(newFunction); }
/// <summary> /// 删除一个函数 /// </summary> /// <param name="Title">函数的名字</param> public bool DelPicFunctionPage(PicFunctionTabPage function) { try { ///从函数列表删除一个函数 ListFunction.Remove(function); return(true); }catch (Exception ex) { LoggerHelp.WriteLogger(ex.ToString()); MessageBox.Show("删除函数出错"); return(false); } }
public void AddHist(int nBins, Color color, ListFunction allDataFunc, string xAxis) { var hist = new Histogram(nBins, color, xAxis); Graph graph = new Graph(hist); void function(DataSource ds) { ds.AddSet(allDataFunc()); } updatingCollection.AddContainer(new UpdatingContainer(hist, function)); updatingFunctions.AddFunction(function); Graphs.AddGraph(graph); }
/// <summary> /// 从文件加载函数 /// </summary> /// <param name="Title">函数名</param> /// <param name="ID">ID</param> public PicFunctionTabPage LoadFunctionPage(string Title, int ID, OpenType opentype, OverrideType overridetype) { foreach (PicFunctionTabPage fun in ListFunction) { if (fun.Title == Title) { return(null); } } PicFunctionTabPage function = new PicFunctionTabPage(ID, this.CallBackFunction, Title); function.MyOpenType = opentype; function.MyOverride = overridetype; ListFunction.Add(function); return(function); }
public async Task TestFunction() { var function = new ListFunction(RegionEndpoint.EUWest1, EnvironmentEnum.Dev); var response = await function.FunctionHandlerAsync(new Amazon.Lambda.APIGatewayEvents.APIGatewayProxyRequest { }); var repository = function.ServiceProvider.GetRequiredService <IFarmRepository>(); var farms = JsonSerializer.Deserialize <List <Farm> >(response.Body); var dbFarms = await repository.ListAllAsync(); Assert.Equal(dbFarms.Count, farms.Count); Assert.Equal(dbFarms[0].Name, farms[0].Name); Assert.Equal(dbFarms[0].Town, farms[0].Town); Assert.Equal(dbFarms[0].County, farms[0].County); Assert.Equal(dbFarms[0].Postcode, farms[0].Postcode); }
/// <summary> /// 載入Functions 建立Tab /// </summary> private void LoadFunctions() { var queryFunctions = from qf in dde.Functions where qf.Function_IsEnable == true select qf; if (queryFunctions.Count() > 0) { foreach (var qf in queryFunctions) { TabItem fTabItem = new TabItem { Header = qf.Function_Title, Uid = qf.Function_ID.ToString() }; switch (fTabItem.Uid) { case "1": if (lf == null) { lf = new ListFunction(Agencys, ShowImages); } break; case "2": if (tf == null) { tf = new TemplateFunction(Agencys, Patients, ShowImages); tf.ReturnValueCallback += new TemplateFunction.ReturnValueDelegate(RenewUsercontrol); } break; } if (qf.Function_ID == Agencys.Function_ID) { FunctionsTabItem = fTabItem; } if (FunctionsTab == null) { FunctionsTab = new ObservableCollection <TabItem>(); } FunctionsTab.Add(fTabItem); } } }
private void btnRename_Click(object sender, EventArgs e) { btnRename.Enabled = false; string oldfilePath = gi.Tag; string newfilePath = ListFunction.renameAlbum(gi.Tag); if (!String.IsNullOrEmpty(newfilePath) && !oldfilePath.Equals(newfilePath)) { List <DbParameter> paramList = new List <DbParameter>(); paramList.Add(new SQLiteParameter("OldFilePath", oldfilePath)); paramList.Add(new SQLiteParameter("NewFilePath", newfilePath)); SQLiteManager.Instance.executeNonQuery(SQLResource.SQL028, paramList); txtArchivePath.Text = newfilePath; gi.Tag = newfilePath; } btnRename.Enabled = true; }
/// <summary> /// 创建一个函数 /// </summary> /// <param name="Title">函数的名字</param> public bool CreatePicFunctionPage(string Title) { foreach (PicFunctionTabPage fun in ListFunction) { if (fun.Title == Title) { return(false); } } PicFunctionTabPage function = new PicFunctionTabPage(1, this.CallBackFunction, Title); ///给函数里面的函数代码创建数据 ObservableCollection <MyXTreeItem> funcitondata = new ObservableCollection <MyXTreeItem>(); foreach (MyXTreeItem item in PopContentCode.MyData) { funcitondata.Add(item); } ///函数属性更新事件 function.XAributeChangeMessage = (tcp) => { XObjectData tcpmessagedata = new XObjectData(tcp); tcpmessagedata.additional_Information = MessageOption.Update.ToString(); ///消息回调 MessageUpdateCall(this, MouseState.XUpdateTreeViewData, tcpmessagedata); }; ///绑定数据 function.PopContentCode.MyData = funcitondata; ListFunction.Add(function); ///通知更新数据 MessageOption option = MessageOption.Add; XObjectData messagedata = new XObjectData(function); messagedata.additional_Information = option.ToString(); MessageUpdateCall(this, MouseState.XUpdateTreeViewData, messagedata); return(true); }