Beispiel #1
0
 public Category(StringId titleID, string target, bool allowScrolling, SQMDataId sqmCountID)
     : base(null, Shell.LoadString(titleID))
 {
     this._target         = target;
     this._allowScrolling = allowScrolling;
     this._sqmCountID     = sqmCountID;
 }
Beispiel #2
0
        public static void Log(SQMDataId sqmDataId, int nData)
        {
            SQMDataPoint dataPoint = FindDataPoint(sqmDataId);

            if (dataPoint.id == SQMDataId.Invalid)
            {
                return;
            }
            switch (dataPoint.action)
            {
            case SQMAction.Add:
                SQMAddWrapper(dataPoint.GetName(), nData);
                break;

            case SQMAction.Inc:
                SQMAddWrapper(dataPoint.GetName(), 1);
                break;

            case SQMAction.SetFlag:
                SQMSetFlagWrapper(dataPoint.GetName(), nData != 0);
                break;

            case SQMAction.SetBits:
                SQMSetBitsWrapper(dataPoint.GetName(), (uint)nData);
                break;

            default:
                throw new ArgumentException("Datapoint " + dataPoint.GetName() + " is not a simple DWORD-type datapoint.  Use LogToStream for stream-type datapoints.");
            }
            Telemetry.Instance.ReportEvent(dataPoint, nData);
        }
Beispiel #3
0
        public CategoryPageNode(
            Experience owner,
            StringId id,
            IList categories,
            SQMDataId sqmDataID,
            bool allowBackNavigation,
            bool hideDeviceOnCancel)
            : base(owner, id, null, sqmDataID)
        {
            this._allowBackNavigation = allowBackNavigation;
            this._hideDeviceOnCancel  = hideDeviceOnCancel;
            bool flag = false;

            foreach (Category category in categories)
            {
                if (category == null)
                {
                    flag = true;
                }
            }
            if (flag)
            {
                List <Category> categoryList = new List <Category>(categories.Count);
                foreach (Category category in categories)
                {
                    if (category != null)
                    {
                        categoryList.Add(category);
                    }
                }
                categories = categoryList.ToArray();
            }
            this._categories = categories;
        }
Beispiel #4
0
 private static SQMDataPoint FindDataPoint(SQMDataId sqmDataId)
 {
     foreach (SQMDataPoint rgSqmDataPoint in SQMData.s_rgSQMDataPoints)
     {
         if (rgSqmDataPoint.id == sqmDataId)
         {
             return(rgSqmDataPoint);
         }
     }
     return(SQMData.s_sqmDataPointInvalid);
 }
 public void ViewChanged(SQMDataId viewSQMId)
 {
     if (this._collectionViewLog != null && viewSQMId != this._collectionViewLog.LogId)
     {
         this._collectionViewLog.Stop();
         this._collectionViewLog = null;
     }
     if (viewSQMId == SQMDataId.Invalid || this._collectionViewLog != null)
     {
         return;
     }
     this._collectionViewLog = new LogHelper(viewSQMId);
     if (this._inCompactMode)
     {
         return;
     }
     this._collectionViewLog.Start();
 }
Beispiel #6
0
        public void ReportEvent(SQMDataPoint datapoint, int nData)
        {
            SQMDataId id   = datapoint.id;
            bool      flag = datapoint.action == SQMAction.Add || datapoint.action == SQMAction.Inc;

            if (id == SQMDataId.Invalid || !flag || !this.m_sqmToEventMap.ContainsKey(id))
            {
                return;
            }
            Hashtable     hashtable  = new Hashtable();
            DatapointInfo sqmToEvent = (DatapointInfo)this.m_sqmToEventMap[id];

            if (sqmToEvent.IsSession)
            {
                hashtable.Add("@Data", nData);
                hashtable.Add("@EventType", sqmToEvent.TypeName);
            }
            this.QueueTelemetry(new TelemetryInfo(sqmToEvent.Event, "", hashtable, sqmToEvent.IsSession));
        }
Beispiel #7
0
 public PageNode(Experience owner, StringId id, GetPageCallback handler, SQMDataId sqmDataID)
     : base(owner, id, null, sqmDataID)
     => this._handler = handler;
Beispiel #8
0
 public WizardNode(Experience owner, Wizard wizard, SQMDataId sqmDataID)
     : base(owner, null, sqmDataID)
     => this._wizard = wizard;
 public LogHelper(SQMDataId logId) => this._logId = logId;
Beispiel #10
0
        public static void LogToStream(SQMDataId sqmDataId, params string[] args)
        {
            SQMDataPoint dataPoint = FindDataPoint(sqmDataId);

            if (dataPoint.id == SQMDataId.Invalid)
            {
                return;
            }
            if (dataPoint.action != SQMAction.MixedStream)
            {
                throw new ArgumentException("Datapoint " + dataPoint.GetName() + " is not a MixedStream-type datapoint.  Error in parameters/paramtypes, or in datapoint declaration.");
            }
            if (args.Length > 9)
            {
                throw new ArgumentException("Too many (or too few) number params.  SQM only allows up to 9 params. Datapoint: " + dataPoint.GetName(), "args.Length");
            }
            if (args.Length != dataPoint.argCount)
            {
                throw new ArgumentException("Passed-in arg count doesn't match datapoint declaration: " + dataPoint.GetName(), "args.Length");
            }
            if (args.Length == 1)
            {
                SQMAddToStream(dataPoint.GetName(), c_rgSPTArrayAllStrings, (uint)args.Length, args[0]);
            }
            else if (args.Length == 2)
            {
                SQMAddToStream(dataPoint.GetName(), c_rgSPTArrayAllStrings, (uint)args.Length, args[0], args[1]);
            }
            else if (args.Length == 3)
            {
                SQMAddToStream(dataPoint.GetName(), c_rgSPTArrayAllStrings, (uint)args.Length, args[0], args[1], args[2]);
            }
            else if (args.Length == 4)
            {
                SQMAddToStream(dataPoint.GetName(), c_rgSPTArrayAllStrings, (uint)args.Length, args[0], args[1], args[2], args[3]);
            }
            else if (args.Length == 5)
            {
                SQMAddToStream(dataPoint.GetName(), c_rgSPTArrayAllStrings, (uint)args.Length, args[0], args[1], args[2], args[3], args[4]);
            }
            else if (args.Length == 6)
            {
                SQMAddToStream(dataPoint.GetName(), c_rgSPTArrayAllStrings, (uint)args.Length, args[0], args[1], args[2], args[3], args[4], args[5]);
            }
            else if (args.Length == 7)
            {
                SQMAddToStream(dataPoint.GetName(), c_rgSPTArrayAllStrings, (uint)args.Length, args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
            }
            else if (args.Length == 8)
            {
                SQMAddToStream(dataPoint.GetName(), c_rgSPTArrayAllStrings, (uint)args.Length, args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7]);
            }
            else
            {
                if (args.Length != 9)
                {
                    return;
                }
                SQMAddToStream(dataPoint.GetName(), c_rgSPTArrayAllStrings, (uint)args.Length, args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8]);
            }
        }
Beispiel #11
0
 public Node(Experience owner, string name, string command)
     : base(owner, name, null)
 {
     this._command    = command;
     this._sqmCountID = SQMDataId.Invalid;
 }
Beispiel #12
0
 public Node(Experience owner, StringId id, string command, SQMDataId sqmCountID)
     : base(owner, Shell.LoadString(id), null)
 {
     this._command    = command;
     this._sqmCountID = sqmCountID;
 }
Beispiel #13
0
 public Node(Experience owner, string command, SQMDataId sqmCountID)
     : base(owner, null, null)
 {
     this._command    = command;
     this._sqmCountID = sqmCountID;
 }