コード例 #1
0
        protected override void Run(object dataItem)
        {
            if (!MonoDroidFramework.EnsureSdksInstalled())
            {
                return;
            }

            var proj = DefaultUploadToDeviceHandler.GetActiveExecutableMonoDroidProject();
            var conf = (MonoDroidProjectConfiguration)proj.GetConfiguration(IdeApp.Workspace.ActiveConfiguration);

            var device = MonoDroidUtility.ChooseDevice(null);

            if (device != null)
            {
                proj.SetDeviceTarget(conf, device.ID);
            }
        }
コード例 #2
0
        public MonoDroidDeviceLog(IPadWindow container)
        {
            Stetic.BinContainer.Attach(this);
            DockItemToolbar toolbar = container.GetToolbar(PositionType.Top);

            var chooseDeviceButton = new Button()
            {
                Label = GettextCatalog.GetString("Choose Device"),
            };

            deviceLabel = new Label()
            {
                Xalign = 0,
            };
            SetDeviceLabel();
            var reconnectButton = new Button()
            {
                Label = GettextCatalog.GetString("Reconnect"),
            };

            toolbar.Add(deviceLabel);
            toolbar.Add(chooseDeviceButton);
            toolbar.Add(reconnectButton);

            reconnectButton.Clicked += delegate {
                Disconnect();
                if (Device != null)
                {
                    Connect();
                }
                else
                {
                    SetDeviceLabel();
                }
            };
            chooseDeviceButton.Clicked += delegate {
                Device = MonoDroidUtility.ChooseDevice(null);
            };

            log = new LogView();
            this.Add(log);

            toolbar.ShowAll();
            ShowAll();
        }