Ejemplo n.º 1
0
        public void DeserializedFromXml(byte[] contentsByte)
        {
            bool canDeserialized = true;

            try
            {
                Logger.LogFuncUp();

                cardModelList = new List <CardModel>();
                string contentsString = Encoding.UTF8.GetString(contentsByte);
                var    xDoc           = new XmlDocument();
                xDoc.LoadXml(contentsString);

                var rootNode = xDoc.DocumentElement;
                if (null != rootNode)
                {
                    var allFilmPagesNode = rootNode.SelectSingleNode(OffScreenRenderXmlHelper.ALL_FILMING_PAGE_INFO);
                    if (allFilmPagesNode != null)
                    {
                        foreach (XmlNode filmPageNode in allFilmPagesNode)
                        {
                            var filmCard = new CardModel();
                            filmCard.DeserializedFromXml(contentsByte, filmPageNode);
                            cardModelList.Add(filmCard);
                        }
                        isPrint = cardModelList[0].IsPrint;
                    }
                    else
                    {
                        Logger.LogWarning("[FilmingSerivceFE]No Common Page info for print");
                        canDeserialized = false;
                    }
                }
                else
                {
                    Logger.LogWarning("[FilmingSerivceFE]No Card info for print");
                    canDeserialized = false;
                }
                Logger.LogFuncDown();
            }
            catch (Exception ex)
            {
                Logger.LogFuncException(ex.Message + ex.StackTrace);
                canDeserialized = false;
            }

            if (!canDeserialized)
            {
                Logger.LogError("[FilmingSerivceFE]Fail to Deserialized card info for print");
                Containee.Main.ShowStatusWarning("UID_Filming_OffScreen_Job_Fail");
            }
        }