Beispiel #1
0
        public static TypeGV From(DefsGM.TypeGM typeGM)
        {
            string strTypeGM = Enum.GetName(typeof(DefsGM.TypeGM), typeGM);
            object obj;

            try
            {
                obj = Enum.Parse(typeof(DefsGV.TypeGV), strTypeGM);
            }
            catch
            {
                return(DefsGV.TypeGV.Invalid);
            }
            return((DefsGV.TypeGV)obj);
        }
Beispiel #2
0
        private void CallGM(DefsGM.TypeGM typeGM, params object[] pars)
        {
            /*
             *        MEANING: UNCONDITIONAL call of action
             */
            this.fm.OnGM(this.index, typeGM, true);

            string     strTypeGM  = Enum.GetName(typeof(DefsGM.TypeGM), typeGM);
            MethodInfo infoMethod = typeof(Glyph).GetMethod(strTypeGM);

            try
            {
                infoMethod.Invoke(this, pars);
            }
            catch (System.Reflection.TargetInvocationException TIException)
            {
                throw TIException.InnerException;
            }
        }
Beispiel #3
0
        /*
         *        METHODS: UPDATES
         */
        internal void OnGM(int indGlyph, DefsGM.TypeGM typeGM, bool isCaller)
        {
            Glyph glyph = this.gStore.GGet(indGlyph);

            if ((isCaller) && (glyph == null))
            {
                throw new ExceptionGlyph("FManager", "OnGM", "Null argument");
            }
            ArrayList arrCompDep = this.grel.GetCompDep(indGlyph);

            if (arrCompDep != null)
            {
                foreach (int indCompDep in arrCompDep)
                {
                    this.OnGM(indCompDep, typeGM, false);
                }
            }

            /*
             *        IN ANY CASE
             */
            // clear self-errors on SourceValidator
            if (isCaller && DefsGM.IsSourceValidator(typeGM))
            {
                this.gerrPool.ClearByGV(indGlyph, DefsGV.From(typeGM));
            }

            //    INVALIDATION TABLE:
            //
            //                            Itself              Dependents
            //                       VSrc VBind VPure     VSrc VBind VPure
            //
            //    Validator SOURCE    No     Yes   Yes       No      Yes   Yes
            //
            //    Validator BINDING    No     No       Yes       No   Yes   Yes
            //
            //    MODIFIER PURE        Yes  Yes   Yes       Yes  Yes   Yes
            //                      |                     |
            //                        BUT: does not clear errors
            //                             VSrc clears its errors by itself

            if (DefsGM.IsSourceValidator(typeGM))
            {
                //    ValidateTypeGlyphSource
                //    ValidateSimpSource
                //    ValidateCompBind
                foreach (DefsGV.TypeGV typeGV in Enum.GetValues(typeof(DefsGV.TypeGV)))
                {
                    if (DefsGV.IsTest(typeGV))
                    {
                        // invalidate & clear errors
                        if (DefsGV.IsSourceValidator(typeGV))
                        {
                            continue;
                        }
                        glyph.StatusVal(typeGV).IsValid = false;
                        this.gerrPool.ClearByGV(indGlyph, typeGV);
                    }
                }
            }
            else if (typeGM == DefsGM.TypeGM.ValidateCompBind)
            {
                //    ValidateCompBind
                foreach (DefsGV.TypeGV typeGV in Enum.GetValues(typeof(DefsGV.TypeGV)))
                {
                    if (DefsGV.IsTest(typeGV))
                    {
                        if (DefsGV.IsSourceValidator(typeGV))
                        {
                            continue;
                        }
                        if (isCaller && (typeGV == DefsGV.TypeGV.ValidateCompBind))
                        {
                            continue;
                        }
                        glyph.StatusVal(typeGV).IsValid = false;
                        this.gerrPool.ClearByGV(indGlyph, typeGV);
                    }
                }
            }
            else
            {
                // Pure Modifier
                foreach (DefsGV.TypeGV typeGV in Enum.GetValues(typeof(DefsGV.TypeGV)))
                {
                    if (DefsGV.IsTest(typeGV))
                    {
                        glyph.StatusVal(typeGV).IsValid = false;
                        if (!DefsGV.IsSourceValidator(typeGV))
                        {
                            this.gerrPool.ClearByGV(indGlyph, typeGV);
                        }
                    }
                }
            }
            if (!this.indGM.Contains(indGlyph))
            {
                this.indGM.Add(indGlyph);
            }
        }