OpenHome.Songcast.Songcast.SetEnabled C# (CSharp) Метод

SetEnabled() публичный Метод

public SetEnabled ( bool aValue ) : void
aValue bool
Результат void
        public void SetEnabled(bool aValue)
        {
            SongcastSetEnabled(iHandle, aValue);
        }

Usage Example

Пример #1
0
    public void Run()
    {
        bool enabled = true;

            try
            {
                Songcast songcast = new Songcast("av.openhome.org", 522, 1, 1, 100, false, enabled, 99, this, this, this, "OpenHome", "http://www.openhome.org", "http://www.openhome.org", new byte[] { }, String.Empty);

                while (true)
                {
                    ConsoleKeyInfo key = Console.ReadKey(true);

                    if (key.KeyChar == 'q')
                    {
                        break;
                    }

                    if (key.KeyChar == 'a')
                    {
                        songcast.SetSubnet(43200);
                    }

                    if (key.KeyChar == 'e')
                    {
                        if (enabled)
                        {
                            enabled = false;
                        }
                        else
                        {
                            enabled = true;
                        }

                        songcast.SetEnabled(enabled);

                        continue;
                    }
                }

                songcast.Dispose();
            }
            catch (SongcastError e)
            {
                Console.WriteLine(e.Message);
            }
    }