示例#1
0
 private void GestureListener_Flick(object sender, FlickGestureEventArgs e)
 {
     if (e.Direction == System.Windows.Controls.Orientation.Horizontal && e.HorizontalVelocity < 0)
     {
         string tmp = LocalFileCache.ContentEncoder(orgUrl);
         NavigationService.Navigate(new Uri("/Views/NotePage.xaml?url=" + tmp, UriKind.Relative));
     }
 }
示例#2
0
        /// <summary>
        /// 点击按钮,进入链接阅读
        /// </summary>
        private void ItemBtn_Tap(object sender, System.Windows.Input.GestureEventArgs e)
        {
            BookmarkItem it = (sender as Button).DataContext as BookmarkItem;

            if (it.isUnReaded)
            {
                it.isUnReaded = false;
            }
            string url = LocalFileCache.ContentEncoder(it.href);

            parent.NavigationService.Navigate(new Uri("/Views/BrowserPage.xaml?url=" + url, UriKind.Relative));
        }
示例#3
0
 private void GestureListener_Flick(object sender, FlickGestureEventArgs e)
 {
     if (e.Direction == System.Windows.Controls.Orientation.Horizontal && e.HorizontalVelocity > 0)
     {
         if (App.RootFrame.CanGoBack)
         {
             App.RootFrame.GoBack();
         }
         else
         {
             string tmp = LocalFileCache.ContentEncoder(url);
             NavigationService.Navigate(new Uri("/Views/BrowserPage.xaml?url=" + tmp, UriKind.Relative));
         }
     }
 }
示例#4
0
        private void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e)
        {
            url = NavigationContext.QueryString["url"].ToString();
            url = LocalFileCache.ContentDecoder(url);
            string text = LocalFileCache.LoadNote(url);

//            BookmarkItem item = App.deliciousApi.LoadLinkItemRecord(url);
//            string text = item.extended;
            if (text == null || text.Length == 0)
            {
                text = url + "\n\n";
            }
            Txt_NoteContent.Text = text;
            Txt_NoteContent.Focus();
        }
示例#5
0
        private void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e)
        {
            Btn_PrePage.IsEnabled    = CanGoBack;
            Btn_NextPage.IsEnabled   = CanGoForward;
            Btn_Add.IsEnabled        = IsNotAdded;
            AddBookmark_Popup.IsOpen = false;
            IsRefresh = false;

            url  = NavigationContext.QueryString["url"].ToString();
            url  = LocalFileCache.ContentDecoder(url);
            item = App.localFileCache.GetBookmarkItem(url);
            if (!String.IsNullOrEmpty(item.cacheHtml))
            {
                webBrowser.NavigateToString(item.cacheHtml);
            }
            else
            {
                //url = baiduUrl + url;
                webBrowser.Navigate(new Uri(url, UriKind.Absolute));
            }
            App.localFileCache.UpdateRecentIndex(item);
        }
示例#6
0
        /// <summary>
        /// BeginTransaction
        /// 保存笔记.
        /// 当前只保存笔记到本地.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void NavigationOutTransition_BeginTransition(object sender, RoutedEventArgs e)
        {
            LocalFileCache.SaveNote(url, Txt_NoteContent.Text);

            BookmarkItem item = App.localFileCache.GetBookmarkItem(url);

            item.extended = Txt_NoteContent.Text;
            //App.deliciousApi.AddBookmark(item).ContinueWith(t =>
            //{
            //    if (t.Status == TaskStatus.RanToCompletion && t.Result != null)
            //    {
            //        Dispatcher.BeginInvoke(() =>
            //        {
            //            //if done, do nothing
            //            if (t.Result != "done") MessageBox.Show("同步失败...检查网络或用户名和密码");
            //        });
            //    }
            //    else if (t.Status == TaskStatus.Faulted)
            //    {
            //        Dispatcher.BeginInvoke(() => { MessageBox.Show("同步失败...检查网络或用户名和密码"); });
            //    }
            //});
        }
示例#7
0
 public void Initialize()
 {
     this.Finfo      = new FileInfo(test_local_file);
     this.RemoteFile = new PutioFile(new PutioFsTestDataProvider(this.Finfo.Name, this.Finfo.FullName, 660, this.Finfo.Length, false, Constants.LocalStoragePath), null);
     this.Cache      = new LocalFileCache(this.RemoteFile);
 }