コード例 #1
0
        /// <summary>
        /// Marca el resultado como fallido
        /// </summary>
        /// <param name="result">Objeto de resultados de donde se sacan los mensajes</param>
        public void MarkAsFailed(OperationResult result)
        {
            Result = result.Result;

            Info.AddRange(result.Info);
            ErrorCode = result.ErrorCode;
        }
コード例 #2
0
ファイル: ExecTester.cs プロジェクト: andszk/Tester
 public ExecTester()
 {
     if (File.Exists(runsFilePath))
     {
         Info.AddRange(this.ReadFromBinary());
     }
 }
コード例 #3
0
        public void Join(Message message)
        {
            Errors.AddRange(message.Errors);
            Success.AddRange(message.Success);
            Warnings.AddRange(message.Warnings);
            Info.AddRange(message.Info);

            refreshType();
        }
コード例 #4
0
        /// <summary>
        /// Creates a new tree, with this node being the root.
        /// </summary>
        /// <param name="key">Unique identifier for the current node.</param>
        /// <param name="info">List of information specific to the node.</param>
        public Tree(T key, params string[] info)
        {
            Key = key;
            Info.AddRange(info);

            // Thses X and Y positions and the level are default. The actual values are set each time another
            // node is added to the tree.
            XPosition = Console.WindowWidth;
            YPosition = 0;
            Level     = 0;
        }
コード例 #5
0
        public void Add(MessageBag other)
        {
            if (other == null)
            {
                throw new ArgumentException("other");
            }

            Danger.AddRange(other.Danger);
            Info.AddRange(other.Info);
            Success.AddRange(other.Success);
            Warning.AddRange(other.Warning);
        }
コード例 #6
0
 internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
 {
     if (id == "info")
     {
         Info.AddRange(parser.ParseSFStringOrMFStringValue());
     }
     else if (id == "title")
     {
         Title = parser.ParseStringValue();
     }
     else
     {
         return(false);
     }
     return(true);
 }
コード例 #7
0
        /// <summary>
        /// Marca el resultado como fallido
        /// </summary>
        /// <param name="messages">Lista de mensajes a ingresar</param>
        /// <param name="errorCode">Código de error</param>
        public void MarkAsFailed(IEnumerable <string> messages, ErrorCodeEnum errorCode = ErrorCodeEnum.LOGIC_ERROR)
        {
            if (messages == null)
            {
                messages = new string[] { "Se recomienda hacer una verificación mas profunda, la lista de errores llego nula" }
            }
            ;

            Result = ResultTypeEnum.Error;

            Info.AddRange(messages.Select(x => new OperationMessage(x, MessageTypeEnum.Error)));
            ErrorCode = errorCode;

            foreach (var item in messages)
            {
                log.Error(item);
            }
        }
コード例 #8
0
 /// <summary>
 /// Agrega un grupo de mensajes a la información de resultado
 /// </summary>
 /// <param name="messages"></param>
 /// <param name="mtype"></param>
 public void AddMessages(IEnumerable <string> messages, MessageTypeEnum mtype = MessageTypeEnum.Info)
 {
     Info.AddRange(messages.Select(x => new OperationMessage(x, mtype)));
 }
コード例 #9
0
        internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
        {
            int line = parser.Line;

            if (id == "center")
            {
                Center = parser.ParseSFVec3fValue();
            }
            else if (id == "info")
            {
                Info.AddRange(parser.ParseSFStringOrMFStringValue());
            }
            else if (id == "joints")
            {
                List <X3DNode> nodes = parser.ParseSFNodeOrMFNodeValue();
                foreach (X3DNode node in nodes)
                {
                    IX3DHAnimJointNode joint = node as IX3DHAnimJointNode;
                    if (joint == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                    else
                    {
                        Joints.Add(joint);
                    }
                }
            }
            else if (id == "name")
            {
                Name = parser.ParseStringValue();
            }
            else if (id == "rotation")
            {
                Rotation = parser.ParseSFRotationValue();
            }
            else if (id == "scale")
            {
                Scale = parser.ParseSFVec3fValue();
            }
            else if (id == "scaleOrientation")
            {
                ScaleOrientation = parser.ParseSFRotationValue();
            }
            else if (id == "segments")
            {
                List <X3DNode> nodes = parser.ParseSFNodeOrMFNodeValue();
                foreach (X3DNode node in nodes)
                {
                    IX3DHAnimeSegmentNode segment = node as IX3DHAnimeSegmentNode;
                    if (segment == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                    else
                    {
                        Segments.Add(segment);
                    }
                }
            }
            else if (id == "sites")
            {
                List <X3DNode> nodes = parser.ParseSFNodeOrMFNodeValue();
                foreach (X3DNode node in nodes)
                {
                    IX3DHAnimSiteNode site = node as IX3DHAnimSiteNode;
                    if (site == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                    else
                    {
                        Sites.Add(site);
                    }
                }
            }
            else if (id == "skeleton")
            {
                List <X3DNode> nodes = parser.ParseSFNodeOrMFNodeValue();
                foreach (X3DNode node in nodes)
                {
                    IX3DHAnimHumanoidSkeleton skeleton = node as IX3DHAnimHumanoidSkeleton;
                    if (skeleton == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                    else
                    {
                        Skeleton.Add(skeleton);
                    }
                }
            }
            else if (id == "skin")
            {
                List <X3DNode> nodes = parser.ParseSFNodeOrMFNodeValue();
                foreach (X3DNode node in nodes)
                {
                    X3DChildNode skin = node as X3DChildNode;
                    if (skin == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                    else
                    {
                        Skin.Add(skin);
                    }
                }
            }
            else if (id == "skinCoord")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    SkinCoord = node as X3DCoordinateNode;
                    if (SkinCoord == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                }
            }
            else if (id == "skinNormal")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    SkinNormal = node as X3DNormalNode;
                    if (SkinNormal == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                }
            }
            else if (id == "translation")
            {
                Translation = parser.ParseSFVec3fValue();
            }
            else if (id == "version")
            {
                Version = parser.ParseStringValue();
            }
            else if (id == "viewpoints")
            {
                List <X3DNode> nodes = parser.ParseSFNodeOrMFNodeValue();
                foreach (X3DNode node in nodes)
                {
                    X3DViewpointNode vp = node as X3DViewpointNode;                   // x3d-Spec specs. x3dHAnimSite change to interface if neccessary
                    if (vp == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                    else
                    {
                        Viewpoints.Add(vp);
                    }
                }
            }
            else if (id == "bboxCenter")
            {
                BBoxCenter = parser.ParseSFVec3fValue();
            }
            else if (id == "bboxSize")
            {
                BBoxSize = parser.ParseSFVec3fValue();
            }
            else
            {
                return(false);
            }
            return(true);
        }