Exemplo n.º 1
0
        /*--------------------------------------------------------------------------------------------*/
        public static void ValidateFactorLocator(CreateFabLocator pObj)
        {
            LocatorType.Item lt   = LocatorType.Map[(LocatorType.Id)pObj.Type];
            string           text = "cannot be %0 than %1 for the '" + lt.Name + "' " + typeof(LocatorType).Name;

            if (pObj.ValueX < lt.MinX)
            {
                throw new FabPropertyOutOfRangeFault(CreateFabLocatorValidator.ValueXName,
                                                     pObj.ValueX, String.Format(text, "less", lt.MinX));
            }

            if (pObj.ValueX > lt.MaxX)
            {
                throw new FabPropertyOutOfRangeFault(CreateFabLocatorValidator.ValueXName,
                                                     pObj.ValueX, String.Format(text, "greater", lt.MaxX));
            }

            if (pObj.ValueY < lt.MinY)
            {
                throw new FabPropertyOutOfRangeFault(CreateFabLocatorValidator.ValueYName,
                                                     pObj.ValueY, String.Format(text, "less", lt.MinY));
            }

            if (pObj.ValueY > lt.MaxY)
            {
                throw new FabPropertyOutOfRangeFault(CreateFabLocatorValidator.ValueYName,
                                                     pObj.ValueY, String.Format(text, "greater", lt.MaxY));
            }

            if (pObj.ValueZ < lt.MinZ)
            {
                throw new FabPropertyOutOfRangeFault(CreateFabLocatorValidator.ValueZName,
                                                     pObj.ValueZ, String.Format(text, "less", lt.MinZ));
            }

            if (pObj.ValueZ > lt.MaxZ)
            {
                throw new FabPropertyOutOfRangeFault(CreateFabLocatorValidator.ValueZName,
                                                     pObj.ValueZ, String.Format(text, "greater", lt.MaxZ));
            }
        }
Exemplo n.º 2
0
 ////////////////////////////////////////////////////////////////////////////////////////////////
 /*--------------------------------------------------------------------------------------------*/
 public CreateFabLocatorValidator(CreateFabLocator pCreateObj) : base(pCreateObj)
 {
     vCreateObj = pCreateObj;
 }