コード例 #1
0
ファイル: OWPath.cs プロジェクト: henrikmbach/ownet
        /// <summary> Create a new path with a starting path.  New elements
        /// can be added with <CODE>add</CODE>.
        ///
        /// </summary>
        /// <param name="adapter">where the 1-Wire path is based
        /// </param>
        /// <param name="currentPath">starting value of this 1-Wire path
        ///
        /// </param>
        /// <seealso cref="add(OneWireContainer, int) add">
        /// </seealso>
        public OWPath(DSPortAdapter adapter, OWPath currentOWPath)
        {
            this.adapter = adapter;
            elements     = System.Collections.ArrayList.Synchronized(new System.Collections.ArrayList(2));

            copy(currentOWPath);
        }
コード例 #2
0
ファイル: OWPath.cs プロジェクト: Agrimeters/winrt-onewire
        /// <summary>
        /// Create a new path with a starting path.  New elements
        /// can be added with <CODE>add</CODE>.
        /// </summary>
        /// <param name="adapter"> where the 1-Wire path is based </param>
        /// <param name="currentPath"> starting value of this 1-Wire path
        /// </param>
        /// <seealso cref= #add(OneWireContainer, int) add </seealso>
        public OWPath(DSPortAdapter adapter, OWPath currentOWPath)
        {
            this.adapter = adapter;
            elements     = new List <OWPathElement>(2);

            copy(currentOWPath);
        }
コード例 #3
0
ファイル: OWPath.cs プロジェクト: Agrimeters/winrt-onewire
        /// <summary>
        /// Copy the elements from the provided 1-Wire path into this 1-Wire path.
        /// </summary>
        /// <param name="currentOWPath"> path to copy from </param>
        public virtual void copy(OWPath currentOWPath)
        {
            elements.Clear();

            if (currentOWPath != null)
            {
                // enumerature through elements in current path
                for (IEnumerator path_enum = currentOWPath.AllOWPathElements; path_enum.MoveNext();)
                {
                    // cast the enum as a OWPathElements and add to vector
                    elements.Add((OWPathElement)path_enum.Current);
                }
            }
        }
コード例 #4
0
ファイル: OWPath.cs プロジェクト: henrikmbach/ownet
        /// <summary> Copy the elements from the provided 1-Wire path into this 1-Wire path.
        ///
        /// </summary>
        /// <param name="currentOWPath">path to copy from
        /// </param>
        public virtual void  copy(OWPath currentOWPath)
        {
            elements.Clear();

            if (currentOWPath != null)
            {
                // enumerature through elements in current path
                //UPGRADE_TODO: Method 'java.util.Enumeration.hasMoreElements' was converted to 'System.Collections.IEnumerator.MoveNext' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilEnumerationhasMoreElements'"
                for (System.Collections.IEnumerator path_enum = currentOWPath.AllOWPathElements; path_enum.MoveNext();)
                {
                    // cast the enum as a OWPathElements and add to vector
                    //UPGRADE_TODO: Method 'java.util.Enumeration.nextElement' was converted to 'System.Collections.IEnumerator.Current' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilEnumerationnextElement'"
                    elements.Add((OWPathElement)path_enum.Current);
                }
            }
        }
コード例 #5
0
ファイル: OWPath.cs プロジェクト: henrikmbach/ownet
 /// <summary> Compare this 1-Wire path with another.
 ///
 /// </summary>
 /// <param name="compareOWPath">1-Wire path to compare to
 ///
 /// </param>
 /// <returns> <CODE> true </CODE> if the 1-Wire paths are the same
 /// </returns>
 public bool equals(OWPath compareOWPath)
 {
     return(this.ToString().Equals(compareOWPath.ToString()));
 }