示例#1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Association" /> class.
        /// </summary>
        /// <param name="expert">Expert, who suggested association.</param>
        /// <param name="notion">Association notion.</param>
        public Association([NotNull] Expert expert, [NotNull] string notion)
        {
            if (expert == null)
            {
                throw new ArgumentNullException(nameof(expert));
            }
            if (string.IsNullOrWhiteSpace(notion))
            {
                throw new ArgumentException("Notion should not be empty string", nameof(notion));
            }

            Expert = expert;
            Notion = notion;
        }
示例#2
0
        public Relation([NotNull] Expert expert, [NotNull] Node source, [NotNull] Node destination)
        {
            if (expert == null)
            {
                throw new ArgumentNullException(nameof(expert));
            }
            if (source == null)
            {
                throw new ArgumentNullException(nameof(source));
            }
            if (destination == null)
            {
                throw new ArgumentNullException(nameof(destination));
            }

            Source      = source;
            Destination = destination;
            Expert      = expert;
            IsChosen    = ChosenState.HadNotChosen;
            _types      = new List <RelationType>();
        }