Пример #1
0
 public void WriteStatus(string message, params object[] args)
 {
     try
     {
         _box.Invoke(new Action(() =>
         {
             _box.Text = GenericProgress.SafeFormat(message + Environment.NewLine,
                                                    args);
         }));
     }
     catch (Exception)
     {
     }
 }
Пример #2
0
        public void WriteStatus(string message, params object[] args)
        {
            string theMessage = GenericProgress.SafeFormat(message, args);

            LastStatus = theMessage;
            if (SyncContext != null)
            {
                SyncContext.Post(UpdateText, theMessage);
            }
            else
            {
                Text = theMessage;
            }
        }
        public void WriteMessage(string message, params object[] args)
        {
//			if (!_loaded)
//				return;

            try
            {
//				string theMessage = GenericProgress.SafeFormat(message, args);
//				//Guard.AgainstNull(SyncContext,"SyncContext");
//				///SyncContext.Post(UpdateText, theMessage);
//
//				this.Invoke(new Action(() => { UpdateText(theMessage);}));
//				Application.DoEvents();

                string theMessage = GenericProgress.SafeFormat(message, args);

//				if (SyncContext != null)
//				{
//					SyncContext.Post(UpdateText, theMessage);//Post() means do it asynchronously, don't wait around and see if there is an exception
//				}
//				else
//				{
//					Text = theMessage;
//				}

                //if (IsHandleCreated)
                {
                    if (InvokeRequired)
                    {
                        BeginInvoke(new Action(() => UpdateText(theMessage)));
                    }
                    else
                    {
                        UpdateText(theMessage);
                    }
                }
//				else
//				{
//					// in this case InvokeRequired might lie - you need to make sure that this never happens!
//					throw new Exception("Somehow Handle has not yet been created on the UI thread!");
//				}
            }
            catch (Exception error)
            {
#if DEBUG
                Debug.Fail(error.Message);
#endif
            }
        }
Пример #4
0
 public override void WriteMessage(string message, params object[] args)
 {
     try
     {
         // if (_box.InvokeRequired)
         _box.Invoke(new Action(() =>
         {
             _box.Text += "                          ".Substring(0, indent * 2);
             _box.Text += GenericProgress.SafeFormat(message + Environment.NewLine, args);
         }));
     }
     catch (Exception)
     {
     }
     //            _box.Invoke(new Action<TextBox, int>((box, indentX) =>
     //            {
     //                box.Text += "                          ".Substring(0, indentX * 2);
     //                box.Text += GenericProgress.SafeFormat(message + Environment.NewLine, args);
     //            }), _box, indent);
 }
Пример #5
0
        public void WriteMessage(string message, params object[] args)
        {
            try
            {
                string theMessage = GenericProgress.SafeFormat(message, args);
                if (InvokeRequired)
                {
                    BeginInvoke(new Action(() => UpdateText(theMessage)));
                }
                else
                {
                    UpdateText(theMessage);
                }
            }
            catch (Exception error)
            {
#if DEBUG
                Debug.Fail(error.Message);
#endif
            }
        }
Пример #6
0
 internal static (string inRssHash, string inProfileHash) GetHash(int id, int progressValue, GenericProgress progress, int score) =>
Пример #7
0
 public void WriteError(string message, params object[] args)
 {
     ErrorEncountered = true;
     LastError        = GenericProgress.SafeFormat(message, args);
     LastStatus       = LastError;
 }
Пример #8
0
 public void WriteWarning(string message, params object[] args)
 {
     WarningEncountered = true;
     LastWarning        = GenericProgress.SafeFormat(message, args);
     LastStatus         = LastWarning;
 }
Пример #9
0
 internal static AnimeProgress ToAnimeProgress(this GenericProgress @this) => (AnimeProgress)@this;
Пример #10
0
 internal static MangaProgress ToMangaProgress(this GenericProgress @this) => (MangaProgress)@this;