当前位置: 首页 > news >正文

电商旅游网站策划书网站 开发 合同

电商旅游网站策划书,网站 开发 合同,seo外链在线工具,网店运营的基本流程本实例是来源msdn的Metro开发文档#xff0c;按着解说一步步来理解的#xff0c;修改了一点点#xff0c;拿了博客园本人的博客作为RSS阅读#xff0c;本实例用来学习还是可以的 参考文档http://msdn.microsoft.com/zh-cn/library/windows/apps/br211380.aspx#Y909 先看允…本实例是来源msdn的Metro开发文档按着解说一步步来理解的修改了一点点拿了博客园本人的博客作为RSS阅读本实例用来学习还是可以的 参考文档http://msdn.microsoft.com/zh-cn/library/windows/apps/br211380.aspx#Y909  先看允许结果                                                        本例子主要有2个类文件和2个xaml文件 第一个类文件FeedData.cs using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Collections.ObjectModel;using System.Threading.Tasks;using Windows.Web.Syndication;using Windows.Globalization.DateTimeFormatting;namespace sl{// FeedData// Holds info for a single blog feed, including a list of blog posts (FeedItem)public class FeedData {public string Title { get; set; }public string Description { get; set; }public DateTime PubDate { get; set; }private ListFeedItem _Items new ListFeedItem();public ListFeedItem Items {get {return this._Items; } } }// FeedItem// Holds info for a single blog postpublic class FeedItem {public string Title { get; set; }public string Author { get; set; }public string Content { get; set; }public DateTime PubDate { get; set; }public Uri Link { get; set; } }// FeedDataSource// Holds a collection of blog feeds (FeedData), and contains methods needed to// retreive the feeds.public class FeedDataSource {private ObservableCollectionFeedData _Feeds new ObservableCollectionFeedData();public ObservableCollectionFeedData Feeds {get {return this._Feeds; } }public async Task GetFeedsAsync() { TaskFeedData feed1 GetFeedAsync( http://feed.cnblogs.com/blog/u/109818/rss);this.Feeds.Add(await feed1); }private async TaskFeedData GetFeedAsync(string feedUriString) {// using Windows.Web.Syndication; SyndicationClient client new SyndicationClient(); Uri feedUri new Uri(feedUriString);try { SyndicationFeed feed await client.RetrieveFeedAsync(feedUri);// This code is executed after RetrieveFeedAsync returns the SyndicationFeed.// Process it and copy the data we want into our FeedData and FeedItem classes. FeedData feedData new FeedData(); feedData.Title feed.Title.Text;if (feed.Subtitle.Text ! null) { feedData.Description feed.Subtitle.Text; }// Use the date of the latest post as the last updated date. feedData.PubDate feed.Items[0].PublishedDate.DateTime;foreach (SyndicationItem item in feed.Items) { FeedItem feedItem new FeedItem(); feedItem.Title item.Title.Text; feedItem.PubDate item.PublishedDate.DateTime; feedItem.Author item.Authors[0].Name.ToString();// Handle the differences between RSS and Atom feeds.if (feed.SourceFormat SyndicationFormat.Atom10) { feedItem.Content item.Content.Text; feedItem.Link new Uri(http://www.cnblogs.com item.Id); }else if (feed.SourceFormat SyndicationFormat.Rss20) { feedItem.Content item.Summary.Text; feedItem.Link item.Links[0].Uri; } feedData.Items.Add(feedItem); }return feedData; }catch (Exception) {return null; } } }}   第2个类文件DateConverter.cs 主要负责数据的转换   using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Collections.ObjectModel;using System.Threading.Tasks;using Windows.Web.Syndication;using Windows.Globalization.DateTimeFormatting;namespace sl{public class DateConverter : Windows.UI.Xaml.Data.IValueConverter {public object Convert(object value, Type targetType, object parameter, string culture) {if (value null)throw new ArgumentNullException(value, Value cannot be null.);if (!typeof(DateTime).Equals(value.GetType()))throw new ArgumentException(Value must be of type DateTime., value); DateTime dt (DateTime)value;if (parameter null) {// Date 7/27/2011 9:30:59 AM returns 7/27/2011return DateTimeFormatter.ShortDate.Format(dt); }else if ((string)parameter day) {// Date 7/27/2011 9:30:59 AM returns 27 DateTimeFormatter dateFormatter new DateTimeFormatter({day.integer(2)});return dateFormatter.Format(dt); }else if ((string)parameter month) {// Date 7/27/2011 9:30:59 AM returns JUL DateTimeFormatter dateFormatter new DateTimeFormatter({month.abbreviated(3)});return dateFormatter.Format(dt).ToUpper(); }else if ((string)parameter year) {// Date 7/27/2011 9:30:59 AM returns 2011 DateTimeFormatter dateFormatter new DateTimeFormatter({year.full});return dateFormatter.Format(dt); }else {// Requested format is unknown. Return in the original format.return dt.ToString(); } }public object ConvertBack(object value, Type targetType, object parameter, string culture) {string strValue value as string; DateTime resultDateTime;if (DateTime.TryParse(strValue, out resultDateTime)) {return resultDateTime; }return Windows.UI.Xaml.DependencyProperty.UnsetValue; } }} 第一个界面文件BlankPage.xaml文件包括两段代码xaml代码Pagex:Classsl.BlankPage xmlnshttp://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:xhttp://schemas.microsoft.com/winfx/2006/xaml xmlns:localusing:sl xmlns:dhttp://schemas.microsoft.com/expression/blend/2008 xmlns:mchttp://schemas.openxmlformats.org/markup-compatibility/2006 mc:IgnorabledGrid Background{StaticResource ApplicationPageBackgroundBrush}Grid.RowDefinitionsRowDefinition Height140 /RowDefinition Height* //Grid.RowDefinitions!-- Title --TextBlock x:NameTitleText Text{Binding Title} VerticalAlignmentCenter FontSize48 Margin56,0,0,0/!-- Content --Grid Grid.Row1Grid.ColumnDefinitionsColumnDefinition Width2* MinWidth320 /ColumnDefinition Width3* //Grid.ColumnDefinitions!-- Left column --!-- The default value of Grid.Column is 0, so we do not need to set it to make the ListView show up in the first column. --ListView x:NameItemListView ItemsSource{Binding Items} Margin60,0,0,10 SelectionChangedItemListView_SelectionChangedListView.ItemTemplateDataTemplateStackPanelTextBlock Text{Binding Title} FontSize24 Margin5,0,0,0 TextWrappingWrap /TextBlock Text{Binding Author} FontSize16 Margin15,0,0,0/TextBlock Text{Binding PathPubDate, Converter{StaticResource dateConverter}} FontSize16 Margin15,0,0,0//StackPanel/DataTemplate/ListView.ItemTemplate/ListView!-- Right column --!-- We use a Grid here instead of a StackPanel so that the WebView sizes correctly. --Grid DataContext{Binding ElementNameItemListView, PathSelectedItem} Grid.Column1 Margin25,0,0,0Grid.RowDefinitionsRowDefinition HeightAuto /RowDefinition Height* //Grid.RowDefinitionsTextBlock x:NamePostTitleText Text{Binding Title} FontSize24/WebView x:NameContentView Grid.Row1 Margin0,5,20,20//Grid/Grid/Grid/Page C#代码 using System;using System.Collections.Generic;using System.IO;using System.Linq;using Windows.Foundation;using Windows.Foundation.Collections;using Windows.UI.Xaml;using Windows.UI.Xaml.Controls;using Windows.UI.Xaml.Controls.Primitives;using Windows.UI.Xaml.Data;using Windows.UI.Xaml.Input;using Windows.UI.Xaml.Media;using Windows.UI.Xaml.Navigation;using System.Collections.ObjectModel;using System.Threading.Tasks;using Windows.Web.Syndication;using Windows.Globalization.DateTimeFormatting;// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId234238namespace sl{/// summary/// An empty page that can be used on its own or navigated to within a Frame./// /summarypublic sealed partial class BlankPage : Page {public BlankPage() {this.InitializeComponent(); }/// summary/// Invoked when this page is about to be displayed in a Frame./// /summary/// param nameeEvent data that describes how this page was reached. The Parameter/// property is typically used to configure the page./paramprotected override async void OnNavigatedTo(NavigationEventArgs e) { FeedDataSource _feedDataSource App.DataSource;if (_feedDataSource.Feeds.Count 0) { await _feedDataSource.GetFeedsAsync(); }this.DataContext (_feedDataSource.Feeds).First(); }private void ItemListView_SelectionChanged(object sender, SelectionChangedEventArgs e) { FeedItem feedItem e.AddedItems[0] as FeedItem;if (feedItem ! null) {// Navigate the WebView to the blog post content HTML string. ContentView.NavigateToString(feedItem.Content); } } }}   第4个文件是App.xaml包括2段代码   xaml代码 Applicationx:Classsl.App xmlnshttp://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:xhttp://schemas.microsoft.com/winfx/2006/xaml xmlns:localusing:slApplication.ResourcesResourceDictionaryResourceDictionary.MergedDictionariesResourceDictionarylocal:FeedDataSource x:KeyfeedDataSource/!-- Add the DateConverter here. --local:DateConverter x:KeydateConverter //ResourceDictionary/ResourceDictionary.MergedDictionaries/ResourceDictionary/Application.Resources/Application   C#代码 using System;using System.Collections.Generic;using System.IO;using System.Linq;using Windows.ApplicationModel;using Windows.ApplicationModel.Activation;using Windows.Foundation;using Windows.Foundation.Collections;using Windows.UI.Xaml;using Windows.UI.Xaml.Controls;using Windows.UI.Xaml.Controls.Primitives;using Windows.UI.Xaml.Data;using Windows.UI.Xaml.Input;using Windows.UI.Xaml.Media;using Windows.UI.Xaml.Navigation;using System.Collections.ObjectModel;using System.Threading.Tasks;using Windows.Web.Syndication;using Windows.Globalization.DateTimeFormatting;// The Blank Application template is documented at http://go.microsoft.com/fwlink/?LinkId234227namespace sl{/// summary/// Provides application-specific behavior to supplement the default Application class./// /summarysealed partial class App : Application {/// summary/// Initializes the singleton application object. This is the first line of authored code/// executed, and as such is the logical equivalent of main() or WinMain()./// /summarypublic static FeedDataSource DataSource;public App() {this.InitializeComponent(); DataSource new FeedDataSource(); }/// summary/// Invoked when the application is launched normally by the end user. Other entry points/// will be used when the application is launched to open a specific file, to display/// search results, and so forth./// /summary/// param nameargsDetails about the launch request and process./paramprotected override void OnLaunched(LaunchActivatedEventArgs args) {if (args.PreviousExecutionState ApplicationExecutionState.Terminated) {//TODO: Load state from previously suspended application }// Create a Frame to act navigation context and navigate to the first pagevar rootFrame new Frame(); rootFrame.Navigate(typeof(BlankPage));// Place the frame in the current Window and ensure that it is active Window.Current.Content rootFrame; Window.Current.Activate(); }/// summary/// Invoked when application execution is being suspended. Application state is saved/// without knowing whether the application will be terminated or resumed with the contents/// of memory still intact./// /summary/// param namesenderThe source of the suspend request./param/// param nameeDetails about the suspend request./paramvoid OnSuspending(object sender, SuspendingEventArgs e) {//TODO: Save application state and stop any background activity } }} 源于参考文档http://msdn.microsoft.com/zh-cn/library/windows/apps/br211380.aspx#Y909转载于:https://www.cnblogs.com/suguoqiang/archive/2012/03/07/2384394.html
http://www.zqtcl.cn/news/19465/

相关文章:

  • 阿里云oss做网站备份网站开发硬件工程师待遇
  • 免费学设计的网站视频网站设计模板
  • php 上传到网站学校网站在建设方面的的优势
  • wordpress+ie9深圳网站seo优化公司
  • 做阿里巴巴网站店铺装修费用定西市建设厅官方网站
  • 学生作业做网站需要县城网站怎么做
  • 桓台响应式网站建设加拿大28怎么做网站代理
  • 个人域名备案网站名称安徽网站优化价格咨询
  • 网站建设运营岗位职责浙江备案需要开启网站吗
  • 做调查赚钱的网站又哪些大家都在哪些网站做宣传
  • 单页面应用的网站做网页链接
  • 2015年做那个网站致富怎么在wordpress建站
  • 无锡网站建设选众鼎做网站的用什么电脑好
  • 太原网站优化培训做网站的硬件成本
  • 做网站的公司推荐哪个平台做推广效果好
  • 成都网站建设方案服务寻找客户的渠道和方法
  • 高端网站设计新鸿儒温州seo公司
  • 网站的收费系统怎么做买域名后 怎么做网站
  • 玛迪做网站做网站源代码
  • 凤岗东莞网站建设河北网站建设电话
  • 网站挂马怎么办车载cms是什么意思
  • 肯德基网站开发网站建设询价
  • 学校网站怎么做优化正规的高端网站制作公司
  • 免费个人网站哪个好旅行社网站建设方案
  • 南通物流网站建设发生太多重定位wordpress
  • 站长工具的使用seo综合查询排名网络营销工资一般多少
  • 建设电子商务网站的预期收益营销网店推广的软文
  • 没有版权可以做视频网站吗汽车拆车件网上商城
  • 广州市住房和城乡建设局网站首页关键词优化软件哪家好
  • 外国网站架构如何做网站内链优化