TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Mike Jonson
NA
239
194k
How call customer exeption
Jul 26 2011 4:17 AM
I chave create my exeption class, but when i call my exeption, show box with this exeption and program stop.
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialiazation;
namespace MyToolBar
{
public class MyXmlExeption : Exception
{
public MyXmlExeption() : base() { }
public MyXmlExeption(string message) : base(message) { }
public MyXmlExeption(string message, Exception e) : base(message, e) { }
}
}
and here i check, when i will call my exeption
foreach (XmlAttribute atr in ch.Attributes)
{
if (atr.Name == "img" && atr.Value == "")
throw new MyXmlExeption("Picture not found in xml file");
if (atr.Name == "id")
button1.Name = atr.Value;
if (atr.Name == "img")
{
button1.BackgroundImage = Image.FromFile(atr.Value);
}
if (atr.Name == "text")
button1.Text = atr.Value;
}
and here i call my exeption
thrd = new Thread(new ParameterizedThreadStart(toolBar1.XmlLoad));
try
{
//?????? ?????? ? ???????????
thrd.Start(xmlPath);
}
catch (MyXmlExeption ex) { }
Reply
Answers (
15
)
SQL Backup error in c sharp
Displaying multiline text in popup window for windows mobile