public ColumnsViewModel(ILogger Logger, FormatHandler FormatHandler, FilterItemSourcesViewModel FilterItemSourcesViewModel, IInlineParserFactoryModule InlineParserBuilderModule, IColorProviderModule ColorProviderModule) : base(Logger) { AssertParameterNotNull(FormatHandler, "FormatHandler", out formatHandler); AssertParameterNotNull(FilterItemSourcesViewModel, "FilterItemSourcesViewModel", out filterItemSourcesViewModel); AssertParameterNotNull(ColorProviderModule, "ColorProviderModule", out colorProviderModule); AssertParameterNotNull(InlineParserBuilderModule, "InlineParserBuilderModule", out inlineParserBuilderModule); }
private bool LoadMiscellaneousFormat(string filePath) { try { FormatHandler fHandler = FFormatManager.GetFormatHandlerFromFilePath(filePath); if (null == fHandler) { return(false); } pb4ImageFiles.Visible = true; pb4ImageFiles.ImageLocation = fHandler.ThumbnailFile; if (textBoxName.Text.Length == 0) { textBoxName.Text = Path.GetFileNameWithoutExtension(filePath); } if (textBoxDescription.Text.Length == 0) { textBoxDescription.Text = Path.GetFileNameWithoutExtension(filePath); } } catch (Exception ex) { _log.Error(ex.ToString()); } return(true); }
private void RenderCell() { if (this.m_column != -1) { ExcelDataType excelDataType = ExcelDataType.Blank; RichTextInfo richTextInfo = null; if (this.m_cellValue != null) { if (this.m_cellValueType == TypeCode.Object) { richTextInfo = (this.m_cellValue as RichTextInfo); if (richTextInfo != null) { excelDataType = ExcelDataType.RichString; } //else if (this.m_cellValue is SqlGeometry || this.m_cellValue is SqlGeography) //{ // excelDataType = ExcelDataType.String; //} } else { excelDataType = FormatHandler.GetDataType(this.m_cellValueType); } } bool flag = false; switch (excelDataType) { case ExcelDataType.String: { string text = this.m_cellValue.ToString(); if (text.Length > 0) { StringBuilder stringBuilder = new StringBuilder(text.Length); ExcelGeneratorStringUtil.ConvertWhitespaceAppendString(text, stringBuilder, this.m_checkForRotatedEastAsianChars, out flag); this.m_cellValue = stringBuilder.ToString(); } break; } case ExcelDataType.RichString: flag = richTextInfo.FoundRotatedFarEastChar; break; } if (flag) { this.m_styleContainer.Orientation = Orientation.Vertical; } this.m_styleContainer.Finish(); if (this.m_cellValue != null || this.m_styleContainer.CellIxfe != 15) { this.m_rowHandler.Add(this.m_cellValue, richTextInfo, this.m_cellValueType, excelDataType, this.m_cellErrorCode, (short)this.m_column, (ushort)this.m_styleContainer.CellIxfe); } this.m_cellValue = null; this.m_cellValueType = TypeCode.String; this.m_cellErrorCode = ExcelErrorCode.None; this.m_styleContainer.Reset(); this.m_checkForRotatedEastAsianChars = false; } }
private void RenderCell() { if (m_column == -1) { return; } ExcelDataType excelDataType = ExcelDataType.Blank; RichTextInfo richTextInfo = null; if (m_cellValue != null) { if (m_cellValueType == TypeCode.Object) { richTextInfo = (m_cellValue as RichTextInfo); if (richTextInfo != null) { excelDataType = ExcelDataType.RichString; } } else { excelDataType = FormatHandler.GetDataType(m_cellValueType); } } bool foundEastAsianChar = false; switch (excelDataType) { case ExcelDataType.String: { string text = m_cellValue.ToString(); if (text.Length > 0) { StringBuilder stringBuilder = new StringBuilder(text.Length); ExcelGeneratorStringUtil.ConvertWhitespaceAppendString(text, stringBuilder, m_checkForRotatedEastAsianChars, out foundEastAsianChar); m_cellValue = stringBuilder.ToString(); } break; } case ExcelDataType.RichString: foundEastAsianChar = richTextInfo.FoundRotatedFarEastChar; break; } if (foundEastAsianChar) { m_styleContainer.Orientation = Orientation.Vertical; } m_styleContainer.Finish(); if (m_cellValue != null || m_styleContainer.CellIxfe != 15) { m_rowHandler.Add(m_cellValue, richTextInfo, m_cellValueType, excelDataType, m_cellErrorCode, (short)m_column, (ushort)m_styleContainer.CellIxfe); } m_cellValue = null; m_cellValueType = TypeCode.String; m_cellErrorCode = ExcelErrorCode.None; m_styleContainer.Reset(); m_checkForRotatedEastAsianChars = false; }
public void Open(string FileName) { FormatHandler schema; schema = FormatHandler.LoadFromFile(FileName); ItemsSource.Add(schema); SelectedItem = schema; }
public void CloseCurrent() { if (SelectedItem == null) { return; } ItemsSource.Remove(SelectedItem); SelectedItem = ItemsSource.FirstOrDefault(); }
private void findFileOffset(object sender, EventArgs e) { Console.WriteLine("DEBUG > 03system Offset: " + FormatHandler.getHexString(Pcsx2Memory.getFileOffset(Enum.FileType.KH2_03SYSTEM), ProcessType.PCSX2)); //Console.WriteLine("DEBUG > 00battle Offset: " + Pcsx2Memory.getFileOffset(Enum.FileType.KH2_00BATTLE)); //Console.WriteLine("DEBUG > 00objentry Offset: " + Pcsx2Memory.getFileOffset(Enum.FileType.KH2_00OBJENTRY)); //Console.WriteLine("DEBUG > jiminy Offset: " + Pcsx2Memory.getFileOffset(Enum.FileType.KH2_JIMINY)); //Console.WriteLine("DEBUG > mixdata Offset: " + Pcsx2Memory.getFileOffset(Enum.FileType.KH2_MIXDATA)); //Console.WriteLine("DEBUG > SUBBAR: " + Pcsx2Memory.getOffsetOfSubBar(0x20000000 + Pcsx2Memory.getFileOffset(Enum.FileType.KH2_03SYSTEM), "cmd\0")); //Console.WriteLine("DEBUG > SUBSUBBAR: " + FormatHandler.getHexString(Pcsx2Memory.getAddressOfSubSubBar(Enum.FileType.KH2_03SYSTEM, "pref", "magi"), ProcessType.PCSX2)); }
public static void SetupPluginVarients(out FormatHandler Formats, out SimpleToolHandler Tools) //public static void FormatChecker(out GenericHandler Formats) { /*fileFormats = new GenericHandler(); * Formats = fileFormats;*/ FileFormats = new FormatHandler(); Formats = FileFormats; SimpleTools = new SimpleToolHandler(); Tools = SimpleTools; }
public void CreateNew() { FormatHandler schema; schema = new FormatHandler() { Name = "New format handler" }; ItemsSource.Add(schema); SelectedItem = schema; }
public void PhoneCheckTest() { FormatHandler m = new FormatHandler(); string s1 = m.PhoneCheck("ss1234567890"); string s2 = m.PhoneCheck("123s4567890s"); string s3 = m.PhoneCheck("1234567ss890s"); Assert.Equal("(123)456-7890", s1); Assert.Equal("(123)456-7890", s2); Assert.Equal("(123)456-7890", s3); }
public static void writeString(List <byte> data, string input, int offset, int size) { if (data.Count <= offset + size) { data.RemoveRange(offset, size); } else { data.RemoveRange(offset, data.Count - offset); } data.InsertRange(offset, BinaryHandler.stringAsBytes(FormatHandler.format32Chars(input))); }
/// <summary> /// Returns string representation of the specified <paramref name="source"/>. /// </summary> /// <param name="source">The <see cref="Tuple"/> to format.</param> /// <returns> /// String representation of the specified <paramref name="source"/>. /// </returns> public static string Format(this Tuple source) { ArgumentValidator.EnsureArgumentNotNull(source, "tuple"); var descriptor = source.Descriptor; var count = source.Count; var targets = new string[count]; for (int i = 0; i < count; i++) { FormatHandler.Get(descriptor[i]).Execute(source, targets, i); } return(targets.RevertibleJoin(Escape, Comma)); }
public void NameFormatTest() { FormatHandler m = new FormatHandler(); string s1 = m.NameFormat("Sam"); string s2 = m.NameFormat("bob"); string s3 = m.NameFormat("123bOb"); string s4 = m.NameFormat("boB321"); Assert.Equal("Sam", s1); Assert.Equal("Bob", s2); Assert.Equal("Bob", s3); Assert.Equal("Bob", s4); }
public void findAddress() { if (AddressFound) { return; } Pcsx2Memory.findProcess(); // Find by pointers long autoAddress = -1; if (fileType == FileType.KH2_00OBJENTRY) { autoAddress = Pcsx2Memory.getAddressOfSubBar(fileType, null); } else if (subBarName != null && subSubBarName != null) { autoAddress = Pcsx2Memory.getAddressOfSubSubBar(fileType, subBarName, subSubBarName); } else if (subBarName != null) { autoAddress = Pcsx2Memory.getAddressOfSubBar(fileType, subBarName); } // Find by string search if (autoAddress <= 0 && fileType != FileType.KH2_00OBJENTRY) { autoAddress = Pcsx2Memory.findBarFileAddress(stringToFind); } // If address was found if (autoAddress > 0) { AddressFound = true; MemOffset = FormatHandler.getHexString(autoAddress, ProcessType.PCSX2); if (Pcsx2Memory.process_current_Type == ProcessType.PCSX2 && autoAddress > 0x2FFFFFFF) { MemOffset = NOT_FOUND; } } else { MemOffset = NOT_FOUND; } }
public void findAddressDirect() { if (AddressFound) { return; } long addressInt = Pcsx2Memory.findAddressOf(stringToFind); AddressFound = true; if (addressInt == -1) { MemOffset = MemOffsetFallback; } else { MemOffset = FormatHandler.getHexString(addressInt, ProcessType.PCSX2); } if (procType == ProcessType.PCSX2 && addressInt > 0x2FFFFFFF) { MemOffset = MemOffsetFallback; } }
public EquipmentItem() { raw = FormatHandler.getByteListOfSize(entrySize); }
public ArifItem() { raw = FormatHandler.getByteListOfSize(Size); }
private void OnBnOkClicked(object sender, EventArgs e) { try { string filePath = fileSelectCtrl.FileName; string fileExt = Path.GetExtension(filePath).ToLower(); fileExt = fileExt.Substring(1); if (!File.Exists(filePath)) { return; } // get tree node for document insertion PPDataContext db = new PPDataContext(); if (null == _nodeTag || _nodeTag.IsDocument) { throw new Exception("Invalid TreeNode tag"); } TreeNode treeNode = Pic.DAL.SQLite.TreeNode.GetById(db, _nodeTag.TreeNode); if (string.Equals("dll", fileExt, StringComparison.CurrentCultureIgnoreCase)) { // make sure "Parametric Component" document type exist if (null == DocumentType.GetByName(db, "Parametric component")) { DocumentType.CreateNew(db, "Parametric component", "Parametric component", "PicParam"); } // create new document Component component = treeNode.InsertComponent( db , filePath , componentLoaderControl.ComponentGuid , DocumentName , DocumentDescription , ThumbnailPath); // create associated majorations if any if (componentLoaderControl.HasMajorations) { component.InsertNewMajorationSet(db, componentLoaderControl.Profile, componentLoaderControl.Majorations); } // create associated default param values if (chkDefaultParameters.Checked) { component.InsertNewParamDefaultValues(db, componentLoaderControl.ParamDefaultValues); } // save document ID to be used later // -> to retrieve document tree node DocumentID = component.DocumentID; OpenInsertedDocument = true; } else { // get a format handler FormatHandler fHandler = FFormatManager.GetFormatHandlerFromFileExt(fileExt); if (null == fHandler) { throw new ExceptionDAL(string.Format("No valid format handler from file extension: {0}", fileExt)); } // get document type DocumentType docType = DocumentType.GetByName(db, fHandler.Name); if (null == docType) { docType = DocumentType.CreateNew(db, fHandler.Name, fHandler.Description, fHandler.Application); } // insert document in database Document document = treeNode.InsertDocument( db , filePath , DocumentName , DocumentDescription , docType.Name , ThumbnailPath); // save document ID DocumentID = document.ID; OpenInsertedDocument = fHandler.OpenInPLMPackLib; } } catch (ExceptionDAL ex) { MessageBox.Show( ex.Message , Application.ProductName , MessageBoxButtons.OK , MessageBoxIcon.Error); _log.Error(ex.ToString()); } catch (Exception ex) { _log.Error(ex.ToString()); } }
public void ClearFormat() { Formatter = null; }
public void SetFormat(FormatHandler del) { Formatter = del; }
public ArifPointer() { raw = FormatHandler.getByteListOfSize(Size); }
public ProductItem() { raw = FormatHandler.getByteListOfSize(entrySize); }
public InventoryItem() { raw = FormatHandler.getByteListOfSize(entrySize); }
public static void writeString32(List <byte> data, string input, int offset, int size) { data.RemoveRange(offset, size); data.InsertRange(offset, BinaryHandler.stringAs32Bytes(FormatHandler.format32Chars(input))); }
public static List <byte> stringAs32Bytes(String text) { return(System.Text.Encoding.UTF8.GetBytes(FormatHandler.format32Chars(text)).ToList()); }
public WalkPathItem() { raw = FormatHandler.getByteListOfSize(entrySize); }
public LeveItem() { raw = FormatHandler.getByteListOfSize(entrySize); }
public MemtConf() { raw = FormatHandler.getByteListOfSize(entrySize); }