コード例 #1
0
        /// <inheritdoc />
        public CombatAttribute Convert(AttributeDTO value, object state)
        {
            var entity = new UnknownModifier();

            this.Merge(entity, value, state);
            return(entity);
        }
コード例 #2
0
ファイル: Documentation.cs プロジェクト: Baltasarq/QDocNet
            /// <summary>
            /// Creates the appropriate modifier for the given command.
            /// </summary>
            /// <returns>The created <see cref="Modifier"/>.</returns>
            /// <param name="pos">The position in text.</param>
            /// <param name="element">The <see cref="XElement"/> to read from.</param>
            public static Modifier Create(int pos, XElement element)
            {
                Modifier toret = null;
                string   cmd   = element.Name.LocalName;

                if (cmd == SeeModifier.KeyWord)
                {
                    var attrCref = element.Attribute("cref");

                    if (attrCref != null)
                    {
                        toret = new SeeModifier(pos, attrCref.Value);
                    }
                    else
                    {
                        throw new ArgumentException("malformed modifier: " + cmd);
                    }
                }
                else
                {
                    toret = new UnknownModifier(pos, cmd, element.Value);
                }

                return(toret);
            }
コード例 #3
0
 // Implement this method in a buddy class to set properties that are specific to 'UnknownModifier' (if any)
 partial void Merge(UnknownModifier entity, AttributeDTO dto, object state);