public void SetLabel(string path, FileLabel label) { if (label != FileLabel.NOTHING) { try { using (var stream = new NTFSDataStream(path, ntfs_stream_name, FileAccess.Write, FileMode.OpenOrCreate, FileShare.Read)) { stream.WriteByte((byte)label); } } catch (NTFSDataStreamException) { return; } } else if (NTFSDataStream.Exists(path, ntfs_stream_name)) { try { NTFSDataStream.Delete(path, ntfs_stream_name); } catch (NTFSDataStreamException) { return; } } }
public void SetLabel(string[] paths, FileLabel label) { foreach (string path in paths) { SetLabel(path, label); } }
public override IDocEntity SaveChanges(bool ignoreCache, DocConstantPermission permission) { FileLabel = FileLabel?.TrimAndPruneSpaces(); FileName = FileName?.TrimAndPruneSpaces(); OriginalFileName = OriginalFileName?.TrimAndPruneSpaces(); return(base.SaveChanges(ignoreCache, permission)); }
public void TrimAll() { FacilityNumber = FacilityNumber?.Trim(); Name = Name?.Trim(); FileLabel = FileLabel?.Trim(); Location = Location?.Trim(); Address = Address?.Trim(); City = City?.Trim(); PostalCode = PostalCode?.Trim(); }
private void draw_file_data(SpriteBatch sprite_batch, Vector2 offset) { sprite_batch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend); // Team leader // Background FileBg.draw(sprite_batch, offset); // Labels FileLabel.draw(sprite_batch, offset); // Data FileNumber.draw(sprite_batch, offset); DifficultyText.draw(sprite_batch, offset); StyleText.draw(sprite_batch, offset); sprite_batch.End(); }
public void WriteRecord(BinaryWriter writer) { writer.Write((int)RecordType); writer.Write(ProductName.PadRight(60, ' ').Substring(0, 60).ToCharArray()); writer.Write(LayoutCode); writer.Write(NominalCaseSize); writer.Write(Compressed ? 1 : 0); writer.Write(WeightIndex); writer.Write(CasesCount); writer.Write(Bias); writer.Write(CreationDate.Substring(0, 9).ToCharArray()); writer.Write(CreationTime.Substring(0, 8).ToCharArray()); writer.Write(FileLabel.PadRight(64, ' ').Substring(0, 64).ToCharArray()); writer.Write(new byte[3]); }
private void CreateBindings() { // menu bar ItemLabel.SetBinding(ContentProperty, new Binding("Item") { Source = _model, Mode = BindingMode.OneWay }); FileLabel.SetBinding(ContentProperty, new Binding("File") { Source = _model, Mode = BindingMode.OneWay }); FileLabel.SetBinding(ForegroundProperty, new Binding("FileLabelForeground") { Source = _model, Mode = BindingMode.OneWay }); }
/// <summary> /// Асинхронный метод сохранения метки для нескольких файлов или каталогов /// </summary> /// <param name="Paths">Полные пути к каталогам или файлам для которых необходимо сохранить метку</param> /// <param name="Label">Метка файла или каталога</param> public static async void SetLabelAsync(string[] Paths, FileLabel Label) => await Task.Run(() => SetLabel(Paths, Label));
/// <summary> /// Метод сохранения метки для нескольких файлов или каталогов /// </summary> /// <param name="Paths">Полные пути к каталогам или файлам для которых необходимо сохранить метку</param> /// <param name="Label">Метка файла или каталога</param> public static void SetLabel(string[] Paths, FileLabel Label) => database.SetLabel(Paths, Label);
private void SaveTypes() { bool Clear = false; string wFileName = ""; try { foreach (var Wfile in WdataFile) { if (Stop) { wFileName = Wfile.Name; FileLabel.Invoke(setCallBack, wFileName); string FilesPath = ResourePath + @"\" + wFileName; ExcelWay(FilesPath); FileprogressBar.Invoke(setCallBack2); //ExcelProcess2.KillSpecialExcel(); } } if (count != 0) { MessageBox.Show("已处理全部" + count + "个文件,处理成功"); } else { MessageBox.Show("未处理文件,请检出资源文件夹是否正确"); } } catch (ThreadAbortException)//线程中断 { if (ExcelProcess2 != null) { ExcelProcess2.KillSpecialExcel(); } } catch (Exception e)//异常中断 { MessageBox.Show("处理" + wFileName + " 文件时出现错误,请检查该文件是否符合处理条件"); MessageBox.Show(e.ToString()); if (ExcelProcess2 != null) { ExcelProcess2.KillSpecialExcel(); } } finally { if (ExcelProcess2 != null) { ExcelProcess2.KillSpecialExcel(); } } if (xlsWorkBook3 != null) { xlsWorkBook3.SaveAs(HZPath); xlsWorkBook3.Close(false); ExcelProcess2.KillSpecialExcel(); } if (xlsWorkBook4 != null) { xlsWorkBook4.SaveAs(HZPath); xlsWorkBook4.Close(false); ExcelProcess2.KillSpecialExcel(); } }//遍历文件并应用不同的方法
private void SetValue(string wFileName) { this.FileLabel.Text = "程序正在运行" + wFileName; FileLabel.Refresh(); }//显示正在处理的文件
public StringFile(FileLabel label, string text) : base(label) { Text = text; }