Пример #1
0
        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);
        }
Пример #2
0
 public DllListing(IFileListing selectedDll)
 {
     Name        = selectedDll.Name;
     FullName    = selectedDll.FullName;
     IsDirectory = selectedDll.IsDirectory;
     ClsId       = (selectedDll as DllListing)?.ClsId;
     Is32Bit     = (selectedDll as DllListing)?.Is32Bit ?? false;
 }
Пример #3
0
        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);
        }
Пример #4
0
        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);
        }
Пример #5
0
 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;
     }
 }
Пример #6
0
 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;
 }
Пример #7
0
        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);
Пример #9
0
        public IList <IFileListing> FetchFiles(IFileListing file)
        {
            var fileListings = _queryManager.FetchFiles(file);

            return(FilterFileListings(fileListings));
        }
Пример #10
0
 public bool Equals(IFileListing other) => string.Equals(Name, other.Name) && string.Equals(FullName, other.FullName) && IsDirectory == other.IsDirectory;
Пример #11
0
 public FileListingModel(IFileChooserModel model, IFileListing file, Action selected)
     : this(model, file, selected, false)
 {
 }
Пример #12
0
 public FileListing(IFileListing selectedDll)
 {
     Name        = selectedDll.Name;
     FullName    = selectedDll.FullName;
     IsDirectory = selectedDll.IsDirectory;
 }
 public IList <IFileListing> GetDllListings(IFileListing listing)
 {
     return(_queryProxy.GetDllListings(listing));
 }