Exemple #1
0
        private async Task GetRemotePrefsAsync(RemoteItem item)
        {
            var file = await CreateTempFileAsync(Constant.USER_PREF);

            await syncInstance.DownloadItemWithPathAsync(Constant.USER_PREF_SYNC_PATH, file);

            using (var remotePrefDatabase = new DB(file.Path))
            {
                remoteUserPref = remotePrefDatabase.GetTable <GeneralPreference>().First();
            }
        }
Exemple #2
0
 public object Clone()
 => new AthameSettings
 {
     SettingsPath            = SettingsPath,
     GeneralPreference       = GeneralPreference.Clone() as MediaPreference,
     PlaylistPreference      = PlaylistPreference.Clone() as MediaPreference,
     DontSavePlaylistArtwork = DontSavePlaylistArtwork,
     PlaylistFileType        = PlaylistFileType,
     WriteWatermark          = WriteWatermark,
     ConfirmExit             = ConfirmExit,
 };
        public void Dispose(bool isTrue)
        {
            KuromojiTokenizer.Dispose();
            JapEngDictionary.Dispose();

            if (KanjiDictionary != null)
            {
                KanjiDictionary.Dispose();
            }

            if (ExampleDictionary != null)
            {
                ExampleDictionary.Dispose();
            }

            if (synth != null)
            {
                synth.Dispose();
            }

            if (UserPrefs != null)
            {
                GeneralPreference.Close();
            }

            if (isTrue)
            {
                if (notifyIcon != null)
                {
                    notifyIcon.Dispose();
                }
                if (notifyIconContextMenu != null)
                {
                    notifyIconContextMenu.Dispose();
                }
            }
        }
 private void RestoreUserPrefs()
 {
     UserPrefs = GeneralPreference.RetrieveUserPreference();
 }
        public UserPreference(string languageFolder)
        {
            // -- Create the instance of general preference class.
            this._General = new GeneralPreference();

            // -- Create the instance of language preference class.
            this._Language = new LanguagePreference();

            // -- Create the instance of indicator preference class.
            this._Indicator = new IndicatorPreference();

            // -- Create the instance of dataview preference class.
            this._DataView = new DataviewPreference(Path.Combine(languageFolder, this._Language.InterfaceLanguage + ".xml"));

            // -- Create the instance of chart preference class.
            this._Chart = new GraphPreference();

            // -- Create the instance of mapping preference class.
            this._Mapping = new MapPrefernce();

            //-- Vreate the instance of default legend colors and add the colors into it.
            this._Mapping.DefaultLegendColors = new List<string>();

            if (this._Mapping.DefaultLegendColors.Count == 0)
            {
                this._Mapping.DefaultLegendColors.Add("#DEE4F0");
                this._Mapping.DefaultLegendColors.Add("#94A9D3");
                this._Mapping.DefaultLegendColors.Add("#4A6EB6");
                this._Mapping.DefaultLegendColors.Add("#003399");
            }

            // -- Create the instance of sound preference class.
            this._Sound = new SoundPreference();

            // -- Create the instance of database preference class.
            this._Database = new DatabasePreference();

            // -- Create the instance of user selection.
            this._UserSelection = new UserSelection();

            // -- Create the instance of MRU preference class.
            this._MRU = new MRUPreference();

            //-- Event to update the language of fields in dataview.
            this._Language.InterfaceLanguageChanged += new LanguagePreference.InterfaceLanguageChangedDelegate(_Language_UpdateLanguageEvent);

            //-- Set the language folder path.
            LanguageFolderPath = languageFolder;
        }
Exemple #6
0
 public MediaPreference GetPreference(MediaType type)
 => type == MediaType.Playlist
         ? PlaylistPreference.Clone() as MediaPreference
         : GeneralPreference.Clone() as MediaPreference;