Пример #1
0
        /// <summary>
        /// Vygeneruje id pro novy disk a prida disk do systemu
        /// </summary>
        /// <param name="name"></param>
        /// <returns>Pridany disk</returns>
        internal MyDevice AddDevice(string name)
        {
            byte[] buff = new byte[sizeof(ulong)];
            Random r    = new Random();
            ulong  id   = 0;

            do
            {
                r.NextBytes(buff);
                id = BitConverter.ToUInt64(buff, 0);
            } while (devices.Find((x) => { return(x.Id == id); }) != null || id == 0);
            var dev = new MyDevice(id, name, Communication.Network, "0", "0", id + ".xml");

            devices.Add(dev);
            return(dev);
        }
Пример #2
0
 public AppTreePosition(MyDevice dev, MyDisk dis, IInfoGetter file)
 {
     Device = dev;
     Disk   = dis;
     File   = file;
 }