Example #1
0
        /// <summary>
        /// Inits the parser for a specific Device.
        /// <p/>
        /// This methods reads the event-log-tags located on the device to find out
        /// what tags are being written to the event log and what their format is. </summary>
        /// <param name="device"> The device. </param>
        /// <returns> <code>true</code> if success, <code>false</code> if failure or cancellation. </returns>
        public bool init(IDevice device)
        {
            // read the event tag map file on the device.
            try
            {
                var tempVar = new MultiLineReceiverAnonymousInnerClassHelper();
                tempVar.processNewLinesDelegateInstance =
                    (string[] lines) => {
                    foreach (string line in lines)
                    {
                        processTagLine(line);
                    }
                };

                /*tempVar.isCancelledDelegateInstance =
                 *  () => {
                 *      return false;
                 *  };*/
                device.executeShellCommand("cat " + EVENT_TAG_MAP_FILE, tempVar);
            }
            catch (Exception)
            {
                // catch all possible exceptions and return false.
                return(false);
            }

            return(true);
        }
Example #2
0
        /// <summary>
        /// Inits the parser for a specific Device.
        /// <p/>
        /// This methods reads the event-log-tags located on the device to find out
        /// what tags are being written to the event log and what their format is. </summary>
        /// <param name="device"> The device. </param>
        /// <returns> <code>true</code> if success, <code>false</code> if failure or cancellation. </returns>
        public bool init(IDevice device)
        {
            // read the event tag map file on the device.
            try
            {
                var tempVar = new MultiLineReceiverAnonymousInnerClassHelper();
                tempVar.processNewLinesDelegateInstance =
                    (string[] lines) => {
                        foreach (string line in lines)
                        {
                            processTagLine(line);
                        }
                    };
                /*tempVar.isCancelledDelegateInstance =
                    () => {
                        return false;
                    };*/
                device.executeShellCommand("cat " + EVENT_TAG_MAP_FILE, tempVar);
            }
            catch (Exception)
            {
                // catch all possible exceptions and return false.
                return false;
            }

            return true;
        }
Example #3
0
        //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
        //ORIGINAL LINE: private void queryNewDeviceForMountingPoint(final Device device, final String name) throws TimeoutException, AdbCommandRejectedException, ShellCommandUnresponsiveException, java.io.IOException
        //JAVA TO C# CONVERTER WARNING: 'final' parameters are not allowed in .NET:
        private void queryNewDeviceForMountingPoint(Device device, string name)
        {
            var tempVar = new MultiLineReceiverAnonymousInnerClassHelper();
            /*tempVar.isCancelledDelegateInstance =
                () => {
                    return false;
                };*/

            tempVar.processNewLinesDelegateInstance =
                (string[] lines) => {
                    foreach (string line in lines)
                    {
                        if (line.Length > 0)
                        {
                            // this should be the only one.
                            device.setMountingPoint(name, line);
                        }
                    }
                };
            device.executeShellCommand("echo $" + name, tempVar);
        }