예제 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        static public IController Create(IParameter p)
        {
            IController c = null;

            if (p is StringParameter)
            {
                c = new StringParameterController((StringParameter)p);
            }
            else if (p is CommuniPortConfigParameter)
            {
                CommuniPortConfigParameter p2 = (CommuniPortConfigParameter)p;
                c = new CommuniPortConfigController(p2);
            }
            else if (p is NumberParameter)
            {
                NumberParameter numP = (NumberParameter)p;
                c = new NumberParameterController(numP);
            }
            else if (p is EnumParameter)
            {
                EnumParameter enumP = (EnumParameter)p;
                c = new EnumParameterController(enumP);
            }

            if (c == null)
            {
                throw new ArgumentException(p.ToString());
            }
            return(c);
        }
예제 #2
0
 public NumberParameterViewer(NumberParameterController c)
 {
     this.Controller = c;
 }