public Note(uint id, string date, AlertScope imp, string content, Campaign campaign = null) : base(id) { Date = date; Importance = imp; Content = content; Campaign = campaign; }
public Note(string d, AlertScope imp, string n, Campaign c) { editDate(d); importance = imp; editNoteContent(n); campaign = c; }
public uint addNote(string date, AlertScope importance, string content) { var note = new Note(IDManager.nextID(), date, importance, content, this); notes.Add(note); sortNotes(); return(note.ID); }
internal static string ToSerializedValue(this AlertScope value) { switch (value) { case AlertScope.Resource: return("Resource"); case AlertScope.Device: return("Device"); } return(null); }
private void okButton_Click(object sender, EventArgs e) { if (newNoteBox.Text == "") { MessageBox.Show("The note must have some content.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else if (globalButton.Checked == false && AlertCampaignButton.Checked == false && noAlert.Checked == false) { MessageBox.Show("Choose a visibilty level.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { AlertScope importance = AlertScope.dontAlert; if (generalBox.Checked) { if (globalButton.Checked) { importance = AlertScope.global; } else if (noAlert.Checked) { importance = AlertScope.dontAlert; } currCalendar.AddGeneralNote(new Note(currCalendar.calendar.ToString(), importance, newNoteBox.Text, null)); MessageBox.Show("Note successfully added", "Note Added", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Close(); } else // if not general { if (globalButton.Checked) { importance = AlertScope.global; } else if (AlertCampaignButton.Checked) { importance = AlertScope.campaign; } else if (noAlert.Checked) { importance = AlertScope.dontAlert; } currCalendar.activeCampaign.addNote(currCalendar.calendar.ToString(), importance, newNoteBox.Text); MessageBox.Show("Note successfully added", "Note Added", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Close(); } } }
/// <summary> /// Initializes a new instance of the Alert class. /// </summary> /// <param name="title">The title of the alert</param> /// <param name="scope">The scope of the alert. Possible values /// include: 'Resource', 'Device'</param> /// <param name="alertType">The type of the alert</param> /// <param name="appearedAtTime">The UTC time at which the alert was /// raised</param> /// <param name="appearedAtSourceTime">The source time at which the /// alert was raised</param> /// <param name="source">The source at which the alert was /// raised</param> /// <param name="severity">The severity of the alert. Possible values /// include: 'Informational', 'Warning', 'Critical'</param> /// <param name="status">The current status of the alert. Possible /// values include: 'Active', 'Cleared'</param> /// <param name="id">The path ID that uniquely identifies the /// object.</param> /// <param name="name">The name of the object.</param> /// <param name="type">The hierarchical type of the object.</param> /// <param name="kind">The Kind of the object. Currently only /// Series8000 is supported. Possible values include: /// 'Series8000'</param> /// <param name="clearedAtTime">The UTC time at which the alert was /// cleared</param> /// <param name="clearedAtSourceTime">The source time at which the /// alert was cleared</param> /// <param name="recommendation">The recommended action for the issue /// raised in the alert</param> /// <param name="resolutionReason">The reason for resolving the /// alert</param> /// <param name="errorDetails">The details of the error for which the /// alert was raised</param> /// <param name="detailedInformation">More details about the /// alert</param> public Alert(string title, AlertScope scope, string alertType, System.DateTime appearedAtTime, System.DateTime appearedAtSourceTime, AlertSource source, AlertSeverity severity, AlertStatus status, string id = default(string), string name = default(string), string type = default(string), Kind?kind = default(Kind?), System.DateTime?clearedAtTime = default(System.DateTime?), System.DateTime?clearedAtSourceTime = default(System.DateTime?), string recommendation = default(string), string resolutionReason = default(string), AlertErrorDetails errorDetails = default(AlertErrorDetails), IDictionary <string, string> detailedInformation = default(IDictionary <string, string>)) : base(id, name, type, kind) { Title = title; Scope = scope; AlertType = alertType; AppearedAtTime = appearedAtTime; AppearedAtSourceTime = appearedAtSourceTime; ClearedAtTime = clearedAtTime; ClearedAtSourceTime = clearedAtSourceTime; Source = source; Recommendation = recommendation; ResolutionReason = resolutionReason; Severity = severity; Status = status; ErrorDetails = errorDetails; DetailedInformation = detailedInformation; }
public Note(string d, AlertScope imp, string n) : this(d, imp, n, null) { }
public void addNote(string date, AlertScope importance, string note) { notes.Add(new Note(date, importance, note, this)); sortNotes(); }
private void okButton_Click(object sender, EventArgs e) { Campaign notesCampaign; if (alertAll.Checked == false && AlertCampaign.Checked == false && noAlert.Checked == false) { MessageBox.Show("Choose a visibilty level.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (month.Text == "" || day.Text == "" || year.Text == "") { MessageBox.Show("Please enter a valid date.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (editNoteBox.Text == "") { MessageBox.Show("The note must have some content.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (campaignSelector.SelectedItem == null && generalBox.Checked) { notesCampaign = null; } else if (campaignSelector.SelectedItem == null && generalBox.Checked == false) { MessageBox.Show("Please select an associated campaign.\nIf it is a general note, check the general box.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { notesCampaign = currentCalendar.CampaignList.Find(x => x.Tag == campaignSelector.SelectedItem.ToString()); } if (editNote.Campaign == null) { currentCalendar.deleteNote(editNote); } else { editNote.Campaign.deleteNote(editNote); } AlertScope importance = AlertScope.dontAlert; if (alertAll.Checked) { importance = AlertScope.global; } else if (AlertCampaign.Checked) { importance = AlertScope.campaign; } else if (noAlert.Checked) { importance = AlertScope.dontAlert; } currentCalendar.AddNote(new Note(textBoxToDate(), importance, editNoteBox.Text, notesCampaign)); this.Close(); }