Ejemplo n.º 1
0
        public static void Init(Version version)
        {
            try
            {
                StringBuilder uriString = new StringBuilder();
                uriString.Append("pack://*****:*****@sentry.skyrez.su/4");
                options.Release    = version.ToString();
                options.BeforeSend = SentryEvent;
            });

            string tmpPath = Settings.PathToLocalTmp;

            if (!Directory.Exists(tmpPath))
            {
                Directory.CreateDirectory(tmpPath);
            }
            YandexMetricaFolder.SetCurrent(tmpPath);
            YandexMetrica.Config.CustomAppVersion = version;
        }
Ejemplo n.º 2
0
 public MainForm()
 {
     InitializeComponent();
     YandexMetricaFolder.SetCurrent("");
     YandexMetrica.Activate("eafbf946-7082-4f83-aef3-6e99c1911a62");
     AppDomain.CurrentDomain.UnhandledException += Application_ThreadException;
 }
Ejemplo n.º 3
0
        static Events()
        {
            var metrika = Configuration.Config.GetSection("metrika");

            YandexMetricaFolder.SetCurrent(metrika.GetValue <string>("folder"));
            YandexMetrica.Config.CrashTracking = true;
            YandexMetrica.Activate(metrika.GetValue <string>("token"));
        }
Ejemplo n.º 4
0
 static Logger()
 {
     Log = new LoggAddinExt();
     try
     {
         YandexMetricaFolder.SetCurrent(Path.GetTempPath());
         YandexMetrica.Activate("4a039a94-ea44-43b7-9025-59a856dd7120");
         YandexMetrica.Config.CustomAppVersion = Commands.AcadLibVersion;
     }
     catch (Exception ex)
     {
         AutoCAD_PIK_Manager.Log.Error(ex, "YandexMetrica Activate error");
     }
 }
Ejemplo n.º 5
0
 public static void Init(Version version)
 {
     try
     {
         string tmpPath = DefaultPaths.PathToLocalTmp;
         IO.CreateDirectory(tmpPath);
         YandexMetricaFolder.SetCurrent(tmpPath);
         ExperimentalFunctions.IfUse("SetVers", () =>
         {
             Version nv = new Version(version.Major, version.Minor, version.Build, version.Revision + 100);
             YandexMetrica.Config.CustomAppVersion = nv;
         }, () =>
         {
             YandexMetrica.Config.CustomAppVersion = version;
         });
     }
     catch { }
 }
Ejemplo n.º 6
0
        private async void App_OnStartup(object sender, StartupEventArgs e)
        {
            LoggingService.Log("Meridian v" + Assembly.GetExecutingAssembly().GetName().Version + " started. OS: " + Environment.OSVersion);

            //DispatcherHelper.Initialize();

            Settings.Load();

            if (Settings.Instance.SendStats)
            {
                YandexMetricaFolder.SetCurrent(Directory.GetCurrentDirectory());
                YandexMetrica.Activate("60fb8ba9-ab3c-4ee8-81ac-559c8aeb305e"); //Yandex Metrica
            }

            System.Threading.Thread.CurrentThread.CurrentCulture   = CultureInfo.GetCultureInfo(Settings.Instance.Language);
            System.Threading.Thread.CurrentThread.CurrentUICulture = System.Threading.Thread.CurrentThread.CurrentCulture;

            if (Settings.Instance.Accounts.Count == 0)
            {
                Settings.Instance.Accounts.Add(new Account()
                {
                    Id = "vk", Title = MainResources.SettingsAccountsVk
                });
                Settings.Instance.Accounts.Add(new Account()
                {
                    Id = "lasfm", Title = MainResources.SettingsAccountsLastFm
                });
            }

            ServiceLocator.DataBaseService.Initialize();

            if (Settings.Instance.NeedClean)
            {
                ViewModelLocator.UpdateService.Clean();

                Settings.Instance.NeedClean = false;
            }

            switch (Settings.Instance.AccentColor)
            {
            case "Red":
            case "Emerald":
            case "Magenta":
            case "Mango":
            case "Sea":
            case "Sky":
            case "Purple":
            case "Pink":
                Resources.MergedDictionaries[0].Source = new Uri(string.Format("/Resources/Themes/Accents/{0}.xaml", Settings.Instance.AccentColor), UriKind.Relative);
                break;

            default:
                Resources.MergedDictionaries[0].Source = new Uri("/Resources/Themes/Accents/Blue.xaml", UriKind.Relative);
                break;
            }

            switch (Settings.Instance.Theme)
            {
            case "Light":
            case "Dark":
            case "Graphite":
            case "Accent":
                Resources.MergedDictionaries[1].Source = new Uri(string.Format("/Resources/Themes/{0}.xaml", Settings.Instance.Theme), UriKind.Relative);
                break;

            default:
                Resources.MergedDictionaries[1].Source = new Uri("/Resources/Themes/Light.xaml", UriKind.Relative);
                break;
            }

            if (Settings.Instance.EnableTrayIcon)
            {
                AddTrayIcon();
            }

            ViewModelLocator.Vkontakte.UseHttps = Settings.Instance.UseHttps;

            AudioService.Load();
        }