public DisconnectPackage(string idReceiver, string idAuthor)
        {
            this.IdReceiver = idReceiver;
            this.IdAuthor   = idAuthor;

            this.RawData = PackageCreator.GetRawFormattedData(
                this.Type,
                this.IdReceiver,
                this.IdAuthor);
        }
        public HistoryAnswerPackage(string idReceiver, string idAuthor)
        {
            this.IdReceiver = idReceiver;
            this.IdAuthor   = idAuthor;

            this.RawData = PackageCreator.GetRawFormattedData(
                this.Type,
                this.IdReceiver,
                this.IdAuthor);
        }
Esempio n. 3
0
        public UsersListAnswerPackage(string idReceiver, string idAuthor, List <string> users)
        {
            this.IdReceiver = idReceiver;
            this.IdAuthor   = idAuthor;
            this.Users      = users.ToList();

            this.RawData = PackageCreator.GetRawFormattedData(
                this.Type,
                this.IdReceiver,
                this.IdAuthor,
                string.Join(separator, users));
        }
        public UsersListRequestPackage(string idReceiver, string idAuthor, string idRequest)
        {
            this.IdReceiver = idReceiver;
            this.IdAuthor   = idAuthor;
            this.IdRequest  = idRequest;

            this.RawData = PackageCreator.GetRawFormattedData(
                this.Type,
                this.IdReceiver,
                this.IdAuthor,
                this.IdRequest);
        }
        public HistoryAnswerPackage(string idReceiver, string idAuthor, List <Tuple <MessageType, string> > messages)
        {
            this.IdReceiver = idReceiver;
            this.IdAuthor   = idAuthor;
            this.Messages   = messages;

            this.RawData = PackageCreator.GetRawFormattedData(
                this.Type,
                this.IdReceiver,
                this.IdAuthor,
                string.Join(separatorMessages, this.Messages.Select(
                                pair => $"{pair.Item1}{separatorTypeContent}{pair.Item2}")));
        }
Esempio n. 6
0
        public TextPackage(string idReceiver, string idAuthor, DateTime time, string content)
        {
            this.IdReceiver = idReceiver;
            this.IdAuthor   = idAuthor;
            this.Time       = time;
            this.Content    = content;

            this.RawData = PackageCreator.GetRawFormattedData(
                this.Type,
                this.IdReceiver,
                this.IdAuthor,
                PackageCreator.GetFormattedTime(this.Time),
                this.Content);
        }
Esempio n. 7
0
        public HistoryRequestPackage(string idReceiver, string idAuthor, string idRequest, DateTime timeUntil)
        {
            this.IdReceiver = idReceiver;
            this.IdAuthor   = idAuthor;
            this.IdRequest  = idRequest;
            this.TimeUntil  = timeUntil;

            this.RawData = PackageCreator.GetRawFormattedData(
                this.Type,
                this.IdReceiver,
                this.IdAuthor,
                this.IdRequest,
                PackageCreator.GetFormattedTime(timeUntil));
        }
Esempio n. 8
0
        public FilePackage(string idReceiver, string idAuthor, DateTime time, byte[] content)
        {
            this.IdReceiver = idReceiver;
            this.IdAuthor   = idAuthor;
            this.Time       = time;
            this.Content    = content;

            this.RawData = PackageCreator.GetRawFormattedData(
                this.Type,
                new []
            {
                this.IdReceiver,
                this.IdAuthor,
                PackageCreator.GetFormattedTime(this.Time)
            },
                this.Content)
                           .ToArray();
        }