Пример #1
0
        public static ResourceItemDescriptor FromString(string str)
        {
            var arr = str.Split('\n');

            if (arr.Length != 3)
            {
                return(null);
            }


            ResourceItemDescriptor resourceItemDescriptor = new ResourceItemDescriptor();

            resourceItemDescriptor.Name    = arr[0];
            resourceItemDescriptor.Action  = arr[1];
            resourceItemDescriptor.Filters = arr[2].Split('\r');

            return(resourceItemDescriptor);
        }
Пример #2
0
        public static ResourceDescriptor FromString(string str)
        {
            var arr = str.Split('\f');

            if (arr.Length != 2)
            {
                return(null);
            }


            ResourceDescriptor resourceDescriptor = new ResourceDescriptor();

            resourceDescriptor._expireDt = DateTime.Parse(arr[0]);
            resourceDescriptor._resourceItemDescriptors = arr[1].Split('\v').Select(t => ResourceItemDescriptor.FromString(t)).Where(t => t != null).ToList();

            return(resourceDescriptor);
        }
Пример #3
0
        public ResourceDescriptor Add(ResourceItemDescriptor resourceItemDescriptor)
        {
            _resourceItemDescriptors.Add(resourceItemDescriptor);

            return(this);
        }