@@ -116,39 +116,46 @@ private async void LoadNewsFeed()
116
116
// RSS Releated
117
117
var rssurl = @"http://go.microsoft.com/fwlink/?linkid=84795&clcid=409" ;
118
118
119
- using ( var reader = XmlReader . Create ( rssurl ) )
119
+ try
120
120
{
121
- var feedReader = new RssFeedReader ( reader ) ;
122
-
123
- while ( await feedReader . Read ( ) )
121
+ using ( var reader = XmlReader . Create ( rssurl ) )
124
122
{
125
- switch ( feedReader . ElementType )
123
+ var feedReader = new RssFeedReader ( reader ) ;
124
+
125
+ while ( await feedReader . Read ( ) )
126
126
{
127
- case SyndicationElementType . Item :
128
- var syndicationItem = await feedReader . ReadItem ( ) ;
127
+ switch ( feedReader . ElementType )
128
+ {
129
+ case SyndicationElementType . Item :
130
+ var syndicationItem = await feedReader . ReadItem ( ) ;
129
131
130
- var content = syndicationItem . Description ;
132
+ var content = syndicationItem . Description ;
131
133
132
- int maxCharCount = 150 ;
134
+ int maxCharCount = 150 ;
133
135
134
- if ( content . Length >= maxCharCount )
135
- {
136
- content = content . StripHTML ( ) . Truncate ( maxCharCount , "..." ) ;
137
- }
136
+ if ( content . Length >= maxCharCount )
137
+ {
138
+ content = content . StripHTML ( ) . Truncate ( maxCharCount , "..." ) ;
139
+ }
138
140
139
- var link = syndicationItem . Links . LastOrDefault ( ) ;
140
- var url = "" ;
141
+ var link = syndicationItem . Links . LastOrDefault ( ) ;
142
+ var url = "" ;
141
143
142
- if ( link != null )
143
- {
144
- url = link . Uri . AbsoluteUri ;
145
- }
144
+ if ( link != null )
145
+ {
146
+ url = link . Uri . AbsoluteUri ;
147
+ }
146
148
147
- _newsFeed . Add ( new NewsFeedViewModel ( url , content , syndicationItem . Categories . FirstOrDefault ( ) ? . Name , syndicationItem . Contributors . FirstOrDefault ( ) ? . Name , syndicationItem . Title ) ) ;
148
- break ;
149
+ _newsFeed . Add ( new NewsFeedViewModel ( url , content , syndicationItem . Categories . FirstOrDefault ( ) ? . Name , syndicationItem . Contributors . FirstOrDefault ( ) ? . Name , syndicationItem . Title ) ) ;
150
+ break ;
151
+ }
149
152
}
150
153
}
151
154
}
155
+ catch ( Exception )
156
+ {
157
+
158
+ }
152
159
}
153
160
154
161
private async void LoadVideoFeed ( )
0 commit comments