Exemplo n.º 1
0
 public void OnRefresh(ServiceInfo client)
 {
     if (client == null)
     {
         using (client = Client(CurrentServer.EndPoint as EndpointAddress))
         {
             if (client != null)
             {
                 DirectoryInfo = client.GetDirectoryInfo(false);
                 FormatDirectoryInfo();
             }
         }
     }
     else
     {
         DirectoryInfo = client.GetDirectoryInfo(false);
         FormatDirectoryInfo();
     }
 }
Exemplo n.º 2
0
 private FileTreeModel FormatDirectoryNode(DirectoryNode node, FileTreeModel parent)
 {
     FileTreeModel tree = new FileTreeModel();
     tree.Node = node;
     tree.Id = node.Path;
     tree.Name = node.Name;
     tree.IsFolder = !node.IsFile;
     if(node.IsFile)
     {
         tree.Icon = GetIconByFileType(node.Extension, false);
     }
     else
     {
         tree.Icon = GetIconByFileType("folder", false);
     }
     tree.Parent = parent;
     if (node.Children != null)
     {
         foreach (var child in node.Children)
         {
             tree.Children.Add(FormatDirectoryNode(child, tree));
         }
     }
     return tree;
 }
Exemplo n.º 3
0
 public void FileTreeSelected(object obj)
 {
     CurrentSelectFileNode = (obj as FileTreeModel);
     CurrentSelectFile = (CurrentSelectFileNode.Node as DirectoryNode);
     if (CurrentServer == null)
         return;
     using (var client = Client(CurrentServer.EndPoint as EndpointAddress))
     {
         if (client != null)
         {
             FileInfo = new ObservableCollection<FileInfoItemModel>();
             foreach (var itm in client.GetFileInfo(CurrentSelectFile.Path, CurrentSelectFile.IsFile))
             {
                 FileInfo.Add(new FileInfoItemModel(itm.Name,itm.Value));
             }//.Items;
         }
     }
 }