protected virtual void OnMessageReady(PictureServiceEventArgs e)
 {
     if (MessageReady != null)
     {
         try
         {
             MessageReady(this, e);
         }
         catch (Exception ex)
         {
             //Always continue after a missed event
         }
     }
 }
 protected virtual void OnDownloadPart(PictureServiceEventArgs e)
 {
     if (DownloadPart != null)
     {
         try
         {
             DownloadPart(this, e);
         }
         catch (Exception ex)
         {
             //Always continue after a missed event
         }
     }
 }
 protected virtual void OnErrorOccured(PictureServiceEventArgs e)
 {
     if (ErrorOccured != null)
     {
         try
         {
             ErrorOccured(this, e);
         }
         catch (Exception ex)
         {
             //Always continue after a missed event
         }
     }
 }
 protected virtual void OnUploadFinish(PictureServiceEventArgs e)
 {
     if (UploadFinish != null)
     {
         try
         {
             UploadFinish(this, e);
         }
         catch (Exception ex)
         {
             //Always continue after a missed event
         }
     }
 }
示例#5
0
 /// <summary>
 /// Event handling for when the upload is finished
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="eventArgs"></param>
 private void pictureService_UploadFinish(object sender, PictureServiceEventArgs eventArgs)
 {
     if (uploadedPictureOrigin == "file")
     {
         AddPictureToForm(eventArgs.PictureFileName, pictureFromStorage);
     }
     else //camera
     {
         AddPictureToForm(eventArgs.PictureFileName, pictureFromCamers);
     }
     UpdatePictureData(eventArgs.ReturnMessage, false);
 }
示例#6
0
        private void pictureService_MessageReady(object sender, PictureServiceEventArgs eventArgs)
        {
            //Show the message
            MessageBox.Show(eventArgs.ReturnMessage);

            if (uploadedPictureOrigin == "file")
            {
                AddPictureToForm(ClientSettings.IconsFolder() + "existingimage.png", pictureFromStorage);
            }
            else //camera
            {
                AddPictureToForm(ClientSettings.IconsFolder() + "takepicture.png", pictureFromCamers);
            }
            UpdatePictureData(string.Empty, false);

        }
示例#7
0
 private void pictureService_ErrorOccured(object sender, PictureServiceEventArgs eventArgs)
 {
     //Show the error message
     UpdatePictureData(string.Empty, false);
     
     if (uploadedPictureOrigin == "file")
     {
         AddPictureToForm(FormColors.GetThemeIconPath("existingimage.png"), pictureFromStorage);
     }
     else //camera
     {
         AddPictureToForm(FormColors.GetThemeIconPath("takepicture.png"), pictureFromCamers);
     }
     MessageBox.Show(eventArgs.ErrorMessage);
 }