Beispiel #1
0
        static void Start()
        {
            string Directory = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);

            FilePath = Directory + @"\" + FileName;
            Console.WriteLine("\nSearch path: " + FilePath);

            if (File.Exists(FilePath))
            {
                Console.WriteLine("--------");
                Console.WriteLine("Attention: make backup of your Unity.exe file!");
                Console.WriteLine("Press Enter to change skin...");
                Console.ReadKey();
                Console.WriteLine("Please wait...");

                BytePosition = GetBytePosition();

                try
                {
                    if (BytePosition != 0)
                    {
                        Console.WriteLine("--------");
                        Console.WriteLine("Please wait...");

                        GetSkin(BytePosition);
                        Console.WriteLine("Current skin: " + Skin.ToString());

                        Console.WriteLine("Please wait...");
                        ToggleSkinType();

                        GetSkin(BytePosition);
                        Console.WriteLine("Current skin: " + Skin.ToString());
                    }
                    else
                    {
                        Console.WriteLine("--------");
                        Console.WriteLine("Signature is not found. Choose another file.");
                    }
                }
                catch (Exception e)
                {
                    Console.WriteLine("--------");
                    Console.WriteLine("Error is ocurred...");
                    Console.WriteLine("Run application as an Adminisrator: " + e.ToString());
                }

                Console.WriteLine("--------");
                Console.WriteLine("Done!");
            }
            else
            {
                Console.WriteLine(FileName + " not found.\nPlease copy this application to folder with " + FileName);
            }

            Console.ReadKey();
        }
Beispiel #2
0
 public override List <string> GetTags()
 {
     return(new List <string>()
     {
         "Skin", skinType.ToString() + " Skin"
     });
 }
Beispiel #3
0
        /// <summary>
        /// 将程序集中嵌入的指定皮肤释放到指定的路径下,成功即返回全路径,失败则返回空字符串string.Empty
        /// </summary>
        /// <param name="runPath"></param>
        /// <param name="skin"></param>
        /// <returns></returns>
        public static string ExtractToFile(string runPath, SkinType skin)
        {
            if (!Directory.Exists(runPath))
            {
                return(string.Empty);
            }
            if (!runPath.EndsWith("\\"))
            {
                runPath += "\\";
            }
            string skinFile = runPath + skin.ToString() + ".ssk";

            try
            {
                Assembly ass = Assembly.LoadFrom("Resources.dll");
                using (Stream s = ass.GetManifestResourceStream(@"KellControls.Resources.Resources.Skin." + skin.ToString() + ".ssk"))
                {
                    using (FileStream fs = new FileStream(skinFile, FileMode.Create, FileAccess.Write))
                    {
                        s.CopyTo(fs);
                        fs.Flush();
                    }
                }
                return(skinFile);
            }
            catch
            {
                if (File.Exists(skinFile))
                {
                    File.Delete(skinFile);
                }
                return(string.Empty);
            }
        }
        /// <summary>
        /// Changes the skin.
        /// </summary>
        /// <param name="st">The st.</param>
        public static void ChangeSkin(SkinType st)
        {
            System.Reflection.Assembly thisDll = System.Reflection.Assembly.GetExecutingAssembly();
            if (se == null)
            {
                se = new Sunisoft.IrisSkin.SkinEngine(Application.OpenForms[0], thisDll.GetManifestResourceStream("Fm.Src.Common.SkinProcessor.Skins." + st.ToString() + ".ssk"));
                se.Active = true;
                for (int i = 0; i < Application.OpenForms.Count; i++)
                {
                    se.AddForm(Application.OpenForms[i]);
                }

            }
            else
            {
                se.SkinStream = thisDll.GetManifestResourceStream("FT.Commons.SkinProcessor.Skins." + st.ToString() + ".ssk");
                se.Active = true;
            }
        }
 /// <summary>
 /// 改变皮肤
 /// </summary>
 /// <param name="st"></param>
 public static void ChangeSkin(SkinType st)
 {
     System.Reflection.Assembly thisDll = System.Reflection.Assembly.GetExecutingAssembly();
     if (se == null)
     {
         //ShortMessageClient是指命名空间,这里你可以换成你自己的。
         se        = new Sunisoft.IrisSkin.SkinEngine(Application.OpenForms[0], thisDll.GetManifestResourceStream("OSM.skin." + st.ToString() + ".ssk"));
         se.Active = true;
         for (int i = 0; i < Application.OpenForms.Count; i++)
         {
             se.AddForm(Application.OpenForms[i]);
         }
     }
     else
     {
         //ShortMessageClient是指命名空间,这里你可以换成你自己的。
         se.SkinStream = thisDll.GetManifestResourceStream("OSM.Skin." + st.ToString() + ".ssk");
         se.Active     = true;
     }
 }
Beispiel #6
0
 /// <summary>
 ///     获取皮肤
 /// </summary>
 /// <param name="assembly"></param>
 /// <param name="themePath"></param>
 /// <param name="skin"></param>
 /// <returns></returns>
 public static ResourceDictionary GetSkin(Assembly assembly, string themePath, SkinType skin) => new ResourceDictionary
 {
     Source = new Uri($"pack://application:,,,/{assembly.GetName().Name};component/{themePath}/Skin{skin.ToString()}.xaml")
 };
Beispiel #7
0
 /// <summary>
 ///     获取HandyControl皮肤
 /// </summary>
 /// <param name="skin"></param>
 /// <returns></returns>
 public static ResourceDictionary GetSkin(SkinType skin) => new ResourceDictionary
 {
     Source = new Uri($"pack://application:,,,/HandyControl;component/Themes/Skin{skin.ToString()}.xaml")
 };
Beispiel #8
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="skin"></param>
 /// <returns></returns>
 public static ResourceDictionary GetSkin(SkinType skin)
 {
     return(new ResourceDictionary
     {
         Source = new Uri($"pack://application:,,,/PersianToolkit;component/Themes/Skin{skin.ToString()}.xaml")
     });
 }
Beispiel #9
0
        /// <summary>
        /// 改变皮肤
        /// </summary>
        /// <param name="st"></param>

        public static void ChangeSkin(SkinType st)
        {
            System.Reflection.Assembly thisDll = System.Reflection.Assembly.GetExecutingAssembly();


            if (se == null)
            {
                //WallControl是指命名空间,这里你可以换成你自己的。
                se        = new Sunisoft.IrisSkin.SkinEngine(Application.OpenForms[0], thisDll.GetManifestResourceStream("WallControl.skin." + st.ToString() + ".ssk"));
                se.Active = true;
                for (int i = 0; i < Application.OpenForms.Count; i++)
                {
                    se.AddForm(Application.OpenForms[i]);
                }
            }
            else
            {
                //WallControl是指命名空间,这里你可以换成你自己的。
                se.SkinAllForm = true;    // 这句话是用来设置整个系统下所有窗体都采用这个皮肤
                se.SkinStream  = thisDll.GetManifestResourceStream("WallControl.skin." + st.ToString() + ".ssk");
                se.Active      = true;
            }
        }
Beispiel #10
0
        private void SetupGridScripts()
        {
            if ((Page == null || !GotHttpContext) && !DesignMode)
            {
                return;
            }

            if (Scripts == null || !Scripts.DisableJQuery)
            {
                RegisterClientScriptResourceInHeader(Page, GetType(), "WebGrid.Resources.jquery-1.3.2.min.js", "JQuery");
            }
            if (Scripts == null || !Scripts.DisableJQueryUI)
            {
                RegisterClientScriptResourceInHeader(Page, GetType(), "WebGrid.Resources.jquery-ui-1.7.2.custom.min.js", "JQueryUI");
            }
            if (Scripts == null || !Scripts.DisableBookmark)
            {
                RegisterClientScriptResourceInHeader(Page, GetType(), "WebGrid.Resources.jquery-bookmark.js", "JqueryBookmark");
            }
            if (Scripts == null || !Scripts.DisableContextMenu)
            {
                RegisterClientScriptResourceInHeader(Page, GetType(), "WebGrid.Resources.jquery.contextMenu.js", "contextMenu");
            }
            if (Scripts == null || !Scripts.DisableSelectMenu)
            {
                RegisterClientScriptResourceInHeader(Page, GetType(), "WebGrid.Resources.jquery-ui.selectmenu.js", "contextMenu");
            }



            if (Scripts == null || !Scripts.DisableInputMask)
            {
                RegisterClientScriptResourceInHeader(Page, GetType(), "WebGrid.Resources.jquery.meio.mask.min.js", "meiomask");
            }
            if (Scripts == null || !Scripts.DisableClientNotification)
            {
                RegisterClientScriptResourceInHeader(Page, GetType(), "WebGrid.Resources.jquery.jgrowl_minimized.js", "jgrowl");
            }

            if (Scripts == null || !Scripts.DisableToolTip)
            {
                RegisterClientScriptResourceInHeader(Page, GetType(), "WebGrid.Resources.jquery.qtip-1.0.0-rc3.min.js", "qtip");
            }

            if (Scripts == null || !Scripts.DisablePopupExtender)
            {
                RegisterClientScriptResourceInHeader(Page, GetType(), "WebGrid.Resources.jquery.colorbox-min.js", "colorbox");
            }

            RegisterClientScriptResourceInHeader(Page, GetType(), "WebGrid.Resources.WebGrid_ColumnChanged.js", "WebGrid_ColumnChanged");
            RegisterClientScriptResourceInHeader(Page, GetType(), "WebGrid.Resources.WebGrid_Misc.js", "WebGrid_Misc");

            if (Page != null)
            {
                if (EnableCallBack && !Page.ClientScript.IsClientScriptBlockRegistered("wgRegisterAnthem"))
                {
                    Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "wgRegisterAnthem", string.Empty);
                    Page.ClientScript.RegisterHiddenField("WebGrid_EnabledAnthem", "true");

                    if (EnableCallBackErrorAlert)
                    {
                        if (!Debug)
                        {
                            Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "wgAnthemError",
                                                                        "function Anthem_Error(result) { alert('Ajax  Error:\\r'+ result.error);}",
                                                                        true);
                        }
                        else
                        {
                            Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "wgAnthemDebugError",
                                                                        "function Anthem_DebugError(text) { alert('Ajax Debug Error:\\r'+ text);}",
                                                                        true);
                        }
                    }
                    if (Scripts == null || !Scripts.DisableAjaxLoader)
                    {
                        Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "wgAnthemPreCallBack",
                                                                    @"function Anthem_PreCallBack() {
                        $(""#"" + wg_gridupdate).find("".wgAjaxLoader:first"").css(""z-index"", ""10000"");
                        $(""#"" + wg_gridupdate).find("".wgAjaxLoader:first"").css(""visibility"", ""visible"");}",
                                                                    true);
                    }
                }

                if (!Page.ClientScript.IsClientScriptBlockRegistered("wgRegisterStyle"))
                {
                    Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "wgRegisterStyle", string.Empty);
                    StringBuilder csslink = new StringBuilder();

                    switch (SkinType)
                    {
                    case SkinType.WebGridJQuery:
                        csslink.Append("<link href=\"");
                        csslink.Append(Page.ClientScript.GetWebResourceUrl(GetType(), "WebGrid.Resources.WebGrid_JQueryUI.css").Replace("&", "&amp;"));
                        csslink.Append("\" rel=\"stylesheet\" type=\"text/css\" />");
                        break;

                    case SkinType.Disabled:
                        break;

                    default:
                        csslink.AppendFormat("<link href=\"{0}\" rel=\"stylesheet\" type=\"text/css\" />",
                                             Page.ClientScript.GetWebResourceUrl(GetType(),
                                                                                 string.Format("WebGrid.Resources.jquery-ui-{0}.css", SkinType.ToString().ToLower()))).
                        Replace("&", "&amp;");
                        csslink.Append("<link href=\"");
                        csslink.Append(Page.ClientScript.GetWebResourceUrl(GetType(), "WebGrid.Resources.WebGrid_JQueryUI.css").Replace("&", "&amp;"));
                        csslink.Append("\" rel=\"stylesheet\" type=\"text/css\" />");
                        break;
                    }

                    //Add
                    if (!Page.IsPostBack)
                    {
                        Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "wgHoverButtons", HoverButtonScript,
                                                                    true);
                    }
                    if (Page.Header != null && DesignMode == false)
                    {
                        Page.Header.Controls.Add(new LiteralControl(csslink.ToString()));
                    }
                    else
                    {
                        Tag["wgcsslink"] = csslink.ToString();
                    }

                    if (Page.Header != null)
                    {
                        Page.Header.Controls.Add(new LiteralControl(m_Scriptandstyles.ToString()));
                    }
                    else
                    {
                        Tag["wgscriptstyles"] = m_Scriptandstyles.ToString();
                    }
                }
            }
        }
        /// <summary> 
        /// 改变皮肤 
        /// </summary> 
        /// <param name="st"></param> 
        public static void ChangeSkin(SkinType st)
        {
            System.Reflection.Assembly thisDll = System.Reflection.Assembly.GetExecutingAssembly();
            if (se == null)
            {
                //ShortMessageClient是指命名空间,这里你可以换成你自己的。
                se = new Sunisoft.IrisSkin.SkinEngine(Application.OpenForms[0], thisDll.GetManifestResourceStream("OSM.skin." + st.ToString() + ".ssk"));
                se.Active = true;
                for (int i = 0; i < Application.OpenForms.Count; i++)
                {
                    se.AddForm(Application.OpenForms[i]);
                }

            }
            else
            {
                //ShortMessageClient是指命名空间,这里你可以换成你自己的。
                se.SkinStream = thisDll.GetManifestResourceStream("OSM.Skin." + st.ToString() + ".ssk");
                se.Active = true;
            }
        }
Beispiel #12
0
        internal void UpdateSkin(SkinType skin)
        {
            var skins0 = Resources.MergedDictionaries[0];

            skins0.MergedDictionaries.Clear();
            skins0.MergedDictionaries.Add(ResourceHelper.GetSkin(skin));
            skins0.MergedDictionaries.Add(ResourceHelper.GetSkin(typeof(App).Assembly, "Resources/Themes", skin));

            var skins1 = Resources.MergedDictionaries[1];

            skins1.MergedDictionaries.Clear();
            skins1.MergedDictionaries.Add(new ResourceDictionary
            {
                Source = new Uri("pack://application:,,,/HandyControl;component/Themes/Theme.xaml")
            });
            skins1.MergedDictionaries.Add(new ResourceDictionary
            {
                Source = new Uri("pack://application:,,,/HandyControlDemo;component/Resources/Themes/Theme.xaml")
            });
            Current.MainWindow?.OnApplyTemplate();

            Resources.MergedDictionaries.Clear();
            Resources.MergedDictionaries.Add(new ResourceDictionary
            {
                Source = new Uri($"pack://application:,,,/HandyControl;component/Themes/Skin{skin.ToString()}.xaml")
            });
            Resources.MergedDictionaries.Add(new ResourceDictionary
            {
                Source = new Uri("pack://application:,,,/HandyControl;component/Themes/Theme.xaml")
            });
        }
Beispiel #13
0
 /// <summary>
 /// ctor
 /// </summary>
 /// <param name="skin"></param>
 /// <param name="style"></param>
 public Skin(SkinType skin, IStyle style)
 {
     SkinType  = skin;
     Name      = skin.ToString();
     SkinStyle = style;
 }
Beispiel #14
0
 public static String DeleteSkin(long idSkin, String query, String backUrl, SkinType type)
 {
     return(_BaseService + "Delete.aspx?type=" + type.ToString() + "&idSkin=" + idSkin.ToString() + query + (String.IsNullOrEmpty(backUrl) ? "" : "&backUrl=" + backUrl));
 }
Beispiel #15
0
 public static String AddSkin(Int32 idCommunity, String query, String backUrl, SkinType type)
 {
     return(_BaseService + "Add.aspx?idCommunity=" + idCommunity.ToString() + "&type=" + type.ToString() + query + (String.IsNullOrEmpty(backUrl) ? "" : "&backUrl=" + backUrl));
 }
Beispiel #16
0
 /// <summary>
 /// Changes the skin.
 /// </summary>
 /// <param name="st">The st.</param>
 public static void ChangeSkin(SkinType st)
 {
     System.Reflection.Assembly thisDll = System.Reflection.Assembly.GetExecutingAssembly();
     if (se == null)
     {
         se        = new Sunisoft.IrisSkin.SkinEngine(Application.OpenForms[0], thisDll.GetManifestResourceStream("Fm.Src.Common.SkinProcessor.Skins." + st.ToString() + ".ssk"));
         se.Active = true;
         for (int i = 0; i < Application.OpenForms.Count; i++)
         {
             se.AddForm(Application.OpenForms[i]);
         }
     }
     else
     {
         se.SkinStream = thisDll.GetManifestResourceStream("FT.Commons.SkinProcessor.Skins." + st.ToString() + ".ssk");
         se.Active     = true;
     }
 }
Beispiel #17
0
 internal void UpdateSkin(SkinType skin)
 {
     Resources.MergedDictionaries.Add(new ResourceDictionary
     {
         Source = new Uri($"pack://application:,,,/HandyControl;component/Themes/Skin{skin.ToString()}.xaml")
     });
     Resources.MergedDictionaries.Add(new ResourceDictionary
     {
         Source = new Uri("pack://application:,,,/HandyControl;component/Themes/Theme.xaml")
     });
 }
Beispiel #18
0
 /// <summary>
 ///     获取皮肤
 /// </summary>
 /// <param name="assembly"></param>
 /// <param name="themePath"></param>
 /// <param name="skin"></param>
 /// <returns></returns>
 public static ResourceDictionary GetSkin(Assembly assembly, string themePath, SkinType skin)
 {
     try
     {
         var uri = new Uri($"pack://application:,,,/{assembly.GetName().Name};component/{themePath}/Skin{skin.ToString()}.xaml");
         return(new ResourceDictionary
         {
             Source = uri
         });
     }
     catch
     {
         return(new ResourceDictionary
         {
             Source = new Uri($"pack://application:,,,/{assembly.GetName().Name};component/{themePath}/Skin{SkinType.Default.ToString()}.xaml")
         });
     }
 }