Пример #1
0
 static public void addTheme(Theme Theme)
 {
     using (ThemeRepository Themerepo = new ThemeRepository())
     {
         Themerepo.Add(Theme);
         Themerepo.Save();
     }
 }
Пример #2
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            CartesianArea area = this.radChartView1.GetArea <CartesianArea>();

            area.ShowGrid = true;

            this.radDropDownList1.SelectedIndex = 0;

            LinearAxis verticalAcix = new LinearAxis();

            verticalAcix.AxisType = AxisType.Second;
            CategoricalAxis  horizontalAxis = new CategoricalAxis();
            PerformanceModel model          = new PerformanceModel();

            for (int i = 0; i < 4; i++)
            {
                BarSeries barSeries = new BarSeries("Performance", "RepresentativeName");
                barSeries.Name           = "Q" + (i + 1);
                barSeries.HorizontalAxis = horizontalAxis;
                barSeries.VerticalAxis   = verticalAcix;
                barSeries.DataSource     = model.GetData(i);
                this.radChartView1.Series.Add(barSeries);
                foreach (DataPointElement pointElement in barSeries.Children)
                {
                    pointElement.BorderWidth = 0;
                }
            }

            Theme theme = Theme.ReadCSSText(@"
                                            theme
                                            {
                                               name: ControlDefault;
                                               elementType: Telerik.WinControls.UI.RadChartElement; 
                                               controlType: Telerik.WinControls.UI.RadChartView; 
                                            }

                                            Bar
                                            {    
                                                HeightAspectRatio
                                                {
                                                    Value: 0.9;
                                                    EndValue: 1;
                                                    MaxValue: 1;
                                                    Frames: 30;
                                                    Interval: 20;
                                                    EasingType: InOutCubic;
                                                    RandomDelay: 200;
                                                    RemoveAfterApply: true; 
                                                }
                                            }
                                            ");

            ThemeRepository.Add(theme, false);
        }
Пример #3
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            this.radChartView1.Controllers.Add(new ChartSelectionController());
            this.radChartView1.Controllers.Add(new SmartLabelsController()
            {
                Strategy = new PieTwoLabelColumnsStrategy()
            });
            var toolTipController = new ChartTooltipController();

            toolTipController.DataPointTooltipTextNeeded += ToolTipController_DataPointTooltipTextNeeded;
            this.radChartView1.Controllers.Add(toolTipController);

            this.radChartView1.SelectionMode         = Telerik.WinControls.UI.ChartSelectionMode.MultipleDataPoints;
            this.radChartView1.SelectedPointChanged += new ChartViewSelectedChangedEventHandler(selectionController_SelectedPointChanged);
            //this.radChartView1.ShowLegend = true;
            //this.radChartView1.ChartElement.LegendElement.Font = this.radChartView1.Font;


            this.pieSeries                        = new PieSeries();
            this.pieSeries.ShowLabels             = true;
            this.pieSeries.DrawLinesToLabels      = true;
            this.pieSeries.SyncLinesToLabelsColor = true;
            this.pieSeries.Font                   = this.radChartView1.Font;
            this.pieSeries.RadiusFactor           = 0.9f;
            this.pieSeries.Range                  = new AngleRange(270, 360);

            Theme theme = Theme.ReadCSSText(@"
                                        theme
                                        {
                                           name: ControlDefault;
                                           elementType: Telerik.WinControls.UI.RadChartElement; 
                                           controlType: Telerik.WinControls.UI.RadChartView; 
                                        }

                                        PieSegment
                                        {    
                                            RadiusAspectRatio
                                            {
                                                Value: 0.5;
                                                EndValue: 1;
                                                MaxValue: 1;
                                                Frames: 20;
                                                Interval: 10;
                                                EasingType: OutCircular;
                                                RandomDelay: 100;
                                                RemoveAfterApply: true; 
                                            }
                                        }
                                        ");

            ThemeRepository.Add(theme, false);
        }
Пример #4
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            this.radLabel4.Visible          = false;
            this.radSpinDonutRadius.Visible = false;

            this.radChartView1.Controllers.Add(new ChartSelectionController());
            this.radChartView1.SelectedPointChanged += new ChartViewSelectedChangedEventHandler(selectionController_SelectedPointChanged);

            BindSelectionModeCombo();
            this.radDropDownList1.SelectedValueChanged += new EventHandler(radDropDownList1_SelectedValueChanged);
            this.radDropDownList1.SelectedValue         = ChartSelectionMode.SingleDataPoint;

            this.pieSeries = new PieSeries();
            this.PopulatePieSeries();
            this.radChartView1.Series.Clear();
            this.radChartView1.Series.Add(this.pieSeries);

            Theme theme = Theme.ReadCSSText(@"
                                        theme
                                        {
                                           name: ControlDefault;
                                           elementType: Telerik.WinControls.UI.RadChartElement; 
                                           controlType: Telerik.WinControls.UI.RadChartView; 
                                        }

                                        PieSegment
                                        {    
                                            RadiusAspectRatio
                                            {
                                                Value: 0.5;
                                                EndValue: 1;
                                                MaxValue: 1;
                                                Frames: 20;
                                                Interval: 10;
                                                EasingType: OutCircular;
                                                RandomDelay: 100;
                                                RemoveAfterApply: true; 
                                            }
                                        }
                                        ");

            ThemeRepository.Add(theme, false);
        }
Пример #5
0
        public ActionResult Ajouter(Excursion.Data.Theme theme)
        {
            Excursion.Data.Theme th = new Data.Theme();
            th.Nom_de = theme.Nom_de;
            th.Nom_en = theme.Nom_en;
            th.Nom_fr = theme.Nom_fr;
            th.Nom_it = theme.Nom_it;

            th.CodeTheme      = theme.CodeTheme;
            th.Description_de = theme.Description_de;
            th.Description_en = theme.Description_en;
            th.Description_fr = theme.Description_fr;
            th.Description_it = theme.Description_it;

            try
            {
                HttpPostedFileBase file      = Request.Files[0];
                byte[]             imageSize = new byte[file.ContentLength];
                file.InputStream.Read(imageSize, 0, (int)file.ContentLength);
                //
                string path = System.IO.Path.Combine(Server.MapPath("~/Images/Img/Theme"), System.IO.Path.GetFileName(file.FileName));
                file.SaveAs(path);
                //
                th.Photo = file.FileName.Split('\\').Last();
            }
            catch (Exception e)
            {
                ModelState.AddModelError("uploadError", e);
            }


            themeRepository.Add(th);
            themeRepository.Save();
            return(RedirectToAction("Ajouter", new RouteValueDictionary(
                                        new { controller = "Excursion", action = "Ajouter" })));
        }
Пример #6
0
        private void LoadControlDefaultTheme()
        {
            Theme      theme      = new Theme("ControlDefault");
            StyleGroup styleGroup = new StyleGroup();

            styleGroup.Registrations.Add(new StyleRegistration());
            styleGroup.Registrations[0].RegistrationType = "ElementTypeControlType";
            styleGroup.Registrations[0].ElementType      = "Telerik.WinControls.RootRadElement";
            styleGroup.Registrations[0].ControlType      = "Telerik.WinControls.UI.RadCarousel";
            theme.StyleGroups.Add(styleGroup);
            styleGroup.PropertySettingGroups.Add(new PropertySettingGroup()
            {
                Selector         = new ElementSelector(ElementSelectorTypes.ClassSelector, "PreviousButton"),
                PropertySettings =
                {
                    new PropertySetting("BackColor",    (object)Color.Transparent),
                    new PropertySetting("DisplayStyle", (object)DisplayStyle.Image),
                    new PropertySetting("Image",        (object)Telerik\u002EWinControls\u002EUI\u002EResources.previousButton)
                }
            });
            styleGroup.PropertySettingGroups.Add(new PropertySettingGroup()
            {
                Selector         = new ElementSelector(ElementSelectorTypes.ClassSelector, "NextButton"),
                PropertySettings =
                {
                    new PropertySetting("BackColor",    (object)Color.Transparent),
                    new PropertySetting("DisplayStyle", (object)DisplayStyle.Image),
                    new PropertySetting("Image",        (object)Telerik\u002EWinControls\u002EUI\u002EResources.nextButton)
                }
            });
            PropertySettingGroup propertySettingGroup1 = new PropertySettingGroup()
            {
                Selector = new ElementSelector(ElementSelectorTypes.ClassSelector, "NextButton")
            };

            propertySettingGroup1.Selector.ChildSelector = new ElementSelector(ElementSelectorTypes.ClassSelector, "ButtonFill");
            propertySettingGroup1.PropertySettings.Add(new PropertySetting("Visibility", (object)ElementVisibility.Hidden));
            styleGroup.PropertySettingGroups.Add(propertySettingGroup1);
            PropertySettingGroup propertySettingGroup2 = new PropertySettingGroup()
            {
                Selector = new ElementSelector(ElementSelectorTypes.ClassSelector, "NextButton")
            };

            propertySettingGroup2.Selector.ChildSelector = new ElementSelector(ElementSelectorTypes.ClassSelector, "ButtonBorder");
            propertySettingGroup2.PropertySettings.Add(new PropertySetting("Visibility", (object)ElementVisibility.Collapsed));
            styleGroup.PropertySettingGroups.Add(propertySettingGroup2);
            PropertySettingGroup propertySettingGroup3 = new PropertySettingGroup()
            {
                Selector = new ElementSelector(ElementSelectorTypes.ClassSelector, "PreviousButton")
            };

            propertySettingGroup3.Selector.ChildSelector = new ElementSelector(ElementSelectorTypes.ClassSelector, "ButtonFill");
            propertySettingGroup3.PropertySettings.Add(new PropertySetting("Visibility", (object)ElementVisibility.Hidden));
            styleGroup.PropertySettingGroups.Add(propertySettingGroup3);
            PropertySettingGroup propertySettingGroup4 = new PropertySettingGroup()
            {
                Selector = new ElementSelector(ElementSelectorTypes.ClassSelector, "PreviousButton")
            };

            propertySettingGroup4.Selector.ChildSelector = new ElementSelector(ElementSelectorTypes.ClassSelector, "ButtonBorder");
            propertySettingGroup4.PropertySettings.Add(new PropertySetting("Visibility", (object)ElementVisibility.Collapsed));
            styleGroup.PropertySettingGroups.Add(propertySettingGroup4);
            PropertySettingGroup propertySettingGroup5 = new PropertySettingGroup()
            {
                Selector = new ElementSelector(ElementSelectorTypes.VisualStateSelector, "CarouselGenericItem")
            };

            propertySettingGroup5.Selector.ChildSelector = new ElementSelector(ElementSelectorTypes.TypeSelector, "Telerik.WinControls.Primitives.TextPrimitive");
            propertySettingGroup5.PropertySettings.Add(new PropertySetting("ForeColor", (object)Color.Transparent));
            styleGroup.PropertySettingGroups.Add(propertySettingGroup5);
            PropertySettingGroup propertySettingGroup6 = new PropertySettingGroup()
            {
                Selector = new ElementSelector(ElementSelectorTypes.VisualStateSelector, "CarouselGenericItem")
            };

            propertySettingGroup6.Selector.ChildSelector = new ElementSelector(ElementSelectorTypes.TypeSelector, "Telerik.WinControls.Primitives.BorderPrimitive");
            propertySettingGroup6.PropertySettings.Add(new PropertySetting("ForeColor", (object)Color.Transparent));
            propertySettingGroup6.PropertySettings.Add(new PropertySetting("GradientStyle", (object)GradientStyles.Solid));
            propertySettingGroup6.PropertySettings.Add(new PropertySetting("BoxSyle", (object)BorderBoxStyle.SingleBorder));
            styleGroup.PropertySettingGroups.Add(propertySettingGroup6);
            PropertySettingGroup propertySettingGroup7 = new PropertySettingGroup()
            {
                Selector = new ElementSelector(ElementSelectorTypes.VisualStateSelector, "CarouselGenericItem")
            };

            propertySettingGroup7.Selector.ChildSelector = new ElementSelector(ElementSelectorTypes.TypeSelector, "Telerik.WinControls.Primitives.FillPrimitive");
            propertySettingGroup7.PropertySettings.Add(new PropertySetting("BackColor", (object)Color.Transparent));
            propertySettingGroup7.PropertySettings.Add(new PropertySetting("ForeColor2", (object)Color.Transparent));
            propertySettingGroup7.PropertySettings.Add(new PropertySetting("GradientStyle", (object)GradientStyles.Radial));
            propertySettingGroup7.PropertySettings.Add(new PropertySetting("ZIndex", (object)10));
            propertySettingGroup7.PropertySettings.Add(new PropertySetting("Visibility", (object)ElementVisibility.Collapsed));
            styleGroup.PropertySettingGroups.Add(propertySettingGroup7);
            PropertySettingGroup propertySettingGroup8 = new PropertySettingGroup()
            {
                Selector = new ElementSelector(ElementSelectorTypes.VisualStateSelector, "CarouselGenericItem.MouseOver")
            };

            propertySettingGroup8.Selector.ChildSelector = new ElementSelector(ElementSelectorTypes.TypeSelector, "Telerik.WinControls.Primitives.FillPrimitive");
            propertySettingGroup8.PropertySettings.Add(new PropertySetting("Visibility", (object)ElementVisibility.Visible));
            propertySettingGroup8.PropertySettings.Add(new PropertySetting()
            {
                Name     = "BackColor",
                EndValue = (object)Color.Transparent
            });
            propertySettingGroup8.PropertySettings.Add(new PropertySetting()
            {
                Name     = "BackColor2",
                EndValue = (object)Color.FromArgb(120, (int)byte.MaxValue, (int)byte.MaxValue, (int)byte.MaxValue)
            });
            propertySettingGroup8.PropertySettings.Add(new PropertySetting("GradientStyle", (object)GradientStyles.Radial));
            propertySettingGroup8.PropertySettings.Add(new PropertySetting("GradientAngle", (object)90f));
            propertySettingGroup8.PropertySettings.Add(new PropertySetting("GradientPercentage", (object)0.5f));
            propertySettingGroup8.PropertySettings.Add(new PropertySetting("GradientPercentage2", (object)0.666f));
            propertySettingGroup8.PropertySettings.Add(new PropertySetting("NumberOfColors", (object)2));
            styleGroup.PropertySettingGroups.Add(propertySettingGroup8);
            ThemeRepository.Add(theme);
        }