Exemplo n.º 1
0
        private void SelectPackage_Executed(object arg)
        {
            var code = (PackageSourceTypes)arg;

            switch (code)
            {
            case PackageSourceTypes.Next:
                Package = new NextPackageSource();
                break;

            case PackageSourceTypes.Random:
                Package = new RandomPackageSource();
                break;

            case PackageSourceTypes.RandomServer:
                Package = new RandomServerPackageSource();
                break;

            case PackageSourceTypes.Local:
                var packagePath = PlatformManager.Instance.SelectLocalPackage();
                if (packagePath != null)
                {
                    Package = new CustomPackageSource(packagePath);
                }
                break;

            case PackageSourceTypes.SIStorage:
                var contentBox = new ContentBox {
                    Data = StorageInfo, Title = Resources.SIStorage
                };
                StorageInfo.Init();
                Navigate?.Invoke(contentBox);
                break;

            case PackageSourceTypes.VK:
                try
                {
                    Process.Start(Resources.ThemesLink);
                }
                catch (Exception exc)
                {
                    PlatformManager.Instance.ShowMessage(string.Format(Resources.VKThemesError + "\r\n{1}", Resources.ThemesLink, exc.Message), MessageType.Error);
                }
                break;
            }
        }