rv.PJLinkConnection.getProjectorInfo C# (CSharp) Method

getProjectorInfo() public method

Return String in the form Manufacturer Product (ProjectorName) or Manufacturer Product if no projector name is set.
public getProjectorInfo ( ) : string
return string
        public string getProjectorInfo()
        {
            string toRet = "";
            ManufacturerNameCommand mnc = new ManufacturerNameCommand();
            if (sendCommand(mnc) == Command.Response.SUCCESS)
                toRet = mnc.Manufacturer;

            ProductNameCommand prnc = new ProductNameCommand();
            if (sendCommand(prnc) == Command.Response.SUCCESS)
                toRet+= " " + prnc.ProductName;

            ProjectorNameCommand pnc = new ProjectorNameCommand();
            if (sendCommand(pnc) == Command.Response.SUCCESS) {
                if (pnc.Name.Length > 0)
                    toRet += " (" + pnc.Name + ")";
            }
            return toRet;
        }

Usage Example

        private async void btnInfo_Click(object sender, RoutedEventArgs e)
        {
            //try
            {
                string info           = "";
                rv.PJLinkConnection c = connectBeamer();
                info = await c.getProjectorInfo();

                LampStatusCommand lscmd = new LampStatusCommand();
                if (await c.sendCommand(lscmd) == Command.Response.SUCCESS)
                {
                    info += "\n";
                    info += lscmd.dumpToString();
                }

                var view = ApplicationView.GetForCurrentView();
                view.TryResizeView(new Size(328, 250));
                InfoDialog dialog = new InfoDialog(info);
                await dialog.ShowAsync();

                view.TryResizeView(new Size(328, 100));
            }
            //catch (Exception)
            {
            }
        }