Пример #1
0
        private async void CheckVIP()
        {
            var purchaseVM = AppManager.GetPurchaseViewModel();
            var ok         = await purchaseVM.CheckVIP();

            if (!ok)
            {
                return;
            }
            if (!purchaseVM.IsVIP)
            {
                AppHelper AppHelper = new AppHelper();
                //0.0069444444444444, 0.0138888888888889 10/20分钟
                //bool canPrpmpt = AppHelper.ShouldPrompt(new WPFPurchasedDataManager(AppManager.PurchaseDataPath), 0.0069444444444444, 0.0138888888888889);
                bool canPrpmpt = AppHelper.ShouldPrompt(new WPFPurchasedDataManager(AppManager.PurchaseDataPath), 15, 30);
                if (canPrpmpt)
                {
                    //var windowManager = IoC.Get<IWindowManager>();
                    var view = new PurchaseTipsView();
                    var vm   = new PurchaseTipsViewModel()
                    {
                        BGM             = new Uri("Res//Sounds//PurchaseTipsBg.mp3", UriKind.RelativeOrAbsolute),
                        Content         = new DefaultPurchaseTipsContent(),
                        PurchaseContent = await LanService.Get("donate_text"),
                        RatingContent   = await LanService.Get("rating_text"),
                    };
                    vm.Initlize(purchaseVM);
                    view.DataContext = vm;
                    view.Show();
                }
            }
        }
Пример #2
0
        public MainWindow()
        {
            string path = System.IO.Path.Combine(Environment.CurrentDirectory, "Languages");

            LanService.Init(new JsonDB(path), true);
            InitializeComponent();
        }
Пример #3
0
 public static void InitMuliLanguage()
 {
     //多语言
     Xaml.CustomMaps.Add(typeof(TaskbarIcon), TaskbarIcon.ToolTipTextProperty);
     //中国人大多都会英语,老大大多不会中文。对国际友人好一点,默认显示英语 -。-##
     LanService.Init(new JsonDB(GetLangaugesFilePath()), true, "en");
 }
Пример #4
0
        public static async Task ApplySetting(SettingObject setting)
        {
            LocalWallpaperDir = Setting.General.WallpaperSaveDir;
            string cultureName = setting.General.CurrentLan;

            if (cultureName == null)
            {
                cultureName = Thread.CurrentThread.CurrentUICulture.Name;
            }

            Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(cultureName);
            await LanService.UpdateLanguage();

            try
            {
                await _desktopBridgeStartupManager.Set(setting.General.StartWithWindows);
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex);
            }
            setting.General.StartWithWindows = await _desktopBridgeStartupManager.Check();

            //WallpaperManager.VideoAspect = setting.Wallpaper.VideoAspect;
            LiveWallpaper.WallpaperManager.WallpaperManager.ApplyVideoAspect(setting.Wallpaper.VideoAspect);
        }
        private async void cb_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ComboBoxItem item    = e.AddedItems[0] as ComboBoxItem;
            string       culture = item.Tag as string;

            ApplicationLanguages.PrimaryLanguageOverride = culture;
            await LanService.UpdateLanguage();
        }
Пример #6
0
        private void Cb_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ComboBoxItem item    = e.AddedItems[0] as ComboBoxItem;
            string       culture = item.Tag as string;

            Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(culture);
            LanService.UpdateLanguage();
        }
Пример #7
0
        private async void Button_Click(object sender, RoutedEventArgs e)
        {
            var vm      = configer.DataContext as ConfigerViewModel;
            var data    = ConfigerService.GetData <Setting>(vm.Nodes);
            var setting = await JsonHelper.JsonSerializeAsync(data, path);

            Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(data.S3);
            await LanService.UpdateLanguage();
        }
Пример #8
0
        public static async Task Initlize()
        {
            //开机启动
#if UWP
            AutoStartupHelper.Initlize(AutoStartupType.Store, "LiveWallpaper");
#else
            AutoStartupHelper.Initlize(AutoStartupType.Win32, "LiveWallpaper");
#endif

            //多语言
            Xaml.CustomMaps.Add(typeof(TaskbarIcon), TaskbarIcon.ToolTipTextProperty);
            //不能用Environment.CurrentDirectory,开机启动目录会出错
            ApptEntryDir = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
            string path = Path.Combine(ApptEntryDir, "Res\\Languages");
            LanService.Init(new JsonDB(path), true, "zh");

            //配置相关
            var appData = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
            AppDataDir        = $"{appData}\\LiveWallpaper";
            UWPRealAppDataDir = Path.Combine(ApplicationData.Current.LocalCacheFolder.Path, "Roaming\\LiveWallpaper");
            SettingPath       = $"{AppDataDir}\\Config\\setting.json";
            //LocalWallpaperDir = $"{AppDataDir}\\Wallpapers";
            //因为uwp store权限问题所以改为 %userprofile%\videos\LivewallpaperCache
            //string videoDir = Environment.GetFolderPath(Environment.SpecialFolder.MyVideos);
            //LocalWallpaperDir = $"{videoDir}\\LivewallpaperCache";

            AppDataPath      = $"{AppDataDir}\\appData.json";
            PurchaseDataPath = $"{AppDataDir}\\purchaseData.json";

            await CheckDefaultSetting();

            //应用程序数据
            AppData = await JsonHelper.JsonDeserializeFromFileAsync <AppData>(AppDataPath);

            if (AppData == null)
            {
                AppData = new AppData();
                await ApplyAppDataAsync();
            }

            //加载壁纸
            await Task.Run(() =>
            {
                RefreshLocalWallpapers();
                //if (AppData.Wallpaper != null)
                //{
                WallpaperManager.MaximizedEvent += WallpaperManager_MaximizedEvent;
                var current = Wallpapers.FirstOrDefault(m => m.AbsolutePath == AppData.Wallpaper);
                if (current != null)
                {
                    WallpaperManager.VideoAspect = Setting.Wallpaper.VideoAspect;
                    WallpaperManager.Show(current);
                }
                WallpaperManager.MonitorMaxiemized(true);
                //}
            });
        }
Пример #9
0
        private void BtnReadInCode_Click(object sender, RoutedEventArgs e)
        {
            var l = LanService.Get("btn_readInCode");

            MessageBox.Show(l);
            Button btn = sender as Button;

            stcPanel.Children.Remove(btn);
        }
Пример #10
0
        /// <summary>
        /// Initializes the singleton application object.  This is the first line of authored code
        /// executed, and as such is the logical equivalent of main() or WinMain().
        /// </summary>
        public App()
        {
            this.InitializeComponent();
            this.Suspending += OnSuspending;


            string path = Path.Combine(Windows.ApplicationModel.Package.Current.InstalledLocation.Path, "Languages");

            LanService.Init(new JsonDB(path), true);
        }
Пример #11
0
        public static void InitMuliLanguage()
        {
            //多语言
            Xaml.CustomMaps.Add(typeof(TaskbarIcon), TaskbarIcon.ToolTipTextProperty);
            //不能用Environment.CurrentDirectory,开机启动目录会出错
            ApptEntryDir = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
            string path = Path.Combine(ApptEntryDir, "Res\\Languages");

            LanService.Init(new JsonDB(path), true, "zh");
        }
Пример #12
0
        public async void Save()
        {
            if (CurrentWallpaper == null)
            {
                MessageBox.Show(await LanService.Get("wallpaperEditor_warning_invalidWallpaper"));
                return;
            }
            if (string.IsNullOrEmpty(CurrentWallpaper.ProjectInfo.Title))
            {
                MessageBox.Show(await LanService.Get("wallpaperEditor_warning_titleEmpty"));
                return;
            }

            CanSave = false;

            try
            {
                if (_editMode)
                {
                    if (_OldWallpaper == null)
                    {
                        //只修改了title,desc等信息
                        _OldWallpaper = CurrentWallpaper;
                    }
                    await Wallpaper.EditLocakPack(CurrentWallpaper, _OldWallpaper.Dir);
                }
                else
                {
                    string destDir; destDir = Path.Combine(AppManager.LocalWallpaperDir, Guid.NewGuid().ToString());
                    await Wallpaper.CreateLocalPack(CurrentWallpaper, destDir);
                }
                //if (_editMode)
                //{
                //    //删除旧包
                //    var temp = CurrentWallpaper;
                //    CurrentWallpaper = null;
                //    bool ok = await Wallpaper.Delete(temp);
                //    if (!ok)
                //    {
                //        MessageBox.Show("删除失败请手动删除");
                //    }
                //}
            }
            catch (Exception ex)
            {
                CanSave = true;
                logger.Error(ex);
                MessageBox.Show(ex.Message);
                return;
            }
            Result = true;
            TryClose();
        }
Пример #13
0
        protected override async void OnInitialize()
        {
            if (firstLaunch)
            {
                firstLaunch = false;
                //读取json按对象重新保存一次。防止json格式不全
                var Setting = await JsonHelper.JsonDeserializeFromFileAsync <SettingObject>(AppManager.SettingPath);

                await JsonHelper.JsonSerializeAsync(Setting, AppManager.SettingPath);
            }

            var config = await JsonHelper.JsonDeserializeFromFileAsync <dynamic>(AppManager.SettingPath);

            //string descPath = Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase, "Res\\setting.desc.json");
            var descConfig = await JsonHelper.JsonDeserializeFromFileAsync <dynamic>(AppManager.SettingDescFile);

            List <dynamic> audioSource    = new List <dynamic>();
            List <dynamic> displayMonitor = new List <dynamic>();

            displayMonitor.Add(new
            {
                lanKey = "setting_displayMonitor_default",
                value  = -1
            });
            audioSource.Add(new
            {
                lanKey = "setting_audioSource_mute",
                value  = -1
            });

            string screenStr = await LanService.Get("setting_screen");

            for (int i = 0; i < System.Windows.Forms.Screen.AllScreens.Length; i++)
            {
                displayMonitor.Add(new
                {
                    lan   = string.Format($"{screenStr} {i + 1}"),
                    value = i
                });
                audioSource.Add(new
                {
                    lan   = string.Format($"{screenStr} {i + 1}"),
                    value = i
                });
            }

            _jcrService.InjectDescObjs("$AudioSource", audioSource);
            _jcrService.InjectDescObjs("$DisplayMonitor", displayMonitor);

            JsonConfierViewModel = _jcrService.GetVM(config, descConfig);
            base.OnInitialize();
        }
Пример #14
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            DescriptorInfo d = null;

            if (value is ConfigItemNode node)
            {
                d = node.Descriptor;
            }
            else if (value is ConfigItemProperty property)
            {
                d = property.Descriptor;
            }
            else if (value is DescriptorInfo)
            {
                d = value as DescriptorInfo;
            }

            if (d != null)
            {
                if (ReadDesc)
                {
                    if (!string.IsNullOrEmpty(d.Desc))
                    {
                        return(d.Desc);
                    }

                    if (!string.IsNullOrEmpty(d.DescKey))
                    {
                        string lan = LanService.Get(d.DescKey).Result;
                        return(lan);
                    }
                    return(null);
                }
                else
                {
                    if (!string.IsNullOrEmpty(d.Text))
                    {
                        return(d.Text);
                    }

                    if (!string.IsNullOrEmpty(d.TextKey))
                    {
                        string lan = LanService.Get(d.TextKey).Result;
                        return(lan);
                    }
                }
                //return d.Name;
            }

            return(value);
        }
Пример #15
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
#endif
        {
#pragma warning disable CS0436 // Type conflicts with imported type
            if (value is CBaseObj)
            {
                CBaseObj cp = value as CBaseObj;
#pragma warning restore CS0436 // Type conflicts with imported type

                if (ReadDesc)
                {
                    if (!string.IsNullOrEmpty(cp.Desc))
                    {
                        return(cp.Desc);
                    }

                    if (!string.IsNullOrEmpty(cp.DescLanKey))
                    {
                        string lan = LanService.Get(cp.DescLanKey).Result;
                        return(lan);
                    }
                    return(null);
                }
                else
                {
                    if (!string.IsNullOrEmpty(cp.Lan))
                    {
                        return(cp.Lan);
                    }

                    if (!string.IsNullOrEmpty(cp.LanKey))
                    {
                        string lan = LanService.Get(cp.LanKey).Result;
                        return(lan);
                    }
                }

#if WINDOWS_UWP
                if (!string.IsNullOrEmpty(cp.UID))
                {
                    string lan = GetString(cp.UID);
                    return(lan);
                }
#endif

                return(cp.Name);
            }

            return(value);
        }
Пример #16
0
        public static async Task ApplySetting(SettingObject setting)
        {
            Setting = setting;

            Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(setting.General.CurrentLan);
            await LanService.UpdateLanguage();

            await AutoStartupHelper.Instance.Set(setting.General.StartWithWindows);

            setting.General.StartWithWindows = await AutoStartupHelper.Instance.Check();

            WallpaperManager.VideoAspect = setting.Wallpaper.VideoAspect;
            WallpaperManager.ApplyVideoAspect();
        }
        private async void btnReadInCode_Click(object sender, RoutedEventArgs e)
        {
            var l = await LanService.Get("btn_readInCode");

            ContentDialog d = new ContentDialog();

            d.PrimaryButtonText = l;
            d.Content           = l;
            await d.ShowAsync();

            Button btn = sender as Button;

            stcPanel.Children.Remove(btn);
        }
Пример #18
0
        public async Task OnLoaded()
        {
            if (_firstLaunch)
            {
                AppManager.Run();
                //第一次时打开检查更新
                var handle = (new WindowInteropHelper(Application.Current.MainWindow)).Handle;
                await Task.Run(() =>
                {
                    AppManager.MainHandle = handle;
                    AppManager.CheckUpates(handle);
                });

                DZY.Util.Common.Helpers.AppHelper AppHelper = new DZY.Util.Common.Helpers.AppHelper();
                //0.0069444444444444, 0.0138888888888889 10/20分钟
                bool canPrpmpt = AppHelper.ShouldPrompt(new WPFPurchasedDataManager(AppManager.PurchaseDataPath), 30, 60);
                if (canPrpmpt)
                {
                    var windowManager = IoC.Get <IWindowManager>();

                    var view = new PurchaseTipsView();
                    var vm   = new PurchaseTipsViewModel()
                    {
                        BGM             = new Uri("Res//Sounds//PurchaseTipsBg.mp3", UriKind.RelativeOrAbsolute),
                        Content         = new DefaultPurchaseTipsContent(),
                        PurchaseContent = await LanService.Get("donate_text"),
                        RatingContent   = await LanService.Get("rating_text"),
                    };
                    vm.Initlize(AppManager.GetPurchaseViewModel());
                    view.DataContext = vm;
                    view.Show();
                }

                _firstLaunch = false;

                if (AppManager.Setting.General.MinimizeUI)
                {
                    TryClose();
                }
            }

            Wallpapers = new ObservableCollection <Wallpaper>(AppManager.Wallpapers);

            if (AppManager.Setting.General.RecordWindowSize)
            {
                Width  = AppManager.Setting.General.Width;
                Height = AppManager.Setting.General.Height;
            }
        }
        public async void Save()
        {
            if (CurrentWallpaper == null)
            {
                MessageBox.Show(await LanService.Get("wallpaperEditor_warning_invalidWallpaper"));
                return;
            }
            if (string.IsNullOrEmpty(CurrentWallpaper.ProjectInfo.Title))
            {
                MessageBox.Show(await LanService.Get("wallpaperEditor_warning_titleEmpty"));
                return;
            }

            CanSave = false;

            string destDir = Path.Combine(AppManager.LocalWallpaperDir, Guid.NewGuid().ToString());

            try
            {
                //await Task.Run(() =>
                //{
                var result = await Task.Run(() => { return(WallpaperManager.CreateLocalPack(CurrentWallpaper, destDir)); });

                if (_editMode)
                {
                    //删除旧包
                    var temp = CurrentWallpaper;
                    CurrentWallpaper = null;
                    bool ok = await WallpaperManager.Delete(temp);

                    if (!ok)
                    {
                        MessageBox.Show("删除失败请手动删除");
                    }
                }
                //});
            }
            catch (Exception ex)
            {
                CanSave = true;
                logger.Error(ex);
                MessageBox.Show(ex.Message);
                return;
            }
            Result = true;
            TryClose();
        }
Пример #20
0
        public object Convert(object value, Type targetType, object parameter, string language)
        {
            if (value is CBaseObj)
            {
                CBaseObj cp = value as CBaseObj;

                if (ReadDesc)
                {
                    if (!string.IsNullOrEmpty(cp.Desc))
                    {
                        return(cp.Desc);
                    }

                    if (!string.IsNullOrEmpty(cp.DescLanKey))
                    {
                        string lan = LanService.Get(cp.DescLanKey).Result;
                        return(lan);
                    }
                    return(null);
                }
                else
                {
                    if (!string.IsNullOrEmpty(cp.Lan))
                    {
                        return(cp.Lan);
                    }

                    if (!string.IsNullOrEmpty(cp.LanKey))
                    {
                        string lan = LanService.Get(cp.LanKey).Result;
                        return(lan);
                    }
                }

                if (!string.IsNullOrEmpty(cp.UID))
                {
                    string lan = GetString(cp.UID);
                    return(lan);
                }

                return(cp.Name);
            }

            return(value);
        }
Пример #21
0
        public static async Task ApplySetting(SettingObject setting)
        {
            LocalWallpaperDir = Setting.General.WallpaperSaveDir;
            string cultureName = setting.General.CurrentLan;

            if (cultureName == null)
            {
                cultureName = Thread.CurrentThread.CurrentUICulture.Name;
            }

            Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(cultureName);
            await LanService.UpdateLanguage();

            await AutoStartupHelper.Instance.Set(setting.General.StartWithWindows);

            setting.General.StartWithWindows = await AutoStartupHelper.Instance.Check();

            //WallpaperManager.VideoAspect = setting.Wallpaper.VideoAspect;
            WallpaperManager.ApplyVideoAspect(setting.Wallpaper.VideoAspect);
        }
Пример #22
0
        public async void SelectFile()
        {
            StringBuilder sb = new StringBuilder();

            sb.Append(await LanService.Get("wallpaperEditor_fileDialogType"));
            foreach (var item in Wallpaper.VideoExtensions)
            {
                sb.Append($"{item};");
            }
            var openFileDialog = new Microsoft.Win32.OpenFileDialog()
            {
                Filter = sb.ToString()
            };
            var result = openFileDialog.ShowDialog();

            if (result == true)
            {
                FilePath = openFileDialog.FileName;
            }
        }
Пример #23
0
        public static async Task ApplySetting(SettingObject setting)
        {
            LocalWallpaperDir = Setting.General.WallpaperSaveDir;
            string cultureName = setting.General.CurrentLan;

            if (cultureName == null)
            {
                cultureName = Thread.CurrentThread.CurrentUICulture.Name;
            }

            Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(cultureName);
            await LanService.UpdateLanguage();

            try
            {
                await _startupManager.Set(setting.General.StartWithWindows);
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex);
            }
            setting.General.StartWithWindows = await _startupManager.Check();

            var screenSetting = WallpaperManager.Instance.ScreenIndexs.Select((m) => new ScreenOption()
            {
                ScreenIndex      = m,
                WhenAppMaximized = setting.Wallpaper.ActionWhenMaximized,
            }).ToList();

            var liveWallpaperOptions = new LiveWallpaperOptions
            {
                AppMaximizedEffectAllScreen = true,
                AudioScreenIndex            = setting.Wallpaper.AudioSource,
                ScreenOptions = screenSetting
            };

            await WallpaperManager.Instance.SetOptions(liveWallpaperOptions);
        }
Пример #24
0
        public App()
        {
            //异常捕获
            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
            Current.DispatcherUnhandledException       += Current_DispatcherUnhandledException;

            //多语言初始化
            string appDir = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
            string path   = Path.Combine(appDir, "Assets\\Languages");

            LanService.Init(new JsonDB(path), true, "zh");

            //mvvm初始化
            IocContainer container = new IocContainer();

            container
            .Singleton <LocalServer>()
            .Singleton <WallpapersViewModel>()
            .Singleton <SettingViewModel>()
            .Singleton <AppMenuViewModel>();

            Inputs = GetInputs();

            AppManager appManager = new AppManager();

            if (Inputs.ContainsKey("wallpaper"))
            {
                string saveDir = Inputs["wallpaper"];
                SetSaveDir(appManager, saveDir);
            }
            container.Instance(appManager);

            EasyManager.Initialize(container, new StoreNavigator());
            EasyManager.Associate <WallpapersView, WallpapersViewModel>();
            EasyManager.Associate <SettingView, SettingViewModel>();
        }
Пример #25
0
        protected override async void OnInitialize()
        {
            if (firstLaunch)
            {
                firstLaunch = false;
                //读取json按对象重新保存一次。防止json格式不全
                var Setting = await JsonHelper.JsonDeserializeFromFileAsync <SettingObject>(AppManager.SettingPath);

                await JsonHelper.JsonSerializeAsync(Setting, AppManager.SettingPath);
            }

            var config = await JsonHelper.JsonDeserializeFromFileAsync <dynamic>(AppManager.SettingPath);

            //string descPath = Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase, "Res\\setting.desc.json");
            var descConfig = await JsonHelper.JsonDeserializeFromFileAsync <dynamic>(AppManager.SettingDescFile);

            List <dynamic> audioSource    = new List <dynamic>();
            List <dynamic> displayMonitor = new List <dynamic>();

            displayMonitor.Add(new
            {
                lanKey = "setting_displayMonitor_default",
                value  = -1
            });
            audioSource.Add(new
            {
                lanKey = "setting_audioSource_mute",
                value  = -1
            });

            string screenStr = await LanService.Get("setting_screen");

            for (int i = 0; i < System.Windows.Forms.Screen.AllScreens.Length; i++)
            {
                displayMonitor.Add(new
                {
                    lan   = string.Format($"{screenStr} {i + 1}"),
                    value = i
                });
                audioSource.Add(new
                {
                    lan   = string.Format($"{screenStr} {i + 1}"),
                    value = i
                });
            }

            _jcrService.InjectDescObjs("$AudioSource", audioSource);
            _jcrService.InjectDescObjs("$DisplayMonitor", displayMonitor);

            //多语言
            DirectoryInfo languageFilesDir = new DirectoryInfo(AppManager.GetLangaugesFilePath());
            var           files            = languageFilesDir.GetFiles("*.json");

            if (files != null)
            {
                List <dynamic> languages = new List <dynamic>();
                foreach (var file in files)
                {
                    string cultureName = file.Name.Replace(file.Extension, "");
                    string text        = await LanService.Get("language", cultureName);

                    languages.Add(new
                    {
                        lan   = text,
                        value = cultureName
                    });
                }
                _jcrService.InjectDescObjs("$languages", languages);
            }

            JsonConfierViewModel = _jcrService.GetVM(config, descConfig);
            base.OnInitialize();
        }
Пример #26
0
 private ServerEnvironment()
 {
     IP      = LanService.GetLocalIP();
     IPValue = IP.IpFromString();
 }
Пример #27
0
        static JsonWindow()
        {
            string path = System.IO.Path.Combine(Environment.CurrentDirectory, "Data\\Languages");

            LanService.Init(new JsonDB(path), true);
        }
Пример #28
0
 public CreateWallpaperViewModel()
 {
     DisplayName      = LanService.Get("common_create").Result;
     PreviewWallpaper = _preview;
 }
Пример #29
0
 internal void SetPaper(Wallpaper w)
 {
     DisplayName      = LanService.Get("common_edit").Result;
     CurrentWallpaper = w;
     _editMode        = true;
 }