public void ProcessingProfile(SyncProfile profile) { //streamHandler.SendString(profile.ProfileName); syncService = new Synchroniser(new FolderHandler(profile.ProfileSyncFolderPath)); syncService.Synchronise(streamHandler); SyncProfilesHandler.UpdateProfile(profile); }
void CreateAddingDialog() { ContextThemeWrapper ctw = new ContextThemeWrapper(this, Android.Resource.Style.ThemeHoloLightDarkActionBar); AlertDialog.Builder builder = new AlertDialog.Builder(ctw); LayoutInflater inflater = Application.Context.GetSystemService(LayoutInflaterService) as LayoutInflater; View view = inflater.Inflate(Resource.Layout.AddingProfile, null); builder.SetView(view); EditText profileName = view.FindViewById <EditText>(Resource.Id.SyncProfileName); ImageButton selectFolder_btn = view.FindViewById <ImageButton>(Resource.Id.SelectFolder_btn); selectFolder_btn.Click += (sender, e) => { var intent = new Intent(this, typeof(FolderPickerActivity)); StartActivity(intent); }; builder.SetTitle("ДОБАВИТЬ НОВЫЙ ПРОФИЛЬ") .SetPositiveButton("ОК", (senderAlert, args) => { if (SyncProfilesHandler.AddNewProfile(profileName.Text, AppData.SelectedFolderPath, this)) { MessageDisplayer.ShowSuccessMessage(this, "Системные оповещения", "Новый профиль успешно добавлен."); Synchroniser service = new Synchroniser(new FolderHandler(AppData.SelectedFolderPath)); service.CreateSyncDataStore(); } profilesListView.Adapter = new ProfilesListAdapter(this, SyncProfilesHandler.AvailableProfilesList); }) .SetNegativeButton("Отмена", (senderAlert, args) => { Toast.MakeText(this, "Добавление профиля отменено!", ToastLength.Short).Show(); }); Dialog dialog = builder.Create(); dialog.Show(); }