Inheritance: MonoBehaviour
Example #1
0
        public MainForm()
        {
            // Define the controller for the application
            m_Controller = new ViewController(this);

            InitializeComponent();

            // All user interface actions should be handled via the UserActionList technique.
            // Those that deal with map navigation get routed to the map control, the rest
            // will get routed to methods in this class.

            m_Actions = new UserActionList();

            // File menu...
            AddAction(fileOpenMenuItem, IsFileOpenEnabled, FileOpen);
            AddAction(fileExitMenuItem, IsFileExitEnabled, FileExit);

            // View menu...
            AddAction(mnuViewAutoSelect, null, AutoSelect);
            AddAction(DisplayToolId.Overview, new ToolStripItem[] { mnuViewOverview, ctxViewOverview });
            AddAction(DisplayToolId.ZoomIn, new ToolStripItem[] { mnuViewZoomIn, ctxViewZoomIn });
            AddAction(DisplayToolId.ZoomOut, new ToolStripItem[] { mnuViewZoomOut, ctxViewZoomOut });
            AddAction(DisplayToolId.ZoomRectangle, new ToolStripItem[] { mnuViewZoomRectangle, ctxViewZoomRectangle });
            AddAction(DisplayToolId.DrawScale, new ToolStripItem[] { mnuViewDrawScale, ctxViewDrawScale });
            AddAction(DisplayToolId.Magnify, new ToolStripItem[] { mnuViewMagnify, ctxViewMagnify });
            AddAction(DisplayToolId.NewCentre, new ToolStripItem[] { mnuViewNewCenter, ctxViewNewCenter });
            AddAction(DisplayToolId.Pan, new ToolStripItem[] { mnuViewPan, ctxViewPan });
            AddAction(DisplayToolId.Previous, new ToolStripItem[] { mnuViewPrevious, ctxViewPrevious });
            AddAction(DisplayToolId.Next, new ToolStripItem[] { mnuViewNext, ctxViewNext });
            AddAction(mnuViewStatusBar, IsViewStatusBarEnabled, ViewStatusBar);

            // Update UI in idle time
            Application.Idle += OnIdle;
        }
Example #2
0
    public override bool FinishedLaunching(UIApplication app, NSDictionary options)
    {
        UIApplication.SharedApplication.StatusBarHidden = true;

        image = new UIImageView (UIScreen.MainScreen.Bounds) {
            Image = UIImage.FromFile ("Background.png")
        };
        text = new UITextField (new RectangleF (44, 32, 232, 31)) {
            BorderStyle = UITextBorderStyle.RoundedRect,
            TextColor = UIColor.Black,
            BackgroundColor = UIColor.Black,
            ClearButtonMode = UITextFieldViewMode.WhileEditing,
            Placeholder = "Hello world",
        };
        text.ShouldReturn = delegate (UITextField theTextfield) {
            text.ResignFirstResponder ();

            label.Text = text.Text;
            return true;
        };

        label = new UILabel (new RectangleF (20, 120, 280, 44)){
            TextColor = UIColor.Gray,
            BackgroundColor = UIColor.Black,
            Text = text.Placeholder
        };

        var vc = new ViewController (this) { image, text, label };

        window = new UIWindow (UIScreen.MainScreen.Bounds){ vc.View };

        window.MakeKeyAndVisible ();

        return true;
    }
    void Awake()
    {
        tf = GetComponent<Transform>();

        motor = GetComponent<AdvancedMotor>();
        viewControl = GetComponent<ViewController>();
           // invControl = GetComponent<InventoryController>();

        PopulateItemKeyMap();
    }
		public override bool  FinishedLaunching(UIApplication application ,/*didFinishLaunchingWithOptions*/ NSDictionary launchOptions){
			ViewController viewController = new ViewController();

			UIWindow window = new UIWindow(UIScreen.MainScreen.Bounds);
			window.RootViewController = viewController;

			this.Window = window;

			window.MakeKeyAndVisible();

			return true;
		}
    public string RegisterViewController(string vcName, ViewController vc)
    {
        if (_viewControllers.ContainsKey(vcName))
        {
            int vcCount = 1;
            while(_viewControllers.ContainsKey(vcName + vcCount.ToString()))
            {
                vcCount++;
            }
            vcName = vcName + vcCount.ToString();
        }

        _viewControllers[vcName] = vc;

        return vcName;
    }
    // 前の階層のビューへ戻る処理をおこなうメソッド
    public void Pop()
    {
        if(stackedViews.Count < 1)
        {
            // 前の階層のビューがないので何もしない
            return;
        }

        // アニメーションの最中はユーザーのインタラクションを無効にする
        EnableInteraction(false);

        // 現在表示されているビューを画面右外に移動する
        ViewController lastView = currentView;
        Vector2 lastViewPos = lastView.CachedRectTransform.anchoredPosition;
        lastViewPos.x = this.CachedRectTransform.rect.width;
        lastView.CachedRectTransform.MoveTo(
            lastViewPos, 0.3f, 0.0f, iTween.EaseType.easeOutSine, ()=>{
                // 移動が終わったらビューを非アクティブにする
                lastView.gameObject.SetActive(false);
        });

        // 前の階層のビューをスタックから戻し、画面左外から中央に移動する
        ViewController poppedView = stackedViews.Pop();
        poppedView.gameObject.SetActive(true);
        Vector2 poppedViewPos = poppedView.CachedRectTransform.anchoredPosition;
        poppedViewPos.x = 0.0f;
        poppedView.CachedRectTransform.MoveTo(
            poppedViewPos, 0.3f, 0.0f, iTween.EaseType.easeOutSine, ()=>{
                // 移動が終わったらユーザーのインタラクションを有効にする
                EnableInteraction(true);
        });

        // スタックから戻したビューを現在のビューとして保持して、ナビゲーションバーのタイトルを変更する
        currentView = poppedView;
        titleLabel.text = poppedView.Title;

        // 前の階層のビューがある場合、バックボタンのラベルを変更してアクティブにする
        if(stackedViews.Count >= 1)
        {
            backButtonLabel.text = stackedViews.Peek().Title;
            backButton.gameObject.SetActive(true);
        }
        else
        {
            backButton.gameObject.SetActive(false);
        }
    }
    // 次の階層のビューへ遷移する処理をおこなうメソッド
    public void Push(ViewController newView)
    {
        if(currentView == null)
        {
            // 最初のビューはアニメーションなしで表示する
            newView.gameObject.SetActive(true);
            currentView = newView;
            return;
        }

        // アニメーションの最中はユーザーのインタラクションを無効にする
        EnableInteraction(false);

        // 現在表示されているビューを画面左外に移動する
        ViewController lastView = currentView;
        stackedViews.Push(lastView);
        Vector2 lastViewPos = lastView.CachedRectTransform.anchoredPosition;
        lastViewPos.x = -this.CachedRectTransform.rect.width;
        lastView.CachedRectTransform.MoveTo(
            lastViewPos, 0.3f, 0.0f, iTween.EaseType.easeOutSine, ()=>{
                // 移動が終わったらビューを非アクティブにする
                lastView.gameObject.SetActive(false);
        });

        // 新しいビューを画面右外から中央に移動する
        newView.gameObject.SetActive(true);
        Vector2 newViewPos = newView.CachedRectTransform.anchoredPosition;
        newView.CachedRectTransform.anchoredPosition =
            new Vector2(this.CachedRectTransform.rect.width, newViewPos.y);
        newViewPos.x = 0.0f;
        newView.CachedRectTransform.MoveTo(
            newViewPos, 0.3f, 0.0f, iTween.EaseType.easeOutSine, ()=>{
                // 移動が終わったらユーザーのインタラクションを有効にする
                EnableInteraction(true);
        });

        // 新しいビューを現在のビューとして保持して、ナビゲーションバーのタイトルを変更する
        currentView = newView;
        titleLabel.text = newView.Title;

        // バックボタンのラベルを変更する
        backButtonLabel.text = lastView.Title;
        // バックボタンをアクティブにする
        backButton.gameObject.SetActive(true);
    }
 internal void MainMenu()
 {
     ViewController.GetController().LoadMainMenu();
 }
 public ActiveCardsPanelLifecycleHandler(ViewController viewController)
 {
     this.viewController = viewController;
 }
 protected PhotonOperationHandler(ViewController controller)
 {
     _controller = controller;
 }
Example #11
0
        public override void ViewDidAppear(bool animated)
        {
            base.ViewDidAppear(animated);
            OAuth2Authenticator auth = null;

            //todo add to appsettings
            auth = new OAuth2Authenticator(
                clientId: "933191510091844",
                scope: "email",
                authorizeUrl: new Uri("https://www.facebook.com/dialog/oauth"),
                redirectUrl: new Uri("http://yourValidEndpoint.com/login_success.html"));

            // we do this to be able to control the cancel flow outself...
            auth.AllowCancel = false;

            auth.Completed += async(sender, e) => {
                if (!e.IsAuthenticated)
                {
                    return;
                }
                else
                {
                    var access = e.Account.Properties ["access_token"];

                    using (var handler = new ModernHttpClient.NativeMessageHandler()) {
                        using (var client = new HttpClient(handler)) {
                            var content = new FormUrlEncodedContent(new[] {
                                new KeyValuePair <string, string> ("accesstoken", access),
                                new KeyValuePair <string, string> ("grant_type", "facebook")
                            });

                            var authenticateResponse = await client.PostAsync(new Uri ("http://windows:8080/Token"), content);

                            if (authenticateResponse.IsSuccessStatusCode)
                            {
                                var responseContent = await authenticateResponse.Content.ReadAsStringAsync();

                                var authenticationTicket = JsonConvert.DeserializeObject <AuthenticatedUser> (responseContent);

                                if (authenticationTicket != null)
                                {
                                    var apiAccessToken = authenticationTicket.Access_Token;
                                    Settings.ApiAccessToken = apiAccessToken;

                                    ((App)App.Current).PresentMain();
                                }
                            }
                        }
                    }
                }
            };

            UIViewController vc = auth.GetUI();

            ViewController.AddChildViewController(vc);
            ViewController.View.Add(vc.View);

            // add out custom cancel button, to be able to navigate back
            vc.ChildViewControllers [0].NavigationItem.LeftBarButtonItem = new UIBarButtonItem(
                UIBarButtonSystemItem.Cancel, async(o, eargs) => await App.Current.MainPage.Navigation.PopModalAsync()
                );
        }
Example #12
0
 public override void OnElementChanged()
 {
     Controller = new ViewController(Element);
     base.OnElementChanged();
 }
Example #13
0
 internal void GoBack()
 {
     ViewController.GetController().LoadLogin();
 }
        public void Authenticate(Uri authorizationUri, Uri redirectUri, RequestContext requestContext)
        {
            try
            {
                /* For app center builds, this will need to build on a hosted mac agent. The mac agent does not have the latest SDK's required to build 'ASWebAuthenticationSession'
                 * Until the agents are updated, appcenter build will need to ignore the use of 'ASWebAuthenticationSession' for iOS 12.*/
#if !IS_APPCENTER_BUILD
                if (UIDevice.CurrentDevice.CheckSystemVersion(12, 0))
                {
                    AsWebAuthenticationSession = new AuthenticationServices.ASWebAuthenticationSession(
                        new NSUrl(authorizationUri.AbsoluteUri),
                        redirectUri.Scheme,
                        (callbackUrl, error) =>
                    {
                        if (error != null)
                        {
                            ProcessCompletionHandlerError(error);
                        }
                        else
                        {
                            ContinueAuthentication(callbackUrl.ToString());
                        }
                    });

                    AsWebAuthenticationSession.Start();
                }
                else if (UIDevice.CurrentDevice.CheckSystemVersion(11, 0))
                {
                    SfAuthenticationSession = new SFAuthenticationSession(
                        new NSUrl(authorizationUri.AbsoluteUri),
                        redirectUri.Scheme,
                        (callbackUrl, error) =>
                    {
                        if (error != null)
                        {
                            ProcessCompletionHandlerError(error);
                        }
                        else
                        {
                            ContinueAuthentication(callbackUrl.ToString());
                        }
                    });

                    SfAuthenticationSession.Start();
                }
#else
                if (UIDevice.CurrentDevice.CheckSystemVersion(11, 0))
                {
                    sfAuthenticationSession = new SFAuthenticationSession(new NSUrl(authorizationUri.AbsoluteUri),
                                                                          redirectUri.Scheme, (callbackUrl, error) =>
                    {
                        if (error != null)
                        {
                            ProcessCompletionHandlerError(error);
                        }
                        else
                        {
                            ContinueAuthentication(callbackUrl.ToString());
                        }
                    });

                    sfAuthenticationSession.Start();
                }
#endif
                else
                {
                    SafariViewController = new SFSafariViewController(new NSUrl(authorizationUri.AbsoluteUri), false)
                    {
                        Delegate = this
                    };
                    ViewController.InvokeOnMainThread(() =>
                    {
                        ViewController.PresentViewController(SafariViewController, false, null);
                    });
                }
            }
            catch (Exception ex)
            {
                requestContext.Logger.ErrorPii(ex);
                throw new AuthClientException(
                          AuthError.AuthenticationUiFailedError,
                          "Failed to invoke SFSafariViewController",
                          ex);
            }
        }
Example #15
0
 public void SetUp()
 {
     _viewController     = new ViewController(_documentService, _spaceService, _storePolicy, _contextService.Object);
     _documentController = new DocumentController(_documentService, _spaceService, _spaceTreeService, _storePolicy, _requestProvider.Object, _contextService.Object);
 }
Example #16
0
 public virtual void Awake()
 {
     Controller = new ViewController(this);
 }
 private void BtnProfile_Click(object sender, EventArgs e)
 {
     ViewController.ViewYourProfile();
 }
 private void BtnLogOut_Click(object sender, EventArgs e)
 {
     ViewController.LogOut();
 }
Example #19
0
 internal void ShowSettings()
 {
     ViewController.GetController().LoadSettings();
 }
Example #20
0
 public override void ScrollAnimationEnded(UIScrollView scrollView)
 {
     ViewController?.HandleScrollAnimationEnded();
 }
Example #21
0
 public MainMenu(FlowStack flowStack, ViewController viewController, GameControllerFactory gameControllerFactory)
 {
     this.flowStack             = flowStack;
     this.viewController        = viewController;
     this.gameControllerFactory = gameControllerFactory;
 }
Example #22
0
        public QuizView(ViewController controller)
        {
            InitializeComponent();

            this.controller = controller;
        }
Example #23
0
 public override void Update(ViewController view)
 {
     base.Update(view);
 }
Example #24
0
 protected override void BackButtonWasPressed(ViewController topViewController)
 {
     BeatSaberUI.MainFlowCoordinator.DismissFlowCoordinator(this);
 }
Example #25
0
 public override void Render(SpriteBatch spriteBatch, ViewController view)
 {
     base.Render(spriteBatch, view);
 }
Example #26
0
 // Start is called before the first frame update
 void Start()
 {
     VC = FindObjectOfType <ViewController>();
     slider.maxValue = youngTimer;
     slider.value    = youngTimer;
 }
Example #27
0
 // Start is called before the first frame update
 void Start()
 {
     //Assign ViewController object
     manager     = GameObject.Find("SpatioManager");
     vcontroller = manager.GetComponent <ViewController>();
 }
 public CharacterCreateHandler(ViewController controller) : base(controller)
 {
 }
 private void userSkillsToolStripMenuItem_Click(object sender, EventArgs e)
 {
     ViewController.switchForm(new UserSkills());
 }
 void Awake()
 {
     motor = GetComponent<AdvancedMotor>();
     viewController = GetComponent<ViewController>();
 }
 private void logoutToolStripMenuItem_Click(object sender, EventArgs e)
 {
     ViewController.switchForm(new Login());
 }
 protected PhotonEventHandler(ViewController controller)
 {
     _controller = controller;
 }
 private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     ViewController.switchForm(new EvidenceReport());
 }
Example #34
0
 public virtual void Awake()
 {
     Controller = new ViewController(this);
 }
 private void buttonCreateEvidence_Click(object sender, EventArgs e)
 {
     ViewController.popupForm(new EvidenceReport());
 }
 public SelectCharacterHandler(ViewController controller)
     : base(controller)
 {
 }
 private void adminControlsToolStripMenuItem_Click(object sender, EventArgs e)
 {
     ViewController.switchForm(new AdminControls());
 }
        /// <summary>
        /// Initializes the projection.
        /// </summary>
        /// <param name="type">The type of entity being viewed.</param>
        public void Initialize(Type type)
        {
            Command = new ViewCommandInfo(type.Name);

            controller = ViewController.New(this);
        }
Example #39
0
 public override CGSize GetReferenceSizeForFooter(UICollectionView collectionView, UICollectionViewLayout layout, nint section)
 {
     return(ViewController.GetReferenceSizeForFooter(collectionView, layout, section));
 }