Example #1
0
        /// <summary>
        /// Adds a control to the GUI
        /// </summary>
        /// <param name="control">The control to add</param>
        public void AddControl(Control control)
        {
            if (control == null)
            {
                return;
            }

            control.ID = Controls.Count;

            Controls.Add(control);

            control.Init();
            control.Parent = new WeakReference <IControlParent>(this);

            if (OnControlAdded != null)
            {
                OnControlAdded(control);
            }
            if (control.OnAdded != null)
            {
                control.OnAdded(control, this);
            }
            if (Control.GlobalAdded != null)
            {
                Control.GlobalAdded(control, this);
            }
        }
Example #2
0
    static public void Init_All()
    {
        Intl  = true;
        Clock = Nbub = 0;
        Program.Renew(Control.States.SAOK);
        Excute.Updata_CC(true, false, false);
        Fetch.Updata(0);
        Decode.Updata(Control.States.SAOK, Control.Codes.INOP, 0, Control.Registers.RNONE, Control.Registers.RNONE, 0, 0);
        Excute.Updata(Control.States.SAOK, Control.Codes.INOP, 0, 0, 0, 0, Control.Registers.RNONE, Control.Registers.RNONE, Control.Registers.RNONE, Control.Registers.RNONE);
        Memory.Updata(Control.States.SAOK, Control.Codes.INOP, 0, false, 0, 0, Control.Registers.RNONE, Control.Registers.RNONE);
        Write_back.Updata(Control.States.SAOK, Control.Codes.INOP, 0, 0, 0, Control.Registers.RNONE, Control.Registers.RNONE);
        Program.Renew(Control.States.SAOK);

        Decode.Init_Reg();
        Memory.Init_Mem();

        Run.ck = false;
        Read_ys.Init();

        Control.Init();
        BreakControl.Init();

        Display.nlog++;
        StreamWriter sw = new StreamWriter(@"./log.out", false);

        sw.Close();
//        print("?");
    }
Example #3
0
        public void AddControl(Control control)
        {
            Controls.Add(control);

            control.Init();

            if (OnAddControl != null)
                OnAddControl(this, control);
            if (GlobalAddControl != null)
                GlobalAddControl(this, control);

            if (control.OnAdded != null)
                control.OnAdded(control, null);
            if (Control.GlobalAdded != null)
                Control.GlobalAdded(control, null);
        }
Example #4
0
        /// <summary>
        /// Adds a control to the GUI
        /// </summary>
        /// <param name="control">The control to add</param>
        public static void AddControl(Control control)
        {
            control.ID = CustomUI.Controls.Count;

            CustomUI.Controls.Add(control);

            control.Init();

            if (OnControlAdded != null)
            {
                OnControlAdded(control);
            }
            if (control.OnAdded != null)
            {
                control.OnAdded(control, null);
            }
            if (Control.GlobalAdded != null)
            {
                Control.GlobalAdded(control, null);
            }
        }
Example #5
0
        public void AddControl(Control control)
        {
            Controls.Add(control);

            control.Init();

            if (OnAddControl != null)
            {
                OnAddControl(this, control);
            }
            if (GlobalAddControl != null)
            {
                GlobalAddControl(this, control);
            }

            if (control.OnAdded != null)
            {
                control.OnAdded(control, null);
            }
            if (Control.GlobalAdded != null)
            {
                Control.GlobalAdded(control, null);
            }
        }
Example #6
0
        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            Rg.Plugins.Popup.Popup.Init();

            Xamarin.Forms.Forms.Init();
            Xamarin.Forms.FormsMaterial.Init();

            Control.Init();
            KeyboardOverlapRenderer.Init();
            CachedImageRenderer.Init();
            //CachedImageRenderer.InitImageSourceHandler();

            LoadApplication(new App());

            if (UIDevice.CurrentDevice.CheckSystemVersion(10, 0))
            {
                // Request Permissions
                UNUserNotificationCenter.Current.RequestAuthorization(UNAuthorizationOptions.Alert | UNAuthorizationOptions.Badge | UNAuthorizationOptions.Sound, (granted, error) =>
                {
                    // Do something if needed
                });
            }
            else if (UIDevice.CurrentDevice.CheckSystemVersion(8, 0))
            {
                var notificationSettings = UIUserNotificationSettings.GetSettingsForTypes(
                    UIUserNotificationType.Alert | UIUserNotificationType.Badge | UIUserNotificationType.Sound, null
                    );
                app.RegisterUserNotificationSettings(notificationSettings);
            }

            var task = FirebasePushNotificationManager.Initialize(options);

            //FirebasePushNotificationManager.CurrentNotificationPresentationOption = UNNotificationPresentationOptions.Alert;

            return(base.FinishedLaunching(app, options));
        }
Example #7
0
        public ControlWrapper(Vector2 anchor, Vector2 offset)
            : base(anchor, offset, "", "")
        {
            Update += () =>
            {
                if (!inited)
                {
                    Control.Init();

                    inited = true;
                }

                Control.Update();

                if (OnUpdate != null)
                {
                    OnUpdate(this);
                }
                if (GlobalUpdate != null)
                {
                    GlobalUpdate(this);
                }
            };
        }
Example #8
0
 public void Init()
 {
     sprite.SetState(spriteId);
     smoke.SetState(spriteId);
     control.Init();
 }
        /// <summary>
        /// Adds a Control to the child controls list
        /// </summary>
        /// <param name="control">The Control to add</param>
        public void AddControl(Control control)
        {
            controls.Add(control);

            control.ID = controls.Count - 1;

            control.Parent = new WeakReference<IControlParent>(this);

            control.Init();

            if (OnAddControl != null)
                OnAddControl(this, control);
            if (GlobalAddControl != null)
                GlobalAddControl(this, control);

            if (control.OnAdded != null)
                control.OnAdded(control, null);
            if (Control.GlobalAdded != null)
                Control.GlobalAdded(control, null);
        }
Example #10
0
        /// <summary>
        /// Adds a control to the GUI
        /// </summary>
        /// <param name="control">The control to add</param>
        public static void AddControl(Control control)
        {
            control.ID = CustomUI.Controls.Count;

            CustomUI.Controls.Add(control);

            control.Init();

            if (OnControlAdded != null)
                OnControlAdded(control);
            if (control.OnAdded != null)
                control.OnAdded(control, null);
            if (Control.GlobalAdded != null)
                Control.GlobalAdded(control, null);
        }