/// <summary> /// TODO make this thread safe /// </summary> public string[] ListServers() { // Only show Projects/Servers if Projects are shared. if (!RemotingServer.SharedProjectsGetter()) { return(Enumerable.Empty <string>().ToArray()); } if (m_allServers == null) { PopulateServerList(); Debug.Assert(m_allServers != null); } return(m_allServers.ToArray()); }
/// ------------------------------------------------------------------------------------ /// <summary> /// Enables/disables sharing of projects from this machine. /// </summary> /// <param name="enableSharingOfProjects">if set to <c>true</c> enable sharing of /// projects; otherwise, disable sharing.</param> /// <exception cref="SecurityException">if called from a remote machine or if current /// user does not have permission to write to HKLM</exception> /// ------------------------------------------------------------------------------------ public void ShareProjects(bool enableSharingOfProjects) { EnsureClientIsLocalHost(); RemotingServer.SharedProjectsSetter(enableSharingOfProjects); }
/// ------------------------------------------------------------------------------------ /// <summary> /// Gets a value indicating whether projects are shared. (Should only be called on local /// machine.) /// </summary> /// <returns> /// true if project are being shared from this machine. /// </returns> /// <exception cref="SecurityException">If called from a remote machine.</exception> /// ------------------------------------------------------------------------------------ public bool AreProjectShared() { EnsureClientIsLocalHost(); return(RemotingServer.SharedProjectsGetter()); }