Ejemplo n.º 1
0
            public clsResult Translate(int SectionNum, clsINIRead.clsSectionTranslator Translator, ref clsINIRead.sErrorCount ErrorCount)
            {
                clsResult result = new clsResult("Section " + this.Name);
                int num2 = this.Properties.Count - 1;
                for (int i = 0; i <= num2; i++)
                {
                    sProperty property;
                    switch (Translator.Translate(SectionNum, this.Properties[i]))
                    {
                        case clsINIRead.enumTranslatorResult.NameUnknown:
                            if (ErrorCount.NameErrorCount < 0x10)
                            {
                                property = this.Properties[i];
                                result.WarningAdd("Property name \"" + property.Name + "\" is unknown.");
                            }
                            ErrorCount.NameErrorCount++;
                            break;

                        case clsINIRead.enumTranslatorResult.ValueInvalid:
                            if (ErrorCount.ValueErrorCount < 0x10)
                            {
                                string[] strArray = new string[5];
                                strArray[0] = "Value \"";
                                sProperty property2 = this.Properties[i];
                                strArray[1] = property2.Value;
                                strArray[2] = "\" for property name \"";
                                property = this.Properties[i];
                                strArray[3] = property.Name;
                                strArray[4] = "\" is not valid.";
                                result.WarningAdd(string.Concat(strArray));
                            }
                            ErrorCount.ValueErrorCount++;
                            break;
                    }
                }
                return result;
            }
Ejemplo n.º 2
0
 public abstract clsINIRead.enumTranslatorResult Translate(clsINIRead.clsSection.sProperty INIProperty);
Ejemplo n.º 3
0
            public clsResult Translate(clsINIRead.clsTranslator Translator)
            {
                clsINIRead.sErrorCount count;
                clsResult result = new clsResult("Section " + this.Name);
                count.NameWarningCountMax = 0x10;
                count.ValueWarningCountMax = 0x10;
                int num2 = this.Properties.Count - 1;
                for (int i = 0; i <= num2; i++)
                {
                    sProperty property;
                    switch (Translator.Translate(this.Properties[i]))
                    {
                        case clsINIRead.enumTranslatorResult.NameUnknown:
                            if (count.NameErrorCount < 0x10)
                            {
                                property = this.Properties[i];
                                result.WarningAdd("Property name \"" + property.Name + "\" is unknown.");
                            }
                            count.NameErrorCount++;
                            break;

                        case clsINIRead.enumTranslatorResult.ValueInvalid:
                            if (count.ValueErrorCount < 0x10)
                            {
                                string[] strArray = new string[5];
                                strArray[0] = "Value \"";
                                sProperty property2 = this.Properties[i];
                                strArray[1] = property2.Value;
                                strArray[2] = "\" for property name \"";
                                property = this.Properties[i];
                                strArray[3] = property.Name;
                                strArray[4] = "\" is not valid.";
                                result.WarningAdd(string.Concat(strArray));
                            }
                            count.ValueErrorCount++;
                            break;
                    }
                }
                if (count.NameErrorCount > count.NameWarningCountMax)
                {
                    result.WarningAdd("There were " + Conversions.ToString(count.NameErrorCount) + " unknown property names that were ignored.");
                }
                if (count.ValueErrorCount > count.ValueWarningCountMax)
                {
                    result.WarningAdd("There were " + Conversions.ToString(count.ValueErrorCount) + " invalid values that were ignored.");
                }
                return result;
            }