Exemplo n.º 1
0
 protected override void OnHandleDestroyed(EventArgs e)
 {
     if (GoingAway != null)
     {
         GoingAway.Invoke(this, null);                 //shake any bindings to us loose
     }
     GoingAway = null;
     base.OnHandleDestroyed(e);
 }
Exemplo n.º 2
0
 /// <summary>
 /// Clean up any resources being used.
 /// </summary>
 /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
 protected override void Dispose(bool disposing)
 {
     if (GoingAway != null)
     {
         GoingAway.Invoke(this, null);                 //shake any bindings to us loose
     }
     if (disposing && (components != null))
     {
         components.Dispose();
     }
     base.Dispose(disposing);
 }
Exemplo n.º 3
0
        private AfkMessage ReplaceSpaceHolder(User user)
        {
            ComingBack = ComingBack.Replace("{username}", user.Username)
                         .Replace("{time}", TimeHelper.ConvertMillisecondsToPassedTime(user.Time, "ago", ConversionType.YearDayHourMin))
                         .Replace("{message}", user.MessageText.Decode());
            ComingBack = string.IsNullOrEmpty(user.MessageText.Decode()) ? ComingBack.Replace(":", "").ReplaceSpaces() : ComingBack;

            GoingAway = GoingAway.Replace("{username}", user.Username);

            Resuming = Resuming.Replace("{username}", user.Username);

            return(this);
        }