private ChainFileHandler(IFileHandler[] fileHandlerChain) { if ((object)fileHandlerChain == null) throw new ArgumentNullException("fileHandlerChain"); this.fileHandlerChain = fileHandlerChain; }
public FileController(IMapHandler newMapHandler, IFileView newFileView, IFileHandler newFileHandler, IValidator newValidator) { maphandler = newMapHandler; fileView = newFileView; fileHandler = newFileHandler; validator = newValidator; }
public FileProcessor(FileProcessorEndpoint endpoint, IFileHandler handler, IFilePostProcessor postProcessor) { if (endpoint == null) { throw new ArgumentException("endpoint"); } if (handler == null) { throw new ArgumentException("handler"); } if (postProcessor == null) { throw new ArgumentNullException("postProcessor"); } this.instanceId = Guid.Empty; this.Endpoint = endpoint; this.Handler = handler; this.PostProcessor = postProcessor; this.timer = new Timer(this.Endpoint.ScavengeInterval.TotalMilliseconds) { AutoReset = true }; this.timer.Elapsed += this.TimerElapsed; this.pendingFiles = new ConcurrentQueue<string>(); this.eventHandle = new AutoResetEvent(false); this.quitHandle = new ManualResetEvent(false); this.quitting = false; Logger.DebugFormat("Scavenger interval set at {0:0.0} seconds", endpoint.ScavengeInterval.TotalSeconds); }
void Events_GetFilesRequestFinished(IFileHandler sender, Backload.Contracts.Eventing.IGetFilesRequestEventArgs e) { // Backload component has finished the internal GET handler method. // Results can be found in e.Param.FileStatus or sender.FileStatus IFileStatus status = e.Param.FileStatus; }
public FolderMonitor CreateFolderMonitor(string path, IFileHandler handler) { return container.Resolve<FolderMonitor>( new ParameterOverride("path", path), new ParameterOverride("fileHandler", handler)); }
// Executes GET requsts for all files private static ActionResult GetHandler(IFileHandler handler) { IFileStatus status = new FileStatus(); using (FilesModel db = new FilesModel()) { foreach (var row in db.Files) { string url = handler.Context.Request.Url.OriginalString + "?fileName=" + row.Id.ToString(); IFileStatusItem file = new FileStatusItem() { ContentType = row.Type, DeleteType = "DELETE", FileName = row.Name, FileSize = row.Size, OriginalName = row.Original, Progress = "100", Success = true, ThumbnailUrl = row.Preview, // Set an identifier for GET and DELETE requests DeleteUrl = url, FileUrl = url }; status.Files.Add(file); } } handler.FileStatus = status; // Create client plugin specific result and return an ActionResult IBackloadResult result = handler.Services.Core.CreatePluginResult(); return ResultCreator.Create((IFileStatusResult)result); }
public LateWriteFileHandler(IFileHandler fileHandler) { _fileHandler = fileHandler; _actions = new Queue<LateAction>(); ToRename = new List<RenameAction>(); ToRetag = new List<RetagAction>(); _namesList = new List<string>(); NameCollisions = new List<string>(); }
public FileContextMenuExtension() { _fileHandler = new UploadFileHandler(); // Load the bitmap for the menu item. var bmp = espurl.explorer.Properties.Resources.espurl_ico; bmp.MakeTransparent(bmp.GetPixel(0, 0)); this.menuBmp = bmp.GetHbitmap(); }
public PlayerJsonService(string storagePath, IFileHandler fileHandler) { _storagePath = Path.Combine(storagePath, "Players.json"); ; _fileHandler = fileHandler; // create the storage path if it does not exist fileHandler.CreatePathIfNotExist(storagePath); RefreshCache (); }
public FileProducerConsumerQueue(int numberOfConsumers, IFileProcessResultHandler processResultHandler, IFileHandler fileProcessor) : base(numberOfConsumers) { if (processResultHandler == null) { throw new ArgumentNullException("processResultHandler"); } if (fileProcessor == null) { throw new ArgumentNullException("fileProcessor"); } this.processResultHandler = processResultHandler; this.fileProcessor = fileProcessor; }
public GameJsonService(string storagePath, IFileHandler fileHandler) { _storagePath = storagePath; _fileHandler = fileHandler; // create the storage path if it does not exist fileHandler.CreatePathIfNotExist(storagePath); RefreshCache (); }
/// <summary> /// Mantein the reference to the previous handler so we can add a new one. /// </summary> /// <param name="handler"></param> public void AddHandler(IFileHandler handler) { if (_firstHandler == null) { _firstHandler = handler; } else { _succesorHandler.NextHandler(handler); } _succesorHandler = handler; }
public EnvironmentFileHandler(IFileHandler<Model.SPSD> control) { _control = control; if (_self != null) { throw new ArgumentException("EnvironmentFileHandler is a Singleton and can only instantiated once."); } _self = this; if (_control == null) { throw new NullReferenceException( "A null object was passed to the EnvironmentFileHandler. Valid objects are of type IFileHandler<Model.SPSD>"); } }
private void listView1_SelectedIndexChanged(object sender, EventArgs e) { if (listView1.SelectedItems.Count > 0) { foreach (ListViewItem item in listView1.Items) { item.ForeColor = listView1.ForeColor; item.BackColor = listView1.BackColor; } listView1.SelectedItems[0].BackColor = SystemColors.Highlight; listView1.SelectedItems[0].ForeColor = SystemColors.HighlightText; SelectedExtension = listView1.SelectedItems[0].Tag as IFileHandler; } }
static HandlerList() { UnknownFileHandler = new UnknownHandler(); AddFileHandler(new JavaHandler(), new []{ "java", "jav" }); AddFileHandler(new AssetHandler(AssetHandler.Type.Image), new []{ "jpg", "jpeg", "gif", "png", "bmp", "ico", "icns", "tif", "tiff", "tga", "svg" }); AddFileHandler(new AssetHandler(AssetHandler.Type.Audio), new []{ "wav", "mp3", "ogg", "flac", "aiff", "wma", "m4a", "aac", "mid", "mod" }); AddFileHandler(new AssetHandler(AssetHandler.Type.Video), new []{ "mp4", "mkv", "mpg", "mpeg", "avi", "m4v", "mov", "wmv" }); AddFileHandler(new AssetHandler(AssetHandler.Type.Document), new []{ "txt", "md", "rtf", "pdf", "doc", "docx", "odt" }); AddFileHandler(new AssetHandler(AssetHandler.Type.Configuration), new []{ "json", "xml", "conf", "cfg", "ini", "yaml" }); AddFileHandler(new AssetHandler(AssetHandler.Type.Archive), new []{ "zip", "rar", "tar", "gz", "tgz", "cab", "bz2", "bzip", "lz", "lzma", "arc", "pak" }); AddFolderHandler(new FolderHandler()); }
public StudentService(IStudentRepository StudentRepository, IFileHandler FileHandler, IStudentsParentService StudentsParentService, IStudentsMedicalService StudentsMedicalService, IStudentsTransportService StudentsTransportService, IAcademicYearService AcademicYearService, IClassService ClassService, ISectionService SectionService, IBatchService BatchService, IAreaService AreaService) { this._StudentRepository = StudentRepository; this._iFileHandler = FileHandler; this._IStudentsParentService = StudentsParentService; this._IStudentsMedicalService = StudentsMedicalService; this._IStudentsTransportService = StudentsTransportService; this._AcademicYearService = AcademicYearService; this._ClassService = ClassService; this._SectionService = SectionService; this._BatchService = BatchService; this._AreaService = AreaService; }
protected FileProcessorBase(FileProcessorEndpoint endpoint, IFileHandler handler, IFilePostProcessor postProcessor, IFileFilter additionalFilter) { if (endpoint == null) { throw new ArgumentException("endpoint"); } if (handler == null) { throw new ArgumentException("handler"); } if (postProcessor == null) { throw new ArgumentNullException("postProcessor"); } if (additionalFilter == null) { throw new ArgumentNullException("additionalFilter"); } this.instanceId = Guid.Empty; this.Endpoint = endpoint; this.Handler = handler; this.PostProcessor = postProcessor; this.AdditionalFilter = additionalFilter; this.scavenger = new FileScavenger(endpoint, additionalFilter, this.InstanceId); this.scavenger.RestartFileChecking += (o, e) => this.RestartNewFileChecking(); this.pendingFiles = new ConcurrentQueue<string>(); this.eventHandle = new AutoResetEvent(false); this.quitHandle = new ManualResetEvent(false); this.quitting = false; Logger.DebugFormat("Scavenger interval set at {0:0.0} seconds", endpoint.ScavengeInterval.TotalSeconds); }
public FolderMonitor(string path, IFileHandler fileHandler) { this.fileHandler = fileHandler; this.path = path; }
public void FileCopy(IFileHandler sourceFileHandler, string syncSourcePath, string path) { }
public PostViewModelFilePathResolver(IWebHostEnvironment env, IFileHandler fileHandler) { _env = env; _fileHandler = fileHandler; }
public TestCodeGenDescriptor(IFileHandler fileHandler, IMessageLogger messageLogger, IPackageInstaller packageInstaller) : base(fileHandler, messageLogger, packageInstaller) { ClientDocUri = "https://odata.org"; }
protected virtual BaseCodeGenDescriptor CreateV3CodeGenDescriptor(IFileHandler fileHandler, IMessageLogger logger, IPackageInstaller packageInstaller) { return(new V3CodeGenDescriptor(fileHandler, logger, packageInstaller)); }
public ResourceHandler(IFileHandler fileHandler, JsonSerializer serializer) { _fileHandler = fileHandler; _serializer = serializer; }
private static void AddFileHandler(IFileHandler handler, IEnumerable<string> extensions) { foreach(string ext in extensions)FileHandlers.Add(ext, handler); }
public BookRepository(IFileHandler fileHandler) { this.fileHandler = fileHandler; Books = fileHandler.Load().ToList(); }
public void SetNext(IFileHandler chain) { _nextChain = chain; }
public void RegisterFileHandler(IFileHandler fileHandler, bool canRead, bool canWrite, params string[] fileExtensions) { _fileHandlers.Add(new FileHandlerData(fileHandler, canRead, canWrite, fileExtensions)); }
public ConsoleApplication(IDictionaryService dictionaryService, IFileHandler fileHandler) { _dictionaryService = dictionaryService; _fileHandler = fileHandler; }
public ContactRepository(IFileHandler fileHandler) { _fileHandler = fileHandler; }
public bool IsValid(IFileHandler fileHandler) { errorMessage = originalErrorMessage; errorMessage = string.Format(errorMessage, fileHandler.FileName); return(Directory.Exists(fileHandler.OutputDirectory)); }
public ScannerController(IFileHandler fileHandler, ILogger <ScannerController> logger) { _fileHandler = fileHandler; _logger = logger; }
public void MapStoreOnto(IFileHandler filehandler) { // The mapping used here is created from AddMappings() in the FileHandlerFactory if (filehandler.GetType() == typeof(XMLFileHandler)) Mapper.Map(Store, ((XMLFileHandler)filehandler).Store); }
public SourceFileTemplate(string name, Bitmap icon, IFileHandler extensionToUse, string baseSource, Action<OpenedFile> action) : base(name, icon, extensionToUse) { BaseSource = baseSource; Action = action; }
InkParser(string str, string inkFilename = null, InkParser rootParser = null, IFileHandler fileHandler = null) : base(str) { _filename = inkFilename; RegisterExpressionOperators(); GenerateStatementLevelRules(); // Built in handler for all standard parse errors and warnings this.errorHandler = OnStringParserError; // The above parse errors are then formatted as strings and passed // to the Ink.ErrorHandler, or it throws an exception _fileHandler = fileHandler ?? new CurrentDirectoryFileHandler(); if (rootParser == null) { _rootParser = this; _openFilenames = new HashSet <string> (); if (inkFilename != null) { var fullRootInkPath = _fileHandler.ResolveInkFilename(inkFilename); _openFilenames.Add(fullRootInkPath); } } else { _rootParser = rootParser; } }
public XmlDataService(IFileHandler fileHandler, IDefaultService defaultService) { FileHandler = fileHandler; DefaultService = defaultService; }
public IconRepository(IIconDownloader iconDownloader, IFileHandler fileHandler, IGravatarUrlBuilder gravatarUrlBuilder) { this.iconDownloader = iconDownloader; this.fileHandler = fileHandler; this.gravatarUrlBuilder = gravatarUrlBuilder; }
/// <summary> /// 导出CSV文件 /// </summary> /// <param name="fileHanlder">文件信息</param> /// <param name="fileName">文件信息</param> /// <param name="columns">列头</param> /// <param name="sql">查询语句</param> /// <param name="namedParameters">参数</param> protected void ExportCSV(IFileHandler fileHanlder, string fileName, Dictionary <string, string> columns, string sql, dynamic namedParameters = null) { List <string> csvRows = new List <string>(); StringBuilder sb = new StringBuilder(); var length = 0; foreach (var item in columns) { sb.AppendFormat("\"{0}\"", item.Value.Replace("\n", "")); if (length < columns.Count - 1) { sb.Append(","); } length++; } sb.AppendLine(); using (var fs = fileHanlder.OpenFile(fileName, FileMode.OpenOrCreate)) { fileHanlder.Append(fs, Encoding.Default.GetBytes(sb.ToString())); length = 0; sb.Clear(); using (DbDataReader reader = dbContext.DbHelper.ExecuteReader(sql, namedParameters, false)) { var count = 0; while (reader.Read()) { foreach (var item in columns) { var index = reader.GetOrdinal(item.Key); if (!reader.IsDBNull(index)) { string value = reader.GetValue(index).ToString(); if (reader.GetFieldType(index) == typeof(String)) { //If double quotes are used in value, ensure each are replaced but 2. if (value.IndexOf("\"") >= 0) { value = value.Replace("\"", "\"\""); } //If separtor are is in value, ensure it is put in double quotes. if (value.IndexOf(",") >= 0) { value = "\"" + value + "\""; } } sb.Append(value); } if (length < columns.Count - 1) { sb.Append(","); } length++; } if (count > 60000) { sb.AppendLine(); fileHanlder.Append(fs, Encoding.Default.GetBytes(sb.ToString())); count = 0; sb.Clear(); } else { sb.AppendLine(); count++; } length = 0; } reader.Close(); } if (sb.Length > 0) { fileHanlder.Append(fs, Encoding.Default.GetBytes(sb.ToString())); } } }
public FileProcessorHelper(FileProcessorEndpoint endpoint, IFileHandler handler, IFilePostProcessor postProcessor) : base(endpoint, handler, postProcessor) { }
protected virtual BaseCodeGenDescriptor CreateV4CodeGenDescriptor(IFileHandler fileHandler, IMessageLogger logger, IPackageInstaller packageInstaller) { return(new V4CodeGenDescriptor(fileHandler, logger, packageInstaller, new ODataT4CodeGeneratorFactory())); }
public FileDataSource(IFilePathProvider filePathProvider, IFileHandler fileHandler) { FilePathProvider = filePathProvider; FileHandler = fileHandler; }
public CustomFileProcessor(FileProcessorEndpoint endpoint, IFileHandler handler, IFilePostProcessor postProcessor) : base(endpoint, handler, postProcessor) { }
public SourceFileTemplate(string name, Bitmap icon, IFileHandler extensionToUse, string baseSource) : this(name, icon, extensionToUse, baseSource, (f) => { }) { }
public InkParser(string str, string filenameForMetadata = null, IFileHandler fileHandler = null) : this(str, filenameForMetadata, null, fileHandler) { }
void Events_GetFilesRequestStarted(IFileHandler sender, Backload.Contracts.Eventing.IGetFilesRequestEventArgs e) { // Backload component has started the internal GET handler method. string searchPath = e.Param.SearchPath; }
public SourceFileTemplate(string name, Bitmap icon, IFileHandler extensionToUse, string baseSource, Action <OpenedFile> action) : base(name, icon, extensionToUse) { BaseSource = baseSource; Action = action; }
public NetAstFileTemplate(string name, string objectName, Bitmap icon, IFileHandler extensionToUse, CodeCompileUnit compileUnit) : base(name, icon, extensionToUse) { ObjectName = objectName; CompileUnit = compileUnit; }
/// <summary> /// instantaites and object of XmlidxindexSpecification /// </summary> /// <param name="xmlFile">XmlFile-Path</param> /// <param name="fileHandler">object for FileSystem operations</param> public XmlIdxIndexSpecification(string xmlFile, IFileHandler fileHandler) : base(xmlFile, fileHandler) { }
public VdbDbDefTreeNode(ITreeNode parent, IFileHandler fhandler) : base(parent, fhandler) { }
public void NextHandler(IFileHandler handler) { _nextHandler = handler; }
public JobTreeNode(ITreeNode parent, IFileHandler fhandler) : base(parent, fhandler) { m_jobconn = new JobConnection(fhandler.FileObject.DataDiskPath); }
void Events_IncomingRequestStarted(IFileHandler sender, Backload.Contracts.Eventing.IIncomingRequestEventArgs e) { // Backload environment is ready }
public OrionReader(string filepath, IFileHandler fileHandler) { m_filepath = filepath; m_fileHandler = fileHandler; }
public V3CodeGenDescriptor(IFileHandler fileHandler, IMessageLogger logger, IPackageInstaller packageInstaller) : base(fileHandler, logger, packageInstaller) { this.ClientNuGetPackageName = Common.Constants.V3ClientNuGetPackage; this.ClientDocUri = Common.Constants.V3DocUri; }
public InvoiceStore(IAppConfiguration config, IFileHandler handler) { this.config = config; this.fileHandler = handler; }
/// <summary> /// Contructor /// </summary> public FileHandlerController() { // Create and initialize the handler _handler = Backload.FileHandler.Create(); _handler.Init(new HttpRequestWrapper(HttpContext.Current.Request)); }
public void FileCopyBack(string path, IFileHandler contentFileHandler, string contentPath) { }
public void AddFileHandler(IFileHandler handler) { _fileHandlers.Add(handler); }
public StepFileGenerator(IFileHandler handler) { _handler = handler; }