/// <summary> /// Initializes a new instance of the <see cref="VCard" /> class. /// </summary> public VCard() { // Per Microsoft best practices, string properties should // never return null. String properties should always // return String.Empty. _additionalNames = string.Empty; _department = string.Empty; _displayName = string.Empty; _familyName = string.Empty; _formattedName = string.Empty; _givenName = string.Empty; _mailer = string.Empty; _namePrefix = string.Empty; _nameSuffix = string.Empty; _office = string.Empty; _organization = string.Empty; _productId = string.Empty; _role = string.Empty; _timeZone = string.Empty; _title = string.Empty; _uniqueId = string.Empty; Categories = new StringCollection(); Certificates = new CertificateCollection(); DeliveryAddresses = new DeliveryAddressCollection(); DeliveryLabels = new DeliveryLabelCollection(); EmailAddresses = new EmailAddressCollection(); _nicknames = new StringCollection(); _notes = new NoteCollection(); Phones = new PhoneCollection(); _photos = new PhotoCollection(); Sources = new SourceCollection(); Websites = new WebsiteCollection(); }
private async Task TryExportation(WebsiteCollection websiteCollection) { foreach (var webSite in websiteCollection) { var imagesFolder = ConfigurationManager.AppSettings["ImagesFolder"]; var siteDir = Path.Combine(DefaultDirectoryPath, webSite.ProductName, webSite.Version, webSite.Language); var exportationPath = DefaultDirectoryPath + "/" + GenerateMkdocsPath(webSite); await exporter.Export(webSite, new ConfigurationPaths(exportationPath, imagesFolder, siteDir)); } }
private async Task Export(WebsiteCollection websiteCollection) { try { await TryExportation(websiteCollection); ToastNotificator.NotifyMessage("Exportación realizada con éxito"); } catch (Exception ex) { EventBus.Send(new OnUserMessageRequest("Ha ocurrido un error en la exportación")); } }
public virtual async Task<WebsiteCollection> Construct(Product product, List<string> languages) { var websites = new WebsiteCollection(); foreach (var version in product.Versions) { foreach (var language in languages) { var website = await CreateWebsiteWithAllDocumentsFor(product, version, language); if (website.HasNotDocuments()) continue; websites.Add(website); } } return websites; }
public void AddWebsiteToCollection() { var website = new Website() { MainUrl = Website.MainUrl, CartButtonXPatch = Website.CartButtonXPatch, NameXPath = Website.NameXPath, PriceXPath = Website.PriceXPath }; _websiteRepository.Add(website); WebsiteCollection.Add(website); }
public async Task export_all_documentation_for_selected_product_in_spanish_and_english() { topicRepo.GetAllTopicsSummariesFor(Arg.Any<string>()).Returns(Task.FromResult(new List<TopicSummary>())); productRepo.GetProduct(OpportunityId).Returns(Task.FromResult(new Product(OpportunityId, "", new List<ProductVersion>()))); StubOutProductRepoToReturnAsAllProducts(allProducts); StubOutProductRepoToReturnAsAllVersionsWhenIsCalledWithProduct(versions, OpportunityId); var viewModel = await InitializeTopicGridVMWith(topicRepo, productRepo, exporter, websiteConstructor); viewModel.SelectedProduct = new DisplayableProduct { ProductId = OpportunityId, ProductName = "Any" }; var websiteCollection = new WebsiteCollection { WebsiteWithADocument}; WhenWebConstructorIsCalledWith(OpportunityId, languages).Returns(Task.FromResult(websiteCollection)); await ExecuteExportSelectedProductCommandFrom(viewModel); exporter.Received().Export(WebsiteWithADocument, Arg.Any<ConfigurationPaths>()); }
public void DeleteElement(Website selectedItem) { _websiteRepository.Delete(selectedItem); WebsiteCollection.Remove(selectedItem); }