Exemplo n.º 1
0
 public AboutViewModel(IUntappdService untappdService)
 {
     this.untappdService = untappdService;
     Version             = CommunicationHelper.GetTitle();
     if (untappdService.IsUNTPProject())
     {
         ImagePaths = GetImagePaths();
     }
 }
Exemplo n.º 2
0
        private void Activate()
        {
            Title = CommunicationHelper.GetTitle();
            bool   isUsedArgument = false;
            string filePath;

            if (argumentsProvider.Arguments.Count > 0)
            {
                filePath       = argumentsProvider.Arguments[0];
                isUsedArgument = true;
            }
            else
            {
                filePath = FileHelper.GetFirstFileItemPath(settingService.GetRecentFilePaths());
            }

            FileStatus fileStatus = FileHelper.Check(filePath, Extensions.GetSupportExtensions());

            if (EnumsHelper.IsValidFileStatus(fileStatus))
            {
                try
                {
                    untappdService.Initialize(filePath);
                    if (isUsedArgument)
                    {
                        settingService.SetRecentFilePaths(FileHelper.AddFilePath(settingService.GetRecentFilePaths(), filePath, settingService.GetMaxRecentFilePaths()));
                    }

                    moduleManager.LoadModule(typeof(MainModule).Name);
                }
                catch (ArgumentException ex)
                {
                    interactionRequestService.ShowError(Properties.Resources.Error, StringHelper.GetFullExceptionMessage(ex));
                    moduleManager.LoadModule(typeof(WelcomeModule).Name);
                }
            }
            else
            {
                if (fileStatus != FileStatus.IsEmptyPath)
                {
                    interactionRequestService.ShowMessage(Properties.Resources.Warning, CommunicationHelper.GetFileStatusMessage(fileStatus, filePath));
                }

                moduleManager.LoadModule(typeof(WelcomeModule).Name);
            }
        }
Exemplo n.º 3
0
 private void UpdateTitle()
 {
     Title = CommunicationHelper.GetTitle();
 }
Exemplo n.º 4
0
 private void UpdateTitle(string untappdUserName)
 {
     Title = CommunicationHelper.GetTitle(untappdUserName);
 }