예제 #1
0
		internal void AddRepository(Repository repository)
		{
			//Logger.LogMethod();
			Logger.LogDebug("repository: " + repository.DefaultLibraryUrl);

			this.repositories.Add(repository.GetId(), repository);
		}
예제 #2
0
		private Artifact BuildArtifact(Repository defaultRepository, Browser.BrowseDialog dlg)
		{
			Uri uri = new Uri(dlg.FileUrl);
			Repository selectedRepository = this.GetRepository(dlg.Url);
			selectedRepository = selectedRepository == null ? defaultRepository : selectedRepository;
			Artifact artifact = new Artifact(uri, selectedRepository);
			artifact.AddFieldRange(dlg.Fields);
			artifact.SetContentType(dlg.ContentType);
			selectedRepository.AddArtifact(artifact);

			return artifact;
		}
예제 #3
0
		private Browser.BrowseDialog CreateBrowseDialog(Browser.BrowseDialog.DialogMode mode, string filter, Repository defaultRepository)
		{
			Logger.LogDebug("defaultRepository: " + defaultRepository.DefaultLibraryUrl);

			Browser.BrowseDialog dlg = new Browser.BrowseDialog(defaultRepository.DefaultLibraryUrl);
			dlg.Filters = filter;
			dlg.Mode = mode;

			// add sites to known sites combo
			foreach (Repository repository in this.repositories.Values)
			{
				foreach (string site in repository.Sites)
				{
					dlg.AddKnownSite(site, site);
				}
			}
			return dlg;
		}
예제 #4
0
		private void Init(Uri documentUrl, Repository repository)
		{
			try
			{
				//Logger.LogMethod();

				this.repository = repository;
				this.uri = documentUrl;
				FetchVersions();
			}
			catch (Exception ex)
			{
				Logger.LogError(ex);
				throw;
			}
		}
예제 #5
0
		public Artifact(Uri documentUrl, Repository repository)
		{
			Init(documentUrl, repository);
		}
예제 #6
0
		public Artifact(string documentId, Repository repository)
        {
			Init(new Uri(repository.Scheme + "://" + documentId), repository);
		}