123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- using System;
- using System.Collections.Generic;
- using System.Collections.ObjectModel;
- using System.Globalization;
- using System.Linq;
- using System.Linq.Expressions;
- using System.Reflection;
- using System.Threading;
- using System.Threading.Tasks;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Data;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- using Comal.Classes;
- using InABox.Clients;
- using InABox.Core;
- using InABox.DynamicGrid;
- using InABox.Wpf;
- using InABox.WPF;
- using org.omg.CORBA;
- using Syncfusion.UI.Xaml.Kanban;
- using Color = System.Drawing.Color;
- /*
- namespace PRSDesktop
- {
- public class StatusTasksHeaderTimeConverter : IValueConverter
- {
- public static IEnumerable<TaskModel> Tasks { get; set; }
- public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
- {
- if (Tasks == null)
- return "0:00";
- var dataContext = value as ColumnTag;
- if (dataContext == null)
- return "0:00";
- var getter = dataContext.GetType().GetProperty("Column", BindingFlags.NonPublic | BindingFlags.Instance);
- if (getter == null)
- return "0:00";
- var column = (KanbanColumn)getter.GetValue(dataContext);
- if (column == null)
- return "0:00";
- double result = 0.0F;
- foreach (var kanban in Tasks.Where(x => Equals(x.Category, column.Categories)))
- result += kanban.EstimatedTime.TotalHours;
- return string.Format("{0:F2}", result);
- }
- public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
- {
- throw new NotImplementedException();
- }
- }
- /// <summary>
- /// Interaction logic for KanbanPanel.xaml
- /// </summary>
- public partial class TasksByStatusControlOld : UserControl, ITaskControl
- {
- private enum Suppress
- {
- This
- }
- private BitmapImage _attachimg = PRSDesktop.Resources.attachment.AsBitmapImage();
- private readonly ObservableCollection<EmployeeModel> _employeelist = new();
- private CoreTable _employees;
- public CoreTable _kanbans;
- private BitmapImage _lockimg = PRSDesktop.Resources.lock_sml.AsBitmapImage();
- private ObservableCollection<TaskModel> _models = new();
- private CoreTable _types;
- public List<string> CheckedKanbans = new();
- // CoreUtils.FullGuid => All Staff
- // Guid.Empty => Unallocated
- // Anything Else => Actual Staff Member
- private Guid EmployeeID = Guid.Empty;
- private Guid? MyID;
- private string MyName = "";
- private string searchtext = "";
- private Guid selectedtype = CoreUtils.FullGuid;
- public TasksByStatusControlOld()
- {
- using (new EventSuppressor(Suppress.This))
- InitializeComponent();
- }
- /*private void ResizeColumns()
- {
- //if (!bResizeRequired)
- // return;
- using (var d = Dispatcher.DisableProcessing())
- {
- var CollapsedWidth = 50;
- var CollapsedColumns = 0;
- Array.ForEach(Kanban.Columns.ToArray(), x => { CollapsedColumns += x.IsExpanded ? 0 : 1; });
- if (Kanban.Columns.Count > 0 && CollapsedColumns != Kanban.Columns.Count)
- {
- var ColumnWidth = (Kanban.ActualWidth - CollapsedColumns * CollapsedWidth) / (Kanban.Columns.Count - CollapsedColumns) - 2;
- if (ColumnWidth != Kanban.ColumnWidth) Kanban.ColumnWidth = ColumnWidth;
- //bResizeRequired = false;
- }
- }
- }
- private void Kanban_SizeChanged(object sender, SizeChangedEventArgs e)
- {
- Kanban.ColumnWidth = Kanban.ActualWidth / Kanban.Columns.Count - 1.0F;
- }
- }
- }*/
|