示例#1
0
        public virtual void AddSessionOfExperts([NotNull] SessionOfExperts sessionOfExperts)
        {
            if (sessionOfExperts == null)
            {
                throw new ArgumentNullException(nameof(sessionOfExperts));
            }

            _sessionsOfExperts.Add(sessionOfExperts);
        }
        public GetExpertsBySessionSpecification([NotNull] SessionOfExperts sessionOfExperts, ExpertFetch fetch)
        {
            if (sessionOfExperts == null)
            {
                throw new ArgumentNullException(nameof(sessionOfExperts));
            }

            SessionOfExperts = sessionOfExperts;
            Fetch            = fetch;
        }
示例#3
0
        public VergeOfSession([NotNull] Verge verge, [NotNull] SessionOfExperts sessionOfExperts, int weight)
        {
            if (verge == null)
            {
                throw new ArgumentNullException(nameof(verge));
            }
            if (sessionOfExperts == null)
            {
                throw new ArgumentNullException(nameof(sessionOfExperts));
            }

            Verge            = verge;
            SessionOfExperts = sessionOfExperts;
            Weight           = weight;
        }
示例#4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Expert"/> class.
        /// </summary>
        /// <param name="name">Login name of the expert.</param>
        /// <param name="sessionOfExperts">Session of experts, in which the expert participates.</param>
        public Expert([NotNull] string name, [NotNull] SessionOfExperts sessionOfExperts)
        {
            if (string.IsNullOrWhiteSpace(name))
            {
                throw new ArgumentException("Name should not contain only whitespaces", nameof(name));
            }
            if (sessionOfExperts == null)
            {
                throw new ArgumentNullException(nameof(sessionOfExperts));
            }

            Name             = name;
            SessionOfExperts = sessionOfExperts;
            _associations    = new List <Association>();
            _relations       = new List <Relation>();
        }
示例#5
0
        public virtual Verge UpdateWeightFromSession(int addedWeight, SessionOfExperts sessionOfExperts)
        {
            if (sessionOfExperts == null)
            {
                throw new ArgumentNullException(nameof(sessionOfExperts));
            }
            if (addedWeight < 0)
            {
                throw new ArgumentException("Weight should not be negative");
            }

            _sessionWeightSlices.Add(new VergeOfSession(this, sessionOfExperts, addedWeight));

            var newWeight = (Weight + addedWeight) / 2;

            return(new Verge(SourceNode, DestinationNode, Type, newWeight));
        }
        public GetExpertByNameAndSessionSpecification(
            [NotNull] string expertName,
            [NotNull] SessionOfExperts sessionOfExperts,
            ExpertFetch fetch)
        {
            if (expertName == null)
            {
                throw new ArgumentNullException(nameof(expertName));
            }
            if (sessionOfExperts == null)
            {
                throw new ArgumentNullException(nameof(sessionOfExperts));
            }

            ExpertName       = expertName;
            SessionOfExperts = sessionOfExperts;
            Fetch            = fetch;
        }