Exemplo n.º 1
0
 void Instance_UserInfoUpdate(object sender, GAPPSF.Chat.UserInRoomInfo usr)
 {
     if (usr.FollowThisUser)
     {
         if (!string.IsNullOrEmpty(usr.ActiveGeocache))
         {
             if (Core.ApplicationData.Instance.ActiveDatabase != null)
             {
                 Core.Data.Geocache gc = Core.ApplicationData.Instance.ActiveDatabase.GeocacheCollection.GetGeocache(usr.ActiveGeocache);
                 if (gc != null)
                 {
                     Core.ApplicationData.Instance.ActiveGeocache = gc;
                     FollowActiveGeocacheText = gc.Code;
                 }
                 else if (usr.ActiveGeocache.StartsWith("GC") && Core.Settings.Default.LiveAPIMemberTypeId > 0)
                 {
                     //offer to download
                     FollowActiveGeocacheText = string.Format("{0} ({1})", usr.ActiveGeocache, Localization.TranslationManager.Instance.Translate("Missing") as string);
                 }
                 else
                 {
                     FollowActiveGeocacheText = gc.Code;
                 }
             }
         }
         else
         {
             FollowActiveGeocacheText = "";
         }
     }
 }
Exemplo n.º 2
0
        void Instance_NewTextMessage(object sender, string fromid, string msg, System.Drawing.Color col)
        {
            GAPPSF.Chat.UserInRoomInfo usr = (from a in GAPPSF.Chat.Manager.Instance.UsersInRoomList where a.ID == fromid select a).FirstOrDefault();

            AddMessage(string.Format("{0} [{1}]:", DateTime.Now.ToString("t"), usr == null ? "" : usr.Username), System.Drawing.Color.Black);
            AddMessage(msg, col);

            txtBox.AppendText("\r");
            txtBox.ScrollToEnd();
        }