예제 #1
0
 void CheckUnusedLocals(Method node)
 {
     foreach (Local local in node.Locals)
     {
         InternalLocal entity = (InternalLocal)local.Entity;
         if (!entity.IsPrivateScope && !entity.IsUsed)
         {
             Warnings.Add(CompilerWarningFactory.UnusedLocalVariable(local, local.Name));
         }
     }
 }
예제 #2
0
 internal StructureBspClusterDebugInfoBlockBase(BinaryReader binaryReader)
 {
     this.errors                       = (Errors)binaryReader.ReadInt16();
     this.warnings                     = (Warnings)binaryReader.ReadInt16();
     this.invalidName_                 = binaryReader.ReadBytes(28);
     this.lines                        = ReadStructureBspDebugInfoRenderLineBlockArray(binaryReader);
     this.fogPlaneIndices              = ReadStructureBspDebugInfoIndicesBlockArray(binaryReader);
     this.visibleFogPlaneIndices       = ReadStructureBspDebugInfoIndicesBlockArray(binaryReader);
     this.visFogOmissionClusterIndices = ReadStructureBspDebugInfoIndicesBlockArray(binaryReader);
     this.containingFogZoneIndices     = ReadStructureBspDebugInfoIndicesBlockArray(binaryReader);
 }
예제 #3
0
        /// <summary>
        /// Area mode functionality
        /// </summary>
        /// <param name="h_tx__meter">Structural height of the TX, in meters</param>
        /// <param name="h_rx__meter">Structural height of the RX, in meters</param>
        /// <param name="tx_site_criteria">Siting criteria of the TX</param>
        /// <param name="rx_site_criteria">Siting criteria of the RX</param>
        /// <param name="d__km">Path distance, in km</param>
        /// <param name="delta_h__meter">Terrain irregularity parameter</param>
        /// <param name="climate">Radio climate</param>
        /// <param name="N_0">Refractivity, in N-Units</param>
        /// <param name="f__mhz">Frequency, in MHz</param>
        /// <param name="pol">Polarization</param>
        /// <param name="epsilon">Relative permittivity</param>
        /// <param name="sigma">Conductivity</param>
        /// <param name="mdvar">Mode of variability</param>
        /// <param name="confidence">Confidence percentage</param>
        /// <param name="reliability">Reliability percentage</param>
        /// <param name="A__db">Basic transmission loss, in dB</param>
        /// <param name="warnings">Warning flags</param>
        /// <returns>Error code</returns>
        public static int ITM_AREA_CR(double h_tx__meter, double h_rx__meter, SitingCriteria tx_site_criteria,
                                      SitingCriteria rx_site_criteria, double d__km, double delta_h__meter, Climate climate, double N_0,
                                      double f__mhz, Polarization pol, double epsilon, double sigma, int mdvar, double confidence, double reliability,
                                      out double A__db, out Warnings warnings)
        {
            int rtn = ITM_AREA_CR(h_tx__meter, h_rx__meter, (int)tx_site_criteria, (int)rx_site_criteria, d__km, delta_h__meter,
                                  (int)climate, N_0, f__mhz, (int)pol, epsilon, sigma, mdvar, confidence, reliability, out A__db, out long warns);

            warnings = (Warnings)warns;
            return(rtn);
        }
예제 #4
0
        private void CheckEventUnsubscribe(BinaryExpression node, IEvent eventInfo)
        {
            var expected = ((ICallableType)eventInfo.Type).GetSignature();
            var actual   = GetCallableSignature(node.Right);

            if (expected != actual)
            {
                Warnings.Add(
                    CompilerWarningFactory.InvalidEventUnsubscribe(node, eventInfo, expected));
            }
        }
예제 #5
0
        public static IEnumerable <T> GetChildComponents <T>(UIContext parent, string name) where T : class
        {
            if (Warnings.NullOrDisposed(parent))
            {
                return(new T[0]);
            }

            var queue = new Queue <GameObject>(parent.GameObj.Children);

            return(GetComponents <T>(queue, name));
        }
예제 #6
0
 /// <summary>
 /// Check whether an individual has all mandotory attributes
 /// </summary>
 /// <param name="ind">Individual ruminant to check</param>
 /// <param name="model">Model adding individuals</param>
 public void CheckMandatoryAttributes(Ruminant ind, IModel model)
 {
     foreach (var attribute in mandatoryAttributes)
     {
         if (!ind.Attributes.Exists(attribute))
         {
             string warningString = $"No mandatory attribute [{attribute.ToUpper()}] present for individual added by [a={model.Name}]";
             Warnings.CheckAndWrite(warningString, Summary, this, MessageType.Error);
         }
     }
 }
    public void Initialize(IEventSource eventSource)
    {
        eventSource.TargetFinished += (sender, e) => FinishedTargets.Add(e);
        eventSource.TaskFinished   += (sender, e) => FinishedTasks.Add(e);

        eventSource.AnyEventRaised += (sender, e) =>
        {
            if (!(e is BuildMessageEventArgs) && Verbosity > LoggerVerbosity.Normal)
            {
                output?.WriteLine(e.Message);
            }
        };

        eventSource.MessageRaised += (sender, e) =>
        {
            var shouldLog = (e.Importance == MessageImportance.High);
            switch (e.Importance)
            {
            case MessageImportance.Normal:
                shouldLog = (Verbosity >= LoggerVerbosity.Normal);
                break;

            case MessageImportance.Low:
                shouldLog = (Verbosity >= LoggerVerbosity.Detailed);
                break;

            default:
                break;
            }

            if (Verbosity != LoggerVerbosity.Quiet && shouldLog)
            {
                output?.WriteLine(e.Message);
            }

            Messages.Add(e);
        };

        eventSource.ErrorRaised += (sender, e) =>
        {
            output?.WriteLine(e.Message);
            Errors.Add(e);
        };

        eventSource.WarningRaised += (sender, e) =>
        {
            if (Verbosity != LoggerVerbosity.Quiet)
            {
                output?.WriteLine(e.Message);
            }

            Warnings.Add(e);
        };
    }
예제 #8
0
 public override void Add(string message, SourceSpan span, int errorCode, Severity severity)
 {
     if (severity == Severity.Error || severity == Severity.FatalError)
     {
         Errors.Add(new ErrorResult(message, span));
     }
     else if (severity == Severity.Warning)
     {
         Warnings.Add(new ErrorResult(message, span));
     }
 }
        private double HandleRestocking(double animalEquivalentsToBuy, string paddockName, Ruminant exampleRuminant)
        {
            if (animalEquivalentsToBuy <= 0)
            {
                return(0);
            }

            GrazeFoodStoreType foodStore = Resources.GetResourceItem(this, typeof(GrazeFoodStore), paddockName, OnMissingResourceActionTypes.Ignore, OnMissingResourceActionTypes.ReportErrorAndStop) as GrazeFoodStoreType;

            // ensure min pasture for restocking
            if ((foodStore == null) || ((foodStore.TonnesPerHectare * 1000) > MinimumFeedBeforeRestock))
            {
                var specifyComponents = FindAllChildren <SpecifyRuminant>();
                if (specifyComponents.Count() == 0)
                {
                    string warn = $"No [f=SpecifyRuminant]s were provided in [a={this.Name}]\r\nNo restocking will be performed.";
                    this.Status = ActivityStatus.Warning;
                    if (!Warnings.Exists(warn))
                    {
                        Summary.WriteWarning(this, warn);
                        Warnings.Add(warn);
                    }
                }

                // buy animals specified in restock ruminant groups
                foreach (SpecifyRuminant item in specifyComponents)
                {
                    double sumAE   = 0;
                    double limitAE = animalEquivalentsToBuy * item.Proportion;

                    while (sumAE < limitAE && animalEquivalentsToBuy > 0)
                    {
                        Ruminant newIndividual = item.Details.CreateIndividuals(1, null).FirstOrDefault();
                        newIndividual.Location    = paddockName;
                        newIndividual.BreedParams = item.BreedParams;
                        newIndividual.HerdName    = item.BreedParams.Name;
                        newIndividual.PurchaseAge = newIndividual.Age;
                        newIndividual.SaleFlag    = HerdChangeReason.RestockPurchase;

                        if (newIndividual.Weight == 0)
                        {
                            throw new ApsimXException(this, $"Specified individual added during restock cannot have no weight in [{this.Name}]");
                        }

                        Resources.RuminantHerd().PurchaseIndividuals.Add(newIndividual);
                        double indAE = newIndividual.AdultEquivalent;
                        animalEquivalentsToBuy -= indAE;
                        sumAE += indAE;
                    }
                }
                return(Math.Max(0, animalEquivalentsToBuy));
            }
            return(animalEquivalentsToBuy);
        }
예제 #10
0
        private void SetupListeners()
        {
            ClearListeners();

            _keyListener = GameObj.GetComponent <KeyListener>();

            if (!Warnings.NullOrDisposed(_keyListener))
            {
                _keyListener.KeyUp += _keyListener_KeyUp;
            }
        }
예제 #11
0
 void Awake()
 {
     panelStatic              = this;
     StaticBtnGameManager     = this.btnGameManager;
     StaticBtnGameManagerBack = this.btnGameManagerBack;
     StaticSendManager        = this.sendManager;
     StaticTVMessage          = this.tvMessage;
     StaticWarnings           = warnings;
     StaticYuanPicManger      = yuanPicManger;
     StaticIteminfo           = itemInfo;
 }
예제 #12
0
 override public void LeaveExceptionHandler(ExceptionHandler node)
 {
     if (null != node.Declaration.Type.Entity &&
         ((IType)node.Declaration.Type.Entity).FullName == "System.Exception" &&
         !string.IsNullOrEmpty(node.Declaration.Name))
     {
         if (null != NameResolutionService.ResolveTypeName(new SimpleTypeReference(node.Declaration.Name)))
         {
             Warnings.Add(CompilerWarningFactory.AmbiguousExceptionName(node));
         }
     }
 }
예제 #13
0
 private void CheckNotFinalizer(Method node)
 {
     if (node.Name == "Finalize" &&
         !node.IsSynthetic &&
         node.IsOverride &&
         0 == node.Parameters.Count &&
         0 == node.GenericParameters.Count)
     {
         Warnings.Add(
             CompilerWarningFactory.OverridingFinalizeIsBadPractice(node));
     }
 }
예제 #14
0
 public Result AsResult()
 {
     return(new Result
     {
         Persons = Persons.OrderBy(p => p.Id).ToList(),
         ChildRelations = ChildRelations,
         SpouseRelations = SpouseRelations,
         SiblingRelations = SiblingRelations,
         Errors = new HashSet <string>(Errors.OrderBy(e => e)),
         Warnings = new HashSet <string>(Warnings.OrderBy(e => e))
     });
 }
        /// <summary>
        /// Push a warning onto the stack.
        /// </summary>
        /// <param name="warning">Warning</param>
        static void PushWarning(Warnings warning)
        {
            if (_warnings == null)
            {
                _warnings = new List <Warnings>(4);
            }

            if (_warnings.Contains(warning) == false)
            {
                _warnings.Add(warning);
            }
        }
예제 #16
0
 private async void ResetWarnings(Warnings warning)
 {
     using (var db = new NinjaBotEntities())
     {
         var currentWarning = db.Warnings.Where(w => w.Warnid == warning.Warnid).FirstOrDefault();
         if (currentWarning != null)
         {
             db.Warnings.Remove(currentWarning);
             await db.SaveChangesAsync();
         }
     }
 }
예제 #17
0
 override public void LeaveBinaryExpression(BinaryExpression node)
 {
     CheckExpressionType(node.Right);
     if (BinaryOperatorType.ReferenceEquality == node.Operator)
     {
         if (IsTypeReference(node.Right))
         {
             Warnings.Add(
                 CompilerWarningFactory.IsInsteadOfIsa(node));
         }
     }
 }
        private InvocationTypeInferenceRule ResolveRule(MethodInvocationExpression invocation, IMethod method, string rule)
        {
            var ruleImpl = typeof(BuiltinRules).GetMethod(rule);

            if (ruleImpl != null)
            {
                return((InvocationTypeInferenceRule)Delegate.CreateDelegate(typeof(InvocationTypeInferenceRule), ruleImpl));
            }

            Warnings.Add(CompilerWarningFactory.CustomWarning(invocation, string.Format("Unknown type inference rule '{0}' on method '{1}'.", rule, method)));
            return(BuiltinRules.NoTypeInference);
        }
예제 #19
0
 public async void ResetWarnings(Warnings warning)
 {
     using (var db = new DiscbotContext())
     {
         var currentWarning = db.Warnings.AsEnumerable().Where(w => w.Id == warning.Id).FirstOrDefault();
         if (currentWarning != null)
         {
             db.Warnings.Remove(currentWarning);
             await db.SaveChangesAsync();
         }
     }
 }
예제 #20
0
        /// <summary>
        /// Area mode functionality
        /// </summary>
        /// <param name="h_tx__meter">Structural height of the TX, in meters</param>
        /// <param name="h_rx__meter">Structural height of the RX, in meters</param>
        /// <param name="tx_site_criteria">Siting criteria of the TX</param>
        /// <param name="rx_site_criteria">Siting criteria of the RX</param>
        /// <param name="d__km">Path distance, in km</param>
        /// <param name="delta_h__meter">Terrain irregularity parameter</param>
        /// <param name="climate">Radio climate</param>
        /// <param name="N_0">Refractivity, in N-Units</param>
        /// <param name="f__mhz">Frequency, in MHz</param>
        /// <param name="pol">Polarization</param>
        /// <param name="epsilon">Relative permittivity</param>
        /// <param name="sigma">Conductivity</param>
        /// <param name="mdvar">Mode of variability</param>
        /// <param name="time">Time percentage</param>
        /// <param name="location">Location percentage</param>
        /// <param name="situation">Situation percentage</param>
        /// <param name="A__db">Basic transmission loss, in dB</param>
        /// <param name="warnings">Warning flags</param>
        /// <param name="interValues">Struct of intermediate values</param>
        /// <returns>Error code</returns>
        public static int ITM_AREA_TLS_Ex(double h_tx__meter, double h_rx__meter, SitingCriteria tx_site_criteria,
                                          SitingCriteria rx_site_criteria, double d__km, double delta_h__meter, Climate climate, double N_0,
                                          double f__mhz, Polarization pol, double epsilon, double sigma, int mdvar, double time, double location,
                                          double situation, out double A__db, out Warnings warnings, out IntermediateValues interValues)
        {
            int rtn = ITM_AREA_TLS_Ex(h_tx__meter, h_rx__meter, (int)tx_site_criteria, (int)rx_site_criteria, d__km,
                                      delta_h__meter, (int)climate, N_0, f__mhz, (int)pol, epsilon, sigma, mdvar, time, location, situation,
                                      out A__db, out long warns, out interValues);

            warnings = (Warnings)warns;
            return(rtn);
        }
예제 #21
0
        void MakeStaticIfNeeded(TypeMember node)
        {
            if (node.DeclaringType.IsStatic)
            {
                if (node.IsStatic)
                {
                    Warnings.Add(CompilerWarningFactory.StaticClassMemberRedundantlyMarkedStatic(node, node.DeclaringType.Name, node.Name));
                }

                node.Modifiers |= TypeMemberModifiers.Static;
            }
        }
예제 #22
0
        /// <summary>
        /// Constructs the response from a lower-level <see cref="JsonResponse"/>.
        /// </summary>
        /// <param name="response"></param>
        internal DockerResponse(JsonResponse response)
        {
            var warnings = response.AsDynamic().Warnings;

            if (warnings != null)
            {
                foreach (string warning in warnings)
                {
                    Warnings.Add(warning);
                }
            }
        }
        // Retrieves identifiers from OAI-XML document and sets them to metadata object
        private void ParseIdentifierFromOaiXml(XDocument document, ref Metadata metadata)
        {
            metadata.ISBN = GetNormalizedISBN(ParseMetadataFromOaiXml(document, Settings.MetadataIsbnField));

            if (metadata.ISBN.Contains('|'))
            {
                Warnings.Add("Záznam obsahuje více než 1 ISBN, vyberte správné, jsou oddělena zvislou čárou.");
            }

            metadata.ISSN = GetNormalizedISSN(ParseMetadataFromOaiXml(document, Settings.MetadataIssnField));

            if (metadata.ISSN.Contains('|'))
            {
                Warnings.Add("Záznam obsahuje více než 1 ISSN, vyberte správné, jsou oddělena zvislou čárou.");
            }

            metadata.CNB = ParseMetadataFromOaiXml(document, Settings.MetadataCnbField);

            if (metadata.CNB.Contains('|'))
            {
                Warnings.Add("Záznam obsahuje více než 1 ČNB, vyberte správné, jsou oddělena zvislou čárou.");
            }

            metadata.OCLC = ParseMetadataFromOaiXml(document, Settings.MetadataOclcField);

            if (metadata.OCLC.Contains('|'))
            {
                Warnings.Add("Záznam obsahuje více než 1 OCLC, vyberte správné, jsou oddělena zvislou čárou.");
            }

            //parse ean
            string ean = "";

            var eanFields = from varfield in document.Descendants("varfield")
                            where Settings.MetadataEanField.Item1.ToString().PadLeft(3, '0').Equals(varfield.Attribute("id").Value) &&
                            Settings.MetadataEanField.Item3.ToString().Equals(varfield.Attribute("i1").Value)
                            select varfield;

            foreach (var eanField in eanFields)
            {
                IEnumerable <string> subfields = from sf in eanField.Elements("subfield")
                                                 where Settings.MetadataEanField.Item2.ToString().Equals(sf.Attribute("label").Value)
                                                 select sf.Value;
                ean += "|" + string.Join("|", subfields);
                ean  = ean.Trim(new char[] { ' ', '/', '|' });
            }
            metadata.EAN = ean;
            if (metadata.EAN.Contains('|'))
            {
                Warnings.Add("Záznam obsahuje více než 1 EAN, vyberte správné, jsou oddělena zvislou čárou.");
            }
        }
예제 #24
0
        void CheckAmbiguousVariableNames(Method node)
        {
            if (null == node.DeclaringType || null == node.DeclaringType.Entity)
            {
                return;
            }
            InternalClass klass = node.DeclaringType.Entity as InternalClass;

            if (null == klass || null == klass.BaseType)
            {
                return;
            }

            if (Parameters.DisabledWarnings.Contains("BCW0025"))
            {
                return;
            }

            klass = klass.BaseType as InternalClass;
            foreach (Local local in node.Locals)
            {
                if (null == local.Entity || ((InternalLocal)local.Entity).IsExplicit)
                {
                    continue;
                }

                //check in the cache if variable is safe (the frequent case)
                if (_safeVars.Contains(local.Name))
                {
                    return;
                }

                //navigate down the base types
                bool safe = true;
                while (null != klass)
                {
                    Field field = klass.TypeDefinition.Members[local.Name] as Field;
                    if (null != field && field.IsPrivate)
                    {
                        safe = false;
                        Warnings.Add(CompilerWarningFactory.AmbiguousVariableName(local, local.Name, klass.Name));
                        break;                         //no need to go further down
                    }
                    klass = klass.BaseType as InternalClass;
                }

                if (safe)                 //this var is safe for all methods of the current type
                {
                    _safeVars.Add(local.Name);
                }
            }
        }
예제 #25
0
        public override void Run()
        {
            var classesWithMembers = Classes.Where(c => c.Members.Any());

            foreach (MoaiClass moaiClass in classesWithMembers)
            {
                if (moaiClass.Description == null)
                {
                    Warnings.Add(moaiClass.ClassPosition ?? moaiClass.DocumentationReferences.FirstOrDefault(), WarningType.MissingAnnotation,
                                 string.Format("Class '{0}' has documented members but is missing a @text description.", moaiClass.Name));
                }
            }
        }
예제 #26
0
        public virtual void AddTransponder(Satellite sat, Transponder trans)
        {
            trans.Satellite = sat;

            if (Transponder.ContainsKey(trans.Id))
            {
                Warnings.AppendFormat("Duplicate transponder data record for satellite #{0} with id {1}\r\n", sat?.Id, trans.Id);
                return;
            }

            sat?.Transponder.Add(trans.Id, trans);
            Transponder.Add(trans.Id, trans);
        }
예제 #27
0
        private bool ValidateWrite(int chunkId)
        {
            if (Created)
            {
                Warnings?.Invoke(this, new WarningEventArgs("File has already been created")); return(false);
            }
            if (MapChunkIdToChunkPos.ContainsKey(chunkId))
            {
                Warnings?.Invoke(this, new WarningEventArgs($"Chunk with id {chunkId} has already been written")); return(false);
            }

            return(true);
        }
예제 #28
0
        public void OnActivate()
        {
            index = 0;

            var renderer = GameObj.GetComponent <TextRenderer>();

            if (Warnings.NullOrDisposed(renderer))
            {
                return;
            }

            renderer.Text.ApplySource("Loading... ");
        }
 public override System.Collections.Generic.Queue <Moonfish.Tags.BlamPointer> ReadFields(System.IO.BinaryReader binaryReader)
 {
     System.Collections.Generic.Queue <Moonfish.Tags.BlamPointer> pointerQueue = new System.Collections.Generic.Queue <Moonfish.Tags.BlamPointer>(base.ReadFields(binaryReader));
     this.StructureBspClusterDebugInfoErrors   = ((Errors)(binaryReader.ReadInt16()));
     this.StructureBspClusterDebugInfoWarnings = ((Warnings)(binaryReader.ReadInt16()));
     this.fieldpad = binaryReader.ReadBytes(28);
     pointerQueue.Enqueue(binaryReader.ReadBlamPointer(32));
     pointerQueue.Enqueue(binaryReader.ReadBlamPointer(4));
     pointerQueue.Enqueue(binaryReader.ReadBlamPointer(4));
     pointerQueue.Enqueue(binaryReader.ReadBlamPointer(4));
     pointerQueue.Enqueue(binaryReader.ReadBlamPointer(4));
     return(pointerQueue);
 }
예제 #30
0
        protected void WarnIfPrivateMemberNeverUsed(TypeMember node)
        {
            if (NodeType.Constructor == node.NodeType && node.IsStatic)
            {
                return;
            }

            if (!IsVisible(node) && node.ContainsAnnotation("PrivateMemberNeverUsed"))
            {
                Warnings.Add(
                    CompilerWarningFactory.PrivateMemberNeverUsed(node));
            }
        }
예제 #31
0
 /// <summary>
 /// Constructor with parameters
 /// </summary>
 public HTMLValidate(string url)
 {
     errors = new Errors();
     warnings = new Warnings();
     warningPotentialIssues = new WarningPotentialIssues();
     faults = new Faults();
     this.URL = url;
 }
예제 #32
0
        /// <summary>
        /// Method to obtain all the warnings as a result of the validation of the html
        /// </summary>
        /// <param name="urlDocument">Xml document that represents the result of the validation</param>
        /// <param name="mNamespace">Namespace used to obtain some data such as line, colum, etc.</param>
        private void HTMLWarnings(XDocument urlDocument, XNamespace mNamespace)
        {
            warnings = new Warnings();

            //Obtaining the descendants of the elements labeled "warnings". With this we obtain all the warnings
            var warningsElements = from e in urlDocument.Descendants(mNamespace + "warnings")
                                   select e;
            //Obtaining the descendants of the elements labeled "warningcount". With this we can obtain the number of warnings.
            var warningCountElement = from e in warningsElements.Descendants(mNamespace + "warningcount")
                                      select e;
            //Obtaining the descendants of the elements labeled "warning". With this we can obtain information from each of the warnings. 
            var warningListElements = from e in warningsElements.Descendants(mNamespace + "warning")
                                      select e;

            //Iterate over the 'warningaccount' variable to obtain the number of warnings
            foreach (var element in warningCountElement)
            {
                //Store the value of the count
                warnings.warningCount = element.Value;

                //Iterate over the 'warningListElements' variable to obtain each error
                foreach (var warningElement in warningListElements)
                {
                    //Create an instance of a Warning
                    Warning warning = new Warning();

                    //If there is a number of line
                    if (warningElement.Descendants(mNamespace + "line").Count() > 0)
                        //Store all the información of the warning.
                        warning.line = warningElement.Descendants(mNamespace + "line").First().Value;
                    //If there is a number of column
                    if (warningElement.Descendants(mNamespace + "col").Count() > 0)
                        //Store all the información of the warning.
                        warning.col = warningElement.Descendants(mNamespace + "col").First().Value;
                    //If there is an explnation
                    if (warningElement.Descendants(mNamespace + "explanation").Count() > 0)
                        //Store all the información of the warning.
                        warning.explanation = warningElement.Descendants(mNamespace + "explanation").First().Value;
                    //If there is a source
                    if (warningElement.Descendants(mNamespace + "source").Count() > 0)
                        //Store all the información of the warning.
                        warning.source = warningElement.Descendants(mNamespace + "source").First().Value;
                    //If there is a messageid
                    if (warningElement.Descendants(mNamespace + "messageid").Count() > 0)
                    {
                        //If the messageid stars with a 'W' it means that the warning is a PotentialIssue
                        if (warningElement.Descendants(mNamespace + "messageid").First().Value.StartsWith("W"))
                        {
                            //Create an instance of a WarningPotentialIssue
                            WarningPotentialIssue warningPotentialIssue = new WarningPotentialIssue();

                            //Store the messageid in the warningPotentialIssue object
                            warningPotentialIssue.messageid = warningElement.Descendants(mNamespace + "messageid").First().Value;
                            //If there is a message
                            if (warningElement.Descendants(mNamespace + "message").Count() > 0)
                                //Store the message in the warningPotentialIssue object
                                warningPotentialIssue.message = warningElement.Descendants(mNamespace + "message").First().Value;
                            ////Add the warningPotentialIssue to the list of warningPotentialIssues.
                            warningPotentialIssues.Add(warningPotentialIssue);
                        }
                        //If the messageid not stars with a 'W'
                        else
                        {
                            //Store the messageid
                            warning.messageid = warningElement.Descendants(mNamespace + "messageid").First().Value;
                            //If there is a message
                            if (warningElement.Descendants(mNamespace + "message").Count() > 0)
                                //Store the message
                                warning.message = warningElement.Descendants(mNamespace + "message").First().Value;

                            //Add the warning to the list of warnings
                            warnings.Add(warning);
                        }
                    }
                }
            }
        }
 public LocalizedStrings()
 {
     Warnings = new Warnings();
     Settings = new Settings();
 }
 public StructureBspClusterDebugInfoBlock(BinaryReader binaryReader)
 {
     this.errors = (Errors)binaryReader.ReadInt16();
     this.warnings = (Warnings)binaryReader.ReadInt16();
     this.padding = binaryReader.ReadBytes(28);
     {
         var elementSize = Marshal.SizeOf(typeof(StructureBspDebugInfoRenderLineBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.lines = new StructureBspDebugInfoRenderLineBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.lines[i] = new StructureBspDebugInfoRenderLineBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(StructureBspDebugInfoIndicesBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.fogPlaneIndices = new StructureBspDebugInfoIndicesBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.fogPlaneIndices[i] = new StructureBspDebugInfoIndicesBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(StructureBspDebugInfoIndicesBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.visibleFogPlaneIndices = new StructureBspDebugInfoIndicesBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.visibleFogPlaneIndices[i] = new StructureBspDebugInfoIndicesBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(StructureBspDebugInfoIndicesBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.visFogOmissionClusterIndices = new StructureBspDebugInfoIndicesBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.visFogOmissionClusterIndices[i] = new StructureBspDebugInfoIndicesBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(StructureBspDebugInfoIndicesBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.containingFogZoneIndices = new StructureBspDebugInfoIndicesBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.containingFogZoneIndices[i] = new StructureBspDebugInfoIndicesBlock(binaryReader);
             }
         }
     }
 }