Exemple #1
0
 private Workspace(IDatabaseWorkspace entity)
     : this(entity as IWorkspace, entity.SyncStatus, entity.LastSyncErrorMessage, entity.IsDeleted)
 {
     SyncStatus           = entity.SyncStatus;
     LastSyncErrorMessage = entity.LastSyncErrorMessage;
     IsDeleted            = entity.IsDeleted;
 }
        public SelectableWorkspaceViewModel(IDatabaseWorkspace workspace, bool selected)
        {
            Ensure.Argument.IsNotNull(workspace, nameof(workspace));

            Selected      = selected;
            WorkspaceId   = workspace.Id;
            WorkspaceName = workspace.Name;
        }
Exemple #3
0
 private IEnumerable <TagSuggestion> getTagSuggestions(int count, IDatabaseWorkspace workspace)
 {
     for (int i = 0; i < count; i++)
     {
         var tag         = Substitute.For <IDatabaseTag>();
         var workspaceId = workspace.Id;
         tag.WorkspaceId.Returns(workspaceId);
         tag.Workspace.Returns(workspace);
         yield return(new TagSuggestion(tag));
     }
 }
Exemple #4
0
            private IEnumerable <TagSuggestion> getTagSuggestions(int count, IDatabaseWorkspace workspace)
            {
                for (int i = 0; i < count; i++)
                {
                    /* Do not inline 'workspace.Id' into another .Return() call
                     * because it's a proxy that won't work later on!
                     * This must be cached before usage.
                     */
                    var workspaceId = workspace.Id;

                    var tag = Substitute.For <IDatabaseTag>();
                    tag.Id.Returns(i);
                    tag.WorkspaceId.Returns(workspaceId);
                    tag.Workspace.Returns(workspace);
                    tag.Name.Returns($"Tag{i}");

                    yield return(new TagSuggestion(tag));
                }
            }
Exemple #5
0
 public RealmWorkspace(IDatabaseWorkspace entity, Realms.Realm realm)
     : this(entity as IWorkspace, realm)
 {
     IsDirty = entity.IsDirty;
 }
Exemple #6
0
 public static Workspace From(IDatabaseWorkspace entity)
 => new Workspace(entity);
Exemple #7
0
 private WorkspaceGroupedSuggestionsCollection workspaceGroupedSuggestionCollection(IDatabaseWorkspace workspace)
 => new WorkspaceGroupedSuggestionsCollection(
     workspace.Name,
     workspace.Id,
     new[] { ProjectSuggestion.NoProject(workspace.Id, workspace.Name) });