public ThreadView() { this.InitializeComponent(); CurrentPage = 1; appBar.Width = ActualWidth; btnPopupPostMessage.IsEnabled = false; BtnRating.IsEnabled = false; comment.IsEnabled = false; bookMark = new BookmarkModelData(); helper = new HtmlHelper(); thread = new ThreadModel(); myLogin = new AccountHelper(); define = new DefineEmoticon(); appSetting = new AppSettingModel(); threadController = new ThreadController(); if (Windows.Foundation.Metadata.ApiInformation.IsPropertyPresent("Windows.UI.Xaml.FrameworkElement", "AllowFocusOnInteraction")) { fl_Page.AllowFocusOnInteraction = true; tbMessage.AllowFocusOnInteraction = true; jumpTextBox.AllowFocusOnInteraction = true; getIdthread.AllowFocusOnInteraction = true; } _instance = this; //this.NavigationCacheMode = NavigationCacheMode.Enabled; }
protected override void OnNavigatingFrom(MtNavigatingCancelEventArgs e) { base.OnNavigatingFrom(e); if (e.NavigationMode == NavigationMode.Back) { //mainGridThread.Children.Remove(myWebview); this.NavigationCacheMode = NavigationCacheMode.Disabled; helper = null; bookMark = null; thread = null; myLogin = null; define = null; appSetting = null; threadController = null; myWebview = null; tbMessage.Text = Resource.STR_EMPTY; if (wbPopup != null) { wbPopup.Navigate(new Uri("about:blank")); wbPopup = null; } _instance = null; GC.Collect(); } else { if (wbPopup != null) { wbPopup.Navigate(new Uri("about:blank")); } } }
public HtmlHelper() { Server = new ConnectServer(); appSetting = new AppSettingModel(); defineEmoticon = new DefineEmoticon(); EasClientDvInfo = new EasClientDeviceInformation(); GetTemplateHTML(); }
public string ConvertMessage(string message) { if (appSetting.TotalPosts < Resource.TOTAL_POST_URL_IMAGE) { GetPosts(); } string DeviceName = Resource.STR_EMPTY; if (appSetting.DeviceName != null) { DeviceName = appSetting.DeviceName; } else { DeviceName = EasClientDvInfo.SystemProductName.ToString() + Resource.STR_SPACE; } string usingApp = Resource.STR_EMPTY; if (appSetting.TotalPosts > Resource.TOTAL_POST_URL_IMAGE) { usingApp = "[I][B][SIZE=\"1\"]Sent from [B][I]" + DeviceName + "[/I][/B] " + " using [URL=\"https://www.microsoft.com/vi-vn/store/p/vozforums-universal/9nblggh438xd\"]Vozforums Universal[/URL][/SIZE][/B][/I]"; } else { usingApp = "[I][B][SIZE=\"1\"]Sent from [B][I]" + DeviceName + "[/I][/B] " + " using Vozforums Universal[/SIZE][/B][/I]"; message = message .Replace("[URL", "[url") .Replace("[/URL", "[/url") .Replace("[IMG", "[img") .Replace("[/IMG", "[/img") .Replace("[url]", string.Empty) .Replace("[/url]", string.Empty) .Replace("[url=\"", string.Empty) .Replace("[img]", string.Empty) .Replace("[/img]", string.Empty) .Replace("[/img]", string.Empty) .Replace("https://www.", "https:// ") .Replace("http://www.", "http:// ") .Replace("https://", "https:// ") .Replace("http://", "http:// "); } message = DefineEmoticon.ConvertMessage(message); message = message + Environment.NewLine + Environment.NewLine + usingApp; return(message); }