Code Monkey home page Code Monkey logo

inkingnewsstand's People

Contributors

xeonkhj avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

inkingnewsstand's Issues

在添加报纸后自动刷新新闻会在Feeds更新到数据库时出现一下错误

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.IdentityMap1.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, Func3 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

点开新闻报错

新闻的原网站无法连接时程序报错
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>,可是我用这个列表的长度来插入新报纸,于是就有

  1. 插入1号报纸 <0, NewsPaper1>
  2. 插入2号报纸 <1 ,NewsPaper2>
  3. 删除1号报纸 ,此时列表只有<1.NewsPaper2>
  4. 再插入3号报纸<1, NewsPaper3>,出现Key相同错误。

NewsDetailPage.xaml.cs中的SaveButton_Click方法中的OnNewsListUpdated事件订阅错误

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; } }
若重复保存同一张报纸的两份内容,可能会订阅事件两次。

导航栏中的报纸列表没法被即时的更新

问题在于用于绑定的List<NewsPaper> newPaperlist 不是一个属性,若要通过绑定newsPaperListView,则会导致在应用启动时程序调用文件读取列表,而属性又在同时试图读取列表,造成文件访问错误。若仅通过属性访问列表,而不在页面初始化时读取文件,则会令导航栏不停地刷新。

在点击扩展选项时有些新闻会报错,有些新闻就不会。

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);
}
}

封面图片在扩展正文中的显示问题

当一篇新闻的订阅源内容有和封面图片一样的图片时,封面图片会隐藏显示,此时再转到扩展模式,若扩展模式中的正文没有封面图片,封面图片不会重新显示。

在切断网络下点击新闻后迅速返回可能会使程序奔溃

从事件查看器中截取的错误信息

日志名称: 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>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.