xeonkhj / inkingnewsstand Goto Github PK
View Code? Open in Web Editor NEW一个可以使用Windows Ink的新闻阅读软件。
一个可以使用Windows Ink的新闻阅读软件。
访问没有图片的新闻时会有UI错误,错误在App.g.i.cs中被抛出。
private async void GetReadingHtml(Uri url)
{
if (isExtend)
{
try
{
await HtmlConverter.ExtractReadableContent(url);
//上一行报错System.UriFormatException:“Invalid URI: The URI is empty.”
}
catch (ReadSharp.ReadException readException)
{
System.Diagnostics.Debug.WriteLine(readException.Message);
}
}
删除报纸时,没有处理被删除报纸的新闻。
每个NewsPaper中的newsItems不能被保存到文件中,每次加载完后总是显示数量为0。
问题在于用于绑定的List<NewsPaper> newPaperlist
不是一个属性,若要通过绑定newsPaperListView
,则会导致在应用启动时程序调用文件读取列表,而属性又在同时试图读取列表,造成文件访问错误。若仅通过属性访问列表,而不在页面初始化时读取文件,则会令导航栏不停地刷新。
如图:
NewsPaper newsPaper = null; private async void SaveButton_Click(object sender, RoutedEventArgs e) { var newsPaper = NewsPaper.NewsPapers.Find((NewsPaper paper) => paper.PaperTitle == News.PaperTitle); newsPaper.OnNewsListUpdated += NewsPaper_OnNewsListUpdated; //小心,可能多次重复使用同份报纸会加两次 //to-do //保存笔迹 var currentStrokes = newsCanvas.InkPresenter.StrokeContainer.GetStrokes(); if (currentStrokes.Count != 0) //改成要是没修改 //to-do { byte[] serializedStrokes = await SerializeStrokes(currentStrokes); News.InkStrokes = serializedStrokes; } }
若重复保存同一张报纸的两份内容,可能会订阅事件两次。
在页面切换后,最近更新的新闻会排在最下面
在TechCrunch的订阅源文章中出现
新闻的原网站无法连接时程序报错
System.AggregateException
HResult=0x80131500
Message=One or more errors occurred. (Object reference not set to an instance of an object.)
Source=System.Private.CoreLib
StackTrace:
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at AngleSharp.TextSource.ExpandBuffer(Int64 size)
at AngleSharp.TextSource.ReadCharacter()
at AngleSharp.Parser.BaseTokenizer.AdvanceUnsafe()
at AngleSharp.Parser.Html.HtmlTokenizer.Get()
at AngleSharp.Parser.Html.HtmlDomBuilder.Parse(HtmlParserOptions options)
at AngleSharp.Parser.Html.HtmlParser.Parse(Stream source)
at SmartReader.Reader.GetArticle()
at InkingNewstand.Utilities.HtmlConverter.<>c__DisplayClass2_0.b__0() in C:\Users\FireM\Source\Repos\InkingNewstand\InkingNewstand.Utilities\HtmlConverter.cs:line 51
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
内部异常 1:
NullReferenceException: Object reference not set to an instance of an object.
文件结构是SortedDictionary<int, NewsPaperModel>,可是我用这个列表的长度来插入新报纸,于是就有
System.InvalidOperationException
HResult=0x80131509
Message=The instance of entity type 'NewsPaper_Feed' cannot be tracked because another instance with the same key value for {'FeedId', 'NewsPaperId'} is already being tracked. When attaching existing entities, ensure that only one entity instance with a given key value is attached. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see the conflicting key values.
Source=Microsoft.EntityFrameworkCore
StackTrace:
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.IdentityMap1.ThrowIdentityConflict(InternalEntityEntry entry) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.IdentityMap
1.Add(TKey key, InternalEntityEntry entry, Boolean updateDuplicate)
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.StartTracking(InternalEntityEntry entry)
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry.SetEntityState(EntityState oldState, EntityState newState, Boolean acceptChanges)
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.EntityGraphAttacher.PaintAction(EntityEntryGraphNode node, Boolean force)
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.EntityEntryGraphIterator.TraverseGraph[TState](EntityEntryGraphNode node, TState state, Func3 handleNode) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.EntityEntryGraphIterator.TraverseGraph[TState](EntityEntryGraphNode node, TState state, Func
3 handleNode)
at Microsoft.EntityFrameworkCore.DbContext.SetEntityStates(IEnumerable`1 entities, EntityState entityState)
at InkingNewsstand.Classes.NewsPaper.d__24.MoveNext() in D:\Dev\Repos\InkingNewsstand\InkingNewsstand\Classes\NewsPaper.cs:line 315
当一篇新闻的订阅源内容有和封面图片一样的图片时,封面图片会隐藏显示,此时再转到扩展模式,若扩展模式中的正文没有封面图片,封面图片不会重新显示。
从事件查看器中截取的错误信息
日志名称: Application
来源: Application Error
日期: 2019/3/16 17:33:40
事件 ID: 1000
任务类别: (100)
级别: 错误
关键字: 经典
用户: 暂缺
计算机: HONGJIA-SURGO
描述:
错误应用程序名称: InkingNewstand.exe,版本: 1.0.0.0,时间戳: 0x5a68410c
错误模块名称: Windows.UI.Xaml.dll,版本: 10.0.17763.379,时间戳: 0x1dcf1d23
异常代码: 0xc000027b
错误偏移量: 0x0000000000708aa2
错误进程 ID: 0x2dc0
错误应用程序启动时间: 0x01d4dbdaff0fcdb8
错误应用程序路径: C:\Users\redal\AppData\Local\DevelopmentFiles\ddb4f763-1fca-4b0d-a199-e50c2be502f2VS.Debug_x64.redal\InkingNewstand.exe
错误模块路径: C:\Windows\System32\Windows.UI.Xaml.dll
报告 ID: 8305d5d5-c771-48f4-a717-42cd569e9b33
错误程序包全名: ddb4f763-1fca-4b0d-a199-e50c2be502f2_0.1.5.0_x64__xe7ejb7dfnp4r
错误程序包相对应用程序 ID: App
事件 Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="Application Error" />
<EventID Qualifiers="0">1000</EventID>
<Level>2</Level>
<Task>100</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2019-03-16T09:33:40.421751800Z" />
<EventRecordID>8915</EventRecordID>
<Channel>Application</Channel>
<Computer>HONGJIA-SURGO</Computer>
<Security />
</System>
<EventData>
<Data>InkingNewstand.exe</Data>
<Data>1.0.0.0</Data>
<Data>5a68410c</Data>
<Data>Windows.UI.Xaml.dll</Data>
<Data>10.0.17763.379</Data>
<Data>1dcf1d23</Data>
<Data>c000027b</Data>
<Data>0000000000708aa2</Data>
<Data>2dc0</Data>
<Data>01d4dbdaff0fcdb8</Data>
<Data>C:\Users\redal\AppData\Local\DevelopmentFiles\ddb4f763-1fca-4b0d-a199-e50c2be502f2VS.Debug_x64.redal\InkingNewstand.exe</Data>
<Data>C:\Windows\System32\Windows.UI.Xaml.dll</Data>
<Data>8305d5d5-c771-48f4-a717-42cd569e9b33</Data>
<Data>ddb4f763-1fca-4b0d-a199-e50c2be502f2_0.1.5.0_x64__xe7ejb7dfnp4r</Data>
<Data>App</Data>
</EventData>
</Event>
DetailPage.xaml中的WebView在MainPage中的contentFrame中无法显示内容,但在外层可以。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.