Beispiel #1
0
        private async void DoRestorePersistedInitialValue()
        {
            var task   = Settings.FolderFactory.CreateFromSerialization(GetPersistedString(RetrieveDefaultValue().Serialize()));
            var folder = await task;

            mFolder = folder;
            Summary = mFolder != null ? mFolder.DisplayName : String.Empty;
        }
Beispiel #2
0
        private void Init(Context context, IAttributeSet attrs)
        {
            var ta = context.ObtainStyledAttributes(attrs, Resource.Styleable.FolderPreference);

            mFolderType = ta.GetString(Resource.Styleable.FolderPreference_folderType);
            ta.Recycle();
            mFolder = RetrieveDefaultValue();
            Summary = mFolder != null ? mFolder.DisplayName : String.Empty;
        }
Beispiel #3
0
        private async void DoOnActivityResult(String serialized)
        {
            var folderTask = Settings.FolderFactory.CreateFromSerialization(serialized);
            var folder     = await folderTask;

            if (folder != null && CallChangeListener(folder.Serialize()))
            {
                mFolder = folder;
                PersistString(mFolder.Serialize());
                Summary = mFolder.DisplayName;
            }
        }
Beispiel #4
0
 protected override void OnSetInitialValue(bool restorePersistedValue, Java.Lang.Object defaultValue)
 {
     if (restorePersistedValue)
     {
         DoRestorePersistedInitialValue();
     }
     else
     {
         mFolder = RetrieveDefaultValue();
         if (mFolder != null)
         {
             PersistString(mFolder.Serialize());
         }
         Summary = mFolder != null ? mFolder.DisplayName : String.Empty;
     }
 }
Beispiel #5
0
 private async void DoRestoreInstanceState(String value)
 {
     mFolder = await Settings.FolderFactory.CreateFromSerialization(value);
 }