public NodeVM(IProjectClient client, FolderItem item) { this.Entity = item; this.Name = string.Format("{0}", item.Name); this.Details = string.Format("{0}", item.Size); this.LoadImageAsync(client); }
public ProjectMembersPage(IProjectClient client) { this.client = client; this.Title = "Members"; this.RefreshAsync(); this.Content = new ListView { ItemsSource = items, ItemTemplate = new DataTemplate(() => { var cell = new TextCell(); cell.SetBinding <PersonVM>(TextCell.TextProperty, _ => _.FullName); cell.SetBinding <PersonVM>(TextCell.DetailProperty, _ => _.Details); return(cell); }), IsPullToRefreshEnabled = true, RefreshCommand = new Command(async() => { try { await this.RefreshAsync(); } finally { ((ListView)this.Content).IsRefreshing = false; } }), }; }
public ProjectToDosPage(IProjectClient client) { this.client = client; this.Title = "ToDos"; this.RefreshAsync(); var listView = new ListView { ItemsSource = items, ItemTemplate = new DataTemplate(() => { var cell = new TextCell(); cell.SetBinding <Todo>(TextCell.TextProperty, _ => _.Label); cell.SetBinding <Todo>(TextCell.DetailProperty, _ => _.Description); return(cell); }), IsPullToRefreshEnabled = true, }; listView.RefreshCommand = new Command(async() => { try { await this.RefreshAsync(); } finally { listView.IsRefreshing = false; } }); this.Content = listView; }
private GitLabClient(string hostUrl, string apiToken) { _api = new API(hostUrl, apiToken); Users = new UserClient(_api); Projects = new ProjectClient(_api); Issues = new IssueClient(_api); }
public GivenAnAssignmentClientInstance() { IApplicationContext applicationContext = new ApplicationContext(); IConfigurationRoot configurationRoot = ConfigurationRootFactory.Create(applicationContext); IConfigurationGetter configurationGetter = new ConfigurationGetter(configurationRoot); var projectContextOptions = configurationGetter.GetOptions <ProjectContextOptions>(); var clientOptions = configurationGetter.GetOptions <CsomClientOptions>(); var projectContext = ProjectContextFactory.Build(projectContextOptions); _projectClient = new ProjectClient(projectContext, clientOptions); _taskClient = new TaskClient(projectContext, clientOptions); _resourceClient = new EnterpriseResourceClient(projectContext, clientOptions); _client = new AssignmentClient(projectContext, clientOptions); _publishedProject = CreateTestProject().Result; _publishedTask = CreateTestTask().Result; _enterpriseResource = CreateTestResource().Result; _enterpriseResource2 = CreateTestResource().Result; _publishedProject = _projectClient.LinkToEnterpriseResources(_publishedProject, new [] { _enterpriseResource, _enterpriseResource2 }).Result; }
public ProjectDetailsPage(IProjectClient client, Project entity) { this.client = client; this.Title = "General"; this.Content = new ScrollView { Content = new StackLayout { Padding = 20, Spacing = 10, Children = { new Image() { Source = ImageSource.FromStream(() => new ThumbnailImageSource(client).GetStream(entity.ThumbnailUrl).Result), Aspect = Aspect.AspectFit, }, new Label { Text = entity.Name, }, new Label { Text = string.Format("Uri: {0}", client.ServiceUri.AbsoluteUri), }, new Label { Text = string.Format("Location: {0}", entity.Location), }, new Label { Text = string.Format("Size: {0}", entity.Size), }, new Label { Text = string.Format("Created by '{0}' on {1}", entity.CreatedBy.Email, entity.CreatedOn.GetValueOrDefault()), }, new Label { Text = string.Format("Modified by '{0}' on {1}", entity.ModifiedBy.Email, entity.ModifiedOn.GetValueOrDefault()), }, new Label { Text = string.Format("Last visited on {0}", entity.LastVisited.GetValueOrDefault()), }, } }, }; }
private void InitializeFakeObjects() { _httpClientFactoryStub = new Mock <IHttpClientFactory>(); var configurationClient = new ConfigurationClient(_httpClientFactoryStub.Object); _projectClient = new ProjectClient(configurationClient, new GetProjectOperation(_httpClientFactoryStub.Object), new DownloadProjectConfiguration(_httpClientFactoryStub.Object)); }
private GitLabClient(string hostUrl, string apiToken) { _api = new API(hostUrl, apiToken); Users = new UserClient(_api); Projects = new ProjectClient(_api); Issues = new IssueClient(_api); Groups = new NamespaceClient(_api); }
public ViewVM(IProjectClient client, Trimble.Connect.Client.Models.View entity) { this.Entity = entity; this.Name = entity.Name; this.Description = entity.Description; this.LoadImageAsync(client); }
private async void LoadImageAsync(IProjectClient client) { if (this.Entity.ThumbnailUrl != null && this.Entity.ThumbnailUrl.StartsWith("http")) { ImageSource = ImageSource.FromStream(() => new ThumbnailImageSource(client).GetStream(this.Entity.ThumbnailUrl).Result); NotifyPropertyChanged("ImageSource"); } }
GitLabClient(string hostUrl, string apiToken) { _api = new API(hostUrl, apiToken); Users = new UserClient(_api); Projects = new ProjectClient(_api); Issues = new IssueClient(_api); Groups = new NamespaceClient(_api); }
private GitLabClient(string hostUrl, string apiToken, IHttpRequestorFactory httpRequestorFactory) { _api = new API(hostUrl, apiToken, httpRequestorFactory); Users = new UserClient(_api); Projects = new ProjectClient(_api); Issues = new IssueClient(_api); Groups = new NamespaceClient(_api); }
/// <summary> /// Constructor. /// </summary> /// <param name="projectClient">Drawboard project API client.</param> public ProjectListViewModel(IProjectClient projectClient) { if (null == projectClient) { throw new ArgumentNullException("projectClient"); } _projectClient = projectClient; }
GitLabClient(string hostUrl, string apiToken, ApiVersion apiVersion) { api = new Api(hostUrl, apiToken); api._ApiVersion = apiVersion; Users = new UserClient(api); Projects = new ProjectClient(api); Issues = new IssueClient(api); Groups = new NamespaceClient(api); }
private GitLabClient(string hostUrl, string apiToken, string accessToken) { _api = new API(hostUrl, apiToken, accessToken); Users = new UserClient(_api); Projects = new ProjectClient(_api); Issues = new IssueClient(_api); Groups = new NamespaceClient(_api); Labels = new LabelClient(_api); }
public NodeVM(IProjectClient client, int level, FolderItem item) { this.Item = item; this.Name = string.Format("{0}{1}", new string(' ', 4 * level), item.Name); this.Details = string.Format("{0}{1}", new string(' ', 4 * level), item.Size); if (this.Item.ThumbnailUrl != null && this.Item.ThumbnailUrl.StartsWith("http")) { this.ImageSource = ImageSource.FromStream(() => new ThumbnailImageSource(client).GetStream(this.Item.ThumbnailUrl).Result); this.NotifyPropertyChanged("ImageSource"); } }
public GivenAProjectClientInstance() { IApplicationContext applicationContext = new ApplicationContext(); IConfigurationRoot configurationRoot = ConfigurationRootFactory.Create(applicationContext); IConfigurationGetter configurationGetter = new ConfigurationGetter(configurationRoot); var projectContextOptions = configurationGetter.GetOptions <ProjectContextOptions>(); var clientOptions = configurationGetter.GetOptions <CsomClientOptions>(); _projectContext = ProjectContextFactory.Build(projectContextOptions); _client = new ProjectClient(_projectContext, clientOptions); _enterpriseResourceClient = new EnterpriseResourceClient(_projectContext, clientOptions); }
public GivenATaskClientInstance() { IApplicationContext applicationContext = new ApplicationContext(); IConfigurationRoot configurationRoot = ConfigurationRootFactory.Create(applicationContext); IConfigurationGetter configurationGetter = new ConfigurationGetter(configurationRoot); var projectContextOptions = configurationGetter.GetOptions <ProjectContextOptions>(); var clientOptions = configurationGetter.GetOptions <CsomClientOptions>(); var projectContext = ProjectContextFactory.Build(projectContextOptions); _projectClient = new ProjectClient(projectContext, clientOptions); _client = new TaskClient(projectContext, clientOptions); _customFieldClient = new CustomFieldClient(projectContext, clientOptions); _entityTypeClient = new EntityTypeClient(projectContext, clientOptions); _publishedProject = CreateTestProject().Result; }
public ProjectPage(IProjectClient client, Project entity) { this.client = client; this.entity = entity; this.ToolbarItems.Add( new ToolbarItem { Text = "Stats", Command = new Command(() => this.Navigation.PushAsync(new StatsPage())) }); this.Children.Add(new ProjectDetailsPage(client, entity)); this.Children.Add(new ProjectMembersPage(client)); this.Children.Add(new ProjectFilesPage(client, entity.RootFolderIdentifier)); this.Children.Add(new ProjectToDosPage(client)); this.Children.Add(new ProjectViewsPage(client)); }
public ProjectFilesPage(IProjectClient client, string rootFolderId) { this.client = client; this.rootFolderId = rootFolderId; this.Title = "Files"; this.RefreshAsync(); var listView = new ListView { ItemsSource = this.items, ItemTemplate = new DataTemplate(() => { var cell = new ImageCell(); cell.SetBinding <NodeVM>(TextCell.TextProperty, _ => _.Name); cell.SetBinding <NodeVM>(TextCell.DetailProperty, _ => _.Details); cell.SetBinding <NodeVM>(ImageCell.ImageSourceProperty, _ => _.ImageSource); cell.Tapped += async delegate { var node = (NodeVM)cell.BindingContext; await this.Navigation.PushAsync(new FilePage(client, node.Item)); }; return(cell); }), IsPullToRefreshEnabled = true, }; listView.RefreshCommand = new Command(async() => { try { await this.RefreshAsync(); } finally { listView.IsRefreshing = false; } }); this.Content = listView; }
public DependantResourceHandler( IProjectClient projectClient, IMarkSessionRepository markSessionRepository, IMetadataClient metadataClient, IScenarioClient scenarioClient, IResultConfigClient resultConfigClient, ISimPlanClient simPlanClient, ISimRunClient simRunClient, IResultDataClient resultDataClient ) { _projectClient = projectClient; _markSessionRepository = markSessionRepository; _metadataClient = metadataClient; _scenarioClient = scenarioClient; _resultConfigClient = resultConfigClient; _simPlanClient = simPlanClient; _simRunClient = simRunClient; _resultDataClient = resultDataClient; }
private async void LoadImageAsync(IProjectClient client) { if (string.IsNullOrEmpty(this.Entity.ParentVersionIdentifier)) { return; } try { var info = await client.Files.GetFileInfoAsync(this.Entity.Identifier).ConfigureAwait(false); if (info.ThumbnailUrl != null && info.ThumbnailUrl.StartsWith("http")) { ImageSource = ImageSource.FromStream(() => new ThumbnailImageSource(client).GetStream(info.ThumbnailUrl).Result); NotifyPropertyChanged("ImageSource"); } } catch (Exception e) { Console.WriteLine(e.ToString()); } }
public FileHistoryPage(IProjectClient client, FolderItem item) { this.client = client; this.item = item; this.Title = "History"; this.RefreshAsync(); var listView = new ListView { ItemsSource = items, ItemTemplate = new DataTemplate(() => { var cell = new ImageCell(); cell.SetBinding <NodeVM>(TextCell.TextProperty, _ => _.Name); cell.SetBinding <NodeVM>(TextCell.DetailProperty, _ => _.Details); cell.SetBinding <NodeVM>(ImageCell.ImageSourceProperty, _ => _.ImageSource); return(cell); }), IsPullToRefreshEnabled = true, }; listView.RefreshCommand = new Command(async() => { try { await this.RefreshAsync(); } finally { listView.IsRefreshing = false; } }); this.Content = listView; }
public ModuleFeedClient(IProjectClient projectClient, IConfigurationClient configurationClient) { _projectClient = projectClient; _configurationClient = configurationClient; }
public AllocationController(IAllocationDataGateway gateway, IProjectClient client) { _gateway = gateway; _client = client; }
public ProjectsTests() { projects = Config.Connect().Projects; CreateProject(out created, "default-project-tests", false); }
public ThumbnailImageSource(IProjectClient client) { this.client = client; this.CachingEnabled = false; this.CacheValidity = TimeSpan.FromDays(1); }
public FileDetailsPage(IProjectClient client, FolderItem item) { this.client = client; this.item = item; this.Title = "File Details"; Entry format; this.Content = new StackLayout { Padding = 20, Spacing = 20, Children = { new Image() { Source = ImageSource.FromStream(() => new ThumbnailImageSource(client).GetStream(this.item.ThumbnailUrl).Result), Aspect = Aspect.AspectFit, }, new Label { Text = item.Name, HorizontalOptions = LayoutOptions.Center, }, new Label { Text = string.Format("Size={0}", item.Size), HorizontalOptions = LayoutOptions.Center, }, (format = new Entry { Placeholder = "format", Keyboard = Keyboard.Email, }), new Button { Text = "Download", Command = new Command(async() => { await this.Download(format.Text); }) }, (this.progressBar = new ProgressBar { }), (this.stat = new Label { Text = string.Empty, HorizontalOptions = LayoutOptions.Center, }), } }; }
public ProjectsTests() { _projects = Config.Connect().Projects; CreateProject(out _created, "default"); }
public StoryController(IStoryDataGateway gateway, IProjectClient client) { _gateway = gateway; _client = client; }
public ProjectHooksClientTests() { projects = Config.Connect().Projects; }
public TimeEntryController(ITimeEntryDataGateway gateway, IProjectClient client) { _gateway = gateway; _client = client; }
public FilePage(IProjectClient client, FolderItem item) { this.client = client; Children.Add(new FileDetailsPage(client, item)); Children.Add(new FileHistoryPage(client, item)); }