public StatsEvent(XmlElement node) : base(node)
        {
            foreach (XmlElement propertyNode in node.ChildNodes)
            {
                switch (propertyNode.Name)
                {
                case "clientVer":
                    this._ClientVer = propertyNode.InnerText;
                    continue;

                case "eventType":
                    this._EventType = (StatsEventType)ParseEnum(typeof(StatsEventType), propertyNode.InnerText);
                    continue;

                case "eventTimestamp":
                    this._EventTimestamp = ParseFloat(propertyNode.InnerText);
                    continue;

                case "sessionId":
                    this._SessionId = propertyNode.InnerText;
                    continue;

                case "partnerId":
                    this._PartnerId = ParseInt(propertyNode.InnerText);
                    continue;

                case "entryId":
                    this._EntryId = propertyNode.InnerText;
                    continue;

                case "uniqueViewer":
                    this._UniqueViewer = propertyNode.InnerText;
                    continue;

                case "widgetId":
                    this._WidgetId = propertyNode.InnerText;
                    continue;

                case "uiconfId":
                    this._UiconfId = ParseInt(propertyNode.InnerText);
                    continue;

                case "userId":
                    this._UserId = propertyNode.InnerText;
                    continue;

                case "currentPoint":
                    this._CurrentPoint = ParseInt(propertyNode.InnerText);
                    continue;

                case "duration":
                    this._Duration = ParseInt(propertyNode.InnerText);
                    continue;

                case "userIp":
                    this._UserIp = propertyNode.InnerText;
                    continue;

                case "processDuration":
                    this._ProcessDuration = ParseInt(propertyNode.InnerText);
                    continue;

                case "controlId":
                    this._ControlId = propertyNode.InnerText;
                    continue;

                case "seek":
                    this._Seek = ParseBool(propertyNode.InnerText);
                    continue;

                case "newPoint":
                    this._NewPoint = ParseInt(propertyNode.InnerText);
                    continue;

                case "referrer":
                    this._Referrer = propertyNode.InnerText;
                    continue;

                case "isFirstInSession":
                    this._IsFirstInSession = ParseBool(propertyNode.InnerText);
                    continue;

                case "applicationId":
                    this._ApplicationId = propertyNode.InnerText;
                    continue;

                case "contextId":
                    this._ContextId = ParseInt(propertyNode.InnerText);
                    continue;

                case "featureType":
                    this._FeatureType = (StatsFeatureType)ParseEnum(typeof(StatsFeatureType), propertyNode.InnerText);
                    continue;
                }
            }
        }
示例#2
0
 public StatsEvent(JToken node) : base(node)
 {
     if (node["clientVer"] != null)
     {
         this._ClientVer = node["clientVer"].Value <string>();
     }
     if (node["eventType"] != null)
     {
         this._EventType = (StatsEventType)ParseEnum(typeof(StatsEventType), node["eventType"].Value <string>());
     }
     if (node["eventTimestamp"] != null)
     {
         this._EventTimestamp = ParseFloat(node["eventTimestamp"].Value <string>());
     }
     if (node["sessionId"] != null)
     {
         this._SessionId = node["sessionId"].Value <string>();
     }
     if (node["partnerId"] != null)
     {
         this._PartnerId = ParseInt(node["partnerId"].Value <string>());
     }
     if (node["entryId"] != null)
     {
         this._EntryId = node["entryId"].Value <string>();
     }
     if (node["uniqueViewer"] != null)
     {
         this._UniqueViewer = node["uniqueViewer"].Value <string>();
     }
     if (node["widgetId"] != null)
     {
         this._WidgetId = node["widgetId"].Value <string>();
     }
     if (node["uiconfId"] != null)
     {
         this._UiconfId = ParseInt(node["uiconfId"].Value <string>());
     }
     if (node["userId"] != null)
     {
         this._UserId = node["userId"].Value <string>();
     }
     if (node["currentPoint"] != null)
     {
         this._CurrentPoint = ParseInt(node["currentPoint"].Value <string>());
     }
     if (node["duration"] != null)
     {
         this._Duration = ParseInt(node["duration"].Value <string>());
     }
     if (node["userIp"] != null)
     {
         this._UserIp = node["userIp"].Value <string>();
     }
     if (node["processDuration"] != null)
     {
         this._ProcessDuration = ParseInt(node["processDuration"].Value <string>());
     }
     if (node["controlId"] != null)
     {
         this._ControlId = node["controlId"].Value <string>();
     }
     if (node["seek"] != null)
     {
         this._Seek = ParseBool(node["seek"].Value <string>());
     }
     if (node["newPoint"] != null)
     {
         this._NewPoint = ParseInt(node["newPoint"].Value <string>());
     }
     if (node["referrer"] != null)
     {
         this._Referrer = node["referrer"].Value <string>();
     }
     if (node["isFirstInSession"] != null)
     {
         this._IsFirstInSession = ParseBool(node["isFirstInSession"].Value <string>());
     }
     if (node["applicationId"] != null)
     {
         this._ApplicationId = node["applicationId"].Value <string>();
     }
     if (node["contextId"] != null)
     {
         this._ContextId = ParseInt(node["contextId"].Value <string>());
     }
     if (node["featureType"] != null)
     {
         this._FeatureType = (StatsFeatureType)ParseEnum(typeof(StatsFeatureType), node["featureType"].Value <string>());
     }
 }