Exemplo n.º 1
0
        private void service_RequestPresentationEvent(object sender, EventArgs e)
        {
            ApplicatoinService service = (ApplicatoinService)sender;
            int index = this.services.IndexOf(service);

            if (index >= 0)
            {
                this.wantToPresentationIndex = index;
                if (this.isPrensening == false)
                {
                    if (this.CurrentMidIndex == index)
                    {
                        this.Presentation(index);
                    }
                    else
                    {
                        this.ReSetOpacityForOverflow(index, this.CurrentMidIndex);
                        this.CurrentMidIndex = index;
                    }
                }
                else
                {
                    if (index != this.CurrentMidIndex)
                    {
                        this.GoToNormal();
                    }
                }
            }
        }
Exemplo n.º 2
0
        private void AddPresentationMenu()
        {
            KMenu menu = new KMenu();

            menu.RenderLayout      = LayoutType.Even;
            menu.RenderOrientation = LayoutOrirentation.Up;
            menu.Width             = menu.Height = 300;

            ApplicatoinService service = this.services[this.CurrentMidIndex];
        }
Exemplo n.º 3
0
 private void kioskMenu_FireEvent(object sender, KMenuArgs e)
 {
     for (int index = 0; index < this.services.Count; index++)
     {
         ApplicatoinService service = this.services[index];
         if (service.ID == e.Key)
         {
             this.Presentation(index, true);
             break;
         }
     }
 }
Exemplo n.º 4
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);
                        }
                    }
                }
            }
        }