コード例 #1
0
ファイル: Overlapping.cs プロジェクト: seniorOtaka/ndoctor
        public static double ItemCount(CalendarAppointmentItem currentApp, UIElementCollection children)
        {
            double count = 0;
            foreach (UIElement child in children)
            {
                if (child is CalendarAppointmentItem)
                {
                    var currentChild = child as CalendarAppointmentItem;

                    var cStart = currentApp.GetValue(TimeSlotPanel.StartTimeProperty) as DateTime?;
                    var cEnd = currentApp.GetValue(TimeSlotPanel.EndTimeProperty) as DateTime?;
                    var toTest = new DateRange(cStart.Value, cEnd.Value);

                    var aStart = currentChild.GetValue(TimeSlotPanel.StartTimeProperty) as DateTime?;
                    var aEnd = currentChild.GetValue(TimeSlotPanel.EndTimeProperty) as DateTime?;
                    var current = new DateRange(aStart.Value, aEnd.Value);

                    if (toTest.Overlaps(current))
                    {
                        count++;
                    }
                }
            }
            return count;
        }
コード例 #2
0
ファイル: Overlapping.cs プロジェクト: thabet-fix/ndoctor
        public static double ItemCount(CalendarAppointmentItem currentApp, UIElementCollection children)
        {
            double count = 0;

            foreach (UIElement child in children)
            {
                if (child is CalendarAppointmentItem)
                {
                    var currentChild = child as CalendarAppointmentItem;

                    var cStart = currentApp.GetValue(TimeSlotPanel.StartTimeProperty) as DateTime?;
                    var cEnd   = currentApp.GetValue(TimeSlotPanel.EndTimeProperty) as DateTime?;
                    var toTest = new DateRange(cStart.Value, cEnd.Value);

                    var aStart  = currentChild.GetValue(TimeSlotPanel.StartTimeProperty) as DateTime?;
                    var aEnd    = currentChild.GetValue(TimeSlotPanel.EndTimeProperty) as DateTime?;
                    var current = new DateRange(aStart.Value, aEnd.Value);

                    if (toTest.Overlaps(current))
                    {
                        count++;
                    }
                }
            }
            return(count);
        }
コード例 #3
0
ファイル: TimeSlotPanel.cs プロジェクト: seniorOtaka/ndoctor
        private double GetWidth(Size finalSize, CalendarAppointmentItem appointementItem)
        {
            double count = Overlapping.ItemCount(appointementItem, this.Children);

            return (double)(finalSize.Width / count);
        }
コード例 #4
0
        private double GetWidth(Size finalSize, CalendarAppointmentItem appointementItem)
        {
            double count = Overlapping.ItemCount(appointementItem, this.Children);

            return((double)(finalSize.Width / count));
        }