private void Timerstory_Elapsed(object sender, ElapsedEventArgs e) { try { if (countstory == count) { Timerstory.Stop(); Timerprogress.Stop(); Finish(); } else if (countstory > count) { Timerstory.Stop(); Timerprogress.Stop(); Finish(); } else { RunOnUiThread(ChangeStoryView); } } catch (Exception exception) { Console.WriteLine(exception); } }
//Event Delete Story private void DeleteStoryIconOnClick(object sender, EventArgs eventArgs) { try { //just pass file_path and type video or image Client.Story.Delete_Story(Story_ID).ConfigureAwait(false); var getStory = Classes.StoryList.FirstOrDefault(a => a.Value == User_ID); if (getStory.Value != null) { Classes.StoryList?.Remove(getStory.Key); } if (Classes.StoryList?.FirstOrDefault(a => a.Value == User_ID).Key?.Count == 0) { var ckd = News_Feed_Fragment.StoryAdapter?.mStorylList?.FirstOrDefault(a => a.user_id == User_ID); News_Feed_Fragment.StoryAdapter?.Remove(ckd); } Toast.MakeText(this, GetText(Resource.String.Lbl_Done), ToastLength.Long).Show(); Finish(); Timerstory.Enabled = false; Timerstory.Stop(); Timerprogress.Enabled = false; Timerprogress.Stop(); } catch (Exception e) { Crashes.TrackError(e); } }
protected override void OnDestroy() { try { Timerstory.Stop(); Timerprogress.Stop(); Timerprogress.Close(); Timerstory.Close(); base.OnDestroy(); } catch (Exception e) { Console.WriteLine(e); } }
protected override void OnDestroy() { try { Timerstory.Stop(); Timerprogress.Stop(); Timerprogress.Close(); Timerstory.Close(); base.OnDestroy(); } catch (Exception e) { Crashes.TrackError(e); } }
//Event Delete Story private void DeleteStoryIconOnClick(object sender, EventArgs eventArgs) { try { //just pass file_path and type video or image WoWonder_API.Requests.RequestsAsync.Story.Delete_Story(Story_ID).ConfigureAwait(false); var getStory = Classes.StoryList.FirstOrDefault(a => a.Value == User_ID); if (getStory.Value != null) { var dataStory = getStory.Key.FirstOrDefault(a => a.id == Story_ID); if (dataStory != null) { getStory.Key.Remove(dataStory); } } if (Classes.StoryList?.FirstOrDefault(a => a.Value == User_ID).Key?.Count == 0) { var ckd = Last_Stroies_Fragment.StoryAdapter?.mStoryList?.FirstOrDefault(a => a.user_id == User_ID); Last_Stroies_Fragment.StoryAdapter?.Remove(ckd); } Toast.MakeText(this, GetText(Resource.String.Lbl_Done), ToastLength.Long).Show(); Finish(); Timerstory.Enabled = false; Timerstory.Stop(); Timerprogress.Enabled = false; Timerprogress.Stop(); } catch (Exception e) { Console.WriteLine(e); } }
public void ChangeStoryView() { try { if (!Timerstory.Enabled) { Timerstory.Enabled = true; Timerprogress.Enabled = true; StoriesProgressViewDisplay.Max = 100; } progrescount = 0; if (Build.VERSION.SdkInt >= BuildVersionCodes.N) { StoriesProgressViewDisplay.SetProgress(progrescount, true); } else { try { // For API < 24 StoriesProgressViewDisplay.Progress = progrescount; } catch (Exception exception) { Console.WriteLine(exception); } } countstory++; CountStoryText.Text = (count - countstory).ToString(); if (countstory <= count - 1) { var dataStory = ListOfStories.FirstOrDefault(); if (dataStory.Key != null) { var type = IMethods.AttachmentFiles.Check_FileExtension(dataStory.Key); if (type == "Video") { SetVideoStory(dataStory.Key, dataStory.Value); } else if (type == "Image") { SetImageStory(dataStory.Key, dataStory.Value); } ListOfStories.Remove(dataStory.Key); } } else { Finish(); Timerstory.Enabled = false; Timerstory.Stop(); Timerprogress.Enabled = false; Timerprogress.Stop(); } } catch (Exception e) { Console.WriteLine(e); } }