Exemplo n.º 1
0
        static void ParseTimedContent(Dictionary <string, string> paramDict)
        {
            var dateMatchGroups = Regex.Match(paramDict[VALUE2], BibaEditorConstants.REGEX_STARTDATE_ENDDATE).Groups;
            var startDate       = DateTime.ParseExact(dateMatchGroups[BibaEditorConstants.REGEX_GROUP_STARTDATE].Value, BibaEditorConstants.DATETIME_PARSE_EXACT_FORMAT, CultureInfo.InvariantCulture);
            var endDate         = DateTime.ParseExact(dateMatchGroups[BibaEditorConstants.REGEX_GROUP_ENDDATE].Value, BibaEditorConstants.DATETIME_PARSE_EXACT_FORMAT, CultureInfo.InvariantCulture);

            var sceneSetting = new TimedSceneSetting();

            sceneSetting.Id        = paramDict[ID];
            sceneSetting.SceneName = paramDict[VALUE1];
            sceneSetting.StartDate = startDate;
            sceneSetting.EndDate   = endDate;

            _specialSceneSettings.TimedSceneSettings.Add(sceneSetting);
        }
Exemplo n.º 2
0
        static void ParseTimedSceneSettings(AtomEntryCollection entries, ref BibaSpecialSceneSettings settings)
        {
            foreach (ListEntry row in entries)
            {
                var idText = row.Elements[0].Value;
                if (string.IsNullOrEmpty(idText))
                {
                    continue;
                }

                var sceneText = row.Elements[1].Value;
                if (string.IsNullOrEmpty(sceneText))
                {
                    continue;
                }

                var durationText = row.Elements[2].Value;
                if (string.IsNullOrEmpty(durationText))
                {
                    continue;
                }

                var dateMatchGroups = Regex.Match(durationText, BibaEditorConstants.REGEX_STARTDATE_ENDDATE).Groups;
                if (dateMatchGroups.Count == 0)
                {
                    continue;
                }

                var startDate = DateTime.ParseExact(dateMatchGroups[BibaEditorConstants.REGEX_GROUP_STARTDATE].Value, BibaEditorConstants.DATETIME_PARSE_EXACT_FORMAT, CultureInfo.InvariantCulture);
                var endDate   = DateTime.ParseExact(dateMatchGroups[BibaEditorConstants.REGEX_GROUP_ENDDATE].Value, BibaEditorConstants.DATETIME_PARSE_EXACT_FORMAT, CultureInfo.InvariantCulture);

                var sceneSetting = new TimedSceneSetting();

                sceneSetting.Id        = idText;
                sceneSetting.SceneName = sceneText;
                sceneSetting.StartDate = startDate;
                sceneSetting.EndDate   = endDate;

                settings.TimedSceneSettings.Add(sceneSetting);
            }
        }