예제 #1
0
        /*
         *        METHODS: clear
         */

        internal void ClearByGV(int indGlyph, DefsGV.TypeGV typeGV)
        {
            GErrList gerrlist = this.gerrlists[indGlyph] as GErrList;

            if (gerrlist == null)
            {
                return;
            }
            for (int poz = gerrlist.Length - 1; poz >= 0; poz--)
            {
                GErr gerr = gerrlist[poz];
                if (GErrSign.DICFunc_IsSignedBy(gerr, typeGV) &&
                    GErrSign.DICFunc_IsSignedBy(gerr, indGlyph))
                {
                    this.DIAFunc_DeleteFromPool(gerr);
                }
            }
        }
예제 #2
0
 public StatusGV.TypeStatusRes StatusResGV(DefsGV.TypeGV typeGV)
 {
     StatusGV.TypeStatusRes statusCur = StatusGV.TypeStatusRes.NoErrors;
     foreach (GErr gerr in this.gerrs)
     {
         if (GErrSign.DICFunc_IsSignedBy(gerr, typeGV))
         {
             if (gerr.TypeBasic == ValInfoBasic.ValInfoType.Error)
             {
                 return(StatusGV.TypeStatusRes.Errors);
             }
             else if (gerr.TypeBasic == ValInfoBasic.ValInfoType.Warning)
             {
                 statusCur = StatusGV.TypeStatusRes.Warnings;
             }
         }
     }
     return(statusCur);
 }
예제 #3
0
        private void CallGV(DefsGV.TypeGV typeGV)
        {
            /*
             *        TRY/CATCH function
             */

            /*
             *        MEANING:    UNCONDITIONAL call of action
             */

            GErrList gerrlist = null;

            try
            {
                this.statusGV[(int)typeGV].StatusExec = StatusGV.TypeStatusExec.Aborted;
                this.statusGV[(int)typeGV].StatusRes  = StatusGV.TypeStatusRes.Undef;
                gerrlist = new GErrList();

                if (DefsGV.IsModifier(typeGV))
                {
                    this.fm.OnGM(this.index, DefsGM.From(typeGV), true);
                }

                // check that pre-required tests are performed
                if (!this.CanBeExec(typeGV))
                {
                    this.statusGV[(int)typeGV].StatusExec =
                        StatusGV.TypeStatusExec.UnableToExec;
                }

                // call Validate.. function
                System.Exception excValidation = null;
                if (this.statusGV[(int)typeGV].StatusExec !=
                    StatusGV.TypeStatusExec.UnableToExec)
                {
                    try
                    {
                        string     strTypeCV  = Enum.GetName(typeof(DefsGV.TypeGV), typeGV);
                        MethodInfo infoMethod = this.GetType().GetMethod(strTypeCV,
                                                                         System.Reflection.BindingFlags.Instance |
                                                                         System.Reflection.BindingFlags.NonPublic);
                        if (infoMethod != null)
                        {
                            object[] pars = { gerrlist };

                            // statusGV can be set to:
                            // Completed || UnableToExec || Aborted
                            try
                            {
                                this.statusGV[(int)typeGV].StatusExec = (StatusGV.TypeStatusExec)
                                                                        infoMethod.Invoke(this, pars);
                            }
                            catch (System.Reflection.TargetInvocationException TIException)
                            {
                                throw TIException.InnerException;
                            }

                            GErrSign.Sign(gerrlist, typeGV, this.index);
                        }
                        if (this.statusGV[(int)typeGV].StatusExec ==
                            StatusGV.TypeStatusExec.Completed)
                        {
                            this.statusGV[(int)typeGV].StatusRes =
                                gerrlist.StatusResGV(typeGV);
                        }
                    }
                    catch (System.Exception exc)
                    {
                        excValidation = exc;
                        this.statusGV[(int)typeGV].StatusExec =
                            StatusGV.TypeStatusExec.Aborted;
                    }
                }

                if (this.statusGV[(int)typeGV].StatusExec !=
                    StatusGV.TypeStatusExec.Completed)
                {
                    this.CleanUpOnNonCompletedGV(typeGV);
                    GErrValidation gerrVal = new GErrValidation(this.index,
                                                                this.typeGlyph,
                                                                typeGV,
                                                                this.statusGV[(int)typeGV].StatusExec,
                                                                excValidation);
                    gerrlist.Add(gerrVal);
                }

                GErrSign.Sign(gerrlist, typeGV, this.index);
                this.fm.OnGV(this.index, typeGV, gerrlist);
                gerrlist.ClearRelease();
            }

            catch (Exception excManagement) // exception thrown by the fm management structures
            {
                this.statusGV[(int)typeGV].StatusExec =
                    StatusGV.TypeStatusExec.Aborted;
                this.CleanUpOnNonCompletedGV(typeGV);    // T/C function
                GErrValidation gerrVal = new GErrValidation(this.index,
                                                            this.typeGlyph,
                                                            typeGV,
                                                            StatusGV.TypeStatusExec.Aborted,
                                                            excManagement);
                this.fm.ReportFailure(gerrVal);            // T/C function
                if (gerrlist != null)
                {
                    try { gerrlist.ClearRelease(); }
                    catch (Exception) {}
                }
            }
        }