Make Visual Studio ignore exceptions?

前端 未结 7 2161
一个人的身影
一个人的身影 2021-01-12 02:27

I\'m using exceptions to validate a control\'s input in Silverlight 4. When I throw an invalid input exception, VS 2010 displays the popup and stops the program. I ignore th

7条回答
  •  别那么骄傲
    2021-01-12 02:37

    Putting this above the property that throws the exception seems like it should work but apparently doesn't: [System.Diagnostics.DebuggerHidden()]:

        private String name;
    
        [System.Diagnostics.DebuggerHidden()]
        public String Name
        {
            get
            {
                return name;
            }
            set
            {
                if (String.IsNullOrWhiteSpace(value))
                {
                    throw new ArgumentException("Please enter a name.");
                }
            }
        }
    

提交回复
热议问题