Beispiel #1
0
        private void ConvertFlashSolution(IProgressMonitor monitor)
        {
            ResourceFolder parentFolder = ((ResourceGroup)this.RootFolder.Items[0]).RootFolder;

            if (Directory.Exists(this.itemDirectory))
            {
                this.LoadFlashResource(monitor, parentFolder, this.itemDirectory);
            }
        }
 public ResourceItem FindResourceItem(ResourceData resourceData)
 {
     if (resourceData.Type == EnumResourceType.Normal || resourceData.Type == EnumResourceType.MarkedSubImage)
     {
         return(this.FindResourceItem(resourceData.Path));
     }
     if (resourceData.Type == EnumResourceType.PlistSubImage)
     {
         ResourceFolder resourceItem = this.FindResourceItem(resourceData.Plist) as ResourceFolder;
         if (resourceItem != null)
         {
             return(resourceItem.Items.FirstOrDefault <ResourceItem>((Func <ResourceItem, bool>)(a => a.Name.Equals(resourceData.Path, StringComparison.OrdinalIgnoreCase))));
         }
     }
     return((ResourceItem)null);
 }
Beispiel #3
0
 private void LoadFlashResource(IProgressMonitor monitor, ResourceFolder parentFolder, string parentDirectory)
 {
     string[] fileSystemEntries = Directory.GetFileSystemEntries(parentDirectory);
     string[] array             = fileSystemEntries;
     for (int i = 0; i < array.Length; i++)
     {
         string       itemFileName = array[i];
         ResourceItem resourceItem = ProjectsService.Instance.ReadResourceItem(monitor, itemFileName);
         if (resourceItem != null)
         {
             parentFolder.Items.Add(resourceItem);
         }
         if (resourceItem is ResourceFolder)
         {
             this.LoadFlashResource(monitor, resourceItem as ResourceFolder, resourceItem.FullPath);
         }
     }
 }
 public ResourceItem FindResourceItem(ResourceItem parentItem, string fullPath)
 {
     if (parentItem.FullPath.Equals(fullPath, StringComparison.OrdinalIgnoreCase))
     {
         return(parentItem);
     }
     if (parentItem is ResourceFolder)
     {
         ResourceFolder resourceFolder = parentItem as ResourceFolder;
         if (fullPath.StartsWith(resourceFolder.FullPath, StringComparison.OrdinalIgnoreCase))
         {
             foreach (ResourceItem parentItem1 in (Collection <ResourceItem>)resourceFolder.Items)
             {
                 ResourceItem resourceItem = this.FindResourceItem(parentItem1, fullPath);
                 if (resourceItem != null)
                 {
                     return(resourceItem);
                 }
             }
         }
     }
     return((ResourceItem)null);
 }
 public ResourceGroup(Solution parentSolution)
 {
     this.ParentFolder   = parentSolution.RootFolder;
     this.ParentSolution = parentSolution;
     this.RootFolder     = new ResourceFolder(parentSolution.ItemDirectory);
 }