Пример #1
0
        public void ShowWindowFon()
        {
            WallpaperSetting ws    = WallpaperSetting.Load();
            Color            color = Color.FromArgb(ws.ColorA, ws.ColorR,
                                                    ws.ColorG, ws.ColorB);

            this.viewWindow.Background        = new SolidColorBrush(color);
            this.viewWindow.imgFon.Visibility = Visibility.Hidden;
        }
Пример #2
0
        public void RefreshPicture()
        {
            WallpaperSetting ws = WallpaperSetting.Load();

            if (File.Exists(ws.Path))
            {
                File.Copy(ws.Path, ExplorerNet.Sys.AppInfo.PictureFilePath, true);
            }
        }
Пример #3
0
        public static WallpaperSetting Load()
        {
            //Properties.Settings.Default.WallpaperSetting = null;
            WallpaperSetting wallpaperSetting = null;
            if (Properties.Settings.Default.WallpaperSetting == null)
            {
                wallpaperSetting = new WallpaperSetting();

                wallpaperSetting.Kind = WallpaperKind.Fon;
                wallpaperSetting.ColorB = 255;

                Properties.Settings.Default.WallpaperSetting = wallpaperSetting;
            }
            else
            {
                wallpaperSetting = Properties.Settings.Default.WallpaperSetting;
            }
            return wallpaperSetting;
        }
Пример #4
0
        private void ShowPicture()
        {
            WallpaperSetting ws       = WallpaperSetting.Load();
            string           pictPath = ExplorerNet.Sys.AppInfo.PictureFilePath;

            byte[] buffer = System.IO.File.ReadAllBytes(pictPath);
            var    ms     = new MemoryStream(buffer);


            var bitmapImage = new BitmapImage();

            bitmapImage.BeginInit();
            bitmapImage.StreamSource = ms;
            bitmapImage.EndInit();
            this.viewWindow.imgFon.Stretch    = ws.Stretch;
            this.viewWindow.imgFon.Source     = bitmapImage;
            this.viewWindow.imgFon.Visibility = Visibility.Visible;
            //ms.Close();
        }
Пример #5
0
        public void Init()
        {
            //var wm = new WallpaperManager();
            WallpaperSetting ws = WallpaperSetting.Load();


            if (ws.Kind == WallpaperKind.Fon)
            {
                Color color = Color.FromArgb(ws.ColorA,
                                             ws.ColorR, ws.ColorG,
                                             ws.ColorB);

                ShowWindowFon();
            }
            else if (ws.Kind == WallpaperKind.Picture)
            {
                ShowPicture();
            }
        }
Пример #6
0
        public static WallpaperSetting Load()
        {
            //Properties.Settings.Default.WallpaperSetting = null;
            WallpaperSetting wallpaperSetting = null;

            if (Properties.Settings.Default.WallpaperSetting == null)
            {
                wallpaperSetting = new WallpaperSetting();

                wallpaperSetting.Kind   = WallpaperKind.Fon;
                wallpaperSetting.ColorB = 255;

                Properties.Settings.Default.WallpaperSetting = wallpaperSetting;
            }
            else
            {
                wallpaperSetting = Properties.Settings.Default.WallpaperSetting;
            }
            return(wallpaperSetting);
        }