예제 #1
0
        /// <summary>
        /// Is this flags configured?
        /// </summary>
        /// <param name="custom">Input customization flags</param>
        /// <returns>Is this flags configured?</returns>
        public bool IsSet(BitFlag flags)
        {
            bool result       = false;
            bool result_small = true;
            bool result_nn    = true;

            if (flags.Equals(Ope_NO_CUSTOM))
            {
                return(true);
            }

            if (flags.IsSet(Ope_NO_SMALL))
            {
                if (!Customization.IsSet(Custom_SMALL))
                {
                    result_small = true;
                }
                else
                {
                    result_small = false;
                }
            }
            if (flags.IsSet(Ope_SMALL))
            {
                if (Customization.IsSet(Custom_SMALL))
                {
                    result_small = true;
                }
                else
                {
                    result_small = false;
                }
            }

            if (flags.IsSet(Ope_NN))
            {
                if (Customization.IsSet(Custom_NN))
                {
                    result_nn = true;
                }
                else
                {
                    result_nn = false;
                }
            }
            if (flags.IsSet(Ope_NO_NN))
            {
                if (!Customization.IsSet(Custom_NN))
                {
                    result_nn = true;
                }
                else
                {
                    result_nn = false;
                }
            }

            if (!flags.And(SmallNN).IsAny())
            {
                result = true;
            }
            if (flags.IsSet(Ope_SH))
            {
                if (Customization.IsSet(Custom_SH))
                {
                    result = true;
                }
            }
            if (flags.IsSet(Ope_NO_SH))
            {
                if (!Customization.IsSet(Custom_SH))
                {
                    result = true;
                }
            }
            if (flags.IsSet(Ope_CH))
            {
                if (Customization.IsSet(Custom_CH))
                {
                    result = true;
                }
            }
            if (flags.IsSet(Ope_NO_CH))
            {
                if (!Customization.IsSet(Custom_CH))
                {
                    result = true;
                }
            }
            if (flags.IsSet(Ope_TS))
            {
                if (Customization.IsSet(Custom_TS))
                {
                    result = true;
                }
            }
            if (flags.IsSet(Ope_NO_TS))
            {
                if (!Customization.IsSet(Custom_TS))
                {
                    result = true;
                }
            }
            if (flags.IsSet(Ope_FU))
            {
                if (Customization.IsSet(Custom_FU))
                {
                    result = true;
                }
            }
            if (flags.IsSet(Ope_HU))
            {
                if (!Customization.IsSet(Custom_FU))
                {
                    result = true;
                }
            }
            if (flags.IsSet(Ope_ZI))
            {
                if (!Customization.IsSet(Custom_JI))
                {
                    result = true;
                }
            }
            if (flags.IsSet(Ope_JI))
            {
                if (Customization.IsSet(Custom_JI))
                {
                    result = true;
                }
            }
            if (flags.IsSet(Ope_L))
            {
                if (!Customization.IsSet(Custom_X))
                {
                    if (flags.IsSet(Ope_YIE))
                    {
                        if (Customization.IsSet(Custom_YIE))
                        {
                            result = true;
                        }
                    }
                    if (flags.IsSet(Ope_NO_YIE))
                    {
                        if (!Customization.IsSet(Custom_YIE))
                        {
                            result = true;
                        }
                    }
                    else
                    {
                        result = true;
                    }
                }
            }
            if (flags.IsSet(Ope_X))
            {
                if (Customization.IsSet(Custom_X))
                {
                    if (flags.IsSet(Ope_YIE))
                    {
                        if (Customization.IsSet(Custom_YIE))
                        {
                            result = true;
                        }
                    }
                    if (flags.IsSet(Ope_NO_YIE))
                    {
                        if (!Customization.IsSet(Custom_YIE))
                        {
                            result = true;
                        }
                    }
                    else
                    {
                        result = true;
                    }
                }
            }
            if (flags.IsSet(Ope_VY))
            {
                if (Customization.IsSet(Custom_VY))
                {
                    result = true;
                }
            }
            if (flags.IsSet(Ope_NO_VY))
            {
                if (!Customization.IsSet(Custom_VY))
                {
                    result = true;
                }
            }
            if ((flags.IsSet(Ope_NO_QW)) &&
                (flags.IsSet(Ope_NO_KW)))
            {
                if (!Customization.IsSet(Custom_QW) && !Customization.IsSet(Custom_KW))
                {
                    result = true;
                }
            }
            else
            {
                if (flags.IsSet(Ope_QW))
                {
                    if (Customization.IsSet(Custom_QW))
                    {
                        result = true;
                    }
                }
                if (flags.IsSet(Ope_NO_QW))
                {
                    if (!Customization.IsSet(Custom_QW))
                    {
                        result = true;
                    }
                }
                if (flags.IsSet(Ope_KW))
                {
                    if (Customization.IsSet(Custom_KW))
                    {
                        result = true;
                    }
                }
                if (flags.IsSet(Ope_NO_KW))
                {
                    if (!Customization.IsSet(Custom_KW))
                    {
                        result = true;
                    }
                }
            }
            if (flags.IsSet(Ope_ZY))
            {
                if (Customization.IsSet(Custom_ZY))
                {
                    result = true;
                }
            }
            if (flags.IsSet(Ope_NO_ZY))
            {
                if (flags.IsSet(Ope_JY))
                {
                    if (Customization.IsSet(Custom_JY))
                    {
                        result = true;
                    }
                    else
                    {
                        result = false;
                    }
                }
                if (flags.IsSet(Ope_NO_JY))
                {
                    if (!Customization.IsSet(Custom_JY))
                    {
                        result = true;
                    }
                    else
                    {
                        result = false;
                    }
                }
            }
            if (flags.IsSet(Ope_FY))
            {
                if (Customization.IsSet(Custom_FY))
                {
                    result = true;
                }
            }
            if (flags.IsSet(Ope_NO_FY))
            {
                if (!Customization.IsSet(Custom_FY))
                {
                    result = true;
                }
            }
            if ((flags.IsSet(Ope_NO_TY)) &&
                (flags.IsSet(Ope_NO_CY)))
            {
                if (!Customization.IsSet(Custom_TY) && !Customization.IsSet(Custom_CY))
                {
                    result = true;
                }
            }
            else
            {
                if (flags.IsSet(Ope_TY))
                {
                    if (Customization.IsSet(Custom_TY))
                    {
                        result = true;
                    }
                    else
                    {
                        result = false;
                    }
                }
                if (flags.IsSet(Ope_NO_TY))
                {
                    if (!Customization.IsSet(Custom_TY))
                    {
                        result = true;
                    }
                }
                if (flags.IsSet(Ope_CY))
                {
                    if (Customization.IsSet(Custom_CY))
                    {
                        result = true;
                    }
                    else
                    {
                        result = false;
                    }
                }
                if (flags.IsSet(Ope_NO_CY))
                {
                    if (!Customization.IsSet(Custom_CY))
                    {
                        result = true;
                    }
                }
            }
            if (flags.IsSet(Ope_XN))
            {
                if (Customization.IsSet(Custom_XN))
                {
                    result = true;
                }
            }
            if (flags.IsSet(Ope_NO_XN))
            {
                if (!Customization.IsSet(Custom_XN))
                {
                    result = true;
                }
            }

            if (flags.IsSet(Ope_C))
            {
                if (Customization.IsSet(Custom_C))
                {
                    result = true;
                }
            }
            if (flags.IsSet(Ope_NO_C))
            {
                if (!Customization.IsSet(Custom_C))
                {
                    if (flags.IsSet(Ope_SH))
                    {
                        if (Customization.IsSet(Custom_SH))
                        {
                            result = true;
                        }
                        else
                        {
                            result = false;
                        }
                    }
                    else if (flags.IsSet(Ope_NO_SH))
                    {
                        if (!Customization.IsSet(Custom_SH))
                        {
                            result = true;
                        }
                        else
                        {
                            result = false;
                        }
                    }
                    else
                    {
                        result = true;
                    }
                }
            }

            return(result && result_small && result_nn);
        }
예제 #2
0
 /// <summary>
 /// Set Input customization flags.
 /// Update Customization member depending on these flags
 /// </summary>
 /// <param name="custom">Input customization flags</param>
 public void SetFlags(BitFlag flags)
 {
     if (flags.Equals(Ope_NO_CUSTOM))
     {
         return;
     }
     if (flags.IsSet(Ope_NN))
     {
         Customization.Set(Custom_NN);
         Customization.Reset(Custom_XN);
     }
     if (flags.IsSet(Ope_NO_NN))
     {
         Customization.Reset(Custom_NN);
     }
     if (flags.IsSet(Ope_SH))
     {
         Customization.Set(Custom_SH);
     }
     if (flags.IsSet(Ope_NO_SH))
     {
         Customization.Reset(Custom_SH);
     }
     if (flags.IsSet(Ope_CH))
     {
         Customization.Set(Custom_CH);
     }
     if (flags.IsSet(Ope_NO_CH))
     {
         Customization.Reset(Custom_CH);
     }
     if (flags.IsSet(Ope_TY))
     {
         Customization.Set(Custom_TY);
     }
     if (flags.IsSet(Ope_NO_TY))
     {
         Customization.Reset(Custom_TY);
     }
     if (flags.IsSet(Ope_CY))
     {
         Customization.Set(Custom_CY);
     }
     if (flags.IsSet(Ope_NO_CY))
     {
         Customization.Reset(Custom_CY);
     }
     if (flags.IsSet(Ope_TS))
     {
         Customization.Set(Custom_TS);
     }
     if (flags.IsSet(Ope_NO_TS))
     {
         Customization.Reset(Custom_TS);
     }
     if (flags.IsSet(Ope_FU))
     {
         Customization.Set(Custom_FU);
     }
     if (flags.IsSet(Ope_HU))
     {
         Customization.Reset(Custom_FU);
     }
     if (flags.IsSet(Ope_ZI))
     {
         Customization.Reset(Custom_JI);
     }
     if (flags.IsSet(Ope_JI))
     {
         Customization.Set(Custom_JI);
     }
     if (flags.IsSet(Ope_L))
     {
         Customization.Reset(Custom_X);
     }
     if (flags.IsSet(Ope_X))
     {
         Customization.Set(Custom_X);
     }
     if (flags.IsSet(Ope_YIE))
     {
         Customization.Set(Custom_YIE);
     }
     if (flags.IsSet(Ope_NO_YIE))
     {
         Customization.Reset(Custom_YIE);
     }
     if (flags.IsSet(Ope_VY))
     {
         Customization.Set(Custom_VY);
     }
     if (flags.IsSet(Ope_NO_VY))
     {
         Customization.Reset(Custom_VY);
     }
     if (flags.IsSet(Ope_QW))
     {
         Customization.Set(Custom_QW);
     }
     if (flags.IsSet(Ope_NO_QW))
     {
         Customization.Reset(Custom_QW);
     }
     if (flags.IsSet(Ope_KW))
     {
         Customization.Set(Custom_KW);
     }
     if (flags.IsSet(Ope_NO_KW))
     {
         Customization.Reset(Custom_KW);
     }
     if (flags.IsSet(Ope_ZY))
     {
         Customization.Set(Custom_ZY);
     }
     if (flags.IsSet(Ope_NO_ZY))
     {
         Customization.Reset(Custom_ZY);
     }
     if (flags.IsSet(Ope_FY))
     {
         Customization.Set(Custom_FY);
     }
     if (flags.IsSet(Ope_NO_FY))
     {
         Customization.Reset(Custom_FY);
     }
     if (flags.IsSet(Ope_NO_SMALL))
     {
         Customization.Reset(Custom_SMALL);
     }
     if (flags.IsSet(Ope_SMALL))
     {
         Customization.Set(Custom_SMALL);
     }
     if (flags.IsSet(Ope_XN))
     {
         Customization.Set(Custom_XN);
         Customization.Reset(Custom_NN);
     }
     if (flags.IsSet(Ope_NO_XN))
     {
         Customization.Reset(Custom_XN);
     }
     if (flags.IsSet(Ope_C))
     {
         Customization.Set(Custom_C);
     }
     if (flags.IsSet(Ope_NO_C))
     {
         Customization.Reset(Custom_C);
     }
     if (flags.IsSet(Ope_JY))
     {
         Customization.Set(Custom_JY);
     }
     if (flags.IsSet(Ope_NO_JY))
     {
         Customization.Reset(Custom_JY);
     }
 }