private async Task DeleteAsync() { string fileName = FileSelectionControl.SelectedFileName; if (String.IsNullOrEmpty(fileName)) { return; } string folderName = FileSelectionControl.SelectedFolderName; if (String.IsNullOrEmpty(folderName)) { return; } StringBuilder parameters = new StringBuilder(); parameters.Append("{\n"); parameters.Append(" \"" + PropFolder + "\" : \"" + folderName + "\",\n"); parameters.Append(" \"" + PropFile + "\" : \"" + fileName + "\"\n"); parameters.Append("}"); CancellationToken cancellationToken = new CancellationToken(); DeviceMethodReturnValue result = await _azureDevice.CallDeviceMethod(DeleteDMFileMethod, parameters.ToString(), new TimeSpan(0, 0, 30), cancellationToken); MessageBox.Show("Triggered file delete..."); FileSelectionControl.EnumFilesAsync().FireAndForget(); }
public static void FileSelectionControl_InvalidFilePath(object sender, RoutedEventArgs e, ModConfiguration configuration) { if (_log.IsDebugEnabled) { _log.DebugFormat("Starting {0}", MethodBase.GetCurrentMethod().ToString()); } if (e != null) { KeyValuePair <string, string> result = ArtemisModLoader.Helpers.FileHelper.ProcessNotInModFile(e.OriginalSource as string, configuration); e.Source = result.Key; if (e.Source == null) { e.Handled = true; } else { if (!string.IsNullOrEmpty(result.Value)) { FileSelectionControl fsc = sender as FileSelectionControl; fsc.AlternatePrefix = result.Value; } } } if (_log.IsDebugEnabled) { _log.DebugFormat("Ending {0}", MethodBase.GetCurrentMethod().ToString()); } }
public FileSelection(FileSelectionControl control) { _control = control; }