Пример #1
0
        //Skins Personalizadas => nao tem

        /// <summary>
        /// Retorna o tema default caso algo errado => Office 2013 Light Gray
        /// </summary>
        /// <param name="skinRibbonGalleryBarItem1"></param>
        /// <returns></returns>
        public static string GetSelectSkin(SkinRibbonGalleryBarItem skinRibbonGalleryBarItem1)
        {
            int i = 0;

            foreach (GalleryItemGroup group in skinRibbonGalleryBarItem1.Gallery.Groups)
            {
                var galleryItemList = group.GetCheckedItems();
                //Skins Padrão
                //Skins Extras
                //Skins temáticos
                //Skins Personalizadas
                foreach (var item in galleryItemList)
                {
                    Console.WriteLine(item.Caption);
                    if (item.Checked)
                    {
                        TypeSkinTheme indexGroup = (TypeSkinTheme)i;

                        string skin = GetSelectSkinFromGalleryItem(group, item, indexGroup);

                        return(skin);
                    }
                }
                i++;
            }
            return("Office 2013 Light Gray");
        }
Пример #2
0
 /// <summary>
 /// Retorna o tema default caso algo errado => Office 2013 Light Gray
 /// </summary>
 /// <param name="group"></param>Grupo do tema
 /// <param name="indexGroup"></param>
 /// <returns></returns>
 private static void PrintSkins(GalleryItemGroup group, TypeSkinTheme indexGroup)
 {
     foreach (GalleryItem item in group.Items)
     {
         //Esse eh o skin que eu preciso salvar
         string skin = item.Caption;
         Console.WriteLine(skin);
     }
 }
Пример #3
0
 /// <summary>
 /// Retorna o tema default caso algo errado => Office 2013 Light Gray
 /// </summary>
 /// <param name="skinRibbonGalleryBarItem1"></param>
 /// <returns></returns>
 public static void PrintGroupSkins(SkinRibbonGalleryBarItem skinRibbonGalleryBarItem1)
 {
     for (int i = 0; i < skinRibbonGalleryBarItem1.Gallery.Groups.Count; i++)
     {
         var group = skinRibbonGalleryBarItem1.Gallery.Groups[i];
         Console.WriteLine(group.Caption);
         Console.WriteLine("============================================================");
         TypeSkinTheme indexGroup = (TypeSkinTheme)i;
         PrintSkins(group, indexGroup);
         Console.WriteLine("============================================================");
     }
 }
Пример #4
0
        /// <summary>
        /// Retorna o tema default caso algo errado => Office 2013 Light Gray
        /// </summary>
        /// <param name="group"></param>Grupo do tema
        /// <param name="indexGroup"></param>
        /// <returns></returns>
        public static string GetSelectSkin(GalleryItemGroup group, TypeSkinTheme indexGroup)
        {
            string skin = "Office 2013 Light Gray";//tema padrão

            for (var j = 0; j < group.Items.Count; j++)
            {
                var item = group.Items[j];

                if (item != null)
                {
                    if (item.Checked)
                    {
                        //Esse eh o skin que eu preciso salvar
                        skin = item.Caption;

                        try
                        {
                            //pega o nome original
                            if (indexGroup == TypeSkinTheme.Default)
                            {
                                skin = SKINS_DEFAULT[j];
                            }

                            else if (indexGroup == TypeSkinTheme.Bonus)
                            {
                                skin = SKINS_BONUS[j];
                            }
                            else
                            {
                                skin = SKINS_THEME[j];
                            }

                            //obtem o tema
                            return(skin);
                        }
                        catch
                        {
                            //Nao se importe se realizou ou nao uma acao tao simples
                            //no pior caso deixa o tema q tava
                        }
                    }
                }
            }
            return(skin);
        }
Пример #5
0
        /// <summary>
        /// Retorna o tema default caso algo errado => Office 2013 Light Gray
        /// </summary>
        /// <param name="group"></param>Grupo do tema
        /// <param name="indexGroup"></param>
        /// <returns></returns>
        public static string GetSelectSkinFromGalleryItem(GalleryItemGroup group, GalleryItem g, TypeSkinTheme indexGroup)
        {
            string skin = "Office 2013 Light Gray";//tema padrão

            for (var i = 0; i < group.Items.Count; i++)
            {
                var item = group.Items[i];

                if (item != null && item.Caption.Equals(g.Caption))
                {
                    try
                    {
                        //Esse eh o skin que eu preciso salvar
                        //pega o nome original
                        if (indexGroup == TypeSkinTheme.Default)
                        {
                            skin = SKINS_DEFAULT[i];
                        }

                        else if (indexGroup == TypeSkinTheme.Bonus)
                        {
                            skin = SKINS_BONUS[i];
                        }
                        else
                        {
                            skin = SKINS_THEME[i];
                        }

                        //obtem o tema
                        return(skin);
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine("Tema nao encontrado => " + ex.Message);
                        //Nao se importe se realizou ou nao uma acao tao simples
                        //no pior caso deixa o tema q tava
                    }
                }
            }
            return(skin);
        }