private static void Init() { _session = new AnalyticsSession("http://unband.nachmore.com/app", "UA-56820272-3"); var props = Settings.Current; _client = _session.CreatePageViewRequest("/", "Global"); if (props.FirstRun) { TrackEvent(TelemetryCategory.General, "Install", props.Device); // TODO: would be nice to fire a new OS event on system upgrade TrackEvent(TelemetryCategory.General, "OS", GetOS()); } }
private void MainWindow_Load(object sender, RoutedEventArgs e) { //System.Media.SoundPlayer player = new System.Media.SoundPlayer(); //player.Play(); Settings.Load(); if (Settings.curSettings == null) SetFirstSettings(); else { TreeTranslateTrans = (gridTree.RenderTransform as TransformGroup).Children[3] as TranslateTransform; TreeTranslateTrans.X = Settings.curSettings.TreeX; TreeTranslateTrans.Y = Settings.curSettings.TreeY; TreeScaleTrans.ScaleX = Settings.curSettings.TreeScale; TreeScaleTrans.ScaleY = Settings.curSettings.TreeScale; gadgetInstances = new List<TreeGadget>(); LoadGadgets(); } dragBehavior.Attach(gridTree); if (Settings.curSettings.PlaySound) { player.Open(new Uri(MainHelper.GetApplicationDir() + "\\sound\\elkasound.mp3")); player.Play(); } #if Garlic gal = new AnalyticsSession("newyear.andromeda.mn", "UA-6790599-40"); gal.SetCustomVariable(2, "ComputerName", Environment.MachineName); gal.SetCustomVariable(3, "OSVersion", Environment.OSVersion.ToString()); gal.SetCustomVariable(4, "UserName", Environment.UserName); var mainGal = gal.CreatePageViewRequest("/Tree", ""); mainGal.Send(); #endif }