Exemplo n.º 1
0
        protected void ReloadFiles()
        {
            _colors.Clear();
            ISet <string> colors = new HashSet <string>();

            foreach (string color in _colorResourceFiles.SelectMany(crd => crd.Colors.Keys))
            {
                colors.Add(color);
            }
            int index = 0;

            foreach (string color in colors.OrderBy(c => c))
            {
                _colors.Add(new ColorRow(this, color, index++));
            }
            GridViewColumnCollection gvcc = ((GridView)ColorsList.View).Columns;

            for (int i = gvcc.Count; i > _colorResourceFiles.Count + 1; i--)
            {
                gvcc.RemoveAt(i - 1);
            }
            for (int i = gvcc.Count; i < _colorResourceFiles.Count + 1; i++)
            {
                DataTemplate colorTemplate = ColorsList.FindResource("ColorTemplate" + (i - 1)) as DataTemplate;
                gvcc.Add(new GridViewColumn
                {
                    Width        = 150,
                    Header       = _colorResourceFiles[i - 1].ThemeName,
                    CellTemplate = colorTemplate,
                });
            }
        }
Exemplo n.º 2
0
    void Awake()
    {
        usingCombine            = "";
        gameManager             = this;
        fileReader              = GetComponent <FileReader>();
        fileReader.combinations = Resources.LoadAll("Combinations", typeof(TextAsset)).Cast <TextAsset>().ToArray();
        fileReader.signs        = Resources.Load <TextAsset>("signs");
        fileReader.ReadSignsFile();
        fileReader.LoadCombinations();
        saveFound = new List <string>();

        /*baseSign.Add("0-1-1-1-0-1-1-RED");
         * baseSign.Add("0-0-0-0-1-0-1-RED");
         * baseSign.Add("0-1-1-0-0-0-1-BLUE");
         * baseSign.Add("1-0-1-0-1-0-1-GREEN");
         * baseSign.Add("0-1-1-1-0-1-1-YELLOW");
         * baseSign.Add("1-0-0-1-0-1-1-PINK");
         * baseSign.Add("0-1-1-1-0-1-1-GREEN");*/

        /* foundSign.Add("0-1-1-1-0-1-1-GREEN");
         * foundSign.Add("0-1-1-1-0-1-1-RED");
         * foundSign.Add("0-1-1-1-0-1-1-YELLOW");
         * foundSign.Add("1-0-0-1-0-1-1-PINK");*/

        //baseLore.Add("0-1-1-1-0-1-1-GREEN+0-1-1-0-0-0-1-BLUE");
        //baseLore.Add("0-1-1-1-0-1-1-YELLOW+0-1-1-1-0-1-1-RED");
        //foundLore.Add("0-1-1-0-0-0-1-BLUE+0-1-1-1-0-1-1-RED");
        Load();
        colorsList = new ColorsList(baseSign);
    }
        private void ComboBox_Loaded(object sender, RoutedEventArgs e)
        {
            ColorConverter colorConverter = new ColorConverter();
            object         _currentColor  = colorConverter.ConvertFromInvariantString(Default.BlockBackgroundBrush);
            Color          currentColor   = _currentColor == null ? Colors.LightBlue : ((Color)_currentColor);

            ColorSelecter.SelectedIndex = ColorsList.FindIndex(p => p.Color == currentColor);
        }
Exemplo n.º 4
0
    public string GetColorName()
    {
        ColorsList colors = new ColorsList();

        foreach (var color in colors.Colors)
        {
            if (color.Value.Equals(Color))
            {
                return(color.Key);
            }
        }
        return("Default");
    }
Exemplo n.º 5
0
        public MainWindow()
        {
            this.DataContext = this;
            InitializeComponent();

            this.colors             = ColorsList.Instance;
            this.defaultStrokeColor = colors[Colors.Black];
            this.defaultFillColor   = colors[Colors.Transparent];

            this.FillColor.ItemsSource   = colors.List;
            this.StrokeColor.ItemsSource = colors.List;

            this.StrokeColor.SelectedItem = defaultStrokeColor;
            this.FillColor.SelectedItem   = defaultFillColor;
        }
Exemplo n.º 6
0
    /// <summary>
    ///
    /// Set Last Panel
    ///
    /// </summary>



    public void SetUI(string parent, string listType)
    {
        List <Item> items = new List <Item>();
        var         ds    = new DataService("tf_database.db");

        if (listType == "Item")
        {
            items = ds.GetShopChildItems(-1, parent);
        }
        else if (listType == "Color")
        {
            Item item = new Item();
            item = ds.GetItemByName(parent);
            ColorsList colors = new ColorsList();
            //Get all purchased items to not show one already bought
            List <Item> purchasedItems = ds.GetAllNonDestroyablePurchasedItems();
            foreach (var color in colors.Colors)
            {
                Item tempItem = new Item(item);
                if (!tempItem.Name.Contains(color.Key))
                {
                    tempItem.Name = tempItem.Name + " " + color.Key;
                }

                tempItem.Color = color.Value;
                bool toShow = true;
                foreach (Item purchasedItem in purchasedItems)
                {
                    if (purchasedItem.IsEqual(tempItem))
                    {
                        toShow = false;
                    }
                }
                if (toShow)
                {
                    items.Add(tempItem);
                }
            }
        }

        Transform[] prefabs = new Transform[lastPanelScrollContent.transform.childCount];
        for (int j = 0; j < lastPanelScrollContent.transform.childCount; j++)
        {
            prefabs[j] = lastPanelScrollContent.transform.GetChild(j);
        }
        SetItems(items, prefabs);
    }
Exemplo n.º 7
0
 public void initializeColorList()
 {
     ColorsList.Add(new CGColor[2] {
         UIColor.FromRGB(45, 189, 212).CGColor, UIColor.FromRGB(187, 210, 198).CGColor
     });
     ColorsList.Add(new CGColor[2] {
         UIColor.FromRGB(224, 50, 115).CGColor, UIColor.FromRGB(251, 147, 66).CGColor
     });
     ColorsList.Add(new CGColor[2] {
         UIColor.FromRGB(37, 191, 44).CGColor, UIColor.FromRGB(216, 204, 121).CGColor
     });
     ColorsList.Add(new CGColor[2] {
         UIColor.FromRGB(137, 25, 178).CGColor, UIColor.FromRGB(237, 168, 152).CGColor
     });
     ColorsList.Add(new CGColor[2] {
         UIColor.FromRGB(32, 98, 229).CGColor, UIColor.FromRGB(30, 197, 206).CGColor
     });
 }
Exemplo n.º 8
0
        public ChartData GetStandardsResultsByCategory()
        {
            int       assessmentId = Auth.AssessmentForUser();
            ChartData chartData    = new ChartData();

            using (CSET_Context context = new CSET_Context())
            {
                context.LoadStoredProc("[usp_getStandardsResultsByCategory]")
                .WithSqlParam("assessment_Id", assessmentId)
                .ExecuteStoredProc((handler) =>
                {
                    var result = handler.ReadToList <usp_getStandardsResultsByCategory>();
                    var labels = (from usp_getStandardsResultsByCategory an in result
                                  orderby an.Question_Group_Heading
                                  select an.Question_Group_Heading).Distinct().ToList();

                    chartData.DataRows = new List <DataRows>();
                    foreach (string c in labels)
                    {
                        //    chartData.data.Add((double) c.prc);
                        chartData.Labels.Add(c);
                        //    chartData.DataRows.Add(new DataRows()
                        //    {
                        //        failed =c.yaCount,
                        //        percent = c.prc,
                        //        total = c.Actualcr,
                        //        title = c.Question_Group_Heading
                        //   });
                    }

                    ColorsList colors = new ColorsList();

                    var sets = (from usp_getStandardsResultsByCategory an in result
                                select new { an.Set_Name, an.Short_Name }).Distinct();
                    foreach (var set in sets)
                    {
                        ChartData nextChartData = new ChartData();
                        chartData.dataSets.Add(nextChartData);
                        nextChartData.DataRows = new List <DataRows>();
                        var nextSet            = (from usp_getStandardsResultsByCategory an in result
                                                  where an.Set_Name == set.Set_Name
                                                  orderby an.Question_Group_Heading
                                                  select an).ToList();
                        nextChartData.label           = set.Short_Name;
                        nextChartData.backgroundColor = colors.getNext(set.Set_Name);
                        foreach (usp_getStandardsResultsByCategory c in nextSet)
                        {
                            nextChartData.data.Add((double)c.prc);
                            nextChartData.Labels.Add(c.Question_Group_Heading);
                            nextChartData.DataRows.Add(new DataRows()
                            {
                                failed  = c.yaCount,
                                percent = c.prc,
                                total   = c.Actualcr,
                                title   = c.Question_Group_Heading
                            });
                        }
                    }
                });
            }

            return(chartData);
        }
Exemplo n.º 9
0
    protected void Page_Load(object sender, System.EventArgs e)
    {
        if (Page.IsPostBack == false)
        {
            LabelTitre.Text = "Edition d'un StyleWeb";
            if (Request.QueryString["Style"] != null && Request.QueryString["Type"] != null)
            {
                string styleNom = Request.QueryString["Style"].ToString();
                string type     = Request.QueryString["Type"].ToString();
                if (type == TypeStyleWeb.Table)
                {
                    PanelTypeTable.Visible = true;
                }
                string membre = HttpContext.Current.User.Identity.Name;
                styleWebObjet           = XmlStyleWebProvider.GetStyleWeb(membre, styleNom, type);
                primaryStyle            = StyleWeb.StyleWebToStyle(styleWebObjet);
                LabelTitre.Text        += " : " + styleNom + "&nbsp;: " + type;
                LabelApplicable.Visible = styleWebObjet.Applicable == false;
            }

            if (Request.QueryString["ReturnUrl"] != null)
            {
                returnUrl = Request.QueryString["ReturnUrl"].ToString();
            }

            TextBoxPadding.Text     = styleWebObjet.Padding.ToString();
            TextBoxSpacing.Text     = styleWebObjet.Spacing.ToString();
            TextBoxWidth.Text       = /*styleWebObjet.Width == 0 ? "" :*/ styleWebObjet.Width.ToString();
            TextBoxHeight.Text      = /*styleWebObjet.Height == 0 ? "" :*/ styleWebObjet.Height.ToString();
            TextBoxBorderWidth.Text = styleWebObjet.BorderWidth == 0 ? "" : styleWebObjet.BorderWidth.ToString();
            TextBoxFontSize.Text    = styleWebObjet.FontSize.ToString();

            ColorsList colors = new ColorsList();

            DropDownListBorderColor.DataSource = colors;
            DropDownListBorderColor.DataBind();
            if (styleWebObjet.BorderColor != "none")
            {
                TextBoxBorderColor.Text = styleWebObjet.BorderColor;
                DropDownListBorderColor.SelectedValue = ColorTranslator.FromHtml(styleWebObjet.BorderColor).Name;
                ColorPickerBorderColor.SelectedColor  = ColorTranslator.FromHtml(styleWebObjet.BorderColor);
            }

            DropDownListBackColor.DataSource = colors;
            DropDownListBackColor.DataBind();
            if (styleWebObjet.BackColor != "none")
            {
                TextBoxBackColor.Text = styleWebObjet.BackColor;
                DropDownListBackColor.SelectedValue = ColorTranslator.FromHtml(styleWebObjet.BackColor).Name;
                ColorPickerBackColor.SelectedColor  = ColorTranslator.FromHtml(styleWebObjet.BackColor);
            }

            DropDownListForegroundColor.DataSource = colors;
            DropDownListForegroundColor.DataBind();
            if (styleWebObjet.ForeColor != "none")
            {
                TextBoxForegroundColor.Text = styleWebObjet.ForeColor;
                DropDownListForegroundColor.SelectedValue = ColorTranslator.FromHtml(styleWebObjet.ForeColor).Name;
                ColorPickerForegroundColor.SelectedColor  = ColorTranslator.FromHtml(styleWebObjet.ForeColor);
            }

            // Add data to the borderStyleList control.
            ListItemCollection styles = new ListItemCollection();
            Type styleType            = typeof(BorderStyle);
            foreach (string s in Enum.GetNames(styleType))
            {
                styles.Add(s);
            }
            DropDownListBorderStyle.DataSource = styles;
            DropDownListBorderStyle.DataBind();
            DropDownListBorderStyle.SelectedIndex = styleWebObjet.BorderStyle;

            // Add data to the borderWidthList control.
            ListItemCollection widths = new ListItemCollection();
            for (int i = 0; i < 46; i++)
            {
                widths.Add(i.ToString() + "px");
            }
            DropDownListBorderWidthList.DataSource = widths;
            DropDownListBorderWidthList.DataBind();

            // Add data to the fontNameList control.
            ListItemCollection names = new ListItemCollection();
            foreach (FontFamily oneFontFamily in FontFamily.Families)
            {
                names.Add(oneFontFamily.Name);
            }
            DropDownListFontName.DataSource = names;
            DropDownListFontName.DataBind();

            // ca ne marche surement pas
            ListItem li = new ListItem(styleWebObjet.FontName);
            if (DropDownListFontName.Items.Contains(li))
            {
                DropDownListFontName.SelectedValue = styleWebObjet.FontName;
            }

            // Add data to the fontSizeList control.
            ListItemCollection fontSizes = new ListItemCollection();
            fontSizes.Add("Small");
            fontSizes.Add("Medium");
            fontSizes.Add("Large");
            fontSizes.Add("8pt");
            fontSizes.Add("10pt");
            fontSizes.Add("12pt");
            fontSizes.Add("14pt");
            fontSizes.Add("16pt");
            fontSizes.Add("18pt");
            fontSizes.Add("20pt");
            fontSizes.Add("24pt");
            fontSizes.Add("48pt");
            DropDownListFontSize.DataSource = fontSizes;
            DropDownListFontSize.DataBind();

            // Font Style
            ListItemCollection stylesF = new ListItemCollection();
            Type styleTypeF            = typeof(FontStyle);
            foreach (string s in Enum.GetNames(styleTypeF))
            {
                stylesF.Add(s);
            }
            stylesF.Add("Overline");   // qui n'est pas dans FontStyle ???!!
            CheckBoxListFontStyle.DataSource = stylesF;
            CheckBoxListFontStyle.DataBind();

            CheckBoxListFontStyle.Items[1].Selected = styleWebObjet.Bold;
            CheckBoxListFontStyle.Items[2].Selected = styleWebObjet.Italic;
            CheckBoxListFontStyle.Items[3].Selected = styleWebObjet.Underline;
            CheckBoxListFontStyle.Items[4].Selected = styleWebObjet.Strikeout;
            CheckBoxListFontStyle.Items[5].Selected = styleWebObjet.Overline;
        }

        // Construire l'objet a chaque fois
        switch (styleWebObjet.Type)
        {
        case "Label":
            Label lbl = new Label();
            lbl.ID   = "ObjetID";
            lbl.Text = Texte;
            PanelObjet.Controls.Add(lbl);
            break;

        case "TextBox":
            TextBox txb = new TextBox();
            txb.ID   = "ObjetID";
            txb.Text = Texte;
            PanelObjet.Controls.Add(txb);
            break;

        case "RadioButtonList":
            RadioButtonListStyle rbl = new RadioButtonListStyle();
            rbl.ID = "ObjetID";
            rbl.Items.Add("article 1");
            rbl.Items.Add("article 2");
            rbl.Items.Add("article 3");
            PanelObjet.Controls.Add(rbl);
            break;

        case "CheckBoxList":
            CheckBoxListStyle cbl = new CheckBoxListStyle();
            cbl.ID = "ObjetID";
            cbl.Items.Add("article 1");
            cbl.Items.Add("article 2");
            cbl.Items.Add("article 3");
            PanelObjet.Controls.Add(cbl);
            break;

        case "Table":
            Table tbl = new Table();
            if (IsPostBack == false)
            {
                int padding = 0;
                try
                {
                    padding         = int.Parse(styleWebObjet.Padding);
                    tbl.CellPadding = padding;
                }
                catch
                {
                }
                int spacing = 0;
                try
                {
                    spacing         = int.Parse(styleWebObjet.Padding);
                    tbl.CellSpacing = spacing;
                }
                catch
                {
                }
            }
            else
            {
                int padding = 0;
                try
                {
                    padding         = int.Parse(TextBoxPadding.Text);
                    tbl.CellPadding = padding;
                }
                catch
                {
                }
                int spacing = 0;
                try
                {
                    spacing         = int.Parse(TextBoxSpacing.Text);
                    tbl.CellSpacing = spacing;
                }
                catch
                {
                }
            }
            TableRow  row  = new TableRow();
            TableCell cell = new TableCell();
            cell.Controls.Add(new LiteralControl(Texte));
            row.Cells.Add(cell);
            tbl.Rows.Add(row);
            this.Controls.Add(tbl);
            tbl.ID = "ObjetID";
            PanelObjet.Controls.Add(tbl);
            break;
        }

        Page.Form.DefaultButton = ButtonWidthOk.UniqueID; // Pour donner le focus
    }
Exemplo n.º 10
0
        public ColorLinkViewModel()
        {
            if (!DesignerProperties.IsInDesignTool)
            {
                Client.GetAllBrandsCompleted += (s, sv) =>
                {
                    BrandsList = sv.Result;
                };
                Client.GetAllBrandsAsync(LoggedUserInfo.Iserial);

                var seasonClient = new CRUD_ManagerServiceClient();
                seasonClient.GetGenericCompleted += (s, sv) =>
                {
                    SeasonList = sv.Result;
                };
                seasonClient.GetGenericAsync("TblLkpSeason", "%%", "%%", "%%", "Iserial", "ASC");

                Client.GetTblColorCompleted += (s, sv) =>
                {
                    // ColorsList.Clear();
                    //  GenericMapper.InjectFromObCollection(ColorsList, sv.Result);

                    foreach (var row in sv.Result)
                    {
                        ColorsList.Add(new TblColor().InjectFrom(row) as TblColor);
                    }

                    Loading         = false;
                    DetailFullCount = sv.fullCount;
                };
                Client.GetTblColorLinkCompleted += (s, sv) =>
                {
                    foreach (var row in sv.Result)
                    {
                        //if (!MainRowList.Contains(row.TblColor1))
                        //{
                        TblColor col = new TblColor();
                        col.Iserial    = row.TblColor1.Iserial;
                        col.Code       = row.TblColor1.Code;
                        col.Ename      = row.TblColor1.Ename;
                        col.Aname      = row.TblColor1.Aname;
                        col.PantonCode = row.PantonCode;

                        MainRowList.Add(col);
                        // }
                    }
                    Loading   = false;
                    FullCount = sv.fullCount;
                };

                lkpClient.GetTblBrandSectionLinkCompleted += (s, sv) =>
                {
                    if (Copy)
                    {
                        BrandSectionListCopy.Clear();
                        foreach (var row in sv.Result)
                        {
                            BrandSectionListCopy.Add(row.TblLkpBrandSection1);
                        }
                        Copy = false;
                    }
                    else
                    {
                        BrandSectionList.Clear();
                        foreach (var row in sv.Result)
                        {
                            BrandSectionList.Add(row.TblLkpBrandSection1);
                        }
                    }
                    Loading = false;
                };

                Client.UpdateOrDeleteTblColorLinkCompleted += (s, ev) =>
                {
                    if (ev.Error != null)
                    {
                    }
                    else
                    {
                        MainRowList.Clear();
                        GetMaindata();
                    }
                    Loading = false;
                };

                Client.CopyColorLinkCompleted += (s, sv) =>
                {
                    Loading = false;
                };
            }
        }