Exemple #1
0
    public static int Main(string[] args)
    {
        if (args.Length != 2)
        {
            Console.Error.WriteLine("Usage: {0} <label> <mount point>",
                                    Process.GetCurrentProcess().ProcessName);
            return(1);
        }
        string label = args[0], point = args[1];

        List <string> volumes         = VolumeUtils.GetVolumeNames();
        List <string> matchingVolumes = volumes.Where(
            volume => VolumeUtils.GetVolumeLabel(volume) == label).ToList();

        if (matchingVolumes.Count == 1)
        {
            string volume = matchingVolumes[0];
            return(VolumeUtils.DeleteAllVolumePaths(volume) &&
                   VolumeAPI.SetVolumeMountPoint(point, volume) ? 0 : 3);
        }
        else
        {
            Console.Error.WriteLine(
                "Should be exactly one volume with label '{0}', got {1}",
                label, matchingVolumes.Count);
            return(2);
        }
    }
Exemple #2
0
    public SvrNativeInterface()
    {
        InitAndroidInterface();

        AppUtils        = new AppUtils(this);
        ApkUtils        = new ApkUtils(this);
        BatteryUtils    = new BatteryUtils(this);
        WifiUtils       = new WifiUtils(this);
        VolumeUtils     = new VolumeUtils(this);
        BrightnessUtils = new BrightnessUtils(this);
        DateTimeUtils   = new DateTimeUtils(this);
        WFDUtils        = new WFDUtils(this);
        FotaUtils       = new FotaUtils(this);
        BluetoothUtils  = new BluetoothUtils(this);
        DeviceUtils     = new DeviceUtils(this);
    }
Exemple #3
0
        private void Initialize()
        {
            Main.Logger.Log("Start of XLGraphics");

            // load settings
            Main.settings = Settings.Load();

            // initialize components
            PresetManager.Instantiate();
            UI.Instantiate();
            VolumeUtils.Instantiate();
            gameObject.AddComponent <CustomCameraController>();
            gameObject.AddComponent <CustomDofController>();
            gameObject.AddComponent <CustomLightController>();
            gameObject.AddComponent <CustomPhysicalCameraController>();

            PresetManager.Instance.LoadPresets();

            // prepare UI
            UI.Instance.CollectElements(false);
            UI.Instance.AddBaseListeners();
            UI.Instance.AddPresetListeners();

            basicEffectHandlers = new List <EffectHandler> {
                new PostProcessingHandler(),
                new VSyncHandler(),
                new FullScreenHandler(),
                new AntiAliasingHandler(),
                new RenderDistanceHandler(),
                new ResolutionHandler(),
                new OverlaysHandler()
            };

            presetEffectHandlers = new List <PresetEffectHandler> {
                new AmbientOcclusionHandler(),
                new BloomHandler(),
                new ChromaticAberrationHandler(),
                new ColorAdjustmentsHandler(),
                new DepthOfFieldHandler(),
                new FilmGrainHandler(),
                new FovOverrideHandler(),
                new LensDistortionHandler(),
                new LightHandler(),
                new MotionBlurHandler(),
                new PaniniProjectionHandler(),
                new PhysicalCameraHandler(),
                new ToneMappingHandler(),
                new VignetteHandler(),
                new WhiteBalanceHandler()
            };

            cameraEffectHandlers = new List <EffectHandler> {
                new CameraModeHandler(),
                new ReplayFovHandler(),
                new FollowCameraHandler(),
                new NormalCameraHandler(),
                new PovCameraHandler(),
                new SkateCameraHandler()
            };

            foreach (var eH in basicEffectHandlers)
            {
                eH.ConnectUI();
            }
            foreach (var eH in presetEffectHandlers)
            {
                eH.ConnectUI();
            }
            foreach (var eH in cameraEffectHandlers)
            {
                eH.ConnectUI();
            }

            XLGraphicsMenu.Instance.basicContent.SetActive(true);
            XLGraphicsMenu.Instance.presetList.SetActive(true);
            XLGraphicsMenu.Instance.main.SetActive(false);

            Main.Logger.Log("End of XLGraphics");
        }