Beispiel #1
0
 public void InitTopFrame()
 {
     if (m_TopFrame == null)
     {
         m_TopFrame = NGUITools.AddChild(GameMain.Instance.m_TopIndicator, m_TopFramePrefab).GetComponent <TopFrame>();
     }
     m_TopFrame.Init();
     CheckNotify();
     m_TopFrame.UpdateNotify();
 }
Beispiel #2
0
        public AppWindow()
        {
            InitializeComponent();

            restoreLocation = this.Location;
            restoreSize     = this.Size = new Size(900, 600);

            this.BackColor       = this.DarkColor;
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            this.Icon            = Properties.Resources.Icon;
            this.StartPosition   = FormStartPosition.CenterScreen;
            this.Text            = "IDPs Biometric Enumeration";
            //this.MinimumSize = this.Size;
            //RegisterToMoveWindow(this);
            maximizedChanged = new EventHandler(DefaultEventHandler);

            //container
            container = new Container(this);
            this.Controls.Add(container);

            //titleBar
            titleBar = new TitleBar(this);
            this.Controls.Add(titleBar);
            RegisterToMoveWindow(titleBar);
            this.TitleBar.RefreshTitleBar(true, true, false);

            //left panel
            pnlLeft = new LeftPanel(this);
            this.Controls.Add(pnlLeft);

            //statusBar
            statusBar = new StatusBar(this);
            //this.Controls.Add(statusBar);

            //topFrame
            topFrame = new TopFrame(this);
            this.Controls.Add(topFrame);
            //bottomFrame
            bottomFrame = new BottomFrame(this);
            this.Controls.Add(bottomFrame);
            //leftFrame
            leftFrame = new LeftFrame(this);
            this.Controls.Add(leftFrame);
            //rightFrame
            rightFrame = new RightFrame(this);
            this.Controls.Add(rightFrame);

            //login form
            Body.Controls.Add(new LoginForm(this));

            FitToScreen();
        }
Beispiel #3
0
        public MagicButton()
        {
            InitializeComponent();

            ActionButton.SetBinding(Button.TextProperty, new Binding(nameof(Text), source: this));
            ActionButton.SetBinding(Button.FontSizeProperty, new Binding(nameof(FontSize), source: this));
            ActionButton.SetBinding(Button.TextColorProperty, new Binding(nameof(TextColor), source: this));
            ActionButton.SetBinding(Button.CommandProperty, new Binding(nameof(Command), source: this));

            GradientView.SetBinding(GradientView.GradientSourceProperty, new Binding(nameof(CssGradientSource), source: this));

            TopFrame.SetBinding(Frame.CornerRadiusProperty, new Binding(nameof(CornerRadius), source: this));
        }
Beispiel #4
0
 private void NavigationView_ItemInvoked(NavigationView sender, NavigationViewItemInvokedEventArgs args)
 {
     if (args.InvokedItem is TextBlock ItemContent)
     {
         try
         {
             Type type = Type.GetType($"locuste.dashboard.deploy.uwp.Frames.{ItemContent.Tag}");
             TopFrame.Navigate(type);
         }
         catch
         {
             TopFrame.Navigate(typeof(ErrorFrame));
         }
     }
 }
Beispiel #5
0
        public void CallFunction(IFunction fct)
        {
            List <IValue> locvars    = new List <IValue>();
            List <IValue> parameters = new List <IValue>();

            List <ICILType> fct_param = fct.ArgVar;


            // On créer tout ce qu'il faut pour faire un container
            // Variables locales, que l'on trouve dans la définition de la fct
            foreach (var locvar in fct.LocVar)
            {
                locvars.Add(new Value(locvar, null));
            }

            // Paramètres, que l'on trouve sur la stack
            int i = 0;

            while (i < fct_param.Count)
            {
                // On choppe le paramètre
                IValue tmp;

                try
                {
                    tmp = TopFrame.Pop();
                }
                catch (Exception e)
                {
                    _engine.ClashError(new RunTimeError(_engine, "Pas assez de paramètre"));
                    return;
                }
                // On regarde si le type correspond avec celui de la fct
                if (tmp.Type.FullName == fct_param[i].FullName)
                {
                    parameters.Add(tmp);
                }
                else
                {
                    _engine.ClashError(new RunTimeError(_engine, "Error with type params"));
                }
                i++;
            }

            _frame.Add(new Container(locvars, parameters, fct, this));
        }
Beispiel #6
0
        /// <summary>
        /// Handle specified command
        /// </summary>
        /// <param name="command">Command to handle</param>
        /// <param name="handleTabIndex">whether to handle tab index</param>
        /// <returns>True if command is handled, otherwise false</returns>
        /// <remarks>
        /// 1- This method first allow focused control (if exist) to handle command
        /// 2- if not let the control that is under mouse cursor to handle command
        /// 3- if not then go through controls and let each to handle command
        /// 4- if not and handleTabIndex is true :
        ///     if command is Up   : PreviousTab()
        ///     if command is Down : NextTab()
        /// 5- Handle cancel command as Back
        /// as soon as first control handled the command ignore next steps
        /// </remarks>
        public virtual bool HandleCommand(UICommand command, bool handleTabIndex = true)
        {
            bool handled = false;

            if (TopDialog != null)
            {
                handled = TopDialog.HandleCommand(command, handleTabIndex);
            }
            else if (TopFrame != null)
            {
                handled = TopFrame.HandleCommand(command, handleTabIndex);
            }

            //if (!handled)
            //{
            //    if (command.Key == KeyCommand.Cancel && _DialogStack.Count == 0 && _ViewStack.Count > 0)
            //    {
            //        Back();
            //        handled = true;
            //    }
            //}
            return(handled);
        }
Beispiel #7
0
        /// <summary>
        /// Update Menu
        /// </summary>
        public virtual void Update()
        {
            bool isValidToProcessNextRequest = true;

            if (_EnteringFrame != null)
            {
                if (_EnteringFrame.EnterFrame())
                {
                    _EnteringFrame = null;
                }
                else
                {
                    isValidToProcessNextRequest = false;
                }
            }
            else if (_ShowingFrame != null)
            {
                if (_ShowingFrame.ShowFrame())
                {
                    _ShowingFrame = null;
                }
                else
                {
                    isValidToProcessNextRequest = false;
                }
            }

            if (isValidToProcessNextRequest)
            {
                if (_ClearRequest)
                {
                    _ViewStack.Clear();
                    _DialogStack.Clear();
                    _ClearRequest = false;
                }
                // there was a request to show previous frame
                else if (_BackRequest)
                {
                    if (_ViewStack.Count > 0)
                    {
                        bool cancel = false;
                        if (_ViewStack.Peek().LeaveFrame(ref cancel)) // let current frame leave
                        {
                            if (!cancel)                              // if current frame do not cancel operation
                            {
                                _ViewStack.Pop();                     // remove top frame
                                if (_ViewStack.Count > 0)
                                {
                                    _ShowingFrame = _ViewStack.Peek();
                                    if (_ShowingFrame.ShowFrame())
                                    {
                                        _ShowingFrame = null;
                                    }
                                }
                                else
                                {
                                    // stack is empty
                                    OnExit();
                                }
                            }
                            _BackRequest = false;
                        }
                        // else wait until current visible frame leave successfully
                    }
                }
                // there was a request to show a frame
                else if (_FrameToShowNext != null)
                {
                    bool enter = false; // can we show next frame or should wait?
                    if (_ViewStack.Count > 0)
                    {
                        enter = _ViewStack.Peek().HideFrame();
                    }
                    else
                    {
                        enter = true;
                    }
                    if (enter) // previous frame hide successfully, so we can show next frame
                    {
                        _ViewStack.Push(_FrameToShowNext);
                        _EnteringFrame = _FrameToShowNext;
                        if (_EnteringFrame.EnterFrame())
                        {
                            _EnteringFrame = null;
                        }
                        _FrameToShowNext = null;
                    }
                    // else wait until current visible frame hide successfully
                }
                // there was a request to show a dialog
                else if (_DialogToShowNext != null)
                {
                    _DialogStack.Push(_DialogToShowNext);
                    _EnteringFrame = _DialogToShowNext;
                    if (_EnteringFrame.EnterFrame())
                    {
                        _EnteringFrame = null;
                    }
                    _DialogToShowNext = null;
                }
            }

            if (TopFrame != null)
            {
                TopFrame.Update();
            }
            if (_DialogStack.Count > 0)
            {
                foreach (Frame dialog in _DialogStack)
                {
                    dialog.Update();
                }
            }

            // check to see if top most dialog provides a valid result and needs to close
            if (_DialogStack.Count > 0)
            {
                Frame dialog = _DialogStack.Peek();
                if (dialog.DialogResult != DialogResult.None) // if dialog provides valid result
                {
                    bool cancel = false;
                    if (dialog.LeaveFrame(ref cancel))   // let current dialog leave
                    {
                        if (!cancel)                     // if current dialog do not cancel operation
                        {
                            dialog = _DialogStack.Pop(); // remove it from stack
                            if (_DialogStack.Count > 0)
                            {
                                _DialogStack.Peek().HandleDialog(dialog);// return message to lower level dialog
                            }
                            else if (_ViewStack.Count > 0)
                            {
                                _ViewStack.Peek().HandleDialog(dialog);// return message to lower level frame
                            }
                        }
                    }
                    // else wait until top dialog leave successfully
                }
            }
        }
Beispiel #8
0
 public MainPage()
 {
     InitializeComponent();
     TopFrame.Navigate(typeof(WelcomePage));
 }
        private bool OnDayOfWeekTimer()
        {
            try
            {
                if (!TimerDow)
                {
                    return(true);
                }

                // 오전 5시 이후에 요일 변경
                DateTime date;
                if (DateTime.Now.Hour >= 5)
                {
                    date = DateTime.Now;
                }
                else
                {
                    date = DateTime.Now.AddDays(-1);
                }

                if (ClassId == "1" && CurrentDow == date.DayOfWeek)
                {
                    return(true);
                }
                CurrentDow = date.DayOfWeek;

                // 요일별 색상 적용
                string hexColor = App.GetDayOfWeekColor(CurrentDow);

                Device.BeginInvokeOnMainThread(async() =>
                {
                    // 날짜 전화 애니메이션 (0: 처음 실행O, 1: 처음 실행X, 처음 실행한 경우 애니메이션 X)
                    if (ClassId == "1")
                    {
                        _ = TopFrame.FadeTo(0.5, 250, Easing.SpringOut);
                        await CurrentDateText.FadeTo(0, 150, Easing.SpringOut);

                        if (Device.RuntimePlatform == Device.Android)
                        {
                            DependencyService.Get <IAppearanceControl>().SetStatusBarColor($"#{hexColor}");
                        }
                        TopFrame.BackgroundColor = Color.FromHex(hexColor);
                        CurrentDateText.Text     = date.ToString("dddd", new CultureInfo("ko-kr"));

                        _ = TopFrame.FadeTo(1, 1000, Easing.SpringIn);
                        await CurrentDateText.FadeTo(1, 1500, Easing.SpringIn);
                    }
                    else
                    {
                        ClassId = "1";
                        if (Device.RuntimePlatform == Device.Android)
                        {
                            DependencyService.Get <IAppearanceControl>().SetStatusBarColor($"#{hexColor}");
                        }
                        TopFrame.BackgroundColor = Color.FromHex(hexColor);
                        CurrentDateText.Text     = date.ToString("dddd", new CultureInfo("ko-kr"));
                    }
                });
            }
            catch (Exception ex)
            {
                App.DisplayEx(ex);
            }

            return(true);
        }