private Message GetMessageByUser(MessageType mtype, UserReferenceType type, uint id)
        {
            var existing = ActiveMessages.FirstOrDefault(x => x.User.Type == type &&
                                                         x.User.Id == id && x.Type == mtype);

            return(existing);
        }
Пример #2
0
        public BuiltInUserReference(UserReferenceType type)
        {
            _Type = type;

            var content = FSO.Content.Content.Get();

            switch (type)
            {
            case UserReferenceType.EA:
                Icon = content.UIGraphics.Get(0x00000B0000000001);
                Name = GameFacade.Strings.GetString("195", "33");
                break;

            case UserReferenceType.MAXIS:
                Icon = content.UIGraphics.Get(0x00000B0100000001);
                Name = GameFacade.Strings.GetString("195", "34");
                break;

            case UserReferenceType.MOMI:
                Icon = content.UIGraphics.Get(0x00000B0200000001);
                Name = "M.O.M.I";
                break;

            case UserReferenceType.TSO:
                Icon = content.UIGraphics.Get(0x00000B0300000001);
                Name = GameFacade.Strings.GetString("195", "35");
                break;
            }
        }
Пример #3
0
 public override void Deserialize(IoBuffer input, ISerializationContext context)
 {
     FromType = input.GetEnum <UserReferenceType>();
     From     = input.GetUInt32();
     To       = input.GetUInt32();
     Type     = input.GetEnum <InstantMessageType>();
     Message  = input.GetPascalVLCString();
     AckID    = input.GetPascalVLCString();
     Reason   = input.GetEnum <InstantMessageFailureReason>();
 }
Пример #4
0
 public static UserReference Of(UserReferenceType type, uint id)
 {
     if (type == UserReferenceType.AVATAR)
     {
         if (Cache.ContainsKey(id))
         {
             return(Cache[id]);
         }
         var value = new AvatarUserReference(id);
         Cache[id] = value;
         return(value);
     }
     else
     {
         return(new BuiltInUserReference(type));
     }
 }
Пример #5
0
        /// <summary>
        /// Outputs the standard.
        /// </summary>
        /// <param name="sw">The writer.</param>
        protected void OutputStandard(TextWriter sw)
        {
            string levelPlusOne = null;

            if (ChangeDate != null)
            {
                if (levelPlusOne == null)
                {
                    levelPlusOne = (Level + 1).ToString();
                }

                sw.Write(Environment.NewLine);
                sw.Write(levelPlusOne);
                sw.Write(" CHAN ");

                ChangeDate.Output(sw);
            }

            if (notes != null)
            {
                if (levelPlusOne == null)
                {
                    levelPlusOne = (Level + 1).ToString();
                }

                foreach (string noteID in Notes)
                {
                    sw.Write(Environment.NewLine);
                    sw.Write("{0} NOTE @{1}@", levelPlusOne, noteID);
                }
            }

            if (sources != null)
            {
                foreach (GedcomSourceCitation citation in Sources)
                {
                    citation.Output(sw);
                }
            }

            if (multimedia != null)
            {
                if (levelPlusOne == null)
                {
                    levelPlusOne = (Level + 1).ToString();
                }

                foreach (string multimediaID in Multimedia)
                {
                    sw.Write(Environment.NewLine);
                    sw.Write("{0} OBJE @{1}@", levelPlusOne, multimediaID);
                }
            }

            if (!string.IsNullOrEmpty(UserReferenceNumber))
            {
                if (levelPlusOne == null)
                {
                    levelPlusOne = (Level + 1).ToString();
                }

                sw.Write(Environment.NewLine);
                sw.Write(levelPlusOne);
                sw.Write(" REFN ");
                string line = UserReferenceNumber.Replace("@", "@@");
                sw.Write(line);

                if (!string.IsNullOrEmpty(UserReferenceType))
                {
                    sw.Write(Environment.NewLine);
                    sw.Write((Level + 2).ToString());
                    sw.Write(" REFN ");
                    line = UserReferenceType.Replace("@", "@@");
                    sw.Write(line);
                }
            }

            if (!string.IsNullOrEmpty(AutomatedRecordId))
            {
                if (levelPlusOne == null)
                {
                    levelPlusOne = (Level + 1).ToString();
                }

                sw.Write(Environment.NewLine);
                sw.Write(levelPlusOne);
                sw.Write(" RIN ");
                string line = AutomatedRecordId.Replace("@", "@@");
                sw.Write(line);
            }
        }
Пример #6
0
 public static UserReference Of(UserReferenceType type)
 {
     return(new BuiltInUserReference(type));
 }