コード例 #1
0
        /// <summary>
        /// Command: Add link.
        /// </summary>
        /// <param name="o">Input options.</param>
        public static void CmdAdd(Option o)
        {
            if (o.Link == null)
            {
                throw new Exception("Bad link: (none)");
            }
            var l  = Get(o.Link, false);
            var mn = Module0.ListOne(o);
            var m  = Module.Get(Module0.Root, mn);
            var mt = o.Target == null?Module.GetTarget(m)[0] : o.Target;

            Link.Create(l, mn, mt);
            Console0.Verbose(o, "Link: {0} -> Module: {1} (linked)", o.Link, Link.GetDescription(l));
            Console0.Verbose(o, "[Target: {0}]", mt);
        }
コード例 #2
0
        /// <summary>
        /// Command: Set link details.
        /// </summary>
        /// <param name="o">Input arguments.</param>
        public static void CmdSet(Option o)
        {
            if (o.Link == null)
            {
                throw new Exception("Bad link: (none)");
            }
            var l = Get(o.Link, true);

            if (o.Module != null)
            {
                var m = Module0.Get(o.Module, true);
                Link.SetDescription(l, o.Module);
                Link.SetTarget(l, Module.GetTarget(m)[0]);
            }
            if (o.Target != null)
            {
                Link.SetTarget(l, o.Target);
            }
            Output(o, new string[] { o.Link });
        }