public Prepend(ITextContent target, string value, bool withNewLine)
        {
            Target      = target;
            Value       = value;
            WithNewLine = withNewLine;

            _originalValue = target.Value;
        }
Example #2
0
        protected override void LoadContent()
        {
            _spriteBatch = new SpriteBatch(GraphicsDevice);

            Art.LoadContent(Content);
            SharedArt.LoadContent(Content);

            App.Register(_spriteBatch);
            LibContent.SetContents();
            LegacySuport.Load(_spriteBatch);

            _textContent      = DependencyInjection.Resolve <ITextContent>();
            _textContent.Size = 0.75f;

            _guiManager   = new GuiManager();
            _boardManager = new BoardManager();
        }
 public Replace(ITextContent target, string oldValue, string newValue)
 {
     Target   = target;
     OldValue = oldValue;
     NewValue = newValue;
 }
Example #4
0
 protected override void Attach(IControl control)
 {
     _itext = control as ITextContent;
 }
Example #5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="node"></param>
        /// <param name="mgr"></param>
        /// <returns></returns>
        public override IFeature FromXml(XmlNode node, XmlNamespaceManager mgr)
        {
            if (node != null && node.HasChildNodes)
            {
                if (node.FirstChild.Attributes.Count > 0)
                {
                    Id = node.FirstChild.Attributes["gml:id"].InnerText;
                }
            }

            var fixedDateRangeNode = node.FirstChild.SelectSingleNode("fixedDateRange", mgr);

            if (fixedDateRangeNode != null && fixedDateRangeNode.HasChildNodes)
            {
                FixedDateRange = new DateRange();
                FixedDateRange.FromXml(fixedDateRangeNode, mgr);
            }

            var periodicDateRangeNodes = node.FirstChild.SelectNodes("periodicDateRange", mgr);

            if (periodicDateRangeNodes != null && periodicDateRangeNodes.Count > 0)
            {
                var dateRanges = new List <DateRange>();
                foreach (XmlNode periodicDateRangeNode in periodicDateRangeNodes)
                {
                    var newDateRange = new DateRange();
                    newDateRange.FromXml(periodicDateRangeNode, mgr);
                    dateRanges.Add(newDateRange);
                }
                PeriodicDateRange = dateRanges.ToArray();
            }

            var featureNameNodes = node.FirstChild.SelectNodes("featureName", mgr);

            if (featureNameNodes != null && featureNameNodes.Count > 0)
            {
                var featureNames = new List <FeatureName>();
                foreach (XmlNode featureNameNode in featureNameNodes)
                {
                    var newFeatureName = new FeatureName();
                    newFeatureName.FromXml(featureNameNode, mgr);
                    featureNames.Add(newFeatureName);
                }
                FeatureName = featureNames.ToArray();
            }

            var sourceIndicationNodes = node.FirstChild.SelectNodes("sourceIndication", mgr);

            if (sourceIndicationNodes != null && sourceIndicationNodes.Count > 0)
            {
                var sourceIndications = new List <SourceIndication>();
                foreach (XmlNode sourceIndicationNode in sourceIndicationNodes)
                {
                    if (sourceIndicationNode != null && sourceIndicationNode.HasChildNodes)
                    {
                        var sourceIndication = new SourceIndication();
                        sourceIndication.FromXml(sourceIndicationNode, mgr);
                        sourceIndications.Add(sourceIndication);
                    }
                }
                SourceIndication = sourceIndications.ToArray();
            }

            var categoryOfShipReportNodes = node.FirstChild.SelectNodes("categoryOfShipReport");

            if (categoryOfShipReportNodes != null && categoryOfShipReportNodes.Count > 0)
            {
                var categories = new List <string>();
                foreach (XmlNode categoryOfShipReportNode in categoryOfShipReportNodes)
                {
                    if (categoryOfShipReportNode != null && categoryOfShipReportNode.HasChildNodes)
                    {
                        categories.Add(categoryOfShipReportNode.FirstChild.InnerText);
                    }
                }
                CategoryOfShipReport = categories.ToArray();
            }

            var imoFormatForReportingNode = node.FirstChild.SelectSingleNode("imoFormatForReporting", mgr);

            if (imoFormatForReportingNode != null && imoFormatForReportingNode.HasChildNodes)
            {
                ImoFormatForReporting = imoFormatForReportingNode.FirstChild.InnerText;
            }

            var noticeTimeNodes = node.FirstChild.SelectNodes("noticeTime");

            if (noticeTimeNodes != null && noticeTimeNodes.Count > 0)
            {
                var noticeTimes = new List <NoticeTime>();
                foreach (XmlNode noticeTimeNode in noticeTimeNodes)
                {
                    if (noticeTimeNode != null && noticeTimeNode.HasChildNodes)
                    {
                        var newNoticeTime = new NoticeTime();
                        newNoticeTime.FromXml(noticeTimeNode, mgr);
                        noticeTimes.Add(newNoticeTime);
                    }
                }
                NoticeTime = noticeTimes.ToArray();
            }

            var textContentNode = node.FirstChild.SelectSingleNode("textContent", mgr);

            if (textContentNode != null && textContentNode.HasChildNodes)
            {
                TextContent = new TextContent();
                TextContent.FromXml(textContentNode, mgr);
            }

            var linkNodes = node.FirstChild.SelectNodes("*[boolean(@xlink:href)]", mgr);

            if (linkNodes != null && linkNodes.Count > 0)
            {
                var links = new List <Link>();
                foreach (XmlNode linkNode in linkNodes)
                {
                    var newLink = new Link();
                    newLink.FromXml(linkNode, mgr);
                    links.Add(newLink);
                }
                Links = links.ToArray();
            }

            return(this);
        }
Example #6
0
        protected override void LoadContent()
        {
            _spriteBatch = new SpriteBatch(GraphicsDevice);

            Art.LoadContent(Content);
            SharedArt.LoadContent(Content);

            App.Register(_spriteBatch);
            LibContent.SetContents();
            LegacySuport.Load(_spriteBatch);

            _textContent = DependencyInjection.Resolve<ITextContent>();
            _textContent.Size = 0.75f;

            _guiManager = new GuiManager();
            _boardManager = new BoardManager();
        }