Exemple #1
0
        private void RemoveSm4shModItem(List <Sm4shModItem> list, string partition, string relativePath)
        {
            if (list == null)
            {
                list = new List <Sm4shModItem>();
            }

            Sm4shModItem resCol = list.Find(p => p.Partition == partition);

            if (resCol == null)
            {
                return;
            }
            resCol.Paths.Remove(relativePath);
        }
Exemple #2
0
        private bool IsSm4shModItem(List <Sm4shModItem> list, string partition, string relativePath)
        {
            if (list == null)
            {
                list = new List <Sm4shModItem>();
            }

            Sm4shModItem resCol = list.Find(p => p.Partition == partition);

            if (resCol == null)
            {
                return(false);
            }

            string pathFound = resCol.Paths.Find(p => (p.EndsWith("packed") && relativePath.StartsWith(p.Substring(0, p.LastIndexOf("packed"))) || p == relativePath));

            if (!string.IsNullOrEmpty(pathFound))
            {
                return(true);
            }
            return(false);
        }
Exemple #3
0
        internal bool IsResourceInPackage(string partition, string relativePath)
        {
            if (ResourcesToPack == null)
            {
                ResourcesToPack = new List <Sm4shModItem>();
            }

            Sm4shModItem resCol = ResourcesToPack.Find(p => p.Partition == partition);

            if (resCol == null)
            {
                return(false);
            }

            string pathFound = resCol.Paths.Find(p => relativePath.StartsWith(p));

            if (!string.IsNullOrEmpty(pathFound))
            {
                return(true);
            }
            return(false);
        }
Exemple #4
0
        private void AddSm4shModItem(List <Sm4shModItem> list, string partition, string relativePath)
        {
            if (list == null)
            {
                list = new List <Sm4shModItem>();
            }

            Sm4shModItem resCol = list.Find(p => p.Partition == partition);

            if (resCol == null)
            {
                resCol = new Sm4shModItem()
                {
                    Partition = partition, Paths = new List <string>()
                };
                list.Add(resCol);
            }
            string checkPathExist = resCol.Paths.Find(p => p == relativePath);

            if (string.IsNullOrEmpty(checkPathExist))
            {
                resCol.Paths.Add(relativePath);
            }
        }