void Trace(Bean bean, string subject) { LastBean = bean; if(TraceLog.Length > 0) TraceLog += " "; TraceLog += subject + ":" + bean["id"]; }
public DirtyTrackingTests() { _api = SQLitePortability.CreateApi(); _api.Exec("create table foo(id, a, b)"); _api.Exec("insert into foo values(1, 'initial', 'initial')"); _bean = _api.Load("foo", 1); _api.QueryExecuting += cmd => _queryCount++; }
public void Export() { var bean = new Bean(); bean["id"] = 123; bean.Put("a", 1).Put("b", "abc"); AssertExtensions.Equivalent(bean.Export(), new Dictionary<string, object> { { "id", 123 }, { "a", 1 }, { "b", "abc" } }); Assert.NotSame(bean.Export(), bean.Export()); }
public FormBoxLabel( Bean.BoxBean bean) { InitializeComponent(); this._bean = bean; if (_bean != null) { txtName.Text = _bean.name; txtNumber.Text = _bean.number; txtRFID.Text = _bean.rfid; } }
public void Indexer() { var bean = new Bean(); Assert.Null(bean["x"]); bean["x"] = "123"; Assert.Equal("123", bean["x"]); bean["x"] = null; Assert.Null(bean["x"]); bean["x"] = new Nullable<int>(123); Assert.Equal(123, bean["x"]); }
public FormUser( Bean.UserBean bean) { InitializeComponent(); _user = bean; if (_user != null) { txtName.Text = _user.username; txtPhone.Text = _user.phone; txtRealName.Text = _user.realname; rdbMan.Checked = _user.sex.Equals("男"); ckbDisable.Checked = _user.enable == 1 ? false : true; rdbNormal.Checked = _user.roletype.Equals(Bean.Constant.Role_User) ? true : false; rdbDB.Checked = _user.roletype.Equals(Bean.Constant.Role_Admin) ? true : false; } }
public void Import() { var bean = new Bean(); bean["a"] = 1; bean["b"] = 1; bean["c"] = 1; var data = new Dictionary<string, object> { { "b", 2 }, { "c", null } }; bean.Import(data); Assert.Equal(1, bean["a"]); Assert.Equal(2, bean["b"]); Assert.Equal(null, bean["c"]); data["b"] = "changed"; Assert.Equal(2, bean["b"]); }
public void GetDrityNames() { var bean = new Bean(); Assert.Empty(bean.GetDirtyNames()); bean["a"] = 1; AssertExtensions.Equivalent(new[] { "a" }, bean.GetDirtyNames()); bean["a"] = null; Assert.Empty(bean.GetDirtyNames()); bean["a"] = 1; bean.ForgetDirtyBackup(); Assert.Empty(bean.GetDirtyNames()); bean["a"] = null; AssertExtensions.Equivalent(new[] { "a" }, bean.GetDirtyNames()); }
private static Texture2D GetCardColorFromBeanSuit(Bean bean, Textures textures) { switch(bean.Suit) { case Suit.Blue: return textures.Blue; case Suit.Green: return textures.Green; case Suit.Orange: return textures.Orange; case Suit.Purple: return textures.Purple; case Suit.Red: return textures.Red; case Suit.Silver: return textures.Silver; case Suit.Yellow: return textures.Yellow; default: return textures.Black; } }
private void SetupReplyTo(IInvocableHandlerMethod handler) { string replyTo = null; var method = handler.Method; if (method != null) { var ann = method.GetCustomAttribute <SendToAttribute>(); replyTo = ExtractSendTo(method.ToString(), ann); } if (replyTo == null) { var ann = Bean.GetType().GetCustomAttribute <SendToAttribute>(); replyTo = ExtractSendTo(Bean.GetType().Name, ann); } if (replyTo != null) { // TODO: _handlerSendTo[handler] = PARSER.parseExpression(replyTo, PARSER_CONTEXT); _handlerSendTo[handler] = new ValueExpression <string>(replyTo); } }
private void Modify_Click(object sender, RoutedEventArgs e) { Bean funcV = (Bean)graficas.SelectedItem; Bean funcN = null; if (funciones.SelectedIndex == 0 || funciones.SelectedIndex == 1 || funciones.SelectedIndex == 3 || funciones.SelectedIndex == 5) { funcN = new Bean(cajaNombre.Text, funciones.SelectedIndex, float.Parse(cajaParA.Text), float.Parse(cajaParB.Text), (Color)cajaColor.SelectedColor); vm.ModifyFunction(funcV, funcN, graficas.SelectedIndex); } if (funciones.SelectedIndex == 2) { funcN = new Bean(cajaNombre.Text, funciones.SelectedIndex, float.Parse(cajaParA.Text), (Color)cajaColor.SelectedColor, float.Parse(cajaExponente.Text)); vm.ModifyFunction(funcV, funcN, graficas.SelectedIndex); } if (funciones.SelectedIndex == 4) { funcN = new Bean(cajaNombre.Text, funciones.SelectedIndex, float.Parse(cajaParA.Text), float.Parse(cajaParB.Text), float.Parse(cajaParC.Text), (Color)cajaColor.SelectedColor); vm.ModifyFunction(funcV, funcN, graficas.SelectedIndex); } }
public void Call_WithRef() { var bean = new Bean { foo = 13 }; byte[] actual; using (var ms = new MemoryStream()) using (var writer = new HessianStreamWriter(ms)) { new HessianOutputV1(writer).WriteCall("eq", new object[] { bean, bean }); actual = ms.ToArray(); } var expected = new HessianDataBuilder() // call .WriteChar('c') // version (major version 1, minor 0) .WriteBytes(1, 0) // method name .WriteChar('m').WriteBytes(0, 0x02).WriteUtf8("eq") // arg1 .WriteChar('M') .WriteChar('t').WriteBytes(0, 0x07).WriteUtf8("qa.Bean") // field foo .WriteChar('S').WriteBytes(0, 0x03).WriteUtf8("foo") .WriteChar('I').WriteBytes(0, 0, 0, 0x0D) // end of map .WriteChar('z') // arg2: ref to arg 1 .WriteChar('R').WriteBytes(0, 0, 0, 0) // call end .WriteChar('z') .ToArray(); CollectionAssert.AreEqual(expected, actual); }
//----------------------------------------------------------------------- protected internal override object propertyGet(Bean bean, string propertyName, bool quiet) { switch (propertyName.GetHashCode()) { case 3237038: // info return(((IborFutureSecurity)bean).Info); case 1585636160: // notional return(((IborFutureSecurity)bean).Notional); case -1041950404: // lastTradeDate return(((IborFutureSecurity)bean).LastTradeDate); case 100346066: // index return(((IborFutureSecurity)bean).Index); case -142444: // rounding return(((IborFutureSecurity)bean).Rounding); case 575402001: // currency return(((IborFutureSecurity)bean).Currency); } return(base.propertyGet(bean, propertyName, quiet)); }
private void SetupReplyTo(IInvocableHandlerMethod handler) { string replyTo = null; var method = handler.Method; if (method != null) { var ann = method.GetCustomAttribute <SendToAttribute>(); replyTo = ExtractSendTo(method.ToString(), ann); } if (replyTo == null) { var ann = Bean.GetType().GetCustomAttribute <SendToAttribute>(); replyTo = ExtractSendTo(Bean.GetType().Name, ann); } if (replyTo != null) { throw new NotImplementedException("PARSER"); // _handlerSendTo[handler] = PARSER.parseExpression(replyTo, PARSER_CONTEXT); } }
//----------------------------------------------------------------------- protected internal override object propertyGet(Bean bean, string propertyName, bool quiet) { switch (propertyName.GetHashCode()) { case 2100884654: // volatilitiesName return(((IborCapletFloorletSensitivity)bean).VolatilitiesName); case -1289159373: // expiry return(((IborCapletFloorletSensitivity)bean).Expiry); case -891985998: // strike return(((IborCapletFloorletSensitivity)bean).Strike); case -677145915: // forward return(((IborCapletFloorletSensitivity)bean).Forward); case 575402001: // currency return(((IborCapletFloorletSensitivity)bean).Currency); case 564403871: // sensitivity return(((IborCapletFloorletSensitivity)bean).Sensitivity); } return(base.propertyGet(bean, propertyName, quiet)); }
//----------------------------------------------------------------------- protected internal override object propertyGet(Bean bean, string propertyName, bool quiet) { switch (propertyName.GetHashCode()) { case 1411950943: // xInterpolator return(((GridSurfaceInterpolator)bean).XInterpolator); case -382665134: // xExtrapolatorLeft return(((GridSurfaceInterpolator)bean).XExtrapolatorLeft); case 1027943729: // xExtrapolatorRight return(((GridSurfaceInterpolator)bean).XExtrapolatorRight); case 1118547936: // yInterpolator return(((GridSurfaceInterpolator)bean).YInterpolator); case 970644563: // yExtrapolatorLeft return(((GridSurfaceInterpolator)bean).YExtrapolatorLeft); case 30871376: // yExtrapolatorRight return(((GridSurfaceInterpolator)bean).YExtrapolatorRight); } return(base.propertyGet(bean, propertyName, quiet)); }
//----------------------------------------------------------------------- protected internal override object propertyGet(Bean bean, string propertyName, bool quiet) { switch (propertyName.GetHashCode()) { case -1321546630: // template return(((FxSwapCurveNode)bean).Template); case -1054985843: // fxRateId return(((FxSwapCurveNode)bean).FxRateId); case -566044884: // farForwardPointsId return(((FxSwapCurveNode)bean).FarForwardPointsId); case 102727412: // label return(((FxSwapCurveNode)bean).Label); case 3076014: // date return(((FxSwapCurveNode)bean).Date); case -263699392: // dateOrder return(((FxSwapCurveNode)bean).DateOrder); } return(base.propertyGet(bean, propertyName, quiet)); }
//----------------------------------------------------------------------- protected internal override object propertyGet(Bean bean, string propertyName, bool quiet) { switch (propertyName.GetHashCode()) { case 113107279: // valuationDate return(((ImmutableLegalEntityDiscountingProvider)bean).ValuationDate); case -1749299407: // repoCurveSecurityGroups return(((ImmutableLegalEntityDiscountingProvider)bean).RepoCurveSecurityGroups); case -1279842095: // repoCurveGroups return(((ImmutableLegalEntityDiscountingProvider)bean).RepoCurveGroups); case 587630454: // repoCurves return(((ImmutableLegalEntityDiscountingProvider)bean).RepoCurves); case 1830129450: // issuerCurveGroups return(((ImmutableLegalEntityDiscountingProvider)bean).IssuerCurveGroups); case -1909076611: // issuerCurves return(((ImmutableLegalEntityDiscountingProvider)bean).IssuerCurves); } return(base.propertyGet(bean, propertyName, quiet)); }
//----------------------------------------------------------------------- protected internal override object propertyGet(Bean bean, string propertyName, bool quiet) { switch (propertyName.GetHashCode()) { case 113107279: // valuationDate return(((ReportCalculationResults)bean).ValuationDate); case -1538277118: // targets return(((ReportCalculationResults)bean).Targets); case 949721053: // columns return(((ReportCalculationResults)bean).Columns); case 2096132333: // calculationResults return(((ReportCalculationResults)bean).CalculationResults); case 1722473170: // calculationFunctions return(((ReportCalculationResults)bean).CalculationFunctions); case 1600456085: // referenceData return(((ReportCalculationResults)bean).ReferenceData); } return(base.propertyGet(bean, propertyName, quiet)); }
//----------------------------------------------------------------------- protected internal override object propertyGet(Bean bean, string propertyName, bool quiet) { switch (propertyName.GetHashCode()) { case 100346066: // index return(((InflationRateSwapLegConvention)bean).Index); case 106898: // lag return(((InflationRateSwapLegConvention)bean).Lag); case -1409010088: // indexCalculationMethod return(((InflationRateSwapLegConvention)bean).IndexCalculationMethod); case -159410813: // notionalExchange return(((InflationRateSwapLegConvention)bean).NotionalExchange); case -716438393: // paymentDateOffset return(((InflationRateSwapLegConvention)bean).paymentDateOffset); case 896049114: // accrualBusinessDayAdjustment return(((InflationRateSwapLegConvention)bean).accrualBusinessDayAdjustment); } return(base.propertyGet(bean, propertyName, quiet)); }
//----------------------------------------------------------------------- protected internal override object propertyGet(Bean bean, string propertyName, bool quiet) { switch (propertyName.GetHashCode()) { case 3237038: // info return(((OvernightFutureSecurity)bean).Info); case 1585636160: // notional return(((OvernightFutureSecurity)bean).Notional); case -1540322338: // accrualFactor return(((OvernightFutureSecurity)bean).AccrualFactor); case -1041950404: // lastTradeDate return(((OvernightFutureSecurity)bean).LastTradeDate); case -2129778896: // startDate return(((OvernightFutureSecurity)bean).StartDate); case -1607727319: // endDate return(((OvernightFutureSecurity)bean).EndDate); case 100346066: // index return(((OvernightFutureSecurity)bean).Index); case -1335729296: // accrualMethod return(((OvernightFutureSecurity)bean).AccrualMethod); case -142444: // rounding return(((OvernightFutureSecurity)bean).Rounding); case 575402001: // currency return(((OvernightFutureSecurity)bean).Currency); } return(base.propertyGet(bean, propertyName, quiet)); }
//----------------------------------------------------------------------- protected internal override object propertyGet(Bean bean, string propertyName, bool quiet) { switch (propertyName.GetHashCode()) { case 100346066: // index return(((OvernightIndexObservation)bean).Index); case 1255202043: // fixingDate return(((OvernightIndexObservation)bean).FixingDate); case 1470566394: // publicationDate return(((OvernightIndexObservation)bean).PublicationDate); case -930389515: // effectiveDate return(((OvernightIndexObservation)bean).EffectiveDate); case -414641441: // maturityDate return(((OvernightIndexObservation)bean).MaturityDate); case -1731780257: // yearFraction return(((OvernightIndexObservation)bean).YearFraction); } return(base.propertyGet(bean, propertyName, quiet)); }
//----------------------------------------------------------------------- protected internal override object propertyGet(Bean bean, string propertyName, bool quiet) { switch (propertyName.GetHashCode()) { case 3237038: // info return(((IborFutureOptionSecurity)bean).Info); case 575402001: // currency return(((IborFutureOptionSecurity)bean).Currency); case -219971059: // putCall return(((IborFutureOptionSecurity)bean).PutCall); case 50946231: // strikePrice return(((IborFutureOptionSecurity)bean).StrikePrice); case -816738431: // expiryDate return(((IborFutureOptionSecurity)bean).ExpiryDate); case -816254304: // expiryTime return(((IborFutureOptionSecurity)bean).ExpiryTime); case -816069761: // expiryZone return(((IborFutureOptionSecurity)bean).ExpiryZone); case -1257652838: // premiumStyle return(((IborFutureOptionSecurity)bean).PremiumStyle); case -142444: // rounding return(((IborFutureOptionSecurity)bean).Rounding); case -109104965: // underlyingFutureId return(((IborFutureOptionSecurity)bean).UnderlyingFutureId); } return(base.propertyGet(bean, propertyName, quiet)); }
//----------------------------------------------------------------------- protected internal override object propertyGet(Bean bean, string propertyName, bool quiet) { switch (propertyName.GetHashCode()) { case 1574023291: // securityId return(((ResolvedBill)bean).SecurityId); case 1585636160: // notional return(((ResolvedBill)bean).Notional); case 1905311443: // dayCount return(((ResolvedBill)bean).DayCount); case -1895216418: // yieldConvention return(((ResolvedBill)bean).YieldConvention); case 866287159: // legalEntityId return(((ResolvedBill)bean).LegalEntityId); case 135924714: // settlementDateOffset return(((ResolvedBill)bean).SettlementDateOffset); } return(base.propertyGet(bean, propertyName, quiet)); }
//----------------------------------------------------------------------- protected internal override object propertyGet(Bean bean, string propertyName, bool quiet) { switch (propertyName.GetHashCode()) { case 575402001: // currency return(((NotionalSchedule)bean).Currency); case -449555555: // fxReset return(((NotionalSchedule)bean).fxReset); case -1413853096: // amount return(((NotionalSchedule)bean).Amount); case -511982201: // initialExchange return(((NotionalSchedule)bean).InitialExchange); case -2147112388: // intermediateExchange return(((NotionalSchedule)bean).IntermediateExchange); case -1048781383: // finalExchange return(((NotionalSchedule)bean).FinalExchange); } return(base.propertyGet(bean, propertyName, quiet)); }
//----------------------------------------------------------------------- protected internal override object propertyGet(Bean bean, string propertyName, bool quiet) { switch (propertyName.GetHashCode()) { case 102727412: // label return(((DepositIsdaCreditCurveNode)bean).Label); case -518800962: // observableId return(((DepositIsdaCreditCurveNode)bean).ObservableId); case 110246592: // tenor return(((DepositIsdaCreditCurveNode)bean).Tenor); case 746995843: // spotDateOffset return(((DepositIsdaCreditCurveNode)bean).SpotDateOffset); case -1065319863: // businessDayAdjustment return(((DepositIsdaCreditCurveNode)bean).BusinessDayAdjustment); case 1905311443: // dayCount return(((DepositIsdaCreditCurveNode)bean).DayCount); } return(base.propertyGet(bean, propertyName, quiet)); }
//----------------------------------------------------------------------- protected internal override object propertyGet(Bean bean, string propertyName, bool quiet) { switch (propertyName.GetHashCode()) { case -450004177: // metadata return(((InterpolatedNodalCurve)bean).Metadata); case 1681280954: // xValues return(((InterpolatedNodalCurve)bean).XValues); case -1726182661: // yValues return(((InterpolatedNodalCurve)bean).YValues); case 2096253127: // interpolator return(((InterpolatedNodalCurve)bean).Interpolator); case 1271703994: // extrapolatorLeft return(((InterpolatedNodalCurve)bean).ExtrapolatorLeft); case 773779145: // extrapolatorRight return(((InterpolatedNodalCurve)bean).ExtrapolatorRight); } return(base.propertyGet(bean, propertyName, quiet)); }
//----------------------------------------------------------------------- protected internal override object propertyGet(Bean bean, string propertyName, bool quiet) { switch (propertyName.GetHashCode()) { case 575402001: // currency return(((ResolvedTermDeposit)bean).Currency); case 1585636160: // notional return(((ResolvedTermDeposit)bean).Notional); case -2129778896: // startDate return(((ResolvedTermDeposit)bean).StartDate); case -1607727319: // endDate return(((ResolvedTermDeposit)bean).EndDate); case -1731780257: // yearFraction return(((ResolvedTermDeposit)bean).YearFraction); case 3493088: // rate return(((ResolvedTermDeposit)bean).Rate); } return(base.propertyGet(bean, propertyName, quiet)); }
//----------------------------------------------------------------------- protected internal override object propertyGet(Bean bean, string propertyName, bool quiet) { switch (propertyName.GetHashCode()) { case -1321546630: // template return(((FixedIborSwapCurveNode)bean).Template); case -938107365: // rateId return(((FixedIborSwapCurveNode)bean).RateId); case 291232890: // additionalSpread return(((FixedIborSwapCurveNode)bean).AdditionalSpread); case 102727412: // label return(((FixedIborSwapCurveNode)bean).Label); case 3076014: // date return(((FixedIborSwapCurveNode)bean).Date); case -263699392: // dateOrder return(((FixedIborSwapCurveNode)bean).DateOrder); } return(base.propertyGet(bean, propertyName, quiet)); }
//----------------------------------------------------------------------- protected internal override object propertyGet(Bean bean, string propertyName, bool quiet) { switch (propertyName.GetHashCode()) { case 2100884654: // volatilitiesName return(((SwaptionSabrSensitivity)bean).VolatilitiesName); case -1289159373: // expiry return(((SwaptionSabrSensitivity)bean).Expiry); case 110246592: // tenor return(((SwaptionSabrSensitivity)bean).Tenor); case 1598929529: // sensitivityType return(((SwaptionSabrSensitivity)bean).SensitivityType); case 575402001: // currency return(((SwaptionSabrSensitivity)bean).Currency); case 564403871: // sensitivity return(((SwaptionSabrSensitivity)bean).Sensitivity); } return(base.propertyGet(bean, propertyName, quiet)); }
//----------------------------------------------------------------------- protected internal override object propertyGet(Bean bean, string propertyName, bool quiet) { switch (propertyName.GetHashCode()) { case 1574023291: // securityId return(((ResolvedIborFuture)bean).SecurityId); case 575402001: // currency return(((ResolvedIborFuture)bean).Currency); case 1585636160: // notional return(((ResolvedIborFuture)bean).Notional); case -1540322338: // accrualFactor return(((ResolvedIborFuture)bean).AccrualFactor); case -1621804100: // iborRate return(((ResolvedIborFuture)bean).IborRate); case -142444: // rounding return(((ResolvedIborFuture)bean).Rounding); } return(base.propertyGet(bean, propertyName, quiet)); }
//----------------------------------------------------------------------- protected internal override object propertyGet(Bean bean, string propertyName, bool quiet) { switch (propertyName.GetHashCode()) { case 116685664: // longShort return(((Swaption)bean).LongShort); case -1937554512: // swaptionSettlement return(((Swaption)bean).SwaptionSettlement); case -816738431: // expiryDate return(((Swaption)bean).ExpiryDate); case -816254304: // expiryTime return(((Swaption)bean).ExpiryTime); case -816069761: // expiryZone return(((Swaption)bean).ExpiryZone); case -1770633379: // underlying return(((Swaption)bean).Underlying); } return(base.propertyGet(bean, propertyName, quiet)); }
//----------------------------------------------------------------------- protected internal override object propertyGet(Bean bean, string propertyName, bool quiet) { switch (propertyName.GetHashCode()) { case -1321546630: // template return(((CdsIsdaCreditCurveNode)bean).Template); case 102727412: // label return(((CdsIsdaCreditCurveNode)bean).Label); case -518800962: // observableId return(((CdsIsdaCreditCurveNode)bean).ObservableId); case 866287159: // legalEntityId return(((CdsIsdaCreditCurveNode)bean).LegalEntityId); case 2049149709: // quoteConvention return(((CdsIsdaCreditCurveNode)bean).QuoteConvention); case 747425396: // fixedRate return(((CdsIsdaCreditCurveNode)bean).fixedRate); } return(base.propertyGet(bean, propertyName, quiet)); }
public override void AfterTrash(Bean bean) { Trace(bean, "at"); }
public Card(Bean bean, Rectangle position, Textures textures) : base(position, GetCardColorFromBeanSuit(bean, textures)) { this.bean = bean; this.digit = textures.GetDigit(bean.Rank); }
public override void BeforeLoad(Bean bean) { Trace(bean, "bl"); }
public override void BeforeStore(Bean bean) { Trace(bean, "bs"); }
protected void EditBean(Bean.FloorBean bean) { FormFloorLabel form = new FormFloorLabel(bean); form.OnRefreshData += form_OnRefreshData; form.StartPosition = FormStartPosition.CenterParent; form.ShowDialog(); }
protected void ResetPassword(Bean.UserBean model) { DialogResult result = MessageBox.Show("您确定要重置【" + model.username + "】用户的密码吗?", "询问", MessageBoxButtons.OKCancel); if (result != System.Windows.Forms.DialogResult.OK) return; if (backgroundWorker3.IsBusy) return; panelLoading.Visible = true; panelLoading.BringToFront(); lblLoadingText.Text = "正在重置密码,请稍等......"; panelLoading.Location = new Point((this.Width / 2 - this.panelLoading.Width / 2), this.Height / 2 - this.panelLoading.Height - 20); backgroundWorker3.RunWorkerAsync(model); }
protected void EditUser(Bean.UserBean bean) { FormUser form = new FormUser(bean); form.StartPosition = FormStartPosition.CenterParent; form.OnRefresh += form_OnRefresh; form.ShowDialog(); }
public virtual void BeforeTrash(Bean bean) { }
public virtual void BeforeStore(Bean bean) { }
public virtual void BeforeLoad(Bean bean) { }
public override void AfterStore(Bean bean) { Trace(bean, "as"); }
protected void SetPosition( Bean.BoxBean bean ) { FormFloorList form = new FormFloorList("选择层架"); form.Text = "请选择所属层架 档案盒:"+ bean.name; form.WindowState = FormWindowState.Normal; form.StartPosition = FormStartPosition.CenterParent; DialogResult result = form.ShowDialog(); if (result != System.Windows.Forms.DialogResult.OK) return; Bean.FloorBean floor = form.SelectedFloorLabel; if (floor == null) return; if (backgroundWorker3.IsBusy) return; panelLoading.Visible = true; panelLoading.BringToFront(); panelLoading.Location = new Point((this.Width / 2 - this.panelLoading.Width / 2), this.Height / 2 - this.panelLoading.Height - 20); lblLoadingText.Text = "正在请求设置层架操作,请稍等......"; PositionConfig config = new PositionConfig(); config.floorrfid = floor.rfid; config.boxrfid = bean.rfid; backgroundWorker3.RunWorkerAsync(config); }
/// <summary> /// Test a bean equals method for the primary purpose of increasing test coverage. /// <para> /// The two beans passed in should contain a different value for each property. /// The method creates a cross-product to ensure test coverage of equals. /// /// </para> /// </summary> /// <param name="bean1"> the first bean to test </param> /// <param name="bean2"> the second bean to test </param> public static void coverBeanEquals(Bean bean1, Bean bean2) { JodaBeanTests.coverBeanEquals(bean1, bean2); }
protected void DeleteFloorLabel( Bean.FloorBean bean ) { if (backgroundWorker2.IsBusy) return; panelLoading.Visible = true; panelLoading.BringToFront(); lblLoadingText.Text = "正在请求删除操作,请稍等......"; panelLoading.Location = new Point((this.Width / 2 - this.panelLoading.Width / 2), this.Height / 2 - this.panelLoading.Height - 20); backgroundWorker2.RunWorkerAsync(bean); }
public override void AfterLoad(Bean bean) { Trace(bean, "al"); }
public void AddBean(Bean bean) { Beans.Add(bean.Name, bean); }
public Bean AddBean(Bean bean) { _context.Bean.Add(bean); _context.SaveChanges(); return bean; }
public void InitMember3() { row = data3.GetLength(0); col = data3.GetLength(1); map = new Block[row, col]; for (int i = 0; i < row; i++) { for (int j = 0; j < col; j++) { if (data3[i, j] == 0) { map[i, j] = new Empty(i, j); } if (data3[i, j] == 1) { map[i, j] = new Wall(i, j); } if (data3[i, j] == 2) { map[i, j] = new Bean(i, j); beanNum++; } } } pacman = new Pacman(1, 1); monster[0] = new Monster(7, 2); monster[1] = new Monster(6, 1); monster[2] = new Monster(8, 10); }
public void AddCopyBeanIfRemovedResult(Bean bean, CheckResult result) { CopyBeanIfRemoved.Add(bean, result); }
public virtual void AfterDispense(Bean bean) { }
public override void BeforeTrash(Bean bean) { Trace(bean, "bt"); }
/// <summary> /// var可能增加,也可能删除,所以兼容仅判断var.id相同的。 /// 并且和谁比较谁没有关系。 /// </summary> /// <param name="other"></param> /// <returns></returns> public override bool IsCompatible(Type other, Context context, Action <Bean> Update, Action <Bean> UpdateVariable) { if (other == null) { return(false); } if (other is Bean beanOther) { CheckResult result = context.GetCheckResult(beanOther, this); if (null != result) { result.AddUpdate(Update, UpdateVariable); return(true); } result = new CheckResult() { Bean = this }; // result在后面可能被更新。 context.AddCheckResult(beanOther, this, result); List <Variable> Deleteds = new List <Variable>(); foreach (var vOther in beanOther.Variables.Values) { if (Variables.TryGetValue(vOther.Id, out var vThis)) { if (vThis.Deleted) { // bean 可能被多个地方使用,前面比较的时候,创建或者复制了被删除的变量。 // 所以可能存在已经被删除var,这个时候忽略比较就行了。 continue; } if (vOther.Deleted) { if (context.Config.AllowSchemasReuseVariableIdWithSameType && vThis.IsCompatible(vOther, context)) { // 反悔 continue; } // 重用了已经被删除的var。此时vOther.Type也是null。 logger.Error("Not Compatible. bean={0} variable={1} Can Not Reuse Deleted Variable.Id", Name, vThis.Name); return(false); } if (false == vThis.IsCompatible(vOther, context)) { logger.Error("Not Compatible. bean={0} variable={1}", Name, vOther.Name); return(false); } } else { // 新删除或以前删除的都创建一个新的。 Deleteds.Add(new Variable() { Id = vOther.Id, Name = vOther.Name, TypeName = vOther.TypeName, KeyName = vOther.KeyName, ValueName = vOther.ValueName, Type = vOther.Type, Deleted = true, }); } } // 限制beankey的var只能增加,不能减少。 // 如果发生了Bean和BeanKey改变,忽略这个检查。 // 如果没有被真正当作Key,忽略这个检查。 if (IsBeanKey && KeyRefCount > 0 && beanOther.IsBeanKey && beanOther.KeyRefCount > 0) { if (Variables.Count < beanOther.Variables.Count) { logger.Error("Not Compatible. beankey={0} Variables.Count < DB.Variables.Count,Must Be Reduced", Name); return(false); } foreach (var vOther in beanOther.Variables.Values) { if (vOther.Deleted) { // 当作Key前允许删除变量,所以可能存在已经被删除的变量。 continue; } if (false == Variables.TryGetValue(vOther.Id, out var _)) { // 被当作Key以后就不能再删除变量了。 logger.Error("Not Compatible. beankey={0} variable={1} Not Exist", Name, vOther.Name); return(false); } } } if (Deleteds.Count > 0) { Bean newBean = ShadowCopy(context); context.Current.AddBean(newBean); result.Bean = newBean; result.AddUpdate(Update, UpdateVariable); foreach (var vDelete in Deleteds) { vDelete.TryCopyBeanIfRemoved(context); newBean.Variables.Add(vDelete.Id, vDelete); } } return(true); } return(false); }
public virtual void AfterLoad(Bean bean) { }
public override void AfterDispense(Bean bean) { bean.Api = _api; }
public virtual void AfterStore(Bean bean) { }
public DefBean(Bean b) : base(b) { }
public virtual void AfterTrash(Bean bean) { }