예제 #1
0
        private void InitializeClient()
        {
        #if NET40
            if (System.Environment.OSVersion.Platform == PlatformID.Unix)
            {
                Client = new LinuxClient();
            }
            else
            {
                Client = new WindowsClient();
            }

            // Non-Windows platforms are only supported through .NET Standard 2.1 at the moment
        #elif NETSTANDARD2_0
            if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
            {
                Client = new WindowsClient();
            }
            else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
            {
                #if Android
                Client = new AndroidClient();
                #else
                Client = new LinuxClient();
                #endif
            }
            else
            {
                Client = new LinuxClient();
            }
            // Use Windows as default for safety
        #else
            Client = new WindowsClient();
        #endif
        }
예제 #2
0
    private IClient GetClient(RuntimePlatform platform)
    {
        IClient client = null;

        switch (platform)
        {
        case RuntimePlatform.WindowsPlayer:
            client = new WindowsClient();
            break;

        case RuntimePlatform.WindowsEditor:
            client = new WindowsClient();
            break;

        case RuntimePlatform.Android:
            client = new AndroidClient();
            break;

        case RuntimePlatform.IPhonePlayer:
            client = new IOSClient();
            break;
        }

        return(client);
    }
예제 #3
0
        private void SaveComputerInfo(string make, string model)
        {
            //save to database through entity framework
            using (var ctx = new Context())
            {
                WindowsClient windowsCleint = new WindowsClient()
                {
                    Make = make, Model = model, TimeAdded = DateTime.Now.ToUniversalTime()
                };

                ctx.WindowsClients.Add(windowsCleint);

                ctx.SaveChanges();
            }
        }