private void AttachToSelectedProcess() { Microsoft.VisualStudio.Shell.ThreadHelper.ThrowIfNotOnUIThread(); var selectedRows = processesGridView.SelectedRows; uint processId = 0; var program = ""; foreach (var row in selectedRows) { var datagridRow = (DataGridViewRow)row; dynamic process = datagridRow.DataBoundItem; processId = process.ProcessId; program = process.CommandLine; } if (processId <= 0) { return; } try { AttachService.AttachToProcess(DTE, processId, program); Close(); } catch (Exception ex) { MessageBox.Show("Failed to attach to process: " + ex.ToString()); } }
public RemoteFileController(AttachService attachService , TokenSerivce tokenSerivce , NoteFileService noteFileService , UserService userService , ConfigFileService configFileService , IHttpContextAccessor accessor , AccessService accessService , ConfigService configService , TagService tagService , NoteService noteService , NotebookService notebookService , IWebHostEnvironment webHostEnvironment , ISevenZipCompressor sevenZipCompressor , BlogService blogService ) : base(attachService, tokenSerivce, noteFileService, userService, configFileService, accessor) { this.accessService = accessService; this.blogService = blogService; this.configService = configService; this.tagService = tagService; this.notebookService = notebookService; this.noteService = noteService; this.HostEnvironment = webHostEnvironment; this.SevenZipCompressor = sevenZipCompressor; if (RuntimeEnvironment.IsWindows) { PathRoot = @"C:\"; } }
public ActionResult DeleteFile(string id, int fileId) { var files = AttachService.Find(o => o.Id == fileId && o.SourceClassify == 2); var re = AttachService.Delete(files); return(new JsonNetResult(re)); }
public NoteAPIController(AttachService attachService , TokenSerivce tokenSerivce , NoteFileService noteFileService , UserService userService , ConfigFileService configFileService , IHttpContextAccessor accessor, NoteService noteService, NoteContentService noteContentService, NotebookService notebookService, NoteRepositoryService noteRepositoryService, TrashService trashService, EPassService ePass, GMService gMService, DataSignService dataSignService ) : base(attachService, tokenSerivce, noteFileService, userService, configFileService, accessor) { this.attachService = attachService; this.noteService = noteService; this.tokenSerivce = tokenSerivce; this.noteContentService = noteContentService; this.trashService = trashService; this.accessor = accessor; this.notebookService = notebookService; this.noteRepositoryService = noteRepositoryService; this.ePassService = ePass; this.dataSignService = dataSignService; this.gMService = gMService; }
public APPController(AttachService attachService , TokenSerivce tokenSerivce , NoteFileService noteFileService , UserService userService , ConfigFileService configFileService , IHttpContextAccessor accessor) : base(attachService, tokenSerivce, noteFileService, userService, configFileService, accessor) { }
public MemberIndexController(AttachService attachService , TokenSerivce tokenSerivce , NoteFileService noteFileService , UserService userService , ConfigFileService configFileService , IHttpContextAccessor accessor, NoteService noteService ) : base(attachService, tokenSerivce, noteFileService, userService, configFileService, accessor) { this.noteService = noteService; }
public ActionResult DeleteFile(string Id, int fileId) { var files = AttachService.Find(o => o.Id == fileId && o.SourceClassify == 1); var re = AttachService.Delete(files); #region 操作日志 var msg = LogEngine.CompareModelToLog <Attachment>(LogModule.合同管理, null, files); new LogEngine().WriteDelete(msg, LogModule.合同管理); #endregion return(new JsonNetResult(re)); }
public JoplinTestingController(AttachService attachService , TokenSerivce tokenSerivce , NoteFileService noteFileService , UserService userService , ConfigFileService configFileService , IHttpContextAccessor accessor , AuthService authService ) : base(attachService, tokenSerivce, noteFileService, userService, configFileService, accessor) { this.AuthService = authService; }
public SpamController(AttachService attachService , TokenSerivce tokenSerivce , NoteFileService noteFileService , UserService userService , ConfigFileService configFileService , IHttpContextAccessor accessor, SpamService spamService ) : base(attachService, tokenSerivce, noteFileService, userService, configFileService, accessor) { this.spamService = spamService; }
public TagAPIController(AttachService attachService , TokenSerivce tokenSerivce , NoteFileService noteFileService , UserService userService , ConfigFileService configFileService , IHttpContextAccessor accessor, TagService tagService ) : base(attachService, tokenSerivce, noteFileService, userService, configFileService, accessor) { this.tokenSerivce = tokenSerivce; this.tagService = tagService; }
public VditorController(AttachService attachService , TokenSerivce tokenSerivce , NoteFileService noteFileService , UserService userService , ConfigFileService configFileService , IHttpContextAccessor accessor, AuthService authService ) : base(attachService, tokenSerivce, noteFileService, userService, configFileService, accessor) { this.authService = authService; this.userService = userService; this.tokenSerivce = tokenSerivce; }
public FileAPIController(AttachService attachService , TokenSerivce tokenSerivce , NoteFileService noteFileService , UserService userService , ConfigFileService configFileService , IHttpContextAccessor accessor, NoteService noteService ) : base(attachService, tokenSerivce, noteFileService, userService, configFileService, accessor) { this.noteService = noteService; this.webSiteConfig = configFileService.WebConfig; }
public void SaveAttach(string fileName, string fileType, string filePath, string thumbPath, string fileSize, string fileExt) { AttachService attachService = new AttachService(); AttachInputDto attachInputDto = new AttachInputDto(); attachInputDto.FileName = fileName; attachInputDto.FileType = fileType; attachInputDto.FilePath = filePath; attachInputDto.FileSize = Convert.ToInt64(fileSize); attachInputDto.FileExt = fileExt; attachInputDto.ThumbPath = thumbPath; attachService.SubmitForm(attachInputDto, ""); }
/// <summary> /// 附件操作 /// </summary> /// <param name="httpFiles"></param> /// <param name="fileId"></param> /// <param name="isTrans">回复或转发</param> /// <returns></returns> static List <Attachment> GetAttachs(System.Web.HttpFileCollectionBase httpFiles, string fileId, bool isTrans) { var relativePath = ""; var path = Sys.SysConstPool.SaveAttachPath(ref relativePath); var root = Sys.SysConstPool.GetRoot; var list = new List <Attachment>(); if (isTrans && !fileId.IsNullOrEmpty()) { var ids = fileId.Split(',').Select(o => int.Parse(o)).ToList(); var attachs = AttachService.FindList(o => ids.Contains(o.Id)); foreach (var att in attachs) { var full = Path.Combine(root, att.SaveUrl); FileInfo file = new FileInfo(full); if (!file.Exists) { continue; } var destFileName = att.SaveUrl.Replace(file.Name, CommonRules.GUID + file.Extension); var destFile = Path.Combine(root, destFileName); var info = file.CopyTo(destFile); list.Add(new Attachment() { SourceClassify = 3, Title = att.Title, Size = att.Size, SaveUrl = destFileName }); } } for (int i = 0; i < httpFiles.Count; i++) { var file = httpFiles[i]; if (file.ContentLength <= 0) { continue; } var filename = CommonRules.GUID + Path.GetExtension(file.FileName); string fullname = path + filename; file.SaveAs(fullname); list.Add(new Attachment() { SourceClassify = 3, Title = Path.GetFileName(file.FileName), Size = file.ContentLength / 1024, SaveUrl = relativePath + filename }); } return(list); }
public OrganizationController(AttachService attachService , TokenSerivce tokenSerivce , NoteFileService noteFileService , UserService userService , ConfigFileService configFileService , IHttpContextAccessor accessor, NotebookService notebookService, OrganizationService organizationService, NoteRepositoryService noteRepositoryService ) : base(attachService, tokenSerivce, noteFileService, userService, configFileService, accessor) { this.organizationService = organizationService; }
public FIDO2Controller(AttachService attachService , TokenSerivce tokenSerivce , NoteFileService noteFileService , UserService userService , ConfigFileService configFileService , IHttpContextAccessor accessor , AuthService authService , FIDO2Service fIDO2Service ) : base(attachService, tokenSerivce, noteFileService, userService, configFileService, accessor) { this.authService = authService; this.fido2Service = fIDO2Service; }
public USBKeyController(AttachService attachService , TokenSerivce tokenSerivce , NoteFileService noteFileService , UserService userService , ConfigFileService configFileService , IHttpContextAccessor accessor , AuthService authService , EPassService ePassService ) : base(attachService, tokenSerivce, noteFileService, userService, configFileService, accessor) { this.authService = authService; this.ePass = ePassService; }
public PayJSController(AttachService attachService , TokenSerivce tokenSerivce , NoteFileService noteFileService , UserService userService , ConfigFileService configFileService , IHttpContextAccessor accessor , DataContext dataContext ) : base(attachService, tokenSerivce, noteFileService, userService, configFileService, accessor) { this.dataContext = dataContext; this.configFileService = configFileService; webSiteConfig = configFileService.WebConfig; pay = new Payjs(webSiteConfig.Payjs.PayJS_MCHID, webSiteConfig.Payjs.PayJS_Key); }
public BaseController(AttachService attachService , TokenSerivce tokenSerivce , NoteFileService noteFileService , UserService userService , ConfigFileService configFileService , IHttpContextAccessor accessor ) { this.attachService = attachService; this.tokenSerivce = tokenSerivce; this.noteFileService = noteFileService; this.configFileService = configFileService; this.userService = userService; this._accessor = accessor; config = configFileService.WebConfig; }
public AuthController(AttachService attachService , TokenSerivce tokenSerivce , NoteFileService noteFileService , UserService userService , ConfigFileService configFileService , IDistributedCache distributedCache , IHttpContextAccessor accessor, AuthService authService, ConfigService configService ) : base(attachService, tokenSerivce, noteFileService, userService, configFileService, accessor) { this.distributedCache = distributedCache; this.authService = authService; this.configService = configService; this.config = configService.config; }
public NotesRepositoryController(AttachService attachService , TokenSerivce tokenSerivce , NoteFileService noteFileService , UserService userService , ConfigFileService configFileService , IHttpContextAccessor accessor, NotebookService notebookService, NoteRepositoryService noteRepositoryService, OrganizationService organizationService, EPassService ePassService, DataSignService dataSignService ) : base(attachService, tokenSerivce, noteFileService, userService, configFileService, accessor) { this.notebookService = notebookService; this.noteRepositoryService = noteRepositoryService; this.ePassService = ePassService; this.dataSignService = dataSignService; }
public ActionResult DeleteFile(int fileId, string isBack) { var op = new OpResult(); if (isBack == "1")//在转发或恢复中删除 { op.Successed = true; } else { var file = AttachService.Find(o => o.Id == fileId && o.SourceClassify == 3); var re = AttachService.Delete(file); if (re.Successed) { System.IO.File.Delete(System.IO.Path.Combine(Pharos.Sys.SysConstPool.GetRoot, file.SaveUrl)); } } return(new JsonNetResult(op)); }
/// <summary> /// This function is the callback used to execute the command when the menu item is clicked. /// See the constructor to see how the menu item is associated with this function using /// OleMenuCommandService service and MenuCommand class. /// </summary> /// <param name="sender">Event sender.</param> /// <param name="e">Event args.</param> private void Execute(object sender, EventArgs e) { ThreadHelper.ThrowIfNotOnUIThread(); if (!string.IsNullOrWhiteSpace(AttachService.PreviousProgram)) { var success = AttachService.AttachToProgram(_dte, AttachService.PreviousProgram); if (success) { return; } } var form = new AttachForm { DTE = _dte }; form.ShowDialog(); }
public APIController(AttachService attachService , TokenSerivce tokenSerivce , NoteFileService noteFileService , UserService userService , ConfigFileService configFileService , IHttpContextAccessor accessor, AccessService accessService, DataContext dataContext ) : base(attachService, tokenSerivce, noteFileService, userService, configFileService, accessor) { this.AccessService = accessService; this.dataContext = dataContext; this.configFileService = configFileService; webcConfig = configFileService.WebConfig; _randomImageFuseSize = webcConfig.PublicAPI.RandomImageFuseSize; }
public UserAPIController(AttachService attachService , TokenSerivce tokenSerivce , NoteFileService noteFileService , UserService userService , ConfigFileService configFileService , GMService gMService , RealNameService realNameService , IHttpContextAccessor accessor, AuthService authService , EPassService ePass , DataSignService dataSignService ) : base(attachService, tokenSerivce, noteFileService, userService, configFileService, accessor) { this.authService = authService; this.userService = userService; this.tokenSerivce = tokenSerivce; this.realNameService = realNameService; this.ePassService = ePass; this.gMService = gMService; this.dataSignService = dataSignService; }
public CommonController(AttachService attachService , TokenSerivce tokenSerivce , NoteFileService noteFileService , UserService userService , ConfigFileService configFileService , IHttpContextAccessor accessor, NoteService noteService, NoteContentService noteContentService, NotebookService notebookService, NoteRepositoryService noteRepositoryService, TrashService trashService ) : base(attachService, tokenSerivce, noteFileService, userService, configFileService, accessor) { this.attachService = attachService; this.noteService = noteService; this.tokenSerivce = tokenSerivce; this.noteContentService = noteContentService; this.trashService = trashService; this.accessor = accessor; this.notebookService = notebookService; this.noteRepositoryService = noteRepositoryService; }
public NoteController(AttachService attachService , TokenSerivce tokenSerivce , NoteFileService noteFileService , UserService userService , ShareService shareService , ConfigFileService configFileService , IWebHostEnvironment env , TagService tagService , TrashService trashService , IHttpContextAccessor accessor , NotebookService notebookService , NoteService noteService , NoteContentService noteContentService ) : base(attachService, tokenSerivce, noteFileService, userService, configFileService, accessor) { this.notebookService = notebookService; this.noteService = noteService; this.noteContentService = noteContentService; this.env = env; this.tagService = tagService; this.trashService = trashService; }
//todo:下载附件 public IActionResult GetAttach(string fileId) { if (string.IsNullOrEmpty(fileId)) { return(Content("error")); } if (fileId.Length == 24) { fileId = fileId.Substring(0, 16); } var attachFile = AttachService.GetAttach(MyConvert.HexToLong(fileId)); if (attachFile == null) { return(Content("NoFoundAttach")); } var stream = System.IO.File.OpenRead(attachFile.Path); string fileExt = Path.GetExtension(attachFile.Name); //获取文件的ContentType var provider = new FileExtensionContentTypeProvider(); var memi = provider.Mappings[fileExt]; return(File(stream, memi, Path.GetFileName(attachFile.Path))); }
public BlogController(AttachService attachService , TokenSerivce tokenSerivce , NoteFileService noteFileService , UserService userService , ConfigFileService configFileService , IHttpContextAccessor accessor , AccessService accessService , ConfigService configService , TagService tagService , NoteService noteService , NotebookService notebookService , BlogService blogService , NoteRepositoryService noteRepository ) : base(attachService, tokenSerivce, noteFileService, userService, configFileService, accessor) { this.accessService = accessService; this.blogService = blogService; this.configService = configService; this.tagService = tagService; this.notebookService = notebookService; this.noteService = noteService; this.noteRepository = noteRepository; }
public AttachController(AttachService attachService, IHostingEnvironment env) { _service = attachService; _env = env; _uploadAttachPath = Path.Combine(_env.WebRootPath, "Uploads", "Attach"); }