コード例 #1
0
        /// <summary>
        /// Signal emitted when the pressed animation has completed.
        /// </summary>The animation source.
        /// <param name="source">The animation source.</param>
        /// <param name="e">event</param>
        private void OnPressedAnimationFinished(object source, EventArgs e)
        {
            mPressedAnimation = null;
            if (mPressedView != null)
            {
                string name = mPressedView.Name;

                this.Deactivate();
                object item = Activator.CreateInstance(global::System.Type.GetType("UIControlSample." + name));
                if (item is IExample)
                {
                    this.Deactivate();
                    global::System.GC.Collect();
                    global::System.GC.WaitForPendingFinalizers();

                    currentSample = item as IExample;
                    if (currentSample != null)
                    {
                        currentSample.Activate();
                    }
                }
                else
                {
                    Log.Error("Example", "FAILED : " + name);
                }

                mPressedView = null;
            }
        }
コード例 #2
0
        private void RunSample(string name)
        {
            Assembly assembly = typeof(DaliDemo).Assembly;

            Type     exampleType = assembly?.GetType(name);
            IExample example     = assembly?.CreateInstance(name) as IExample;

            if (null != example)
            {
                DeleteDaliDemo();
                int    exceptNum        = 0;
                string exceptionMessage = "Unknown!";
                try
                {
                    example.Activate();
                }
                catch (Exception e)
                {
                    if (e is global::System.EntryPointNotFoundException)
                    {
                        Tizen.Log.Fatal("NUI", $"@@ ERROR! No dali-csharp-binding! Exception={e.Message} \n");
                        exceptNum        = 1;
                        exceptionMessage = e.Message;
                    }
                    else if (e is global::System.ArgumentException)
                    {
                        Tizen.Log.Fatal("NUI", $"@@ ERROR! this comes when VideoView test on Ubuntu! Exception={e.Message} \n");
                        exceptNum        = 2;
                        exceptionMessage = e.Message;
                    }
                }
                switch (exceptNum)
                {
                case 0:
                default:
                    break;

                case 1:
                case 2:
                    example.Deactivate();
                    var errorPage = assembly?.CreateInstance("Tizen.NUI.Samples.ShowErrorPage") as ShowErrorPage;
                    errorPage.Activate();
                    errorPage.ShowExcpetionText(exceptionMessage);
                    example = errorPage;
                    break;
                }
                curExample = example;
            }
        }
コード例 #3
0
ファイル: DaliDemo.cs プロジェクト: yunmiha/TizenFX
        private void RunSample(string name)
        {
            Assembly assembly = typeof(DaliDemo).Assembly;

            Type     exampleType = assembly?.GetType(name);
            IExample example     = assembly?.CreateInstance(name) as IExample;

            if (null != example)
            {
                DeleteDaliDemo();

                example.Activate();
            }

            curExample = example;
        }
コード例 #4
0
        private void RunSample(string name)
        {
            IExample example = typeof(Program).Assembly?.CreateInstance(name) as IExample;

            Console.WriteLine($"@@@ typeof(Program).Assembly={typeof(Program).Assembly}, name={name}");

            if (example != null)
            {
                example.Activate();
            }
            else
            {
                Console.WriteLine($"@@@ examle is null!");
            }
            currentExample = example;
        }
コード例 #5
0
        private void RunSample(string name)
        {
            IExample example = typeof(Program).Assembly?.CreateInstance(name) as IExample;


            Console.WriteLine($"typeof(Program).Assembly={typeof(Program).Assembly}, name={name}");

            if (example != null)
            {
                example.Activate();
                if (example is Page examplePage)
                {
                    navigator.Push(examplePage);
                }
            }
            else
            {
                Console.WriteLine($"examle is null!");
            }
        }
コード例 #6
0
ファイル: DaliDemo.cs プロジェクト: yunmiha/TizenFX
        private void RunSample(string name)
        {
            Assembly assembly = typeof(DaliDemo).Assembly;

            Type     exampleType = assembly?.GetType(name);
            IExample example     = assembly?.CreateInstance(name) as IExample;

            curPageIndex = demo.GetCurrentPageIndex();

            if (null != example)
            {
                DeleteDaliDemo();

                example.Activate();
            }

            curExample = example;

            backNavigation.Show();
            backNavigation.RaiseToTop();
        }
コード例 #7
0
        private void RunSample(string name)
        {
            IExample example = typeof(Program).Assembly?.CreateInstance(name) as IExample;


            Console.WriteLine($"@@@ typeof(Program).Assembly={typeof(Program).Assembly}, name={name}");

            if (example != null)
            {
                example.Activate();
                if (example is Page examplePage)
                {
                    examplePage.Focusable = true;
                    navigator.Push(examplePage);
                    FocusableExtension.SetFocusOnPage(examplePage);
                }
            }
            else
            {
                Console.WriteLine($"@@@ examle is null!");
            }
        }
コード例 #8
0
        /// <summary>
        /// The call back for the KeyEvent of grid
        /// </summary>
        /// <param name="source">the object</param>
        /// <param name="e">the args of the event</param>
        /// <returns>return whether the key has been consumed</returns>
        private bool DoTilePress(object source, View.KeyEventArgs e)
        {
            GridView gridView = source as GridView;

            if (e.Key.State == Key.StateType.Down)
            {
                if (e.Key.KeyPressedName == "Return")
                {
                    int focusedGroupIndex = 0;
                    int focusedItemIndex  = 0;
                    gridView.GetFocusItemIndex(out focusedGroupIndex, out focusedItemIndex);
                    if (focusedItemIndex == 3)
                    {
                        //ShowMainPage
                        Tizen.Log.Fatal("NUI", " Item 3 Clicked!!!!!!!!!!!!!!");
                        Deactivate();
                        object item = Activator.CreateInstance(global::System.Type.GetType("Tizen.NUI.MediaHub." + "MainPage"));
                        if (item is IExample)
                        {
                            this.Deactivate();
                            global::System.GC.Collect();
                            global::System.GC.WaitForPendingFinalizers();

                            currentSample = item as IExample;
                            if (currentSample != null)
                            {
                                currentSample.Activate();
                            }
                        }
                    }

                    return(true);
                }
            }

            return(false);
        }