Exemplo n.º 1
0
        private void Ta_ProcessCompleted(object sender, EventArgs e)
        {
            try
            {
                PersoProcessingOutcome tpo = (e as PersoProcessingOutcomeEventArgs).TerminalProcessingOutcome;
                if (tpo == null)//error occurred, error displayed via Ta_ExceptionOccured
                {
                    return;
                }

                if (tpo is PersoProcessingOutcome)
                {
                    SetStatusLabel("Complete");

                    if (tpo.GPRegistry != null)
                    {
                        GPRegistry reg = tpo.GPRegistry;
                        PrintRegistry(reg);
                    }
                }
                else
                {
                    SetStatusLabel(string.Format("{0}\n{1}", tpo.UserInterfaceRequest.MessageIdentifier, tpo.UserInterfaceRequest.Status));
                }
            }
            catch (Exception ex)
            {
                SetStatusLabel(ex.Message);
            }
        }
Exemplo n.º 2
0
        private void PrintRegistry(GPRegistry reg)
        {
            foreach (GPRegistryEntry e in reg.entries.Values)
            {
                AID aid = e.getAID();
                Log(e.getType() + ": " + Formatting.ByteArrayToHexString(aid.getBytes()) + " (" + e.getLifeCycleString() + ")");
                if (e.getDomain() != null)
                {
                    Log("\t" + "Parent:  " + e.getDomain());
                }
                else
                {
                    Log("\t" + "No Parent");
                }

                AppVM vm = new AppVM();
                vm.AID  = Formatting.ByteArrayToHexString(aid.getBytes());
                vm.Type = e.getType().ToString();
                AddToList(vm);

                if (e.getType() == Kind.ExecutableLoadFile)
                {
                    GPRegistryEntryPkg pkg = (GPRegistryEntryPkg)e;
                    if (pkg.getVersion() != null)
                    {
                        Log("\t" + "Version: " + pkg.getVersionString());
                    }
                    else
                    {
                        Log("\t" + "No Version");
                    }

                    vm.Version = "Version: " + pkg.getVersionString();

                    if (pkg.getModules().Count == 0)
                    {
                        Log("\t" + "No Executable Modules");
                    }

                    vm.LifeCycle = pkg.getLifeCycleString();

                    foreach (AID a in pkg.getModules())
                    {
                        Log("\t" + "Applet:  " + Formatting.ByteArrayToHexString(a.getBytes()));
                        Log(" (" + Formatting.ByteArrayToHexString(a.getBytes()) + ")");
                    }
                }
                else
                {
                    GPRegistryEntryApp app = (GPRegistryEntryApp)e;
                    if (app.getLoadFile() != null)
                    {
                        Log("\t" + "From:    " + app.getLoadFile());
                    }
                    else
                    {
                        Log("\t" + "No Load File");
                    }


                    if (!app.getPrivileges().isEmpty())
                    {
                        Log("\t" + "Privs:   " + app.getPrivileges());
                        vm.Privileges = app.getPrivileges().ToString();
                    }
                    else
                    {
                        Log("\t" + "No Privileges");
                        vm.Privileges = "No Privileges";
                    }

                    vm.LifeCycle = app.getLifeCycleString();
                }
            }
        }