public MediaPickerService() { IDirectory directory = new FoodMarkerPendingImageDirectory(); _directoryAccess = new DirectoryAccess(directory); _index = 1; }
public FoodMarkerPhotosFileSystemService(FoodMarker marker) { IDirectory directory = new FoodMarkerImageDirectory(); _marker = marker; _directoryAccess = new DirectoryAccess(directory); _path = directory.GetDir(); }
public ActionResult DeleteConfirmed(int id) { DirectoryAccess directoryAccess = db.DirectoryAccesses.Find(id); db.DirectoryAccesses.Remove(directoryAccess); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "UserId,DirectoryId,AccessType,Permissions")] DirectoryAccess directoryAccess) { if (ModelState.IsValid) { db.Entry(directoryAccess).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.DirectoryId = new SelectList(db.Directories, "Id", "Name", directoryAccess.DirectoryId); ViewBag.UserId = new SelectList(db.Users, "Id", "Login", directoryAccess.UserId); return(View(directoryAccess)); }
public void da_returns_files() { // arrange var location = Assembly.GetExecutingAssembly().Location; var installDir = Path.GetDirectoryName(location); //act var files = DirectoryAccess.GetDirContent(installDir, "*"); //assert Assert.NotEmpty(files); }
public int KphOpenDirectoryObject(DirectoryAccess access, ObjectAttributes objectAttributes) { byte *inData = stackalloc byte[0xc]; int directoryObjectHandle; *(int *)inData = (int)&directoryObjectHandle; *(int *)(inData + 0x4) = (int)access; *(int *)(inData + 0x8) = (int)&objectAttributes; _fileHandle.IoControl(CtlCode(Control.KphOpenDirectoryObject), inData, 0xc, null, 0); return(directoryObjectHandle); }
// GET: DirectoryAccesses/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } DirectoryAccess directoryAccess = db.DirectoryAccesses.Find(id); if (directoryAccess == null) { return(HttpNotFound()); } return(View(directoryAccess)); }
public void da_finds_files() { // arrange var fileStoreLocations = new FileStorageLocations(); var fileStoreLocation = fileStoreLocations.Locations.First(); // act var files = DirectoryAccess.GetDirContent(fileStoreLocation.Location, fileStoreLocation.Filter); // assert Assert.NotEmpty(files); Assert.True(files.Count > 0); }
// GET: DirectoryAccesses/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } DirectoryAccess directoryAccess = db.DirectoryAccesses.Find(id); if (directoryAccess == null) { return(HttpNotFound()); } ViewBag.DirectoryId = new SelectList(db.Directories, "Id", "Name", directoryAccess.DirectoryId); ViewBag.UserId = new SelectList(db.Users, "Id", "Login", directoryAccess.UserId); return(View(directoryAccess)); }
public LogFileViewModel(IInputBox inputBox) { InputBox = inputBox; FileStoreLocations = FileStorageLocations.Create(); OpenFileCommand = new DelegateCommand <FileInfo>(new Action <FileInfo>(fi => { FileText = DirectoryAccess.GetFileContent(fi.FullName); this.OnDisplayPopupWindow(FileText); OnPropertyChanged("FileText"); })); }
private void GetFiles() { if (DirectoryAccess.Password == null) { var pw = this.InputBox.RequestPassword(); if (pw == null) { return; } DirectoryAccess.Password = pw; } Files = new ObservableCollection <FileInfo>( DirectoryAccess.GetDirContent(SelectedFileStoreLocation.Location, SelectedFileStoreLocation.Filter)); OnPropertyChanged("Files"); }
public int KphOpenDirectoryObject(DirectoryAccess access, ObjectAttributes objectAttributes) { byte* inData = stackalloc byte[0xc]; int directoryObjectHandle; *(int*)inData = (int)&directoryObjectHandle; *(int*)(inData + 0x4) = (int)access; *(int*)(inData + 0x8) = (int)&objectAttributes; _fileHandle.IoControl(CtlCode(Control.KphOpenDirectoryObject), inData, 0xc, null, 0); return directoryObjectHandle; }
public AnnotationService() { IDirectory directory = new TempDirectory(); _directoryAccess = new DirectoryAccess(directory); }