Exemple #1
0
        private void HandleGetStatusRequest(NamedPipeServer.Connection connection)
        {
            NamedPipeMessages.GetStatus.Response response = new NamedPipeMessages.GetStatus.Response();
            response.EnlistmentRoot = this.enlistment.EnlistmentRoot;
            response.RepoUrl        = this.enlistment.RepoUrl;
            response.ObjectsUrl     = this.enlistment.ObjectsEndpointUrl;
            response.LockStatus     = this.gvfsLock != null?this.gvfsLock.GetStatus() : "Unavailable";

            response.DiskLayoutVersion = RepoMetadata.GetCurrentDiskLayoutVersion();

            switch (this.currentState)
            {
            case MountState.Mounting:
                response.MountStatus = NamedPipeMessages.GetStatus.Mounting;
                break;

            case MountState.Ready:
                response.MountStatus = NamedPipeMessages.GetStatus.Ready;
                response.BackgroundOperationCount = this.gvfltCallbacks.GetBackgroundOperationCount();
                break;

            case MountState.Unmounting:
                response.MountStatus = NamedPipeMessages.GetStatus.Unmounting;
                break;

            case MountState.MountFailed:
                response.MountStatus = NamedPipeMessages.GetStatus.MountFailed;
                break;

            default:
                response.MountStatus = NamedPipeMessages.UnknownGVFSState;
                break;
            }

            connection.TrySendResponse(response.ToJson());
        }