コード例 #1
0
ファイル: MainViewModel.cs プロジェクト: FredWings/SubMethod
        private bool SameDateTime()
        {
            _xmlWriter.Save(xmlpath);
            _xmlReader.Load(xmlpath);
            var nodeList = _xmlReader.GetXmlNodeList(DATENOTE);

            if (nodeList.Count <= 0)
            {
                return(false);
            }
            for (int i = 0; i < nodeList.Count; i++)
            {
                XmlAttribute xab = _xmlReader.GetXmlAttribute(DATENOTE, i, CURRENTDATE);
                if (xab == null)
                {
                    return(false);
                }
                if (xab.InnerText == SelectedDate.ToShortDateString())
                {
                    _xmlWriter.RemoveChild(DATENOTE, i);
                    return(true);
                }
            }
            return(false);
        }