Beispiel #1
0
 private DateTime GetDateTime(XElement element, AttributeNames attributeIndex)
 {
     return(Serialization.GetDateTime(GetString(element, attributeIndex)));
 }
Beispiel #2
0
        private void SetAttributes(object node)
        {
            var metadata = node as Metadata;

            if (metadata != null)
            {
                metadata.Name  = Dequeue();
                metadata.Value = Dequeue();
                return;
            }

            var property = node as Property;

            if (property != null)
            {
                property.Name  = Dequeue();
                property.Value = Dequeue();
                return;
            }

            var message = node as Message;

            if (message != null)
            {
                message.IsLowRelevance = Serialization.GetBoolean(Dequeue());
                message.Timestamp      = Serialization.GetDateTime(Dequeue());
                message.Text           = Dequeue();
                return;
            }

            var folder = node as Folder;

            if (folder != null)
            {
                folder.IsLowRelevance = Serialization.GetBoolean(Dequeue());
                return;
            }

            var namedNode = node as NamedNode;

            if (namedNode != null)
            {
                namedNode.Name = Dequeue();
            }

            var textNode = node as TextNode;

            if (textNode != null)
            {
                textNode.Text = Dequeue();
            }

            var timedNode = node as TimedNode;

            if (timedNode != null)
            {
                timedNode.StartTime = Serialization.GetDateTime(Dequeue());
                timedNode.EndTime   = Serialization.GetDateTime(Dequeue());
                if (formatSupportsTimedNodeId)
                {
                    timedNode.NodeId = Serialization.GetInteger(Dequeue());
                }
            }

            var task = node as Task;

            if (task != null)
            {
                task.FromAssembly         = Dequeue();
                task.CommandLineArguments = Dequeue();
                if (formatSupportsSourceFiles)
                {
                    task.SourceFilePath = Dequeue();
                }

                return;
            }

            var target = node as Target;

            if (target != null)
            {
                target.DependsOnTargets = Dequeue();
                target.IsLowRelevance   = Serialization.GetBoolean(Dequeue());
                if (formatSupportsSourceFiles)
                {
                    target.SourceFilePath = Dequeue();
                }

                return;
            }

            var diagnostic = node as AbstractDiagnostic;

            if (diagnostic != null)
            {
                diagnostic.Code            = Dequeue();
                diagnostic.File            = Dequeue();
                diagnostic.LineNumber      = Serialization.GetInteger(Dequeue());
                diagnostic.ColumnNumber    = Serialization.GetInteger(Dequeue());
                diagnostic.EndLineNumber   = Serialization.GetInteger(Dequeue());
                diagnostic.EndColumnNumber = Serialization.GetInteger(Dequeue());
                diagnostic.ProjectFile     = Dequeue();
                return;
            }

            var project = node as Project;

            if (project != null)
            {
                project.ProjectFile = Dequeue();
                return;
            }

            var build = node as Build;

            if (build != null)
            {
                build.Succeeded  = Serialization.GetBoolean(Dequeue());
                build.IsAnalyzed = Serialization.GetBoolean(Dequeue());
                return;
            }

            var import = node as Import;

            if (import != null)
            {
                import.ProjectFilePath         = Dequeue();
                import.ImportedProjectFilePath = Dequeue();
                import.Line           = Serialization.GetInteger(Dequeue());
                import.Column         = Serialization.GetInteger(Dequeue());
                import.IsLowRelevance = Serialization.GetBoolean(Dequeue());
                return;
            }

            var noImport = node as NoImport;

            if (noImport != null)
            {
                noImport.ProjectFilePath  = Dequeue();
                noImport.ImportedFileSpec = Dequeue();
                noImport.Line             = Serialization.GetInteger(Dequeue());
                noImport.Column           = Serialization.GetInteger(Dequeue());
                noImport.IsLowRelevance   = Serialization.GetBoolean(Dequeue());
                return;
            }
        }
 private DateTime GetDateTime(AttributeNames attributeIndex)
 {
     return(Serialization.GetDateTime(GetString(attributeIndex)));
 }