using System; using System.Collections; using System.Collections.Generic; using System.Text; using Interop.VixCOM; namespace Vestris.VMWareLib { /// /// A VMWare Shared Folder. /// A shared folder is a local mount point in the guest file system which mounts a shared folder exported by the host. /// Shared folders are not supported for the following guest operating systems: /// Windows ME, Windows 98, Windows 95, Windows 3.x, and DOS. /// public class VMWareSharedFolder { private string _shareName; private string _hostPath; private int _flags; /// /// A shared folder defined by share name and host path. /// /// share name /// host path public VMWareSharedFolder(string shareName, string hostPath) : this(shareName, hostPath, 0) { } /// /// A shared folder defined by share name, host path and additional flags. /// /// share name /// host path /// additional flags public VMWareSharedFolder(string shareName, string hostPath, int flags) { _shareName = shareName; _hostPath = hostPath; _flags = flags; } /// /// The name of the folder. /// public string ShareName { get { return _shareName; } } /// /// Host path this folder is mounted from. /// Only absolute paths should be used for files in the guest; the resolution of relative paths is not specified. /// public string HostPath { get { return _hostPath; } } /// /// Shared folder flags, one of the following. /// /// VIX_SHAREDFOLDER_WRITE_ACCESS: allow write access /// /// public int Flags { get { return _flags; } } /// /// Compare with another instance of a shared folder or object. /// /// another shared folder /// true if the shared folders are identical public override bool Equals(object obj) { if (obj is VMWareSharedFolder) { VMWareSharedFolder sharedFolder = (VMWareSharedFolder)obj; return sharedFolder._hostPath == _hostPath && sharedFolder._shareName == _shareName; } return base.Equals(obj); } /// /// Serves as a hash function for a particular type. /// /// A hash code for the current System.Object. public override int GetHashCode() { return base.GetHashCode(); } } }