예제 #1
0
        public void GetPropertyParser_DateAlignmentIsSent_EnumPropertyParserIsCreated()
        {
            PropertyInfo    property       = typeof(FullCalendarParameters).GetProperties().Single(x => x.Name == nameof(FullCalendarParameters.DateAlignment));
            IPropertyParser propertyParser = PropertyParserFactory.GetPropertyParser(property);

            propertyParser.Should().BeOfType <EnumPropertyParser>();
        }
예제 #2
0
        public void GetPropertyParser_SlotLabelIntervalIsSent_TimeSpanPropertyParserIsCreated()
        {
            PropertyInfo    property       = typeof(FullCalendarParameters).GetProperties().Single(x => x.Name == nameof(FullCalendarParameters.SlotLabelInterval));
            IPropertyParser propertyParser = PropertyParserFactory.GetPropertyParser(property);

            propertyParser.Should().BeOfType <TimeSpanPropertyParser>();
        }
예제 #3
0
        public void GetPropertyParser_DefaultDateIsSent_DateTimePropertyParserIsCreated()
        {
            PropertyInfo    property       = typeof(FullCalendarParameters).GetProperties().Single(x => x.Name == nameof(FullCalendarParameters.DefaultDate));
            IPropertyParser propertyParser = PropertyParserFactory.GetPropertyParser(property);

            propertyParser.Should().BeOfType <DateTimePropertyParser>();
        }
예제 #4
0
        public void GetPropertyParser_HandleWindowResizeIsSent_DoublePropertyParserIsCreated()
        {
            PropertyInfo    property       = typeof(FullCalendarParameters).GetProperties().Single(x => x.Name == nameof(FullCalendarParameters.HandleWindowResize));
            IPropertyParser propertyParser = PropertyParserFactory.GetPropertyParser(property);

            propertyParser.Should().BeOfType <BoolPropertyParser>();
        }
예제 #5
0
        public void GetPropertyParser_ViewsIsSent_CustomViewPropertyParserIsCreated()
        {
            PropertyInfo    property       = typeof(FullCalendarParameters).GetProperties().Single(x => x.Name == nameof(FullCalendarParameters.Views));
            IPropertyParser propertyParser = PropertyParserFactory.GetPropertyParser(property);

            propertyParser.Should().BeOfType <CustomViewPropertyParser>();
        }
예제 #6
0
        public void GetPropertyParser_ContentHeightIsSent_UnitPropertyParserIsCreated()
        {
            PropertyInfo    property       = typeof(FullCalendarParameters).GetProperties().Single(x => x.Name == nameof(FullCalendarParameters.ContentHeight));
            IPropertyParser propertyParser = PropertyParserFactory.GetPropertyParser(property);

            propertyParser.Should().BeOfType <UnitPropertyParser>();
        }
예제 #7
0
        public void GetPropertyParser_AspectRatioIsSent_DoublePropertyParserIsCreated()
        {
            PropertyInfo    property       = typeof(FullCalendarParameters).GetProperties().Single(x => x.Name == nameof(FullCalendarParameters.AspectRatio));
            IPropertyParser propertyParser = PropertyParserFactory.GetPropertyParser(property);

            propertyParser.Should().BeOfType <DoublePropertyParser>();
        }
예제 #8
0
        public void GetPropertyParser_BusinessHoursIsSent_BusinessHoursPropertyParserIsCreated()
        {
            PropertyInfo    property       = typeof(FullCalendarParameters).GetProperties().Single(x => x.Name == nameof(FullCalendarParameters.BusinessHours));
            IPropertyParser propertyParser = PropertyParserFactory.GetPropertyParser(property);

            propertyParser.Should().BeOfType <BusinessHoursPropertyParser>();
        }
예제 #9
0
        public void GetPropertyParser_WeekNumbersWithinDaysIsSent_BoolPropertyParserIsCreated()
        {
            PropertyInfo    property       = typeof(FullCalendarParameters).GetProperties().Single(x => x.Name == nameof(FullCalendarParameters.WeekNumbersWithinDays));
            IPropertyParser propertyParser = PropertyParserFactory.GetPropertyParser(property);

            propertyParser.Should().BeOfType <BoolPropertyParser>();
        }
예제 #10
0
        public void GetPropertyParser_HiddenDaysIsSent_ArrayPropertyParserIsCreated()
        {
            PropertyInfo    property       = typeof(FullCalendarParameters).GetProperties().Single(x => x.Name == nameof(FullCalendarParameters.HiddenDays));
            IPropertyParser propertyParser = PropertyParserFactory.GetPropertyParser(property);

            propertyParser.Should().BeOfType <ArrayPropertyParser>();
        }
예제 #11
0
        public void GetPropertyParser_ThemeSystemIsSent_ThemeSystemPropertyParserIsCreated()
        {
            PropertyInfo    property       = typeof(FullCalendarParameters).GetProperties().Single(x => x.Name == nameof(FullCalendarParameters.ThemeSystem));
            IPropertyParser propertyParser = PropertyParserFactory.GetPropertyParser(property);

            propertyParser.Should().BeOfType <ThemeSystemPropertyParser>();
        }
예제 #12
0
        public void GetPropertyParser_SelectMinDistanceIsSent_IntegerPropertyParserIsCreated()
        {
            PropertyInfo    property       = typeof(FullCalendarParameters).GetProperties().Single(x => x.Name == nameof(FullCalendarParameters.SelectMinDistance));
            IPropertyParser propertyParser = PropertyParserFactory.GetPropertyParser(property);

            propertyParser.Should().BeOfType <IntegerPropertyParser>();
        }
예제 #13
0
        public void GetPropertyParser_DropAcceptIsSent_FunctionPropertyParserIsCreated()
        {
            PropertyInfo    property       = typeof(FullCalendarParameters).GetProperties().Single(x => x.Name == nameof(FullCalendarParameters.DropAccept));
            IPropertyParser propertyParser = PropertyParserFactory.GetPropertyParser(property);

            propertyParser.Should().BeOfType <FunctionPropertyParser>();
        }
예제 #14
0
        public void GetPropertyParser_EventLongPressDelayIsSent_IntegerPropertyParserIsCreated()
        {
            PropertyInfo    property       = typeof(FullCalendarParameters).GetProperties().Single(x => x.Name == nameof(FullCalendarParameters.EventLongPressDelay));
            IPropertyParser propertyParser = PropertyParserFactory.GetPropertyParser(property);

            propertyParser.Should().BeOfType <IntegerPropertyParser>();
        }
예제 #15
0
        public void GetPropertyParser_EventOverlapIsSent_StringPropertyParserIsCreated()
        {
            PropertyInfo    property       = typeof(FullCalendarParameters).GetProperties().Single(x => x.Name == nameof(FullCalendarParameters.EventOverlap));
            IPropertyParser propertyParser = PropertyParserFactory.GetPropertyParser(property);

            propertyParser.Should().BeOfType <StringPropertyParser>();
        }
예제 #16
0
        public void GetPropertyParser_EventConstraintIsSent_ObjectPropertyParserIsCreated()
        {
            PropertyInfo    property       = typeof(FullCalendarParameters).GetProperties().Single(x => x.Name == nameof(FullCalendarParameters.EventConstraint));
            IPropertyParser propertyParser = PropertyParserFactory.GetPropertyParser(property);

            propertyParser.Should().BeOfType <ObjectPropertyParser>();
        }
예제 #17
0
        public void GetPropertyParser_DragRevertDurationIsSent_IntegerPropertyParserIsCreated()
        {
            PropertyInfo    property       = typeof(FullCalendarParameters).GetProperties().Single(x => x.Name == nameof(FullCalendarParameters.DragRevertDuration));
            IPropertyParser propertyParser = PropertyParserFactory.GetPropertyParser(property);

            propertyParser.Should().BeOfType <IntegerPropertyParser>();
        }
예제 #18
0
        public void GetPropertyParser_DragScrollIsSent_BoolPropertyParserIsCreated()
        {
            PropertyInfo    property       = typeof(FullCalendarParameters).GetProperties().Single(x => x.Name == nameof(FullCalendarParameters.DragScroll));
            IPropertyParser propertyParser = PropertyParserFactory.GetPropertyParser(property);

            propertyParser.Should().BeOfType <BoolPropertyParser>();
        }
예제 #19
0
        public void GetPropertyParser_EventDurationEditableIsSent_BoolPropertyParserIsCreated()
        {
            PropertyInfo    property       = typeof(FullCalendarParameters).GetProperties().Single(x => x.Name == nameof(FullCalendarParameters.EventDurationEditable));
            IPropertyParser propertyParser = PropertyParserFactory.GetPropertyParser(property);

            propertyParser.Should().BeOfType <BoolPropertyParser>();
        }
예제 #20
0
        public void GetPropertyParser_FirstDayIsSent_DayOfWeekPropertyParserIsCreated()
        {
            PropertyInfo    property       = typeof(FullCalendarParameters).GetProperties().Single(x => x.Name == nameof(FullCalendarParameters.FirstDay));
            IPropertyParser propertyParser = PropertyParserFactory.GetPropertyParser(property);

            propertyParser.Should().BeOfType <DayOfWeekPropertyParser>();
        }
예제 #21
0
        public void GetPropertyParser_NextDayThresholdIsSent_TimeSpanPropertyParserIsCreated()
        {
            PropertyInfo    property       = typeof(FullCalendarParameters).GetProperties().Single(x => x.Name == nameof(FullCalendarParameters.NextDayThreshold));
            IPropertyParser propertyParser = PropertyParserFactory.GetPropertyParser(property);

            propertyParser.Should().BeOfType <TimeSpanPropertyParser>();
        }
예제 #22
0
        public void GetPropertyParser_EventBackgroundColorIsSent_ColorPropertyParserIsCreated()
        {
            PropertyInfo    property       = typeof(FullCalendarParameters).GetProperties().Single(x => x.Name == nameof(FullCalendarParameters.EventBackgroundColor));
            IPropertyParser propertyParser = PropertyParserFactory.GetPropertyParser(property);

            propertyParser.Should().BeOfType <ColorPropertyParser>();
        }
예제 #23
0
        public void GetPropertyParser_BootstrapGlyphiconsIconsIsSent_ButtonIconsPropertyParserIsCreated()
        {
            PropertyInfo    property       = typeof(FullCalendarParameters).GetProperties().Single(x => x.Name == nameof(FullCalendarParameters.BootstrapGlyphicons));
            IPropertyParser propertyParser = PropertyParserFactory.GetPropertyParser(property);

            propertyParser.Should().BeOfType <ButtonIconsPropertyParser>();
        }
예제 #24
0
        public void GetPropertyParser_DefaultAllDayEventDurationIsSent_TimeSpanPropertyParserIsCreated()
        {
            PropertyInfo    property       = typeof(FullCalendarParameters).GetProperties().Single(x => x.Name == nameof(FullCalendarParameters.DefaultAllDayEventDuration));
            IPropertyParser propertyParser = PropertyParserFactory.GetPropertyParser(property);

            propertyParser.Should().BeOfType <TimeSpanPropertyParser>();
        }
예제 #25
0
        public XmlParser(string[] properties)
        {
            this.Parsers = new List <IPropertyParser>();

            foreach (var property in properties)
            {
                var parser = PropertyParserFactory.Create(property);
                if (parser != null)
                {
                    this.Parsers.Add(parser);
                }
            }
        }
예제 #26
0
        public static IHtmlString FullCalendar(this HtmlHelper htmlHelper, Action <FullCalendarParameters> parameters)
        {
            var fullCalendarParameters = new FullCalendarParameters();

            parameters(fullCalendarParameters);

            Dictionary <string, string> attributes = new Dictionary <string, string>();

            foreach (var property in typeof(FullCalendarParameters).GetProperties())
            {
                if (property.Name == nameof(FullCalendarParameters.Name) || property.Name == nameof(FullCalendarParameters.CssClass))
                {
                    continue;
                }
                IPropertyParser propertyParser = PropertyParserFactory.GetPropertyParser(property);
                propertyParser.AddPropertyToDictionary(fullCalendarParameters, ref attributes);
            }

            return(MvcHtmlString.Create(string.Format("<div {0} {1} class=\"fc {2}\" {3}></div>", !string.IsNullOrEmpty(fullCalendarParameters.Name) ?
                                                      string.Format("id='{0}'", fullCalendarParameters.Name) : "", !string.IsNullOrEmpty(fullCalendarParameters.Name) ?
                                                      string.Format("name='{0}'", fullCalendarParameters.Name) : "", fullCalendarParameters.CssClass,
                                                      string.Join(" ", attributes.Select(x => x.Key + "=\"" + x.Value + "\"")))));
        }