Ejemplo n.º 1
0
        public string Serialize(PinGroupStatus status, bool parentRead)
        {
            var str = "";

            var dialogueStr = dialogueStatusSerializer.Serialize(status.DialogueStatus, status.Read);

            if (!string.IsNullOrWhiteSpace(dialogueStr))
            {
                str += dialogueStr;
            }
            str += END_CHAR;

            var quizStr = quizStatusSerializer.Serialize(status.QuizStatus, status.Read);

            if (!string.IsNullOrWhiteSpace(quizStr))
            {
                str += quizStr;
            }
            str += END_CHAR;

            if (string.IsNullOrWhiteSpace(str) && status.Read == parentRead)
            {
                return(null);
            }

            var readChar = status.Read ? '1' : '0';

            str = readChar + str;

            return(str);
        }
Ejemplo n.º 2
0
        public string Serialize(PanelStatus status, bool parentRead)
        {
            var str = "";

            var pinStr = pinGroupStatusSerializer.Serialize(status.PinGroupStatus, status.Read);

            if (!string.IsNullOrWhiteSpace(pinStr))
            {
                str += pinStr;
            }

            foreach (var panel in status.ChildPanelStatuses)
            {
                var panelStr = Serialize(panel.Value, status.Read);
                if (!string.IsNullOrWhiteSpace(panelStr))
                {
                    str += panel.Key + panelStr + END_CHAR;
                }
            }

            if (string.IsNullOrWhiteSpace(str) && status.Read == parentRead)
            {
                return(null);
            }

            var readChar = status.Read ? '1' : '0';

            str = readChar + str;

            return(str);
        }
Ejemplo n.º 3
0
 public Task Export(DateTime cursor)
 {
     using (_logger.Scope("Exporting service status."))
     {
         var rootComponent = _componentExporter.Export();
         var recentEvents  = _eventExporter.Export(cursor);
         return(_serializer.Serialize(cursor, rootComponent, recentEvents));
     }
 }
Ejemplo n.º 4
0
        public async Task Export(DateTime cursor)
        {
            using (_logger.Scope("Exporting service status."))
            {
                var rootComponent = _componentExporter.Export();
                var recentEvents  = _eventExporter.Export(cursor);

                var lastUpdated = await _cursor.Get(StatusUpdater.LastUpdatedCursorName);

                await _serializer.Serialize(cursor, lastUpdated, rootComponent, recentEvents);
            }
        }
Ejemplo n.º 5
0
        public string Serialize(EncounterContentStatus encounterStatus)
        {
            var str = encounterStatus.Read ? "1" : "0";

            foreach (var section in encounterStatus.SectionStatuses)
            {
                var sectionStr = sectionStatusSerializer.Serialize(section.Value, encounterStatus.Read);
                if (!string.IsNullOrWhiteSpace(sectionStr))
                {
                    str += section.Key + sectionStr + END_CHAR;
                }
            }

            return(str.Trim());
        }
Ejemplo n.º 6
0
        public string Serialize(SectionStatus status, bool parentRead)
        {
            var str = "";

            foreach (var tab in status.TabStatuses)
            {
                var tabStr = tabStatusSerializer.Serialize(tab.Value, status.Read);
                if (!string.IsNullOrWhiteSpace(tabStr))
                {
                    str += tab.Key + tabStr + END_CHAR;
                }
            }

            if (str.Length == 0 && status.Read == parentRead)
            {
                return(null);
            }

            var readChar = status.Read ? '1' : '0';

            str = readChar + str;

            return(str);
        }