Пример #1
0
 public void addFolder(String folder)
 {
     if (!FileDiggerModel.getInstance().OwnFolders.Contains(folder))
     {
         FileDiggerModel.getInstance().addFolder(folder);
     }
 }
Пример #2
0
        public void deletePeer(String peer)
        {
            this.peers.Remove(peer);

            StreamWriter sw = new StreamWriter(peerConfig, false);

            foreach (string p in FileDiggerModel.getInstance().Peers)
            {
                sw.WriteLine(p);
            }
            sw.Close();
        }
Пример #3
0
        public List <String> findFile(String name)
        {
            List <String> result = new List <string>();

            foreach (String folder in FileDiggerModel.getInstance().OwnFolders)
            {
                try
                {
                    DirectoryInfo di = new DirectoryInfo(folder);
                    result.AddRange(this.findFile(name, di));
                }
                catch (Exception openException)
                {
                }
            }
            return(result);
        }
Пример #4
0
        public void addPeer(String peer)
        {
            if (peer == null || peer.Trim().Equals(""))
            {
                return;
            }
            foreach (string p in FileDiggerModel.getInstance().Peers)
            {
                if (p.Equals(peer, StringComparison.InvariantCultureIgnoreCase))
                {
                    return;
                }
            }
            FileDiggerModel.getInstance().Peers.Add(peer);
            StreamWriter sw = new StreamWriter(this.peerConfig, true);

            sw.WriteLine(peer);
            sw.Close();
        }
Пример #5
0
 public void deleteSharedFolder(String folder)
 {
     FileDiggerModel.getInstance().deleteSharedFolder(folder);
 }
Пример #6
0
        public List <String> findFile(String name)
        {
            List <String> rslt = FileDiggerModel.getInstance().findFile(name);

            return(rslt);
        }
Пример #7
0
 public List <String> findSharedFolders()
 {
     return(FileDiggerModel.getInstance().OwnFolders);
 }
Пример #8
0
 public List <String> findPeers()
 {
     return(FileDiggerModel.getInstance().Peers);
 }
Пример #9
0
 public void deletePeer(String peer)
 {
     FileDiggerModel.getInstance().deletePeer(peer);
 }
Пример #10
0
 public void addPeer(String peer)
 {
     FileDiggerModel.getInstance().addPeer(peer);
 }