Пример #1
0
        /// <summary>
        /// The get SCO info.
        /// </summary>
        /// <param name="scoId">
        /// The SCO id.
        /// </param>
        /// <returns>
        /// The <see cref="ScoInfoResult"/>.
        /// </returns>
        public EventInfoResult GetEventInfo(string scoId)
        {
            if (string.IsNullOrWhiteSpace(scoId))
            {
                throw new ArgumentException("Non-empty value expected", nameof(scoId));
            }

            // act: "sco-info"
            StatusInfo status;

            var doc = this.requestProcessor.Process(Commands.Event.Info, string.Format(CommandParams.ScoId, scoId), out status);

            if (ResponseIsOk(doc, status))
            {
                EventInfo result      = EventInfoParser.Parse(doc.SelectSingleNode("//event-info"));
                var       preferences = PrincipalPreferencesParser.Parse(doc.SelectSingleNode("//preferences"));
                return(new EventInfoResult(status, result, preferences));
            }

            return(new EventInfoResult(status));
        }
Пример #2
0
 /// <summary>
 /// Creates and initializes a new instance of the EcoreEvent class.
 /// </summary>
 /// <param name="type">EcoreEventType</param>
 /// <param name="parser">EventInfoParser</param>
 /// <since_tizen> preview </since_tizen>
 public EcoreEvent(EcoreEventType type, EventInfoParser parser)
 {
     _eventType = type;
     _parser    = parser;
 }