示例#1
0
 ///<summary>
 ///Returns a <see cref="T:System.String"/> that represents the current <see cref="UsbInterfaceInfo"/>.
 ///</summary>
 ///
 ///<param name="prefixSeperator">The field prefix string.</param>
 ///<param name="entitySperator">The field/value seperator string.</param>
 ///<param name="suffixSeperator">The value suffix string.</param>
 ///<returns>A formatted representation of the <see cref="UsbInterfaceInfo"/>.</returns>
 public string ToString(string prefixSeperator, string entitySperator, string suffixSeperator)
 {
     string[] names  = { "ManufacturerString", "ProductString", "SerialString" };
     Object[] values = { ManufacturerString, ProductString, SerialString };
     return(Descriptor.ToString(prefixSeperator, entitySperator, suffixSeperator) +
            LHelper.ToString(prefixSeperator, names, entitySperator, values, suffixSeperator));
 }
        ///<summary>
        ///Returns a <see cref="T:System.String"/> that represents the current <see cref="UsbConfigDescriptor"/>.
        ///</summary>
        ///
        ///<param name="prefixSeperator">The field prefix string.</param>
        ///<param name="entitySperator">The field/value seperator string.</param>
        ///<param name="suffixSeperator">The value suffix string.</param>
        ///<returns>A formatted representation of the <see cref="UsbConfigDescriptor"/>.</returns>
        public string ToString(string prefixSeperator, string entitySperator, string suffixSeperator)
        {
            Object[] values = { Length, DescriptorType, TotalLength, InterfaceCount, ConfigID, StringIndex, "0x" + Attributes.ToString("X2"), MaxPower };
            string[] names  = { "Length", "DescriptorType", "TotalLength", "InterfaceCount", "ConfigID", "StringIndex", "Attributes", "MaxPower" };

            return(LHelper.ToString(prefixSeperator, names, entitySperator, values, suffixSeperator));
        }
示例#3
0
 ///<summary>
 ///Returns a <see cref="T:System.String"/> that represents the current <see cref="UsbConfigInfo"/>.
 ///</summary>
 ///
 ///<param name="prefixSeperator">The field prefix string.</param>
 ///<param name="entitySperator">The field/value seperator string.</param>
 ///<param name="suffixSeperator">The value suffix string.</param>
 ///<returns>A formatted representation of the <see cref="UsbConfigInfo"/>.</returns>
 public string ToString(string prefixSeperator, string entitySperator, string suffixSeperator)
 {
     Object[] values = { ConfigString };
     string[] names  = { "ConfigString" };
     return(Descriptor.ToString(prefixSeperator, entitySperator, suffixSeperator) +
            LHelper.ToString(prefixSeperator, names, entitySperator, values, suffixSeperator));
 }
示例#4
0
        /// <summary>
        /// String representation of the UsbDescriptor class.
        /// </summary>
        public override string ToString()
        {
            Object[] values = { Length, DescriptorType };
            string[] names  = { "Length", "DescriptorType" };

            return(LHelper.ToString("", names, ToStringParamValueSeperator, values, ToStringFieldSeperator));
        }
        ///<summary>
        ///Returns a <see cref="T:System.String"/> that represents the current <see cref="UsbEndpointDescriptor"/>.
        ///</summary>
        ///
        ///<param name="prefixSeperator">The field prefix string.</param>
        ///<param name="entitySperator">The field/value seperator string.</param>
        ///<param name="suffixSeperator">The value suffix string.</param>
        ///<returns>A formatted representation of the <see cref="UsbEndpointDescriptor"/>.</returns>
        public string ToString(string prefixSeperator, string entitySperator, string suffixSeperator)
        {
            Object[] values =
            {
                Length,  DescriptorType, "0x" + EndpointID.ToString("X2"), "0x" + Attributes.ToString("X2"), MaxPacketSize, Interval,
                Refresh, "0x" + SynchAddress.ToString("X2")
            };
            string[] names = { "Length", "DescriptorType", "EndpointID", "Attributes", "MaxPacketSize", "Interval", "Refresh", "SynchAddress" };

            return(LHelper.ToString(prefixSeperator, names, entitySperator, values, suffixSeperator));
        }
示例#6
0
        ///<summary>
        ///Returns a <see cref="T:System.String"/> that represents the current <see cref="UsbInterfaceDescriptor"/>.
        ///</summary>
        ///
        ///<param name="prefixSeperator">The field prefix string.</param>
        ///<param name="entitySperator">The field/value seperator string.</param>
        ///<param name="suffixSeperator">The value suffix string.</param>
        ///<returns>A formatted representation of the <see cref="UsbInterfaceDescriptor"/>.</returns>
        public string ToString(string prefixSeperator, string entitySperator, string suffixSeperator)
        {
            Object[] values =
            {
                Length,                         DescriptorType, InterfaceID, AlternateID, EndpointCount, Class, "0x" + SubClass.ToString("X2"),
                "0x" + Protocol.ToString("X2"), StringIndex
            };
            string[] names =
            {
                "Length", "DescriptorType", "InterfaceID", "AlternateID", "EndpointCount", "Class", "SubClass", "Protocol",
                "StringIndex"
            };

            return(LHelper.ToString(prefixSeperator, names, entitySperator, values, suffixSeperator));
        }
 ///<summary>
 ///Returns a <see cref="T:System.String"/> that represents the current <see cref="MonoUsbDeviceDescriptor"/>.
 ///</summary>
 ///
 ///<returns>
 ///A <see cref="System.String"/> that represents the current <see cref="MonoUsbDeviceDescriptor"/>.
 ///</returns>
 public override string ToString()
 {
     Object[] values =
     {
         Length,                         DescriptorType,                  "0x" + BcdUsb.ToString("X4"), Class, SubClass, Protocol, MaxPacketSize0,
         "0x" + VendorID.ToString("X4"), "0x" + ProductID.ToString("X4"), BcdDevice,
         ManufacturerStringIndex,        ProductStringIndex,              SerialStringIndex,            ConfigurationCount
     };
     string[] names =
     {
         "Length",                  "DescriptorType",     "BcdUsb",            "Class", "SubClass", "Protocol", "MaxPacketSize0", "VendorID", "ProductID",
         "BcdDevice",
         "ManufacturerStringIndex", "ProductStringIndex", "SerialStringIndex", "ConfigurationCount"
     };
     return(LHelper.ToString("", names, ":", values, "\r\n"));
 }
示例#8
0
        ///<summary>
        ///Returns a <see cref="T:System.String"/> that represents the current <see cref="UsbDeviceDescriptor"/>.
        ///</summary>
        ///
        ///<param name="prefixSeperator">The field prefix string.</param>
        ///<param name="entitySperator">The field/value seperator string.</param>
        ///<param name="suffixSeperator">The value suffix string.</param>
        ///<returns>A formatted representation of the <see cref="UsbDeviceDescriptor"/>.</returns>
        public string ToString(string prefixSeperator, string entitySperator, string suffixSeperator)
        {
            Object[] values =
            {
                Length,                         DescriptorType,                  "0x" + BcdUsb.ToString("X4"),    Class, "0x" + SubClass.ToString("X2"),
                "0x" + Protocol.ToString("X2"), MaxPacketSize0,
                "0x" + VendorID.ToString("X4"), "0x" + ProductID.ToString("X4"), "0x" + BcdDevice.ToString("X4"),
                ManufacturerStringIndex,        ProductStringIndex,              SerialStringIndex,               ConfigurationCount
            };
            string[] names =
            {
                "Length",                  "DescriptorType",     "BcdUsb",            "Class", "SubClass", "Protocol", "MaxPacketSize0", "VendorID", "ProductID",
                "BcdDevice",
                "ManufacturerStringIndex", "ProductStringIndex", "SerialStringIndex", "ConfigurationCount"
            };

            return(LHelper.ToString(prefixSeperator, names, entitySperator, values, suffixSeperator));
        }