Example #1
0
        protected override void RemoveItem(int index)
        {
            CaseViewModel caseToRemove = this[index];

            _master.Remove(caseToRemove.RecordId);
            base.RemoveItem(index);

            if (caseToRemove.EpiCaseDef == Core.Enums.EpiCaseClassification.Confirmed)
            {
                Confirmed.Remove(caseToRemove);
            }
            if (caseToRemove.EpiCaseDef == Core.Enums.EpiCaseClassification.Probable)
            {
                Probable.Remove(caseToRemove);
            }
            if (caseToRemove.EpiCaseDef == Core.Enums.EpiCaseClassification.Suspect)
            {
                Suspect.Remove(caseToRemove);
            }
            if (caseToRemove.EpiCaseDef == Core.Enums.EpiCaseClassification.NotCase)
            {
                NotCase.Remove(caseToRemove);
            }

            caseToRemove.EpiCaseDefinitionChanging -= item_EpiCaseDefinitionChanging;
            caseToRemove.CaseIDChanging            -= item_CaseIDChanging;
            caseToRemove.CaseSecondaryIDChanging   -= item_CaseIDChanging;
            caseToRemove.MarkedForRemoval          -= item_MarkedForRemoval;
            caseToRemove.Inserted            -= item_Inserted;
            caseToRemove.Updated             -= item_Updated;
            caseToRemove.ViewerClosed        -= item_ViewerClosed;
            caseToRemove.SwitchToLegacyEnter -= item_SwitchToLegacyEnter;
        }
Example #2
0
        public MAlertDialog(EvasObject parent) : base(parent)
        {
            Style = Styles.Popup.Alert;

            _confirmButton = new Button(parent)
            {
                Style = Styles.Popup.PopupButton
            };

            _confirmButton.Clicked += (s, e) =>
            {
                Dismiss();
                Confirmed?.Invoke(this, EventArgs.Empty);
            };

            _cancelButton = new Button(this)
            {
                Style = Styles.Popup.PopupButton
            };

            _cancelButton.Clicked += (s, e) =>
            {
                Dismiss();
            };

            SetPartContent(Parts.Popup.Button2, _confirmButton);
            SetPartContent(Parts.Popup.Button1, _cancelButton);

            MColors.AddColorSchemeComponent(this);
        }
Example #3
0
        public IActionResult Confirmed(string id, Confirmed data)
        {
            ViewBag.use  = HttpContext.Session.GetString("use");
            ViewBag.name = HttpContext.Session.GetString("Uname");
            ViewBag.id   = HttpContext.Session.GetString("id");
            var datainp = CollectionJregis.Find(it => it._id == id).FirstOrDefault();

            var item = new Confirmed
            {
                _id       = Guid.NewGuid().ToString(),
                Sesid     = ViewBag.id,
                Jid       = datainp._id,
                Bossid    = datainp.Sesid,
                Nsesid    = ViewBag.name,
                jname     = datainp.jname,
                jpictrue1 = datainp.jpictrue1,
                jpictrue2 = datainp.jpictrue2,
                jpictrue3 = datainp.jpictrue3,
                jdatail   = datainp.jdatail,
                jaddress  = datainp.jaddress,
                jprice    = datainp.jprice,
                jline     = datainp.jline,
                jphone    = datainp.jphone,
                jstatus   = "1"
            };

            Collationconf.InsertOne(item);
            return(RedirectToAction("Index"));
        }
Example #4
0
        private void OnOkClicked(object sender, EventArgs e)
        {
            OnOk();
            TaskPaneArgs args = new TaskPaneArgs();

            Confirmed?.Invoke(this, args);
            Visible = args.KeepOpen;
        }
Example #5
0
 private async void ConfirmClicked(object sender, EventArgs e)
 {
     Confirmed?.Invoke(this, null);
     if (CloseOnConfirm)
     {
         await PopupNavigation.Instance.PopAsync();
     }
 }
Example #6
0
        public AddResourceViewModel(IEnumerable <Metadata> metadata, IRestClient restClient)
        {
            _urls = metadata.Select(x => x.Url.ToString());

            Added = Confirmed
                    .SelectMany(x => restClient.PostAsync(BuildUrl(), new Resource(_json)).ToObservable(), (x, y) => y)
                    .Take(1)
                    .AsUnit();
        }
 internal MessageBoxViewModel()
 {
     _confirmCommand = new Command(
         new Action(
             delegate
     {
         Confirmed?.Invoke(this, null);
     }),
         null);
 }
        protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
        {
            if (args.Key == Key.Enter)
            {
                Confirmed?.Invoke();
                return(true);
            }

            return(base.OnKeyDown(state, args));
        }
Example #9
0
        /// <summary>
        /// Show the fragment
        /// </summary>
        /// <param name="manager"></param>
        public static void ShowFragment(FragmentManager manager, Confirmed callback, string actionToConfirm, string positiveText = "Yes", string negativeText = "No")
        {
            // Save the title and reporter statically to survive a rotation.
            reporter           = callback;
            titleString        = actionToConfirm;
            positiveButtonText = positiveText;
            negativeButtonText = negativeText;

            new ConfirmationDialogFragment().Show(manager, "fragment_confirmation_tag");
        }
Example #10
0
        protected override void ClearItems()
        {
            _master.Clear();

            Confirmed.Clear();
            Probable.Clear();
            Suspect.Clear();
            NotCase.Clear();

            base.ClearItems();
        }
            protected override void HandleInput(Vector2 cursorPos)
            {
                base.HandleInput(cursorPos);

                if (SharedBinds.Escape.IsNewPressed)
                {
                    Confirmed?.Invoke();
                }

                DragUpdateAction();
            }
Example #12
0
        /// <summary>
        /// Handles the Confirm button click event.
        /// </summary>
        /// <returns>A task that represents the asynchronous operation.</returns>
        protected Task OnConfirmClicked()
        {
            return(InvokeAsync(async() =>
            {
                await ModalRef.Hide();

                if (IsConfirmation && Callback != null)
                {
                    await InvokeAsync(() => Callback.SetResult(true));
                }

                await Confirmed.InvokeAsync();
            }));
        }
 private void NowBtn_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         RunUpdate();
     }
     catch (UnauthorizedAccessException)
     {
         ProcessStartInfo processStartInfo = new ProcessStartInfo(Process.GetCurrentProcess().MainModule.FileName, "-update")
         {
             Verb = "runas"
         };
         Process.Start(processStartInfo);
     }
     Confirmed?.Invoke(true);
 }
Example #14
0
        public static Transaction getTransaction(int transactionId)
        {
            Transaction transaction = null;

            DataAccess da = new DataAccess();
            DataTable  dt = da.select(String.Format("TransactionId = '{0}'", transactionId), "Transactions", NumRows: 1);

            if (dt != null && dt.Rows.Count > 0)
            {
                DataRow row = dt.Rows[0];

                int       TransactionId = Convert.ToInt32(row["TransactionId"]);
                int       TextbookId    = Convert.ToInt32(row["TextbookId"]);
                int       SellerId      = Convert.ToInt32(row["SellerId"]);
                int       BuyerId       = Convert.ToInt32(row["BuyerId"]);
                int       SellerPostId  = Convert.ToInt32(row["SellerPostId"]);
                int       BuyerPostId   = Convert.ToInt32(row["BuyerPostId"]);
                int?      FinalPrice    = row["FinalPrice"] is DBNull ? (int?)null : Convert.ToInt32(row["FinalPrice"]);
                int?      ConfirmPrice  = row["ConfirmPrice"] is DBNull ? (int?)null : Convert.ToInt32(row["ConfirmPrice"]);
                int       InitialPrice  = Convert.ToInt32(row["InitialPrice"]);
                Confirmed Confirmed     = (Confirmed)Convert.ToInt32(row["Confirmed"]);
                int       IsActive      = Convert.ToInt32(row["IsActive"]);
                int       IsDeleted     = Convert.ToInt32(row["IsDeleted"]);
                DateTime  CreatedDate   = Convert.ToDateTime(row["CreatedDate"]);
                DateTime  ModifiedDate  = Convert.ToDateTime(row["ModifiedDate"]);

                transaction = new Transaction(
                    TransactionId,
                    TextbookId,
                    SellerId,
                    BuyerId,
                    SellerPostId,
                    BuyerPostId,
                    FinalPrice,
                    ConfirmPrice,
                    InitialPrice,
                    Confirmed,
                    IsActive,
                    IsDeleted,
                    CreatedDate,
                    ModifiedDate
                    );
            }

            return(transaction);
        }
Example #15
0
        private void btnConfirm_Click(object sender, EventArgs e)
        {
            var info = new NodeInfo()
            {
                TagName      = tbTagName.Text,
                OriginalNode = node,
            };

            foreach (ListViewItem item in lvAttributes.Items)
            {
                info.Attributes[item.SubItems[0].Text] = item.SubItems[1].Text;
            }

            Confirmed?.Invoke(info);

            Close();
        }
        public override void RenderBlock(Block <T> oldTip, Block <T> newTip)
        {
            Confirmed.TryAdd(oldTip.Hash, 0);
            if (_eventReceivingReorg is Reorg reorg &&
                reorg.OldTip.Equals(oldTip) &&
                reorg.NewTip.Equals(newTip))
            {
                if (_localUnrenderBuffer.Value
                    is Dictionary <HashDigest <SHA256>, List <ActionEvaluation> > buf)
                {
                    foreach (HashDigest <SHA256> block in reorg.Unrendered)
                    {
                        if (buf.TryGetValue(block, out List <ActionEvaluation>?b))
                        {
                            _bufferedActionUnrenders[block] = b;
                        }
                        else
                        {
                            _bufferedActionUnrenders.TryRemove(
                                block,
                                out List <ActionEvaluation>?removed
                                );
                            if (removed is List <ActionEvaluation> l)
                            {
                                Logger.Warning(
                                    "The existing {Count} buffered action unrenders for " +
                                    "the block {BlockHash} were overwritten.",
                                    l.Count,
                                    block
                                    );
                            }
                        }

                        Logger.Debug(
                            "Committed {Count} buffered action unrenders from " +
                            "the block {BlockHash}.",
                            b?.Count ?? 0,
                            block
                            );
                    }

                    _localUnrenderBuffer.Value =
                        new Dictionary <HashDigest <SHA256>, List <ActionEvaluation> >();
                }
            }
Example #17
0
        private void Button_MouseUp(object sender, MouseEventArgs e)
        {
            if (mouseButtonIsDown)
            {
                mouseButtonIsDown = false;

                this.BackColor = HighlightColor;

                // Is the mouse pointer within the bounds of the CheckBox?
                if (!confirmed)
                {
                    if (e.Location.X < SeparatorDistance)
                    {
                        if (ticked)
                        {
                            ticked = false;
                            CheckedChanged?.Invoke(this, new ButtonCheckedChangedEventArgs(this, false));
                        }
                        else
                        {
                            ticked = true;

                            CheckedChanged?.Invoke(this, new ButtonCheckedChangedEventArgs((Button)this, true));
                        }
                    }
                    else if (e.Location.X > SeparatorDistance)
                    {
                        if (ticked)
                        {
                            this.Enabled   = false;
                            this.BackColor = ConfirmedBackgroundColor;
                            confirmed      = true;

                            Confirmed?.Invoke(this, new ButtonConfirmedEventArgs(e));
                        }

                        Clicked?.Invoke(this, new ButtonClickedEventArgs(e));
                    }
                }
            }

            this.Refresh();
        }
Example #18
0
        private void btnConfirm_Click(object sender, EventArgs e)
        {
            var dict = new Dictionary <string, string>();

            foreach (ListViewItem pair in lvAttributes.Items)
            {
                dict.Add(pair.SubItems[0].Text, pair.SubItems[1].Text);
            }

            try
            {
                databaseService.AddTable(database, tbTableName.Text, dict);
                Confirmed?.Invoke();
                Close();
            } catch (Exception ex)
            {
                MessageBoxEx.Error(ex.Message);
            }
        }
            public DragWindow(Action UpdateAction) : base(HudMain.HighDpiRoot)
            {
                DragUpdateAction = UpdateAction;
                MinimumSize      = new Vector2(100f);
                AllowResizing    = false;

                BodyColor   = new Color(41, 54, 62, 150);
                BorderColor = new Color(58, 68, 77);

                HeaderBuilder.Format = TerminalFormatting.ControlFormat.WithAlignment(TextAlignment.Center);
                header.Height        = 40f;

                confirmButton = new BorderedButton(this)
                {
                    Text         = "Confirm",
                    DimAlignment = DimAlignments.Width | DimAlignments.IgnorePadding,
                };

                confirmButton.MouseInput.LeftClicked += (sender, args) => Confirmed?.Invoke();
            }
Example #20
0
        private void item_EpiCaseDefinitionChanging(object sender, Events.EpiCaseDefinitionChangingEventArgs e)
        {
            CaseViewModel caseVM = sender as CaseViewModel;

            if (caseVM != null)
            {
                if (e.PreviousDefinition == EpiCaseClassification.Confirmed)
                {
                    Confirmed.Remove(caseVM);
                }
                else if (e.PreviousDefinition == EpiCaseClassification.Probable)
                {
                    Probable.Remove(caseVM);
                }
                else if (e.PreviousDefinition == EpiCaseClassification.Suspect)
                {
                    Suspect.Remove(caseVM);
                }
                else if (e.PreviousDefinition == EpiCaseClassification.NotCase)
                {
                    NotCase.Remove(caseVM);
                }

                if (e.NewDefinition == EpiCaseClassification.Confirmed)
                {
                    Confirmed.Add(caseVM);
                }
                else if (e.NewDefinition == EpiCaseClassification.Probable)
                {
                    Probable.Add(caseVM);
                }
                else if (e.NewDefinition == EpiCaseClassification.Suspect)
                {
                    Suspect.Add(caseVM);
                }
                else if (e.NewDefinition == EpiCaseClassification.NotCase)
                {
                    NotCase.Add(caseVM);
                }
            }
        }
        public async void Start()
        {
            if (_isRunning)
            {
                return;
            }

            _isRunning = true;

            while (_isRunning)
            {
                try
                {
                    var typing = await _keyboard.FetchTextAsync();

                    if (typing.Enter)
                    {
                        _lastTyping = typing;
                        Confirmed?.Invoke(this, new TypingTextEventArgs(typing));
                    }
                    else
                    {
                        var isEqual = _lastTyping != null && _lastTyping.Text == typing.Text &&
                                      _lastTyping.CaretStartIndex == typing.CaretStartIndex &&
                                      _lastTyping.CaretEndIndex == typing.CaretEndIndex;
                        _lastTyping = typing;
                        if (!isEqual)
                        {
                            Typing?.Invoke(this, new TypingTextEventArgs(typing));
                        }
                    }
                }
                catch (Exception ex)
                {
                    ExceptionOccurred?.Invoke(this, new ExceptionEventArgs(ex));
                }

                await Task.Delay(20);
            }
        }
Example #22
0
        protected override void ClearItems()
        {
            foreach (CaseViewModel c in this)
            {
                c.EpiCaseDefinitionChanging -= item_EpiCaseDefinitionChanging;
                c.CaseIDChanging            -= item_CaseIDChanging;
                c.CaseSecondaryIDChanging   -= item_CaseIDChanging;
                c.MarkedForRemoval          -= item_MarkedForRemoval;
                c.Inserted            -= item_Inserted;
                c.Updated             -= item_Updated;
                c.ViewerClosed        -= item_ViewerClosed;
                c.SwitchToLegacyEnter -= item_SwitchToLegacyEnter;
            }
            _master.Clear();

            Confirmed.Clear();
            Probable.Clear();
            Suspect.Clear();
            NotCase.Clear();

            base.ClearItems();
        }
Example #23
0
        static public decimal GetBalance(string address)
        {
            decimal          balance          = 0;
            string           url1             = "{\"jsonrpc\": \"2.0\",\"method\": \"getbalance\",\"params\": {\"addresses\": [";
            string           url3             = "]},\"id\": 1}";
            string           jsonBlock        = String.Concat(url1, address, url3);
            string           response         = TalkToNode(jsonBlock);
            Getbalance       result           = JsonConvert.DeserializeObject <Getbalance>(response);
            ResultGetbalance ResultGetbalance = result.ResultGetbalance;

            if (result.ResultGetbalance != null)
            {
                Confirmed[] confirmedList  = ResultGetbalance.Confirmed;
                Confirmed   Confirmed      = confirmedList[0];
                string      totalConfirmed = Confirmed.TotalAmount;
                if (totalConfirmed != null)
                {
                    balance = decimal.Parse(totalConfirmed) / 100000000;
                }
            }
            return(balance);
        }
Example #24
0
        public Transaction(
            int transactionId,
            int textbookId,
            int sellerId,
            int buyerId,
            int sellerPostId,
            int buyerPostId,
            int?finalPrice,
            int?confirmPrice,
            int initialPrice,
            Confirmed confirmed,
            int isActive,
            int isDeleted,
            DateTime createdDate,
            DateTime modifiedDate
            )
        {
            this.TransactionId = transactionId;
            this.TextbookId    = textbookId;
            this.SellerId      = sellerId;
            this.BuyerId       = buyerId;
            this.SellerPostId  = sellerPostId;
            this.BuyerPostId   = buyerPostId;
            this.FinalPrice    = finalPrice;
            this.ConfirmPrice  = confirmPrice;
            this.InitialPrice  = initialPrice;
            this.Confirmed     = confirmed;
            this.IsActive      = isActive;
            this.IsDeleted     = isDeleted;
            this.CreatedDate   = createdDate;
            this.ModifiedDate  = modifiedDate;

            // calculate how many days are left before this transaction is auto confirmed
            // default transaction period is 14 days
            DateTime deadline = this.CreatedDate.AddDays(Globals.TRANSACTION_PERIOD);

            this.DaysRemaining = (deadline - DateTime.Now).Days + 1;
        }
Example #25
0
        public Transaction(
            int transactionId,
            int textbookId,
            int sellerId,
            int buyerId,
            int sellerPostId,
            int buyerPostId,
            int? finalPrice,
            int? confirmPrice,
            int initialPrice,
            Confirmed confirmed,
            int isActive,
            int isDeleted,
            DateTime createdDate,
            DateTime modifiedDate
            )
        {
            this.TransactionId = transactionId;
            this.TextbookId = textbookId;
            this.SellerId = sellerId;
            this.BuyerId = buyerId;
            this.SellerPostId = sellerPostId;
            this.BuyerPostId = buyerPostId;
            this.FinalPrice = finalPrice;
            this.ConfirmPrice = confirmPrice;
            this.InitialPrice = initialPrice;
            this.Confirmed = confirmed;
            this.IsActive = isActive;
            this.IsDeleted = isDeleted;
            this.CreatedDate = createdDate;
            this.ModifiedDate = modifiedDate;

            // calculate how many days are left before this transaction is auto confirmed
            // default transaction period is 14 days
            DateTime deadline = this.CreatedDate.AddDays(Globals.TRANSACTION_PERIOD);
            this.DaysRemaining = (deadline - DateTime.Now).Days + 1;
        }
Example #26
0
 protected virtual void OnConfirmed(IEnumerable <IFile> files)
 {
     Confirmed?.Invoke(this, files);
 }
Example #27
0
 private void LaterBtn_Click(object sender, RoutedEventArgs e)
 {
     ((Grid)this.Parent).Children.Remove(this);
     Confirmed?.Invoke(false);
 }
Example #28
0
 private void NowBtn_Click(object sender, RoutedEventArgs e)
 {
     ((Grid)this.Parent).Children.Remove(this);
     UpdateUtil.RunUpdate();
     Confirmed?.Invoke(true);
 }
 public void OnConfirmed()
 {
     Confirmed?.Invoke();
 }
Example #30
0
 private void LaterBtn_Click(object sender, RoutedEventArgs e)
 {
     this.Visibility = Visibility.Hidden;
     Confirmed?.Invoke(false);
 }
Example #31
0
 private void NowBtn_Click(object sender, RoutedEventArgs e)
 {
     ExportResource(UpdaterPath, "Updater.Bili-dl-updater.exe");
     System.Diagnostics.Process.Start(UpdaterPath, System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName);
     Confirmed?.Invoke(true);
 }