コード例 #1
0
ファイル: MemberRepo.cs プロジェクト: Rfishernc/ClinkedIn
        public Member RemoveServices(RemoveService removeServiceRequest)
        {
            // gets member by Id
            Member currentMemb = GetMember(removeServiceRequest.MemberId);

            /* for each service requested for removal
             * check if the member currently offers such service
             * and remove that service from their list
             */
            foreach (var service in removeServiceRequest.Services)
            {
                if (currentMemb.Services.Contains(service))
                {
                    currentMemb.Services.Remove(service);
                }
            }

            // return member with removed services
            return(currentMemb);
        }
コード例 #2
0
        private void Uninstaller_Load(object sender, EventArgs e)
        {
            fileLocationLabel.Text = "";

            try
            {
                _installPath = RegistryUtils.GetRegistryEntry();
                installLocationLabel.Text = _installPath;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

            var removeFactory   = new RemoveFactory();
            var removeService   = new RemoveService(removeFactory);
            var clientRemove    = removeService.Create(FileType.Client, _installPath);
            var documentsRemove = removeService.Create(FileType.Documents, BotDirectories.baseDir);

            _commandList.Add(clientRemove);
            _commandList.Add(documentsRemove);
        }
コード例 #3
0
        private void Loading_Load(object sender, EventArgs e)
        {
            if (InstallPathExists() && !IsNewVersionAvailable())
            {
                ExecuteApplication();
            }
            else if (IsNewVersionAvailable())
            {
                NotifyNewVersionIsAvailable();
            }

            statusLabelMessage.Text    = "";
            fileDataReceivedLabel.Text = "";

            var fileProcess       = new FileProcess();
            var botDirectories    = new CreateBotDirectoriesCommand();
            var downloadFactory   = new DownloadFactory(_webClient, fileProcess);
            var downloadService   = new DownloadService(downloadFactory);
            var extractFactory    = new ExtractFactory();
            var extractService    = new ExtractService(extractFactory);
            var removeFactory     = new RemoveFactory();
            var removeService     = new RemoveService(removeFactory);
            var tesseractDownload = downloadService.Create(FileType.Tesseract, _binDirectory);
            var clientDownload    = downloadService.Create(FileType.Client, _installPath);
            var tesseractExtract  = extractService.Create(FileType.Tesseract, _binDirectory);
            var clientExtract     = extractService.Create(FileType.Client, _installPath);
            var tesseractRemove   = removeService.Create(FileType.Tesseract, _binDirectory);
            var clientRemove      = removeService.Create(FileType.Client, _installPath);

            _commandList.Add(botDirectories);
            _commandList.Add(tesseractDownload);
            _commandList.Add(clientDownload);
            _commandList.Add(tesseractExtract);
            _commandList.Add(clientExtract);
            _commandList.Add(tesseractRemove);
            _commandList.Add(clientRemove);

            Run();
        }
コード例 #4
0
 // Pass a member ID and an array of services to remove
 public ActionResult <Member> RemoveMemberServices(RemoveService removeServiceRequest) => _memberRepo
 .RemoveServices(removeServiceRequest);