コード例 #1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            hubCode = Persistence.GetHubCode();
            if (hubCode != null)
            {
                renderCode();
            }
            //else
        }
コード例 #2
0
ファイル: App.xaml.cs プロジェクト: andrevctr12/Mimic-macOS
        /**
         * Updates the code menu item with the current code, if it has changed.
         */
        private void UpdateCodeMenuItemText()
        {
            var code = Persistence.GetHubCode();

            if (code == null)
            {
                codeMenuItem.Text = "Start League to generate an access code!";
            }
            else
            {
                codeMenuItem.Text = "Access Code: " + code;
            }
        }
コード例 #3
0
        public AboutWindow()
        {
            InitializeComponent();
            Logo.Source = Imaging.CreateBitmapSourceFromHIcon(Properties.Resources.mimic.Handle, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions());
            StartOnStartupCheckbox.IsChecked = Persistence.LaunchesAtStartup();

            AboutTitle.Content = "Mimic Conduit v" + Program.VERSION;

            if (Persistence.GetHubCode() != null)
            {
                RenderCode();
            }
            Persistence.OnHubCodeChanged += RenderCode;
        }
コード例 #4
0
ファイル: App.cs プロジェクト: andrevctr12/Mimic-macOS
        /**
         * Updates the code menu item with the current code, if it has changed.
         */
        private void UpdateCodeMenuItemText()
        {
            var code = Persistence.GetHubCode();

            if (code == null)
            {
                codeMenuItem = "Start League to generate an access code!";
            }
            else
            {
                codeMenuItem = "Access Code: " + code;
            }
            DebugLogger.Global.WriteMessage(codeMenuItem);
        }
コード例 #5
0
        /**
         * Renders the current hub code. This assumes that a hub token exists and doesn't check for null.
         */
        private void RenderCode()
        {
            Dispatcher.Invoke(() =>
            {
                QRCodeGenerator qrGenerator = new QRCodeGenerator();
                QRCodeData qrCodeData       = qrGenerator.CreateQrCode("https://remote.mimic.lol/" + Persistence.GetHubCode(), QRCodeGenerator.ECCLevel.Q);
                XamlQRCode qrCode           = new XamlQRCode(qrCodeData);

                ConnectionQR.Source     = qrCode.GetGraphic(20);
                ConnectionQR.Visibility = Visibility.Visible;

                CodeLabel.Content    = Persistence.GetHubCode();
                CodeLabel.Visibility = Visibility.Visible;

                ConnectionSteps.Visibility = Visibility.Visible;
                NoCodeText.Visibility      = Visibility.Hidden;
            });
        }