Exemple #1
0
        /// <summary>
        /// Gets the full path.
        /// </summary>
        /// <returns>System.String.</returns>
        public string GetFullPath()
        {
            LightCollection <string> paths = new LightCollection <string>();

            paths.Add(_id);
            TreeItem <T> parent = this.Parent;

            while (parent != null)
            {
                paths.Add(parent.Id);
                parent = parent.Parent;
            }
            paths.Reverse();
            string fullPath = string.Join("/", paths.GetItems());

            return(fullPath);
        }
 public void CloseFile(string filename)
 {
     if (_files.ContainsKey(filename))
     {
         //_currentBufferSize -= _files[filename].Length;
         //_files.Remove(filename);
         //EnsureCapacity();
         if (!_freeFiles.Contains(filename))
         {
             _freeFiles.Add(filename);
         }
     }
 }
Exemple #3
0
        private unsafe int[] GetBufferUsedColorArray(int *src)
        {
            LightCollection <int> colors = new LightCollection <int>();

            for (int i = 0; i < _pixelsCount; i++)
            {
                int c = *((int *)src);
                if (!colors.Contains(c))
                {
                    colors.Add(c);
                }
                src++;
            }
            return(colors.GetItems());
        }
        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
        {
            var collection = new LightCollection();
            while (true)
            {
                // read json key.
                reader.Read();
                var id = (string)reader.Value;
                // null is the end of json.
                if (id == null) break;

                // read json value.
                reader.Read();
                var light = serializer.Deserialize<Light>(reader);

                // set light identifier.
                light.Id = id;

                collection.Add(light);
            }
            return collection;
        }
Exemple #5
0
 private unsafe int[] GetBufferUsedColorArray(int* src)
 {
     LightCollection<int> colors = new LightCollection<int>();
     for (int i = 0; i < _pixelsCount; i++)
     {
         int c = *((int*)src);
         if (!colors.Contains(c))
         {
             colors.Add(c);
         }
         src++;
     }
     return colors.GetItems();
 }
 public int Add(string item)
 {
     return(_coll.Add(item));
 }