Exemple #1
0
        //+---------------------------------------------------------------------------
        //
        //  function:    listDevices
        //
        //  Synopsis:    sets the value of TSID for a FaxDevice
        //
        //  Arguments:  [pFaxDevices] - FaxDevices object pointing to the list of devices on the server
        //
        //  Returns:     bool: true if passed successfully
        //
        //----------------------------------------------------------------------------
        static bool listDevices(IFaxDevices objFaxDevices)
        {
            FaxDevice objFaxDevice = null;
            int       count        = objFaxDevices.Count;

            if (objFaxDevices != null)
            {
                for (int i = 0; i < count; i++)
                {
                    objFaxDevice = objFaxDevices[i + 1];
                    System.Console.Write("Device No: ");
                    System.Console.Write(i);
                    System.Console.Write("  Device Id = ");
                    System.Console.Write(objFaxDevice.Id);
                    System.Console.Write("  Device Name = ");
                    System.Console.Write(objFaxDevice.DeviceName);
                    System.Console.WriteLine();
                }
                return(true);
            }
            System.Console.WriteLine("listDevices: Parameter is NULL");
            return(false);
        }
        //+---------------------------------------------------------------------------
        //
        //  function:    listDevices
        //
        //  Synopsis:    sets the value of TSID for a FaxDevice
        //
        //  Arguments:  [pFaxDevices] - FaxDevices object pointing to the list of devices on the server
        //
        //  Returns:     bool: true if passed successfully
        //
        //----------------------------------------------------------------------------
        static bool listDevices(IFaxDevices objFaxDevices)
        {
            FaxDevice objFaxDevice = null;
                        int count = objFaxDevices.Count;

                        if (objFaxDevices != null)
                        {
                                for (int i = 0; i < count; i++)
                                {
                                        objFaxDevice = objFaxDevices[i+1];
                                        System.Console.Write("Device No: ");
                                        System.Console.Write(i);
                                        System.Console.Write("  Device Id = ");
                                        System.Console.Write(objFaxDevice.Id);
                                        System.Console.Write("  Device Name = ");
                                        System.Console.Write(objFaxDevice.DeviceName);
                                        System.Console.WriteLine();
                                }
                                return true;
                        }
                        System.Console.WriteLine("listDevices: Parameter is NULL");
                        return false;
        }