Exemplo n.º 1
0
        public async Task DoDownload(string FileName, string PathForDownload = null, string FileID = "")
        {
            GoogleServiceController GSC = new GoogleServiceController();
            DriveService            DS  = GSC.GetDriveService();
            DriveController         dc  = new DriveController(DS);
            string OnlyFileName         = AuxFileCommCenter.GetFileNameOnlyWithFormat(FileName)[0];

            if (string.IsNullOrEmpty(FileID))
            {
                //Find the file
                Dictionary <string, string> FilesInDrive = dc.FindFiles(false);
                FileID = FilesInDrive.Where(x => x.Value == OnlyFileName).First().Key;
            }

            if (!string.IsNullOrEmpty(FileID))
            {
                if (string.IsNullOrEmpty(PathForDownload))
                {
                    await dc.DownloadFile(FileID, FileName);
                }
                else
                {
                    await dc.DownloadFile(FileID, FileName, PathForDownload);
                }
            }
            else
            {
                Console.WriteLine("O Arquivo não foi localizado, abortando a operação.");
            }
        }
Exemplo n.º 2
0
        public async Task ShowFiles()
        {
            GoogleServiceController GSC = new GoogleServiceController();
            DriveService            DS  = GSC.GetDriveService();
            DriveController         dc  = new DriveController(DS);

            dc.FindFiles();
        }
Exemplo n.º 3
0
        public async Task <string> CreateGDriveDir(string FolderName)
        {
            GoogleServiceController GSC = new GoogleServiceController();
            DriveService            DS  = GSC.GetDriveService();
            DriveController         dc  = new DriveController(DS);

            var f = dc.FindFiles(false, "application/vnd.google-apps.folder");

            bool exist = f.ContainsValue(FolderName);

            if (exist)
            {
                return(f.Where(x => x.Value == FolderName).First().Key);
            }

            return(dc.CreateGDriveDir(FolderName));
        }
Exemplo n.º 4
0
        public async Task DoUpload(string PathFile, string GDriveFolder = null, string MimeType = "application/octet-stream")
        {
            Console.WriteLine("Iniciando Upload");

            GoogleServiceController GSC = new GoogleServiceController();
            DriveService            DS  = GSC.GetDriveService();
            DriveController         dc  = new DriveController(DS);

            string GDriveFolderID = null;

            if (!string.IsNullOrEmpty(GDriveFolder))
            {
                GDriveFolderID = await CreateGDriveDir(GDriveFolder);
            }

            await dc.UploadFile(PathFile, GDriveFolderID, MimeType);
        }
Exemplo n.º 5
0
    void Start()
    {
        //set input to playernumber
        camY       = "CamY" + playerNumber;
        camX       = "CamX" + playerNumber;
        reset      = "Reset" + playerNumber;
        vertical   = "Vertical" + playerNumber;
        horizontal = "Horizontal" + playerNumber;
        accelerate = "Accelerate" + playerNumber;
        reverse    = "Reverse" + playerNumber;
        jump       = "Jump" + playerNumber;
        shoot      = "Shoot" + playerNumber;
        aimMode    = "AimMode" + playerNumber;


        dc = GetComponent <DriveController>();
        sc = GetComponent <SwingController>();
        hb = GameObject.Find("Hook").GetComponent <hookBehaviour>();
        cc = GameObject.Find("Main Camera").GetComponent <CameraController>();
    }
Exemplo n.º 6
0
    void Start()
    {
        //set input to playernumber
        camY       = "CamY" + playerNumber;
        camX       = "CamX" + playerNumber;
        reset      = "Reset" + playerNumber;
        vertical   = "Vertical" + playerNumber;
        horizontal = "Horizontal" + playerNumber;
        accelerate = "Accelerate" + playerNumber;
        reverse    = "Reverse" + playerNumber;
        jump       = "Jump" + playerNumber;
        shoot      = "Shoot" + playerNumber;
        DebugReset = "DebugReset" + playerNumber;
        nitro      = "Nitro" + playerNumber;

        dc       = GetComponent <DriveController>();
        cc       = FindObjectOfType <CameraController>();
        gb       = GetComponent <GroundBoost>();
        upgrades = FindObjectOfType <CarUpgrades>();
    }
Exemplo n.º 7
0
        public async Task <string> GetFileID(string PartialOrFullFileName = "")
        {
            GoogleServiceController GSC = new GoogleServiceController();
            DriveService            DS  = GSC.GetDriveService();
            DriveController         dc  = new DriveController(DS);

            Dictionary <string, string> Files = dc.FindFiles(false);

            if (Files.Count > 0)
            {
                List <string> FileID = (from f in Files
                                        where f.Value.Contains(PartialOrFullFileName)
                                        select f.Key).ToList();

                if (FileID.Count >= 1)
                {
                    return(FileID[0]);
                }
            }

            return(null);
        }
Exemplo n.º 8
0
        public async Task DeleteFile(string FileName = "", string FileID = "")
        {
            GoogleServiceController GSC = new GoogleServiceController();
            DriveService            DS  = GSC.GetDriveService();
            DriveController         dc  = new DriveController(DS);

            string OnlyFileName = AuxFileCommCenter.GetFileNameOnlyWithFormat(FileName)[0];

            if (string.IsNullOrEmpty(FileID) && string.IsNullOrEmpty(FileName))
            {
                //Find the file
                Dictionary <string, string> FilesInDrive = dc.FindFiles(false);
                FileID = FilesInDrive.Where(x => x.Value == OnlyFileName).First().Key;
            }
            else if (string.IsNullOrEmpty(FileID))
            {
                dc.DeleteFile(DS, FileID);
            }
            else
            {
                Console.WriteLine("Nomes em branco, abortando operação");
            }
        }
Exemplo n.º 9
0
 public TreeView()
 {
     DriveController = new DriveController();
     DataContext     = DriveController;
     InitializeComponent();
 }
Exemplo n.º 10
0
 // Use this for initialization
 void Awake()
 {
     carRigidBody = GetComponent<Rigidbody>();
     driveController = GetComponent<DriveController>();
 }
 public DriveAPIStepDefinitions(ScenarioContext scenarioContext)
 {
     _scenarioContext = scenarioContext;
     _controller      = new DriveController(null, new DriverService());
 }
Exemplo n.º 12
0
 private void Start()
 {
     DCon    = GameObject.Find("D:").GetComponent <DriveController>();
     MyAudio = this.GetComponent <AudioSource>();
 }
Exemplo n.º 13
0
 // Use this for initialization
 void Start()
 {
     driveController  = GetComponent <DriveController>();
     carControlCanvas = WorldController.Instance.CarControlCanvas.GetComponent <CarControlCanvasController>();
     driveController.car.RegisterOnOverDamageEffect(SetSomokeParticules);
 }
Exemplo n.º 14
0
 public Jeep(GameWorld world) : base(-1, world)
 {
     jeepControllerType = new JeepControllerType();
     driveController    = new DriveController(world, jeepControllerType, world.Camera);
 }