- Timestamp:
- 05/29/09 12:16:28 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Hive.Client.Console/3.2/HiveClientConsole.cs
r1930 r1943 68 68 { 69 69 InitializeComponent(); 70 //lvwColumnSorter = new ListViewColumnSorterDate();71 //lvLog.ListViewItemSorter = lvwColumnSorter;72 //lvwColumnSorter.SortColumn = 3;73 //lvwColumnSorter.Order = SortOrder.Descending;74 70 InitTimer(); 75 71 ConnectToClient(); 76 72 RefreshGui(); 77 //GetEventLog();78 73 InitCalender(); 79 74 InitLogFileReader(); 80 75 } 81 76 77 #endregion 78 79 #region Methods 80 82 81 private void InitLogFileReader() { 83 //lo = new Tail(this.tailFilenameTextbox.Text); 84 //myTail.MoreData += new Tail.MoreDataHandler(myTail_MoreData); 85 //myTail.Start(); 86 //MessageBox.Show(Environment.CurrentDirectory); 87 logFileReader = new LogFileReader(Environment.CurrentDirectory + @"/HiveLog.log"); 82 logFileReader = new LogFileReader(Environment.CurrentDirectory + @"/Hive.log"); 88 83 logFileReader.MoreData += new LogFileReader.MoreDataHandler(logFileReader_MoreData); 89 84 logFileReader.Start(); … … 102 97 AppendText(newData); 103 98 } 104 105 #endregion106 107 #region Methods108 99 109 100 private void InitTimer() … … 147 138 this.Close(); 148 139 } 149 }150 151 //private void GetEventLog()152 //{153 // HiveClientEventLog = new EventLog(EVENTLOGNAME);154 // HiveClientEventLog.Source = EVENTLOGNAME;155 // HiveClientEventLog.EntryWritten += new EntryWrittenEventHandler(OnEntryWritten);156 // HiveClientEventLog.EnableRaisingEvents = true;157 158 // ListViewItem curEventLogEntry;159 160 // //databinding on listview?161 // if (HiveClientEventLog != null && HiveClientEventLog.Entries != null)162 // {163 // foreach (EventLogEntry ele in HiveClientEventLog.Entries)164 // {165 // curEventLogEntry = GenerateEventEntry(ele);166 // lvLog.Items.Add(curEventLogEntry);167 // }168 // lvJobDetail.Sort();169 // }170 //}171 172 private ListViewItem GenerateEventEntry(EventLogEntry ele)173 {174 ListViewItem curEventLogEntry;175 curEventLogEntry = new ListViewItem("", 0);176 if (ele.EntryType == EventLogEntryType.Error)177 curEventLogEntry = new ListViewItem("", 1);178 curEventLogEntry.SubItems.Add(ele.InstanceId.ToString());179 curEventLogEntry.SubItems.Add(ele.Message);180 curEventLogEntry.SubItems.Add(ele.TimeGenerated.ToString());181 return curEventLogEntry;182 140 } 183 141 … … 376 334 } 377 335 378 public void OnEntryWritten(object source, EntryWrittenEventArgs e)379 {380 //UpdateText(e.Entry);381 }382 383 //private void lvLog_DoubleClick(object sender, EventArgs e)384 //{385 // ListViewItem lvi = lvLog.SelectedItems[0];386 // HiveEventEntry hee = new HiveEventEntry(lvi.SubItems[2].Text, lvi.SubItems[3].Text, lvi.SubItems[1].Text);387 388 // Form EventlogDetails = new EventLogEntryForm(hee);389 // EventlogDetails.Show();390 //}391 392 336 private void btConnect_Click(object sender, EventArgs e) 393 337 { … … 411 355 cccc.DisconnectAsync(); 412 356 } 413 414 //private void lvLog_ColumnClick(object sender, ColumnClickEventArgs e)415 //{416 // // Determine if clicked column is already the column that is being sorted.417 // if (e.Column == lvwColumnSorter.SortColumn)418 // {419 // // Reverse the current sort direction for this column.420 // if (lvwColumnSorter.Order == SortOrder.Ascending)421 // {422 // lvwColumnSorter.Order = SortOrder.Descending;423 // }424 // else425 // {426 // lvwColumnSorter.Order = SortOrder.Ascending;427 // }428 // }429 // else430 // {431 // // Set the column number that is to be sorted; default to ascending.432 // lvwColumnSorter.SortColumn = e.Column;433 // lvwColumnSorter.Order = SortOrder.Ascending;434 // }435 436 // // Perform the sort with these new sort options.437 // //lvLog.Sort();438 //}439 357 440 358 private void btn_clientShutdown_Click(object sender, EventArgs e) … … 475 393 private void dvOnline_OnSelectionChanged(object sender, EventArgs e) 476 394 { 395 btCreate.Enabled = true; 477 396 if (dvOnline.Selection == SelectionType.DateRange) 478 397 { … … 493 412 txttimeTo.Text = dvOnline.SelectedAppointment.EndDate.ToShortTimeString(); 494 413 414 if (dvOnline.SelectedAppointment.Recurring) 415 btCreate.Enabled = false; 495 416 //also change the caption of the save button 496 417 btCreate.Text = "Save changes"; … … 594 515 { 595 516 List<Appointment> recurringAppointments = onlineTimes.Where(appointment => appointment.RecurringId == recurringId).ToList(); 596 recurringAppointments.ForEach(appointment => appointment.StartDate = DateTime.Parse(appointment.StartDate.Date + " " + txttimeFrom.Text));597 recurringAppointments.ForEach(appointment => appointment.EndDate = DateTime.Parse(appointment.EndDate.Date + " " + txttimeTo.Text));517 recurringAppointments.ForEach(appointment => appointment.StartDate = DateTime.Parse(appointment.StartDate.Date.ToString() + " " + txttimeFrom.Text)); 518 recurringAppointments.ForEach(appointment => appointment.EndDate = DateTime.Parse(appointment.EndDate.Date.ToString() + " " + txttimeTo.Text)); 598 519 599 520 DeleteRecurringAppointment(recurringId); … … 634 555 } 635 556 636 #endregion 637 638 private void CreateDailyRecurrenceAppointments(DateTime dateFrom, DateTime dateTo, bool allDay, int incWeek, HashSet<DayOfWeek> daysOfWeek) 639 { 557 private void CreateDailyRecurrenceAppointments(DateTime dateFrom, DateTime dateTo, bool allDay, int incWeek, HashSet<DayOfWeek> daysOfWeek) { 640 558 DateTime incDate = dateFrom; 641 559 Guid guid = Guid.NewGuid(); 642 560 643 while (incDate.Date <= dateTo.Date) 644 { 561 while (incDate.Date <= dateTo.Date) { 645 562 if (daysOfWeek.Contains(incDate.Date.DayOfWeek)) 646 563 onlineTimes.Add(CreateAppointment(incDate, new DateTime(incDate.Year, incDate.Month, incDate.Day, dateTo.Hour, dateTo.Minute, 0), allDay, true, guid)); … … 651 568 } 652 569 653 private void lvLog_SelectedIndexChanged(object sender, EventArgs e) { 654 655 } 570 #endregion 571 656 572 } 657 573 }
Note: See TracChangeset
for help on using the changeset viewer.