public List <IFileListing> GetComDllListings(IFileListing listing) { var serializer = new Dev2JsonSerializer(); var comsController = CommunicationControllerFactory.CreateController("GetComDllListingsService"); comsController.AddPayloadArgument("currentDllListing", serializer.Serialize(listing)); var workspaceId = Connection.WorkspaceID; var result = comsController.ExecuteCommand <ExecuteMessage>(Connection, workspaceId); if (result == null || result.HasError) { if (!Connection.IsConnected) { ShowServerDisconnectedPopup(); return(new List <IFileListing>()); } if (result != null) { throw new WarewolfSupportServiceException(result.Message.ToString(), null); } throw new WarewolfSupportServiceException(ErrorResource.ServiceDoesNotExist, null); } var dllListings = serializer.Deserialize <List <IFileListing> >(result.Message.ToString()); return(dllListings); }
public DllListing(IFileListing selectedDll) { Name = selectedDll.Name; FullName = selectedDll.FullName; IsDirectory = selectedDll.IsDirectory; ClsId = (selectedDll as DllListing)?.ClsId; Is32Bit = (selectedDll as DllListing)?.Is32Bit ?? false; }
static List <IFileListing> GetDllListing(IFileListing src) { var completeList = new List <IFileListing>(); var fileSystemParent = new DllListing { Name = "File System", IsDirectory = true }; var gacItem = new DllListing { Name = "GAC", IsDirectory = true }; if (src == null) { var drives = DriveInfo.GetDrives().Where(info => info.DriveType != DriveType.CDRom && info.DriveType != DriveType.Removable); try { var listing = drives.Select(BuildDllListing); fileSystemParent.Children = listing.ToList(); } catch (Exception e) { Dev2Logger.Error(e.Message, GlobalConstants.WarewolfError); } var enumAssembly = new AssemblyCacheEnumerator(); var assemblyName = enumAssembly.GetNextAssembly(); var gacList = new List <IFileListing>(); while (assemblyName != null) { // Create the assembly description. try { var displayName = new AssemblyDescription(assemblyName).DisplayName; var name = GlobalConstants.GACPrefix + displayName; gacList.Add(new DllListing { Name = displayName, FullName = name, IsDirectory = false }); } catch (Exception e) { Dev2Logger.Error(e.Message, GlobalConstants.WarewolfError); } // Create an assembly view model. assemblyName = enumAssembly.GetNextAssembly(); } gacItem.Children = gacList; completeList.Add(fileSystemParent); completeList.Add(gacItem); } else { if (src.IsDirectory) { completeList = GetChildrenForDllListing(new DirectoryInfo(src.FullName)); } } return(completeList); }
public bool Equals(IFileListing other) { var equals = true; equals &= string.Equals(Name, other.Name); equals &= string.Equals(FullName, other.FullName); equals &= IsDirectory == other.IsDirectory; return(equals); }
public FileListingModel(IFileChooserModel model, IFileListing file, Action selected, bool useIsSelected) { _model = model; _selectedAction = selected; UseIsSelected = useIsSelected; if (file != null) { Name = file.Name; FullName = file.FullName; if (file.Children != null && file.Children.Count > 0) { Children = new AsyncObservableCollection <IFileListingModel>( file.Children.Select(input => new FileListingModel(_model, input, selected, useIsSelected))); } IsDirectory = file.IsDirectory; IsExpanderVisible = IsDirectory; IsVisible = true; _file = file; } }
public DllListingModel(IManagePluginSourceModel updateManager, IFileListing dllListing) { _updateManager = updateManager; if (dllListing != null) { Name = dllListing.Name; FullName = dllListing.FullName; if (dllListing.Children != null && dllListing.Children.Count > 0) { Children = new AsyncObservableCollection <IDllListingModel>( dllListing.Children.Select(input => new DllListingModel(_updateManager, input))); } IsDirectory = dllListing.IsDirectory; IsExpanderVisible = IsDirectory; IsVisible = true; _dllListing = dllListing; } _isCom = false; }
public IList <IFileListing> FetchFiles(IFileListing file) { var serializer = new Dev2JsonSerializer(); var comsController = CommunicationControllerFactory.CreateController("GetFiles"); comsController.AddPayloadArgument("fileListing", serializer.Serialize(file)); var workspaceId = Connection.WorkspaceID; var result = comsController.ExecuteCommand <ExecuteMessage>(Connection, workspaceId); if (result.HasError) { if (!Connection.IsConnected) { ShowServerDisconnectedPopup(); return(new List <IFileListing>()); } throw new WarewolfSupportServiceException(result.Message.ToString(), null); } var fileListings = serializer.Deserialize <List <IFileListing> >(result.Message.ToString()); return(fileListings); }
public IList <IFileListing> GetComDllListings(IFileListing listing) => _queryProxy.GetComDllListings(listing);
public IList <IFileListing> FetchFiles(IFileListing file) { var fileListings = _queryManager.FetchFiles(file); return(FilterFileListings(fileListings)); }
public bool Equals(IFileListing other) => string.Equals(Name, other.Name) && string.Equals(FullName, other.FullName) && IsDirectory == other.IsDirectory;
public FileListingModel(IFileChooserModel model, IFileListing file, Action selected) : this(model, file, selected, false) { }
public FileListing(IFileListing selectedDll) { Name = selectedDll.Name; FullName = selectedDll.FullName; IsDirectory = selectedDll.IsDirectory; }
public IList <IFileListing> GetDllListings(IFileListing listing) { return(_queryProxy.GetDllListings(listing)); }