private void InitializeGraphicsComponents(GraphicsDeviceEventArgs e)
 {
     // Load services, textures and initialize spritebatch
     _serviceProvider   = new SimpleProvider(xnaViewport.GraphicsService);
     _spriteBatch       = new SpriteBatch(e.GraphicsDevice);
     _textureDictionary = new Textures(_serviceProvider);
 }
Esempio n. 2
0
    public static int Main(string[] args)
    {
        SimpleProvider agent = null;

        try
        {
            if (args.Length < 2)
            {
                Console.WriteLine("Usage: SimpleProvider /zone zone /url url [/events] [options]");
                Console.WriteLine("    /zone zone     The name of the zone");
                Console.WriteLine("    /url url       The zone URL");
                Console.WriteLine("    /events        Periodically send change events");
                AdkExamples.printHelp();
                return(0);
            }

            Console.ForegroundColor = ConsoleColor.Green;

            //	Pre-parse the command-line before initializing the ADK
            Adk.Debug = AdkDebugFlags.None;
            AdkExamples.parseCL(null, args);

            //  Initialize the ADK with the specified version, loading only the Student SDO package
            Adk.Initialize(SifVersion.SIF23, SIFVariant.SIF_UK, (int)SdoLibraryType.All);

            //  Start the agent...
            agent = new SimpleProvider();

            // Call StartAgent. This method does not return until the agent shuts down
            agent.startAgent(args);

            //	Wait for Ctrl-C to be pressed
            Console.WriteLine("Agent is running (Press Ctrl-C to stop)");
            new AdkConsoleWait().WaitForExit();
        }
        catch (Exception e)
        {
            Console.WriteLine(e);
        }
        finally
        {
            if (agent != null && agent.Initialized)
            {
                //  Always shutdown the agent on exit
                try
                {
                    agent.Shutdown
                        (AdkExamples.Unreg
                             ? ProvisioningFlags.Unregister
                             : ProvisioningFlags.None);
                }
                catch (AdkException adkEx)
                {
                    Console.WriteLine(adkEx);
                }
            }
        }
        return(0);
    }
Esempio n. 3
0
    public static int Main(string[] args)
    {
        SimpleProvider agent = null;
        try
        {
            if (args.Length < 2)
            {
                Console.WriteLine("Usage: SimpleProvider /zone zone /url url [/events] [options]");
                Console.WriteLine("    /zone zone     The name of the zone");
                Console.WriteLine("    /url url       The zone URL");
                Console.WriteLine("    /events        Periodically send change events");
                AdkExamples.printHelp();
                return 0;
            }

            Console.ForegroundColor = ConsoleColor.Green;

            //	Pre-parse the command-line before initializing the ADK
            Adk.Debug = AdkDebugFlags.None;
            AdkExamples.parseCL(null, args);

            //  Initialize the ADK with the specified version, loading only the Student SDO package
            Adk.Initialize(SifVersion.SIF23, SIFVariant.SIF_UK, (int)SdoLibraryType.All );

            //  Start the agent...
            agent = new SimpleProvider();

            // Call StartAgent. This method does not return until the agent shuts down
            agent.startAgent(args);

            //	Wait for Ctrl-C to be pressed
            Console.WriteLine("Agent is running (Press Ctrl-C to stop)");
            new AdkConsoleWait().WaitForExit();
        }
        catch (Exception e)
        {
            Console.WriteLine(e);
        }
        finally
        {
            if (agent != null && agent.Initialized)
            {
                //  Always shutdown the agent on exit
                try
                {
                    agent.Shutdown
                        (AdkExamples.Unreg
                             ? ProvisioningFlags.Unregister
                             : ProvisioningFlags.None);
                }
                catch (AdkException adkEx)
                {
                    Console.WriteLine(adkEx);
                }
            }
        }
        return 0;
    }
Esempio n. 4
0
        static void Main(string[] args)
        {
            // To run this program directly after build, in shell, type:
            //   dotnet run bin/Debug/netcoreapp2.1/simple.dll

            var cypherQueryText = @"
                |MATCH (d:device)-[:belongsTo]->(t:tenant)
                |MATCH (d)-[:runs]->(a:app)
                |RETURN t.id as TenantId, a.AppName as AppName, COUNT(d) as DeviceCount
            ".StripMargin();

            Console.WriteLine("Input openCypher Query:");
            Console.WriteLine(cypherQueryText);

            var graphDef = new SimpleProvider();

            var plan      = LogicalPlan.ProcessQueryTree(OpenCypherParser.Parse(cypherQueryText, null), graphDef, null);
            var sqlRender = new SQLRenderer(graphDef, null);
            var tSqlQuery = sqlRender.RenderPlan(plan);

            Console.WriteLine("Output T-SQL Query:");
            Console.WriteLine(tSqlQuery);
        }
Esempio n. 5
0
 internal ResultCache(Func<Category, Result> obtainResult)
     : base(NextObjectId++)
 {
     Provider = new SimpleProvider(obtainResult);
 }
Esempio n. 6
0
        public static int Main(string [] args)
        {
            string       output = "tree";
            HelpSource   hs;
            ArrayList    list = new ArrayList();
            EcmaProvider ecma = null;
            bool         sort = false;

            int argc = args.Length;

            for (int i = 0; i < argc; i++)
            {
                string arg = args [i];

                switch (arg)
                {
                case "-o":
                case "--out":
                    if (i < argc)
                    {
                        output = args [++i];
                    }
                    else
                    {
                        Usage();
                        return(1);
                    }
                    break;

                case "--ecma":
                    if (i < argc)
                    {
                        if (ecma == null)
                        {
                            ecma = new EcmaProvider();
                            list.Add(ecma);
                            sort = true;
                        }
                        ecma.AddDirectory(args [++i]);
                    }
                    else
                    {
                        Usage();
                        return(1);
                    }
                    break;

                case "--xhtml":
                case "--hb":
                    if (i < argc)
                    {
                        Provider populator = new XhtmlProvider(args [++i]);

                        list.Add(populator);
                    }
                    else
                    {
                        Usage();
                        return(1);
                    }
                    break;

                case "--man":
                    if (i < argc)
                    {
                        int      countfiles = args.Length - ++i;
                        string[] xmlfiles   = new String[countfiles];
                        for (int a = 0; a < countfiles; a++)
                        {
                            xmlfiles[a] = args [i];
                            i++;
                        }
                        Provider populator = new ManProvider(xmlfiles);

                        list.Add(populator);
                    }
                    else
                    {
                        Usage();
                        return(1);
                    }
                    break;

                case "--simple":
                    if (i < argc)
                    {
                        Provider populator = new SimpleProvider(args [++i]);

                        list.Add(populator);
                    }
                    else
                    {
                        Usage();
                        return(1);
                    }
                    break;

                case "--error":
                    if (i < argc)
                    {
                        Provider populator = new ErrorProvider(args [++i]);

                        list.Add(populator);
                    }
                    else
                    {
                        Usage();
                        return(1);
                    }
                    break;

                case "--ecmaspec":
                    if (i < argc)
                    {
                        Provider populator = new EcmaSpecProvider(args [++i]);

                        list.Add(populator);
                    }
                    else
                    {
                        Usage();
                        return(1);
                    }
                    break;

                case "--addins":
                    if (i < argc)
                    {
                        Provider populator = new AddinsProvider(args [++i]);
                        list.Add(populator);
                    }
                    else
                    {
                        Usage();
                        return(1);
                    }
                    break;

                default:
                    Usage();
                    return(1);
                }
            }

            hs = new HelpSource(output, true);

            foreach (Provider p in list)
            {
                p.PopulateTree(hs.Tree);
            }

            if (sort)
            {
                hs.Tree.Sort();
            }

            //
            // Flushes the EcmaProvider
            //
            foreach (Provider p in list)
            {
                p.CloseTree(hs, hs.Tree);
            }

            hs.Save();
            return(0);
        }