private void TxtInStock_ButtonClick(object sender, EventArgs e) { try { if (this._product == null) { return; } if (int.TryParse(this.txtInStock.Text, out int inStock)) { // Validar cantidad if (inStock <= 0) { throw new Exception("La cantidad debe ser mayor a cero."); } // Validar cantidad disponible. if (this.Filter.WarehouseID != null && inStock > this._product.AvailableQuantity) { throw new Exception("La cantidad no puede ser mayor a la cantidad disponible del producto"); } this.txtInStock.Clear(); OnPush?.Invoke(inStock, this._product); } } catch (Exception ex) { ex.ShowDialog(MessageBoxIcon.Warning); } }
public new T Pop() { T item = base.Pop(); OnPush?.Invoke(); return(item); }
public void GetRepulsed(Vector3 force, ForceMode forceMode = ForceMode.VelocityChange) { if (!IsActive) { return; } OnPush?.Invoke(force); switch (forceMode) { case ForceMode.Acceleration: _rb.AddForce(force, ForceMode.Acceleration); break; case ForceMode.VelocityChange: _rb.AddForce(force, ForceMode.VelocityChange); break; case ForceMode.Impulse: _rb.AddForce(force, ForceMode.Impulse); break; case ForceMode.Force: _rb.AddForce(force, ForceMode.Force); break; } }
// Pool an item public void Push(T obj) { if (obj == null) { return; } OnPush?.Invoke(obj); _pool.Push(obj); }
void Manual() { maxIndex = 1; nowIndex = 0; titleUi.text = "そうさほうほう\nかわずたん\u3000\u3000\u3000\u3000\u3000\u3000\u3000ジョイコン\n<sprite=7>\u3000…いどう\u3000\u3000\u3000\u3000\u3000\u3000 かたむける・ふる\n<sprite=4>\u3000…ジャンプ、決定\u3000\u3000 ZRでほせい\n<sprite=3>\u3000…キャンセル"; onSelecteds[0] = SetButtonPush(StartPlacement); onSelecteds[0] += SetButtonPush(() => nowIndex = 1); onCancel = StartPlacement; onCancel += () => nowIndex = 1; cursor.gameObject.SetActive(false); }
public Button( Canvas canvas, OnPush onPushDelegate, Texture defaultTexture, Texture highlighedTexture, Texture pushedTexture) : base(canvas, defaultTexture, highlighedTexture, pushedTexture) { m_OnPushDelegate = onPushDelegate; }
void VideoOption() { cursor.gameObject.SetActive(true); maxIndex = 2; nowIndex = 0; addIndex = 1; titleUi.text = "がめんせってい\nフルスクリーン\u3000< " + ScreenIsFull() + " >\nかいぞうど < " + ScreenSizeString() + " >"; onSelecteds[0] = SetFullScreen(); onSelecteds[1] = SetScreenSize(); onCancel = Option; onCancel += () => nowIndex = 0; }
void Option() { cursor.gameObject.SetActive(true); titleUi.text = "オプション\nがめんせってい\nおんりょうせってい"; maxIndex = 2; nowIndex = 0; addIndex = 1; onSelecteds[0] = SetButtonPush(VideoOption); onSelecteds[1] = SetButtonPush(BgmOption); onCancel = StartPlacement; onCancel += () => nowIndex = 2; }
public override void Write(CustomFileWriter writer) { bool HasBranchFilter() => OnPushBranchIncludes != null || OnPushBranchExcludes != null || OnPushBranchRegexIncludes != null || OnPushBranchRegexExcludes != null || OnPushPathIncludes != null || OnPushPathExcludes != null; bool HasPathFilter() => OnPushPathIncludes != null || OnPushPathExcludes != null; if (OnPush != null || HasBranchFilter() || HasPathFilter()) { using (writer.WriteBlock("gitPush")) { if (OnPush != null) { writer.WriteLine($"enabled = {OnPush.ToString().ToLowerInvariant()}"); } if (HasBranchFilter()) { using (writer.WriteBlock("branchFilter")) { new[] { OnPushBranchIncludes?.Select(x => $"+{x.DoubleQuote()}"), OnPushBranchExcludes?.Select(x => $"-{x.DoubleQuote()}"), OnPushBranchRegexIncludes?.Select(x => $"+Regex({x.DoubleQuote()})"), OnPushBranchRegexExcludes?.Select(x => $"-Regex({x.DoubleQuote()})") }.WhereNotNull().SelectMany(x => x).ForEach(x => writer.WriteLine(x)); } } if (HasPathFilter()) { using (writer.WriteBlock("pathFilter")) { new[] { OnPushPathIncludes?.Select(x => $"+{x.DoubleQuote()}"), OnPushPathExcludes?.Select(x => $"-{x.DoubleQuote()}") }.WhereNotNull().SelectMany(x => x).ForEach(x => writer.WriteLine(x)); } } } } }
void StartPlacement() { cursor.gameObject.SetActive(true); maxIndex = 4; addIndex = 0; titleUi.text = "スタート\nそうさほうほう\nオプション\nおわる"; onSelecteds = new OnSelected[maxIndex]; onSelecteds[0] = SetButtonPush(StartRocketScene); onSelecteds[1] = SetButtonPush(Manual); onSelecteds[2] = SetButtonPush(Option); onSelecteds[3] = SetButtonPush(Quit); onCancel = null; }
public bool enPool(T obj) { if (obj != null) { OnPush.Invoke(obj); avaliableItems.Enqueue(obj); return(true); } else { return(false); } }
void BgmOption() { cursor.gameObject.SetActive(true); maxIndex = 4; nowIndex = 0; addIndex = 1; audioMixer.GetFloat("MasterVol", out masterVol); audioMixer.GetFloat("BGMVol", out bgmVol); audioMixer.GetFloat("SEVol", out seVol); titleUi.text = "おんりょうせってい … <sprite=7>でへんこう\n全体 < " + (masterVol + 80) + " >\nBGM < " + (bgmVol + 80) + " >\nこうかおん < " + (seVol + 80) + " >\n元にもどす"; onSelecteds[0] = SetMaster(); onSelecteds[1] = SetBGM(); onSelecteds[2] = SetSE(); onSelecteds[3] = SetDefault(); onCancel = Option; onCancel += () => nowIndex = 1; }
public override async Task <PushResponse> Push( IAsyncStreamReader <Rumor> requestStream, ServerCallContext context) { var rumors = new List <Rumor>(); while (!context.CancellationToken.IsCancellationRequested && await requestStream.MoveNext(context.CancellationToken)) { var rumor = requestStream.Current; rumors.Add(rumor); } OnPush?.Invoke(this, new PushRumorEventArgs { Rumors = rumors, }); return(new PushResponse()); }
public override void DidPush() { if (OnPush != null) { OnPush.Invoke(); } if (m_components != null) { foreach (var c in m_components) { c.DidPush(this.m_dataObject); } } //Populate(); //DidShow(); //base.DidPush(); }
private bool Populate(T blueprint, int count, Transform transform = null) { parent = this.parent; T startObj = CreateObject(blueprint); if (startObj == null) { throw new Exception(); } avaliableItems.Enqueue(startObj); OnPush.Invoke(startObj); for (int i = 1; i < count; i++) { startObj = CreateObject(blueprint); avaliableItems.Enqueue(startObj); OnPush.Invoke(startObj); } return(true); }
public virtual void Push(T item) { stack.Push(item); OnPush?.Invoke(item); }
public void Push(PointF direction, PointF?source) => OnPush?.Invoke(direction, source);
public new void Push(T item) { base.Push(item); OnPush?.Invoke(); }
protected virtual void OnPushEvent(WebhookEventArgs e) { OnPush?.Invoke(this, e); }
public new void Push(T item) { OnPush?.Invoke(item); base.Push(item); }
public ObjectPool(Creator creator, OnPush onPush = null, OnPop onPop = null) { this.creator = creator; this.onPop = onPop; this.onPush = onPush; }