private void DeleteHandler()
 {
     if (EditorUtility.DisplayDialog("Delete", $"Remove the `{_action.name}` action?", "Yes", "No"))
     {
         EventDelete?.Invoke(this);
     }
 }
예제 #2
0
 // Метод-обработчик события KeyPress для textBox1, возникающее когда элемент управления находится в фокусе и пользователь нажимает и отпускает клавишу
 private void textBoxKeyPress(object sender, KeyPressEventArgs e)
 {
     keyPressEventArgs.KeyChar = e.KeyChar;
     eventArgs = new KeyPressEventArgs(keyPressEventArgs.KeyChar);
     ((TextBox)senderDeleteX).Text = ((TextBox)senderDelete).Text;
     EventBoolM.Invoke(senderDeleteX, eventArgs);
     if (keyDelete == true)
     {
         EventDelete.Invoke(senderDelete, keyPressEventArgs);
         keyDelete = false;
         e.KeyChar = '\0';
     }
     if (keyBackspace == true)
     {
         EventBackspace.Invoke(senderDelete, keyPressEventArgs);
         keyBackspace = false;
         return;
     }
     if (((TextBox)senderDeleteX).Text == "\0\0\0")
     {
         ((TextBox)senderDelete).Text = "0";
     }
     EventSigns.Invoke(sender, e);
     EventOperation.Invoke(sender, e);
     EventKeyPress.Invoke(sender, e);
     EventKeyPressKey.Invoke(sender, e);
     keyPressEventArgs = e;
 }
예제 #3
0
        /// <summary>
        /// Delete multiple events in the same project.
        /// </summary>
        /// <param name="query">The list of events to delete.</param>
        /// <param name="token">Optional cancellation token.</param>
        public async Task <EmptyResponse> DeleteAsync(EventDelete query, CancellationToken token = default)
        {
            if (query is null)
            {
                throw new ArgumentNullException(nameof(query));
            }

            var req = Oryx.Cognite.Events.delete <EmptyResponse>(query);

            return(await RunAsync(req, token).ConfigureAwait(false));
        }
예제 #4
0
        /// <summary>
        /// Delete multiple events in the same project.
        /// </summary>
        /// <param name="externalIds">The list of event externalids to delete.</param>
        /// <param name="token">Optional cancellation token.</param>
        public async Task <EmptyResponse> DeleteAsync(IEnumerable <string> externalIds, CancellationToken token = default)
        {
            if (externalIds is null)
            {
                throw new ArgumentNullException(nameof(externalIds));
            }

            var query = new EventDelete {
                Items = externalIds.Select(Identity.Create)
            };

            return(await DeleteAsync(query, token).ConfigureAwait(false));
        }
예제 #5
0
        /// <summary>
        /// Delete multiple events in the same project.
        /// </summary>
        /// <param name="identities">The list of event ids to delete.</param>
        /// <param name="token">Optional cancellation token.</param>
        public async Task <EmptyResponse> DeleteAsync(IEnumerable <Identity> identities, CancellationToken token = default)
        {
            if (identities is null)
            {
                throw new ArgumentNullException(nameof(identities));
            }

            var query = new EventDelete {
                Items = identities
            };

            return(await DeleteAsync(query, token).ConfigureAwait(false));
        }
예제 #6
0
        public virtual void SendEmailEventDelete(ProcessedEvents eventItem, ProcessedGroup group)
        {
            var messageSubject = $"Delete {eventItem.Title}";

            _logger.LogInformation("Sending event delete email");

            var emailBody = new EventDelete {
                Title = eventItem.Title
            };

            var emailsTosend = string.Join(",", group.GroupAdministrators.Items.Select(i => i.Email).ToList());

            emailsTosend = emailsTosend + "," +
                           _configuration.GetGroupSubmissionEmail(_businessId.ToString());

            if (!string.IsNullOrEmpty(emailsTosend))
            {
                _emailClient.SendEmailToService(new EmailMessage(messageSubject, _emailClient.GenerateEmailBodyFromHtml(emailBody),
                                                                 _fromEmail, emailsTosend, new List <IFormFile>()));
            }
        }
예제 #7
0
        public void AddButtonInColumns(ref DataGridView dgv, TypeButton tb, EventEdit editEvent, EventDelete deleteEvent)
        {
            switch (tb)
            {
            case TypeButton.Search:

                DataGridViewButtonColumn editColumn = new DataGridViewButtonColumn();
                editColumn.Text             = "Editar";
                editColumn.Name             = "Editar";
                editColumn.Width            = 45;
                editColumn.DataPropertyName = "btnDgvEdit";
                dgv.Columns.Add(editColumn);
                editColumn.DataGridView.CellContentClick += new DataGridViewCellEventHandler(editEvent);

                DataGridViewButtonColumn delColumn = new DataGridViewButtonColumn();
                delColumn.Text             = "Deletar";
                delColumn.Name             = "Deletar";
                delColumn.Width            = 45;
                delColumn.DataPropertyName = "btnDgvEditDelete";
                dgv.Columns.Add(delColumn);
                delColumn.DataGridView.CellContentClick += new DataGridViewCellEventHandler(deleteEvent);


                //image column
                //DataGridViewImageColumn img = new DataGridViewImageColumn();
                //Image image = Image.FromFile(@"..\Resources\plus.png");
                //img.Image = image;
                //dgv.Columns.Add(img);
                //img.HeaderText = "Image";
                //img.Name = "img";

                break;
            }
        }