Пример #1
0
        internal void ApplicationExit()
        {
#if !DEBUG
#if !PocketPC
            // send end ping to codeplex Analytics service
            try
            {
                if (!AnalyticsStopDone)
                {
                    AnalyticsStopDone = true;

                    using (Analytics.MessagingServiceV2 s = new Analytics.MessagingServiceV2())
                    {
                        s.Timeout = 10 * 1000;

                        if (GMaps.Instance.Proxy != null)
                        {
                            s.Proxy           = GMaps.Instance.Proxy;
                            s.PreAuthenticate = true;
                        }

                        Analytics.MessageCache info = new Analytics.MessageCache();
                        {
                            FillAnalyticsInfo(info);

                            info.Messages = new Analytics.Message[2];

                            Analytics.SessionLifeCycle slc = new Analytics.SessionLifeCycle();
                            {
                                slc.Id           = Guid.NewGuid();
                                slc.SessionId    = SessionIdGuid;
                                slc.TimeStampUtc = DateTime.UtcNow;

                                slc.Event = new GMap.NET.Analytics.EventInformation();
                                {
                                    slc.Event.Code           = "Session.Stop";
                                    slc.Event.PrivacySetting = GMap.NET.Analytics.PrivacySettings.SupportOptout;
                                }
                            }
                            info.Messages[0] = slc;

                            Analytics.ApplicationLifeCycle alc = new Analytics.ApplicationLifeCycle();
                            {
                                alc.Id           = Guid.NewGuid();
                                alc.SessionId    = SessionIdGuid;
                                alc.TimeStampUtc = DateTime.UtcNow;

                                alc.Event = new GMap.NET.Analytics.EventInformation();
                                {
                                    alc.Event.Code           = "Application.Stop";
                                    alc.Event.PrivacySetting = GMap.NET.Analytics.PrivacySettings.SupportOptout;
                                }

                                alc.Binary = new Analytics.BinaryInformation();
                                {
                                    System.Reflection.AssemblyName app = System.Reflection.Assembly.GetEntryAssembly().GetName();
                                    alc.Binary.Name    = app.Name;
                                    alc.Binary.Version = app.Version.ToString();
                                }

                                alc.Host = new GMap.NET.Analytics.HostInfo();
                                {
                                    alc.Host.RuntimeVersion = Environment.Version.ToString();
                                }

                                alc.Host.OS = new GMap.NET.Analytics.OSInformation();
                                {
                                    alc.Host.OS.OsName = Environment.OSVersion.VersionString;
                                }
                            }
                            info.Messages[1] = alc;
                        }
                        s.Publish(info);
                    }
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine("Analytics Stop: " + ex.ToString());
            }
#endif
#endif
        }
Пример #2
0
      internal void ApplicationExit()
      {
#if !DEBUG
#if !PocketPC
         // send end ping to codeplex Analytics service
         try
         {
            if(!AnalyticsStopDone)
            {
               AnalyticsStopDone = true;

               using(Analytics.MessagingServiceV2 s = new Analytics.MessagingServiceV2())
               {
                  s.Timeout = 10 * 1000;

                  if(GMaps.Instance.Proxy != null)
                  {
                     s.Proxy = GMaps.Instance.Proxy;
                     s.PreAuthenticate = true;
                  }

                  Analytics.MessageCache info = new Analytics.MessageCache();
                  {
                     FillAnalyticsInfo(info);

                     info.Messages = new Analytics.Message[2];

                     Analytics.SessionLifeCycle slc = new Analytics.SessionLifeCycle();
                     {
                        slc.Id = Guid.NewGuid();
                        slc.SessionId = SessionIdGuid;
                        slc.TimeStampUtc = DateTime.UtcNow;

                        slc.Event = new GMap.NET.Analytics.EventInformation();
                        {
                           slc.Event.Code = "Session.Stop";
                           slc.Event.PrivacySetting = GMap.NET.Analytics.PrivacySettings.SupportOptout;
                        }
                     }
                     info.Messages[0] = slc;

                     Analytics.ApplicationLifeCycle alc = new Analytics.ApplicationLifeCycle();
                     {
                        alc.Id = Guid.NewGuid();
                        alc.SessionId = SessionIdGuid;
                        alc.TimeStampUtc = DateTime.UtcNow;

                        alc.Event = new GMap.NET.Analytics.EventInformation();
                        {
                           alc.Event.Code = "Application.Stop";
                           alc.Event.PrivacySetting = GMap.NET.Analytics.PrivacySettings.SupportOptout;
                        }

                        alc.Binary = new Analytics.BinaryInformation();
                        {
                           System.Reflection.AssemblyName app = System.Reflection.Assembly.GetEntryAssembly().GetName();
                           alc.Binary.Name = app.Name;
                           alc.Binary.Version = app.Version.ToString();
                        }

                        alc.Host = new GMap.NET.Analytics.HostInfo();
                        {
                           alc.Host.RuntimeVersion = Environment.Version.ToString();
                        }

                        alc.Host.OS = new GMap.NET.Analytics.OSInformation();
                        {
                           alc.Host.OS.OsName = Environment.OSVersion.VersionString;
                        }
                     }
                     info.Messages[1] = alc;
                  }
                  s.Publish(info);
               }
            }
         }
         catch(Exception ex)
         {
            Debug.WriteLine("Analytics Stop: " + ex.ToString());
         }
#endif
#endif
      }
Пример #3
0
        /// <summary>
        /// starts core system
        /// </summary>
        public void StartSystem()
        {
            if (!IsStarted)
            {
                IsStarted = true;
                GoToCurrentPosition();
#if !DEBUG
#if !PocketPC
                // in case there a few controls in one app
                if (!AnalyticsStartDone)
                {
                    AnalyticsStartDone = true;

                    // send start ping to codeplex Analytics service
                    ThreadPool.QueueUserWorkItem(new WaitCallback(delegate(object o)
                    {
                        try
                        {
                            using (Analytics.MessagingServiceV2 s = new Analytics.MessagingServiceV2())
                            {
                                if (GMaps.Instance.Proxy != null)
                                {
                                    s.Proxy           = GMaps.Instance.Proxy;
                                    s.PreAuthenticate = true;
                                }

                                Analytics.MessageCache info = new Analytics.MessageCache();
                                {
                                    FillAnalyticsInfo(info);

                                    info.Messages = new Analytics.Message[2];

                                    Analytics.ApplicationLifeCycle alc = new Analytics.ApplicationLifeCycle();
                                    {
                                        alc.Id           = Guid.NewGuid();
                                        alc.SessionId    = SessionIdGuid;
                                        alc.TimeStampUtc = DateTime.UtcNow;

                                        alc.Event = new GMap.NET.Analytics.EventInformation();
                                        {
                                            alc.Event.Code           = "Application.Start";
                                            alc.Event.PrivacySetting = GMap.NET.Analytics.PrivacySettings.SupportOptout;
                                        }

                                        alc.Binary = new Analytics.BinaryInformation();
                                        {
                                            System.Reflection.AssemblyName app = System.Reflection.Assembly.GetEntryAssembly().GetName();
                                            alc.Binary.Name    = app.Name;
                                            alc.Binary.Version = app.Version.ToString();
                                        }

                                        alc.Host = new GMap.NET.Analytics.HostInfo();
                                        {
                                            alc.Host.RuntimeVersion = Environment.Version.ToString();
                                        }

                                        alc.Host.OS = new GMap.NET.Analytics.OSInformation();
                                        {
                                            alc.Host.OS.OsName = Environment.OSVersion.VersionString;
                                        }
                                    }
                                    info.Messages[0] = alc;

                                    Analytics.SessionLifeCycle slc = new Analytics.SessionLifeCycle();
                                    {
                                        slc.Id           = Guid.NewGuid();
                                        slc.SessionId    = SessionIdGuid;
                                        slc.TimeStampUtc = DateTime.UtcNow;

                                        slc.Event = new GMap.NET.Analytics.EventInformation();
                                        {
                                            slc.Event.Code           = "Session.Start";
                                            slc.Event.PrivacySetting = GMap.NET.Analytics.PrivacySettings.SupportOptout;
                                        }
                                    }
                                    info.Messages[1] = slc;
                                }
                                s.Publish(info);
                            }
                        }
                        catch (Exception ex)
                        {
                            Debug.WriteLine("Analytics Start: " + ex.ToString());
                        }
                    }));
                }
#endif
#endif
            }
        }
Пример #4
0
      /// <summary>
      /// starts core system
      /// </summary>
      public void StartSystem()
      {
         if(!IsStarted)
         {
            IsStarted = true;
            GoToCurrentPosition();
#if !DEBUG
#if !PocketPC
            // in case there a few controls in one app
            if(!AnalyticsStartDone)
            {
               AnalyticsStartDone = true;

               // send start ping to codeplex Analytics service
               ThreadPool.QueueUserWorkItem(new WaitCallback(delegate(object o)
               {
                  try
                  {
                     using(Analytics.MessagingServiceV2 s = new Analytics.MessagingServiceV2())
                     {
                        if(GMaps.Instance.Proxy != null)
                        {
                           s.Proxy = GMaps.Instance.Proxy;
                           s.PreAuthenticate = true;
                        }

                        Analytics.MessageCache info = new Analytics.MessageCache();
                        {
                           FillAnalyticsInfo(info);

                           info.Messages = new Analytics.Message[2];

                           Analytics.ApplicationLifeCycle alc = new Analytics.ApplicationLifeCycle();
                           {
                              alc.Id = Guid.NewGuid();
                              alc.SessionId = SessionIdGuid;
                              alc.TimeStampUtc = DateTime.UtcNow;

                              alc.Event = new GMap.NET.Analytics.EventInformation();
                              {
                                 alc.Event.Code = "Application.Start";
                                 alc.Event.PrivacySetting = GMap.NET.Analytics.PrivacySettings.SupportOptout;
                              }

                              alc.Binary = new Analytics.BinaryInformation();
                              {
                                 System.Reflection.AssemblyName app = System.Reflection.Assembly.GetEntryAssembly().GetName();
                                 alc.Binary.Name = app.Name;
                                 alc.Binary.Version = app.Version.ToString();
                              }

                              alc.Host = new GMap.NET.Analytics.HostInfo();
                              {
                                 alc.Host.RuntimeVersion = Environment.Version.ToString();
                              }

                              alc.Host.OS = new GMap.NET.Analytics.OSInformation();
                              {
                                 alc.Host.OS.OsName = Environment.OSVersion.VersionString;
                              }
                           }
                           info.Messages[0] = alc;

                           Analytics.SessionLifeCycle slc = new Analytics.SessionLifeCycle();
                           {
                              slc.Id = Guid.NewGuid();
                              slc.SessionId = SessionIdGuid;
                              slc.TimeStampUtc = DateTime.UtcNow;

                              slc.Event = new GMap.NET.Analytics.EventInformation();
                              {
                                 slc.Event.Code = "Session.Start";
                                 slc.Event.PrivacySetting = GMap.NET.Analytics.PrivacySettings.SupportOptout;
                              }
                           }
                           info.Messages[1] = slc;
                        }
                        s.Publish(info);
                     }
                  }
                  catch(Exception ex)
                  {
                     Debug.WriteLine("Analytics Start: " + ex.ToString());
                  }
               }));
            }
#endif
#endif
         }
      }