Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/01/11 17:41:25 (13 years ago)
Author:
ascheibe
Message:

#1233

  • some cleanups
  • removed unused code
Location:
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Administrator/3.4/Views
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Administrator/3.4/Views/HiveAppointment.cs

    r6688 r6696  
    3838
    3939    [XmlIgnore]
    40     public int Layer {
     40    public new int Layer {
    4141      get { return base.Layer; }
    4242      set { base.Layer = value; }
     
    4444
    4545    [XmlIgnore]
    46     public string Group {
     46    public new string Group {
    4747      get { return base.Group; }
    4848      set { base.Group = value; }
     
    5050
    5151    [XmlAttribute("Locked")]
    52     public bool Locked {
     52    public new bool Locked {
    5353      get { return base.Locked; }
    5454      set { base.Locked = value; }
     
    5656
    5757    [XmlIgnore]
    58     public Color Color {
     58    public new Color Color {
    5959      get { return base.Color; }
    6060      set { base.Color = value; }
     
    6262
    6363    [XmlIgnore]
    64     public Color TextColor {
     64    public new Color TextColor {
    6565      get { return base.TextColor; }
    6666      set { base.TextColor = value; }
     
    6868
    6969    [XmlIgnore]
    70     public Color BorderColor {
     70    public new Color BorderColor {
    7171      get { return base.BorderColor; }
    7272      set { base.BorderColor = value; }
     
    7474
    7575    [XmlIgnore]
    76     public bool DrawBorder {
     76    public new bool DrawBorder {
    7777      get { return base.DrawBorder; }
    7878      set { base.DrawBorder = value; }
     
    8080
    8181    [XmlAttribute("AllDayEvent")]
    82     public bool AllDayEvent {
     82    public new bool AllDayEvent {
    8383      get { return base.AllDayEvent; }
    8484      set { base.AllDayEvent = value; Changed = true; }
     
    8686
    8787    [XmlAttribute("Recurring")]
    88     public bool Recurring {
     88    public new bool Recurring {
    8989      get { return base.Recurring; }
    9090      set { base.Recurring = value; Changed = true; }
     
    9898
    9999    [XmlAttribute("EndDate")]
    100     public DateTime EndDate {
     100    public new DateTime EndDate {
    101101      get { return base.EndDate; }
    102102      set { base.EndDate = value; Changed = true; }
     
    104104
    105105    [XmlAttribute("StartDate")]
    106     public DateTime StartDate {
     106    public new DateTime StartDate {
    107107      get { return base.StartDate; }
    108108      set { base.StartDate = value; Changed = true; }
     
    110110
    111111    [XmlIgnore]
    112     public int AppointmentId {
     112    public new int AppointmentId {
    113113      get { return base.AppointmentId; }
    114114      set { base.AppointmentId = value; }
     
    116116
    117117    [XmlElement("Subject")]
    118     public string Subject {
     118    public new string Subject {
    119119      get { return base.Subject; }
    120120      set { base.Subject = value; }
     
    122122
    123123    [XmlIgnore]
    124     public string Location {
     124    public new string Location {
    125125      get { return base.Location; }
    126126      set { base.Location = value; }
     
    128128
    129129    [XmlIgnore]
    130     public string Note {
     130    public new string Note {
    131131      get { return base.Note; }
    132132      set { base.Note = value; }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Administrator/3.4/Views/Recurrence.Designer.cs

    r6688 r6696  
    3333      this.dtpFromTime = new System.Windows.Forms.DateTimePicker();
    3434      this.label6 = new System.Windows.Forms.Label();
    35       this.txtDays = new System.Windows.Forms.TextBox();
    36       this.label4 = new System.Windows.Forms.Label();
    37       this.label7 = new System.Windows.Forms.Label();
    3835      this.btSaveRecurrence = new System.Windows.Forms.Button();
    3936      this.btCancelRecurrence = new System.Windows.Forms.Button();
     
    130127      this.label6.Text = "Start Date:";
    131128      //
    132       // txtDays
    133       //
    134       this.txtDays.Location = new System.Drawing.Point(160, 13);
    135       this.txtDays.Name = "txtDays";
    136       this.txtDays.Size = new System.Drawing.Size(30, 20);
    137       this.txtDays.TabIndex = 24;
    138       this.txtDays.Text = "1";
    139       this.txtDays.Visible = false;
    140       //
    141       // label4
    142       //
    143       this.label4.AutoSize = true;
    144       this.label4.Location = new System.Drawing.Point(120, 16);
    145       this.label4.Name = "label4";
    146       this.label4.Size = new System.Drawing.Size(34, 13);
    147       this.label4.TabIndex = 23;
    148       this.label4.Text = "Every";
    149       this.label4.Visible = false;
    150       //
    151       // label7
    152       //
    153       this.label7.AutoSize = true;
    154       this.label7.Location = new System.Drawing.Point(196, 16);
    155       this.label7.Name = "label7";
    156       this.label7.Size = new System.Drawing.Size(59, 13);
    157       this.label7.TabIndex = 25;
    158       this.label7.Text = "week(s) on";
    159       this.label7.Visible = false;
    160       //
    161129      // btSaveRecurrence
    162130      //
     
    181149      // gbWeekly
    182150      //
    183       this.gbWeekly.Controls.Add(this.label7);
    184151      this.gbWeekly.Controls.Add(this.cbSunday);
    185       this.gbWeekly.Controls.Add(this.txtDays);
    186152      this.gbWeekly.Controls.Add(this.cbSaturday);
    187153      this.gbWeekly.Controls.Add(this.cbFriday);
    188154      this.gbWeekly.Controls.Add(this.cbThursday);
    189       this.gbWeekly.Controls.Add(this.label4);
    190155      this.gbWeekly.Controls.Add(this.cbWednesday);
    191156      this.gbWeekly.Controls.Add(this.cbTuesday);
     
    292257
    293258    private System.Windows.Forms.GroupBox gbAppointment;
    294     private System.Windows.Forms.TextBox txtDays;
    295     private System.Windows.Forms.Label label4;
    296259    private System.Windows.Forms.DateTimePicker dtpEnd;
    297260    private System.Windows.Forms.DateTimePicker dtpStart;
    298261    private System.Windows.Forms.Label label5;
    299262    private System.Windows.Forms.Label label6;
    300     private System.Windows.Forms.Label label7;
    301263    private System.Windows.Forms.Button btSaveRecurrence;
    302264    private System.Windows.Forms.Button btCancelRecurrence;
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Administrator/3.4/Views/Recurrence.cs

    r6688 r6696  
    2626namespace HeuristicLab.Clients.Hive.Administrator.Views {
    2727
    28   public enum RecurrenceMode {
    29     Daily,
    30     Weekly
    31   }
    32 
    3328  public partial class Recurrence : Form {
    3429
     
    4439
    4540    private void btSaveRecurrence_Click(object sender, EventArgs e) {
    46       DateTime dateFrom, dateTo;
    47       RecurrenceMode mode = RecurrenceMode.Daily;
    48       int incWeek = 0;
     41      DateTime dateFrom, dateTo;           
    4942      HashSet<DayOfWeek> days = new HashSet<DayOfWeek>();
    5043
     
    5245
    5346      //check if valid
    54       if (InputIsValid()) {
    55         //set entity
     47      if (InputIsValid())
     48      {   
     49          dateFrom = DateTime.Parse(dtpStart.Text + " " + dtpFromTime.Text);
     50          dateTo = DateTime.Parse(dtpEnd.Text + " " + dtpToTime.Text);
    5651
    57         dateFrom = DateTime.Parse(dtpStart.Text + " " + dtpFromTime.Text);
    58         dateTo = DateTime.Parse(dtpEnd.Text + " " + dtpToTime.Text);
     52          RecurrentEvent recurrentEvent = new RecurrentEvent()
     53          {
     54              DateFrom = dateFrom,
     55              DateTo = dateTo,
     56              AllDay = chbade.Checked,
     57              WeekDays = days             
     58          };
    5959
    60         if (int.TryParse(txtDays.Text, out incWeek))
    61           mode = RecurrenceMode.Weekly;
    62         else
    63           mode = RecurrenceMode.Daily;
    64 
    65         RecurrentEvent recurrentEvent = new RecurrentEvent() {
    66           DateFrom = dateFrom,
    67           DateTo = dateTo,
    68           AllDay = chbade.Checked,
    69           WeekDays = days,
    70           IncWeeks = incWeek,
    71         };
    72 
    73         //fire delegate and close the dialog
    74         dialogClosedDelegate(recurrentEvent);
    75         this.Close();
    76       } else
    77         MessageBox.Show("Incorrect date format", "Schedule Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     60          //fire delegate and close the dialog
     61          dialogClosedDelegate(recurrentEvent);
     62          this.Close();
     63      }
     64      else
     65      {
     66          MessageBox.Show("Incorrect date format", "Schedule Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     67      }
    7868    }
    7969
     
    10090
    10191    private bool InputIsValid() {
    102       DateTime dateFrom, dateTo;
    103       int i = 0;
     92      DateTime dateFrom, dateTo;     
    10493
    10594      dateFrom = DateTime.Parse(dtpStart.Text + " " + dtpFromTime.Text);
    10695      dateTo = DateTime.Parse(dtpEnd.Text + " " + dtpToTime.Text);
    10796
    108       if (dateFrom < dateTo && dateFrom.TimeOfDay < dateTo.TimeOfDay && int.TryParse(txtDays.Text, out i))
     97      if (dateFrom < dateTo && dateFrom.TimeOfDay < dateTo.TimeOfDay)
    10998        return true;
    11099      else
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Administrator/3.4/Views/RecurrentEvent.cs

    r6688 r6696  
    2727    public DateTime DateFrom { get; set; }
    2828    public DateTime DateTo { get; set; }
    29     public bool AllDay { get; set; }
    30     public int IncWeeks { get; set; }
     29    public bool AllDay { get; set; }   
    3130    public HashSet<DayOfWeek> WeekDays { get; set; }
    3231  }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Administrator/3.4/Views/ScheduleView.cs

    r6688 r6696  
    189189
    190190    public void DialogClosed(RecurrentEvent e) {
    191       CreateDailyRecurrenceAppointments(e.DateFrom, e.DateTo, e.AllDay, e.IncWeeks, e.WeekDays);
    192     }
    193 
    194     private void CreateDailyRecurrenceAppointments(DateTime dateFrom, DateTime dateTo, bool allDay, int incWeek, HashSet<DayOfWeek> daysOfWeek) {
     191      CreateDailyRecurrenceAppointments(e.DateFrom, e.DateTo, e.AllDay, e.WeekDays);
     192    }
     193
     194    private void CreateDailyRecurrenceAppointments(DateTime dateFrom, DateTime dateTo, bool allDay, HashSet<DayOfWeek> daysOfWeek) {
    195195      DateTime incDate = dateFrom;
    196196      Guid guid = Guid.NewGuid();
Note: See TracChangeset for help on using the changeset viewer.