private void OnCategorySelectionChanged() { if (string.IsNullOrWhiteSpace(CategorySelection)) { return; } var list = GetFormatList(CategorySelection); if (list == null) { return; } list.Add(Properties.Resources.CustomString); FormatList = list; if (!FormatList.Contains(FormatSelection) || FormatSelection == Properties.Resources.CustomString) { // update format selection FormatSelection = FormatList.FirstOrDefault(); } RaisePropertyChanged(() => FormatList); OutputCoordItem.CType = GetCoordinateType(); OutputCoordItem.Name = OutputCoordItem.CType.ToString(); }
public void Write(FileWriter writer) { byte format = FormatList.FirstOrDefault(x => x.Value == Format).Key; writer.Write(format); writer.Write(Padding); writer.Write(Width); writer.Write(Height); writer.Align(32); writer.Write(ImageData); }
public void Write(FileWriter writer) { TextureFormat format = FormatList.FirstOrDefault(x => x.Value == PicaFormat).Key; writer.Write(ImageData.Length); writer.Write(MaxLevel); writer.Write(Unknown); writer.Write((ushort)Width); writer.Write((ushort)Height); writer.Write(format, true); writer.Write(DataOffset); writer.WriteString(Name, 16); }
public WiiUSwizzle(TexFormat format) { Format = FormatList.FirstOrDefault(x => x.Value == format).Key; OutputFormat = format; AAMode = GX2.GX2AAMode.GX2_AA_MODE_1X; TileMode = GX2.GX2TileMode.MODE_2D_TILED_THIN1; ResourceFlags = GX2.GX2RResourceFlags.GX2R_BIND_TEXTURE; SurfaceDimension = GX2.GX2SurfaceDimension.DIM_2D; SurfaceUse = GX2.GX2SurfaceUse.USE_COLOR_BUFFER; Alignment = 0; Pitch = 0; }
public void DeleteTest() { FormatList formats = new FormatList(); formats.Load(); //Find the format with the description testingformat Format format = formats.FirstOrDefault(f => f.Description == "UpdatedFormat"); //Delete it int result = format.Delete(); Assert.IsTrue(result == 1); }
private void SelectFormat(string format) { var defaultFormat = GetFormatSample(format); foreach (var item in FormatList) { if (item == defaultFormat) { FormatSelection = item; return; } } FormatSelection = FormatList.FirstOrDefault(); }
private void OnCategorySelectionChanged() { var selectedCoordinateType = Convert.ToString(SelectedCoordinateType); if (string.IsNullOrWhiteSpace(selectedCoordinateType)) { return; } var list = GetFormatList(selectedCoordinateType); if (list == null) { return; } if (selectedCoordinateType != CoordinateType.Default.ToString()) { list.Add(CoordinateConversionLibrary.Properties.Resources.CustomString); } FormatList = list; if (( (!FormatList.Contains(FormatSelection) || FormatSelection == CoordinateConversionLibrary.Properties.Resources.CustomString) && !CoordinateConversionLibraryConfig.AddInConfig.IsCustomFormat) ) { // update format selection FormatSelection = FormatList.FirstOrDefault(); } RaisePropertyChanged(() => FormatList); if (!CoordinateConversionLibraryConfig.AddInConfig.IsCustomFormat) { Format = GetFormatFromDefaults(); } else { Format = CoordinateBase.InputCustomFormat; } RaisePropertyChanged(() => Format); }
private void UpdateSample() { var type = GetCoordinateType(); switch (type) { case CoordinateType.DD: var dd = new CoordinateDD(); if (ctdict.ContainsKey(CoordinateType.DD)) { CoordinateDD.TryParse(ctdict[type], out dd); } Sample = dd.ToString(Format, new CoordinateDDFormatter()); break; case CoordinateType.DDM: var ddm = new CoordinateDDM(); if (ctdict.ContainsKey(type)) { CoordinateDDM.TryParse(ctdict[type], out ddm); } Sample = ddm.ToString(Format, new CoordinateDDMFormatter()); break; case CoordinateType.DMS: var dms = new CoordinateDMS(); if (ctdict.ContainsKey(type)) { CoordinateDMS.TryParse(ctdict[type], out dms); } Sample = dms.ToString(Format, new CoordinateDMSFormatter()); break; case CoordinateType.GARS: var gars = new CoordinateGARS(); if (ctdict.ContainsKey(type)) { CoordinateGARS.TryParse(ctdict[type], out gars); } Sample = gars.ToString(Format, new CoordinateGARSFormatter()); break; case CoordinateType.MGRS: var mgrs = new CoordinateMGRS(); if (ctdict.ContainsKey(type)) { CoordinateMGRS.TryParse(ctdict[type], out mgrs); } Sample = mgrs.ToString(Format, new CoordinateMGRSFormatter()); break; case CoordinateType.USNG: var usng = new CoordinateUSNG(); if (ctdict.ContainsKey(type)) { CoordinateUSNG.TryParse(ctdict[type], out usng); } Sample = usng.ToString(Format, new CoordinateMGRSFormatter()); break; case CoordinateType.UTM: var utm = new CoordinateUTM(); if (ctdict.ContainsKey(type)) { CoordinateUTM.TryParse(ctdict[type], out utm); } Sample = utm.ToString(Format, new CoordinateUTMFormatter()); break; default: Sample = FormatList.FirstOrDefault(); break; } RaisePropertyChanged(() => Sample); }