Example #1
0
        public void ShareFile(string filePath, string hashAlgo = "SHA1")
        {
            SharedFile sharedFile = SharedFile.ShareFile(filePath, hashAlgo, this, _syncCxt);

            lock (_sharedFiles)
            {
                if (!_sharedFiles.ContainsKey(sharedFile.MetaData.FileID))
                {
                    _sharedFiles.Add(sharedFile.MetaData.FileID, sharedFile);

                    if (FileAdded != null)
                    {
                        RaiseEventFileAdded(sharedFile);
                    }

                    //advertise file
                    SendFileAdvertisement(sharedFile);
                }
            }
        }