示例#1
0
        /// <inheritdoc />
        public override Task OnDisconnectedAsync(HubConnectionContext connection)
        {
            _connections.Remove(connection);
            var emptyGroups = _groups.RemoveDisconnectedConnection(connection.ConnectionId);

            var actions = new List <DirectoryAction>();

            actions.Add(DirectoryAction.RemoveConnection(_hubName, connection.ConnectionId));

            if (!string.IsNullOrEmpty(connection.UserIdentifier))
            {
                actions.Add(DirectoryAction.RemoveUser(_hubName, connection.UserIdentifier));
            }

            actions.AddRange(emptyGroups.Select(g => DirectoryAction.RemoveGroup(_hubName, g)));

            return(_localDirectory.PerformActions(actions));
        }
 private void UploadDirectoryToolStripMenuItem_Click(object sender, System.EventArgs e)
 {
     DirectoryAction?.Invoke(this, null, ActionType.UPLOAD_DIRECTORY);
 }
 public void ExecForDirectory(string par1)
 {
     DirectoryAction.Invoke(par1, Parameter);
 }
 private void NewDirectoryToolStripMenuItem_Click(object sender, System.EventArgs e)
 {
     DirectoryAction?.Invoke(this, null, ActionType.CREATE_DIRECTORY);
 }