Exemplo n.º 1
0
        private void GoToNormal()
        {
            if (this.isPrensening && this.isAnimation == false)
            {
                KioskLog.Instance().Info("Shell", "GoToNormal");
                this.services[this.CurrentMidIndex].BeginBackground();
                this.isPrensening = false;
                this.isAnimation  = true;
                if (this.FullScreenPanel.Children.Count > 0)
                {
                    UIElement ui = this.FullScreenPanel.Children[0];
                    this.FullScreenPanel.Children.Remove(ui);
                    this.gdAnimationView.Children.Add(ui);
                    this.FullScreenPanel.IsHitTestVisible = false;
                    this.FullScreenPanel.ClearValue(Panel.BackgroundProperty);
                }

                if (this.fullScreenSb != null)
                {
                    this.fullScreenSb.Stop();
                }

                if (this.normalSb == null)
                {
                    this.normalSb            = this.GetNormalScreenStory();
                    this.normalSb.Completed += this.normalSb_Completed;
                }
                this.gdAnimationView.CacheMode = new BitmapCache(0.2);
                this.recBack.Visibility        = System.Windows.Visibility.Visible;
                this.normalSb.Begin();
            }
        }
Exemplo n.º 2
0
        private void InitModules()
        {
            if (this.services == null)
            {
                this.services = new List <ApplicatoinService>();
            }
            List <WebAppPlugin> plugins = new List <WebAppPlugin>();

            LoadModules.Load(this.services, plugins);

            NameValueCollection section = ConfigurationManager.GetSection("CustomerConfig/BrowserInfo") as NameValueCollection;

            foreach (string key in section.AllKeys)
            {
                string content = section[key];
                Kiosk.Browser.Service service = new Kiosk.Browser.Service(key, content);
                this.services.Add(service);

                foreach (WebAppPlugin plugin in plugins)
                {
                    if (plugin.GetHostName() == service.GetApplicationName())
                    {
                        service.AddPlugin(plugin);
                    }
                }
            }

            KioskLog.Instance().Info("Shell", "InitModules");
        }
Exemplo n.º 3
0
        private void Shell_Loaded(object sender, RoutedEventArgs e)
        {
            this.viewers = new List <UIElement>();
            foreach (ApplicatoinService service in services)
            {
                try
                {
                    viewers.Add((UIElement)service.GetViewer());
                    service.CloseApp                 += service_CloseApp;
                    service.OnNotificationEvent      += service_OnNotificationEvent;
                    service.RequestPresentationEvent += service_RequestPresentationEvent;
                    KMenuItem item = new KMenuItem(service.ID, service.GetApplicationName());
                    this.kioskMenu.Items.Add(item);
                }
                catch (Exception ex)
                {
                    KioskLog.Instance().Info("Shell", ex.StackTrace);
                }
            }

            for (int i = 0; i < this.viewers.Count; i++)
            {
                Ellipse elp = new Ellipse();
                elp.Width  = elp.Height = 10;
                elp.Fill   = Brushes.Silver;
                elp.Margin = new Thickness(10, 0, 10, 0);
                this.stkIndicator.Children.Add(elp);
            }
            this.LoadModulesToViewport3D(viewers);

            this.ModelAngle             = 64.313725490196077;
            this.XDistanceBetweenModels = 0.82189542483660138;
            this.ZDistanceBetweenModels = 2.0;
            this.MidModelDistance       = 2.5;

            this.kioskMenu.ItemColor = new SolidColorBrush(Color.FromArgb(255, 87, 87, 129));
            this.kioskMenu.Render();

            CurrentMidIndex = StartIndex;
            KioskLog.Instance().Info("Shell", "Shell_Loaded");
        }
Exemplo n.º 4
0
        private void Presentation(int index, bool needStarted = false)
        {
            if (this.isPrensening == false && isAnimation == false)
            {
                KioskLog.Instance().Info("Shell", "Presentation");
                ReSetOpacityForOverflow(index, this.CurrentMidIndex);
                this.CurrentMidIndex = index;
                UIElement visual = (UIElement)this.services[index].GetViewer();
                if (visual != null)
                {
                    this.needStartApp = needStarted;
                    Panel panel = Shell.GetOverFlowParent(visual);
                    if (panel.Children.Contains(visual))
                    {
                        panel.Children.Remove(visual);
                    }
                    this.gdAnimationView.Children.Add(visual);

                    this.GoToFullScreen(needStarted);
                }
            }
        }
Exemplo n.º 5
0
        public static void Load(List <ApplicatoinService> appServiceContainer, List <WebAppPlugin> plugins)
        {
            if (appServiceContainer != null && plugins != null)
            {
                string rootPath      = System.Environment.CurrentDirectory;
                string moduleAddress = string.Format(modulesPath, rootPath);
                System.Console.WriteLine(moduleAddress);

                if (Directory.Exists(moduleAddress) == false)
                {
                    Directory.CreateDirectory(moduleAddress);
                }

                string[] files = Directory.GetFiles(moduleAddress);
                foreach (string file in files)
                {
                    System.Console.WriteLine(file);
                    if (file.EndsWith(".dll"))
                    {
                        try
                        {
                            Assembly lib = Assembly.LoadFile(file);

                            System.Console.WriteLine(lib.FullName);
                            foreach (Type ty in lib.GetExportedTypes())
                            {
                                if (ty.IsSubclassOf(typeof(ApplicatoinService)))
                                {
                                    try
                                    {
                                        ApplicatoinService app = (ApplicatoinService)lib.CreateInstance(ty.FullName);
                                        UIElement          ui  = app.GetViewer() as UIElement;
                                        if (ui != null)
                                        {
                                            appServiceContainer.Add(app);
                                        }
                                    }
                                    catch (Exception ex)
                                    {
                                        System.Console.WriteLine(ex.StackTrace);
                                        KioskLog.Instance().Error("LoadModules", ex.Message + ex.StackTrace);
                                    }

                                    break;
                                }
                                else if (ty.IsSubclassOf(typeof(WebAppPlugin)))
                                {
                                    WebAppPlugin plugin = (WebAppPlugin)lib.CreateInstance(ty.FullName);
                                    plugins.Add(plugin);
                                    break;
                                }
                            }
                        }
                        catch (Exception ex)
                        {
                            System.Console.WriteLine(ex.Message);
                            KioskLog.Instance().Error("LoadModules", ex.Message + ex.StackTrace);
                        }
                    }
                }
            }
        }
Exemplo n.º 6
0
 void App_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
 {
     KioskLog.Instance().Error("All", e.Exception.StackTrace);
     e.Handled = true;
 }