Ejemplo n.º 1
0
        /// <summary>
        /// Add a definition to the output.
        /// Also adds a ref to the def, and
        /// potentially a doc.
        /// </summary>
        /// <param name="def">The def to add.</param>
        /// <param name="symbol">The symbol the def was created from.</param>
        void AddDef(Def def, Doc doc = null)
        {
            var r = Ref.AtDef(def);

            _output.Defs.Add(def);
            _output.Refs.Add(r);

            if (doc != null)
            {
                doc.UnitType = r.DefUnitType;
                doc.Unit     = r.DefUnit;
                doc.Path     = r.DefPath;
                _output.Docs.Add(doc);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Add a definition to the output.
        /// Also adds a ref to the def, and
        /// potentially a doc.
        /// </summary>
        /// <param name="def">The def to add.</param>
        /// <param name="symbol">The symbol the def was created from.</param>
        void AddDef(Def def, Doc doc = null)
        {
            string key = def.DefKey;

            if (!keys.Contains(key))
            {
                keys.Add(key);
                var r = Ref.AtDef(def);
                _output.Defs.Add(def);
                _output.Refs.Add(r);

                if (doc != null)
                {
                    doc.UnitType = r.DefUnitType;
                    doc.Unit     = r.DefUnit;
                    doc.Path     = r.DefPath;
                    _output.Docs.Add(doc);
                }
            }
        }