Click here to Skip to main content
15,902,112 members
Home / Discussions / C#
   

C#

 
AnswerRe: problem to importing DLL files Pin
Luc Pattyn4-Apr-09 22:54
sitebuilderLuc Pattyn4-Apr-09 22:54 
GeneralRe: problem to importing DLL files Pin
PIEBALDconsult5-Apr-09 4:14
mvePIEBALDconsult5-Apr-09 4:14 
QuestionSeparator Line on form.....help guys! Pin
Rajdeep.NET is BACK4-Apr-09 21:21
Rajdeep.NET is BACK4-Apr-09 21:21 
AnswerRe: Separator Line on form.....help guys! Pin
Harvey Saayman4-Apr-09 22:02
Harvey Saayman4-Apr-09 22:02 
GeneralRe: Separator Line on form.....help guys! Pin
Rajdeep.NET is BACK4-Apr-09 22:13
Rajdeep.NET is BACK4-Apr-09 22:13 
GeneralRe: Separator Line on form.....help guys! Pin
Rajdeep.NET is BACK4-Apr-09 22:16
Rajdeep.NET is BACK4-Apr-09 22:16 
GeneralRe: Separator Line on form.....help guys! Pin
Luc Pattyn4-Apr-09 22:59
sitebuilderLuc Pattyn4-Apr-09 22:59 
AnswerRe: Separator Line on form.....help guys! Pin
#realJSOP5-Apr-09 3:07
professional#realJSOP5-Apr-09 3:07 
QuestionOk, is it just me or...? Pin
jas0n234-Apr-09 20:26
jas0n234-Apr-09 20:26 
AnswerRe: Ok, is it just me or...? Pin
hot_ice4-Apr-09 20:39
hot_ice4-Apr-09 20:39 
GeneralRe: Ok, is it just me or...? Pin
jas0n234-Apr-09 20:42
jas0n234-Apr-09 20:42 
AnswerRe: Ok, is it just me or...? Pin
DaveyM694-Apr-09 22:16
professionalDaveyM694-Apr-09 22:16 
AnswerRe: Ok, is it just me or...? Pin
Luc Pattyn4-Apr-09 23:02
sitebuilderLuc Pattyn4-Apr-09 23:02 
AnswerRe: Ok, is it just me or...? Pin
Christian Graus5-Apr-09 0:01
protectorChristian Graus5-Apr-09 0:01 
GeneralRe: Ok, is it just me or...? Pin
jas0n235-Apr-09 0:05
jas0n235-Apr-09 0:05 
AnswerRe: Ok, is it just me or...? Pin
#realJSOP5-Apr-09 3:09
professional#realJSOP5-Apr-09 3:09 
AnswerRe: Ok, is it just me or...? Pin
PIEBALDconsult5-Apr-09 5:39
mvePIEBALDconsult5-Apr-09 5:39 
QuestionHow to validate the xml while updating the node of an xml Pin
member1234564-Apr-09 19:40
member1234564-Apr-09 19:40 
QuestionRounded button and panel in c# Pin
sepel4-Apr-09 19:17
sepel4-Apr-09 19:17 
AnswerRe: Rounded button in c# Pin
Xmen Real 4-Apr-09 19:36
professional Xmen Real 4-Apr-09 19:36 
AnswerRe: [Message Deleted] Pin
Luc Pattyn4-Apr-09 23:05
sitebuilderLuc Pattyn4-Apr-09 23:05 
GeneralRe: [Message Deleted] Pin
sepel5-Apr-09 18:17
sepel5-Apr-09 18:17 
QuestionCOM Interop GUID Help Pin
monkh4-Apr-09 18:01
monkh4-Apr-09 18:01 
QuestionClickOnce app... contanstly checking for updates? Pin
Jacob Dixon4-Apr-09 17:16
Jacob Dixon4-Apr-09 17:16 
I was wondering if there was a better way of doing this?

What I am trying to accomplish is always checking for updates and displaying there is an update with a NotifyIcon. Now I got it working good, but was wondering if there was a better way.

The way I did it was used a timer (every 5 min). On the Tick event:
private void timerCheckUpdates_Tick(object sender, EventArgs e)
{
    if (ApplicationDeployment.IsNetworkDeployed)
    {
        if (!CheckUpdate)
        {
            ApplicationDeployment ad = ApplicationDeployment.CurrentDeployment;

            try
            {
                ad.CheckForUpdateCompleted += new CheckForUpdateCompletedEventHandler(ad_CheckForUpdateCompleted);
                ad.CheckForUpdateAsync();
                CheckUpdate = true;
            }
            catch (COMException)
            {
                ad.CheckForUpdateAsyncCancel();
            }
        }
    }
}

void ad_CheckForUpdateCompleted(object sender, CheckForUpdateCompletedEventArgs e)
{
    CheckUpdate = false;
    if (e.UpdateAvailable)
    {
        notifyIcon1.ShowBalloonTip(5000, "Update Available!", "There is a new update available for this application!\nPlease click on the Help menu and click Check for updates.", ToolTipIcon.Info);
        timerCheckUpdates.Enabled = false;
    }
}


Ok I haven't tried it since I've changed it to the COMException, but if the user didn't have internet at all it would throw an exception. I am trying to get away from the error messages.

Is there a better way of doing this?
AnswerRe: ClickOnce app... contanstly checking for updates? Pin
Mycroft Holmes4-Apr-09 22:48
professionalMycroft Holmes4-Apr-09 22:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.