Exemplo n.º 1
0
        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
        {
            //The first will value is the datastoreitme
            //the second is the diaryentryholderviewmodel
            try
            {
                DateTime?bt = values[0] as DateTime?;
                DiaryEntryHolderViewModel d = values[1] as DiaryEntryHolderViewModel;
                if (bt.Value < d.StartTime)
                {
                    return(Visibility.Collapsed);
                }
                if (bt.Value > d.EndTime)
                {
                    return(Visibility.Collapsed);
                }
            }
            catch
            {
                return(Visibility.Collapsed);
            }


            return(Visibility.Visible);
        }
Exemplo n.º 2
0
        public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            //so the first will be the task item iself
            //the second will be the diaryentryholdeviewmodel
            if (values[0] != null)
            {
                try
                {
                    DiaryEntryHolderViewModel d = (DiaryEntryHolderViewModel)values[1];
                    DateTime startTime, endTime;
                    startTime = d.StartTime;
                    endTime   = d.EndTime;

                    try
                    {
                        Int32 num = (Int32)values[0];
                        return((num / d.MinutesPerPixel));
                    }
                    catch (Exception ex)
                    {
                        return(50);
                    }
                }
                catch
                {
                    //This seems to thow an error if the usercontrol is being movedd

                    return(50);
                }
            }
            else
            {
                return(50);
            }
        }
Exemplo n.º 3
0
        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
        {
            //The first will value is the datastoreitme
            //the second is the diaryentryholderviewmodel
            BasicFiniteTask           bt = values[0] as BasicFiniteTask;
            DiaryEntryHolderViewModel d  = values[1] as DiaryEntryHolderViewModel;

            if (bt.ValidCompletionTime < d.StartTime)
            {
                return(Visibility.Collapsed);
            }
            if (bt.ValidCompletionTime > d.EndTime)
            {
                return(Visibility.Collapsed);
            }

            return(Visibility.Visible);
        }
Exemplo n.º 4
0
        public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            DateTime schedulingTime = (DateTime)values[0];

            try
            {
                DiaryEntryHolderViewModel d = (DiaryEntryHolderViewModel)values[1];
                DateTime startTime, endTime;
                if (d != null)
                {
                    startTime = d.StartTime;
                    endTime   = d.EndTime;



                    double MinutePerPixel = (endTime - startTime).TotalMinutes / 800;



                    return((schedulingTime - startTime).TotalMinutes / d.MinutesPerPixel);



                    //return 50;



                    return(null);
                }
            }
            catch (Exception ex)
            {
            }

            return(null);
        }