public virtual void AddRange(DestinationInfo[] items)
		{
			foreach (DestinationInfo item in items)
			{
				this.List.Add(item);
			}
		}
Exemplo n.º 2
0
        /// <summary>
        /// Returns a collection of destinations specified within the system.
        /// </summary>
        /// <returns>A DestinationInfo collection with details of all the destinations in the system.</returns>
        public DestinationInfoCollection EnumDestinations()
        {
            DestinationInfoCollection dests = new DestinationInfoCollection();

            int i = 0;

            lock (syncRoot)
            {
                do
                {
                    IntPtr hDestInfo = Marshal.AllocHGlobal(DestinationInfo.NativeSize);

                    long ret = SafeNativeMethods.ConnMgrEnumDestinations(i++, hDestInfo);
                    if (ret != 0)
                    {
                        break;
                    }
                    DestinationInfo cm = new DestinationInfo(hDestInfo);
                    dests.Add(cm);

                    Marshal.FreeHGlobal(hDestInfo);
                }while (true);
            }

            return(dests);
        }
 public virtual void Remove(DestinationInfo value)
 {
     this.List.Remove(value);
 }
 public virtual void Insert(int index, DestinationInfo value)
 {
     this.List.Insert(index, value);
 }
 public virtual int IndexOf(DestinationInfo value)
 {
     return(this.List.IndexOf(value));
 }
 public virtual bool Contains(DestinationInfo value)
 {
     return(this.List.Contains(value));
 }
 public virtual void Add(DestinationInfo value)
 {
     this.List.Add(value);
 }
		public virtual void Remove(DestinationInfo value)
		{
			this.List.Remove(value);
		}
		public virtual void Insert(int index, DestinationInfo value)
		{
			this.List.Insert(index, value);
		}
		public virtual int IndexOf(DestinationInfo value)
		{
			return this.List.IndexOf(value);
		}
		public virtual bool Contains(DestinationInfo value)
		{
			return this.List.Contains(value);
		}
		public virtual void Add(DestinationInfo value)
		{
			this.List.Add(value);
		}
		public DestinationInfoCollection(DestinationInfo[] items)
		{
			this.AddRange(items);
		}
Exemplo n.º 14
0
		/// <summary>
		/// Returns a collection of destinations specified within the system.
		/// </summary>
		/// <returns>A DestinationInfo collection with details of all the destinations in the system.</returns>
		public DestinationInfoCollection EnumDestinations()
		{
			DestinationInfo destInfo = new DestinationInfo();
			IntPtr hDestInfo = IntPtr.Zero;

			DestinationInfoCollection dests = new DestinationInfoCollection();

			bool loop = true;

			int i = 0;
			int ret = 0;

			lock(syncRoot)
			{
				do  
				{
					hDestInfo = MarshalEx.AllocHLocal((uint)DestinationInfo.NativeSize);

					ret = ConnMgrEnumDestinations(i++, hDestInfo);
					if(ret == -2147467259)
					{
						loop = false;
						break;
					}
					DestinationInfo cm = new DestinationInfo(hDestInfo);
					dests.Add(cm);

					MarshalEx.FreeHLocal(hDestInfo);
				}
				while(loop);
			}

			return dests;
		}