Exemplo n.º 1
0
        private bool checkEmptyPage()
        {
            bool   result = true;
            string msg    = string.Empty;

            int[]          array      = new int[10];
            PropertyInfo[] properties = GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.FlattenHierarchy);
            PropertyInfo[] array2     = properties;
            foreach (PropertyInfo propertyInfo in array2)
            {
                object value = propertyInfo.GetValue(this, null);
                if (!(value is IconParam))
                {
                    continue;
                }
                object[] customAttributes = propertyInfo.GetCustomAttributes(typeof(SaveAttribute), false);
                if (0 >= customAttributes.Length)
                {
                    continue;
                }
                string empty = string.Empty;
                empty = empty + "[" + GetPropertyCategory(propertyInfo) + "] -> ";
                empty = empty + "[" + GetPropertyDisplayName(propertyInfo) + "]";
                IconParam iconParam = value as IconParam;
                if (!checkImageFile(out msg, iconParam.m_iconFilePath, 32, false, 128, 128, 32768L))
                {
                    msg = empty + " -> [" + GetPropertyDisplayName(iconParam, "m_iconFilePath") + "] : " + iconParam.m_iconFilePath + "\n" + msg;
                    Dialog.AddMsg(msg);
                    result = false;
                }
                if (iconParam.m_pagePos != -1)
                {
                    if (checkPageIndex(out msg, iconParam.m_pagePos, 10))
                    {
                        array[iconParam.m_pagePos]++;
                        continue;
                    }
                    msg = empty + " -> [" + GetPropertyDisplayName(iconParam, "m_pagePos") + "] : \n" + msg;
                    Dialog.AddMsg(msg);
                    result = false;
                }
            }
            string text = string.Empty;

            for (int j = 0; j < 10; j++)
            {
                if (array[j] != 0)
                {
                    continue;
                }
                bool flag = false;
                for (int k = j + 1; k < 10; k++)
                {
                    if (array[k] != 0)
                    {
                        flag = true;
                    }
                }
                if (flag)
                {
                    text += ErrorMsg.GetString(ErrorMsg.DEFINES.NON_CONTIGUOUS_PAGE);
                    text  = text + " : Page " + j + "\n";
                }
            }
            if (!string.IsNullOrEmpty(text))
            {
                Dialog.AddMsg(text);
                result = false;
            }
            return(result);
        }