public string RunCommand(string cmd) { string fsCommand = cmd.Split(' ')[0]; string[] args = cmd.Split(' ').Skip(1).ToArray(); try { IFileServiceCommand fsCommandObj = FileServiceCommands.NewCommand(fsCommand.ToLower()); string answer = fsCommandObj.Run(OperationContext.Current.SessionId, args); OperationContext.Current.GetCallbackChannel <IFileServiceCallback>().Notify(FileServiceSession.GetUser(OperationContext.Current.SessionId) + " " + fsCommandObj.Notify(args)); return(answer); } catch (FileServiceCommandExeption e) { return($"Error: {e.Message}"); } finally { if (Monitor.IsEntered(VirtualFileSystem.Lock)) { Monitor.Exit(VirtualFileSystem.Lock); } } }