各位大神,请教程序Exception_WasThrown的问题

wangwei26144 2018-07-20 10:28:55
程序提出System.StackOverflowException:“Exception_WasThrown”我应该怎么改?初学C#请求帮助





using System;
using System.Collections.Generic;
using System.ComponentModel;

namespace DrawC
{
internal class JsonClass : INotifyPropertyChanged
{
public string RunNum
{
get
{
return this.RunNum;
}
set
{
this.RunNum = value;
this.NotifyPropertyChange("RunNum");
}
}
public bool UseNorepeat
{
get
{
return this.UseNorepeat;
}
set
{
this.UseNorepeat = value;
}
}
public string LuckMan
{
get
{
return this.LuckMan;
}
set
{
this.LuckMan = value;
this.NotifyPropertyChange("LuckMan");
}
}
public string SaveText
{
get
{
return this.SaveText;
}
set
{
this.SaveText = value;
this.NotifyPropertyChange("SaveText");
}
}
public List<JsonrootItem> Jsonroot
{
get
{
return this.Jsonroot;
}
set
{
this.Jsonroot = value;
}
}
public JsonClass()
{
this.Jsonroot = new List<JsonrootItem>();
this.LuckMan = "抽签抽中人员";
this.RunNum = "0个人";
this.UseNorepeat = true;
}
public event PropertyChangedEventHandler PropertyChanged;
private void NotifyPropertyChange(string propertyName)
{
if (this.PropertyChanged != null)
{
this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}

}
}
...全文
12147 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
datafansbj 2019-07-05
  • 打赏
  • 举报
回复 2
你的属性值获取的 get 方法,返回的是属性值本身,这属于递归循环了,导致堆栈溢出。应该定义一个私有的变量存储属性值,get 方法返回私有的值。
chromedriver,v2.24,支持chrome v52-54. ----------ChromeDriver v2.24 (2016-09-09)---------- Supports Chrome v52-54 Resolved issue 1497: GetLog fails when the current window is closed [['OS-All', 'Pri-0']] Resolved issue 1495: ChromeDriver crashes with "Check failed: !page_load_strategy_.empty()" [['OS-All', 'Pri-0']] Resolved issue 1463: SessionNotCreatedException: Runtime.evaluate missing 'wasThrown' on Chrome 54+ [['OS-All', 'Pri-0']] Resolved issue 1484: SendKeys of a Tab Key has no effect in Chrome 53 [['OS-All', 'Pri-1']] Resolved issue 1431: GetLog command does not work for Chrome 54+ [['OS-All', 'Pri-1']] Resolved issue 1411: sendKeys generates events that are missing some fields [['OS-All', 'Pri-1']] Resolved issue 1451: Chrome 54+ session not created exception: Runtime.executionContextCreated has invalid 'context' [['Pri-1']] Resolved issue 984: Extend ChromeDriver capabilities to cover network throttling feature from Chrome DevTools [['OS-All', 'Pri-2']] Resolved issue 1454: Net::ReadTimeout error on launching Canary v54 through RemoteWebDriver [[]] ----------ChromeDriver v2.23 (2016-08-04)---------- Supports Chrome v51-53 Resolved issue 1378: Android 6: Intitialization of Chrome driver fails when Chrome/Webview process is in running (R) state [['OS-Android', 'Pri-1']] Resolved issue 1379: Chromedriver does not catch all available browser console log entries [['OS-All', 'Pri-2']] ----------ChromeDriver v2.22 (2016-06-06)---------- Supports Chrome v49-52 Resolved issue 1348: Timeout error while navigating to URL on Chrome 51+ [['OS-All', 'Pri-0']] Resolved issue 1381: Timeout error occurs when alert dialog is displayed on Chrome 52+ [['OS-All', 'Pri-1', 'merge-merged-2743']] Resolved issue 1339: Failure when executing JS in a content script context [['OS-All', 'Pri-1']] Resolved issue 1387: ChromeDriver hangs when calling driver.get() for same-process navigations [['OS-All', 'Pri-1']] Resolved issue 1365: Touch emulation is not working under mobile emulation

110,571

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧