public GetPath ( string getWhat, FindEnum ofType, bool sansLeadingSlash = false ) : string | ||
getWhat | string | |
ofType | FindEnum | |
sansLeadingSlash | bool | |
리턴 | string |
protected string BuildModifierItemTags(SymbolSet ss, string modNumber, ModifiersTypeModifier m, bool omitSource, bool omitLegacy) { // Constructs a string of semicolon delimited tags that users can utilize to search // for or find a given symbol. // The information concatenated together for this comes from a given SymbolSet and // modifier. Information includes the Label attributes, geometry // type, location of the original graphic file, the code, etc. string path = ""; string typ = ""; string result = ss.Label.Replace(',', '-'); result = result + ";" + "Modifier " + modNumber; result = result + ";" + m.Label.Replace(',', '-'); switch (modNumber) { case "1": path = _configHelper.GetPath(ss.ID, FindEnum.FindModifierOnes, true); typ = "MOD1"; break; case "2": path = _configHelper.GetPath(ss.ID, FindEnum.FindModifierTwos, true); typ = "MOD2"; break; } result = result + ";" + typ; if (!omitLegacy) { result = result + ";" + _configHelper.SIDCIsNA; } if (!omitSource) { result = result + ";" + path + "\\" + m.Graphic; } result = result + ";Point"; result = result + ";" + BuildModifierItemName(ss, modNumber, m); result = result + ";" + BuildModifierCode(ss, modNumber, m); return(result); }
protected string BuildEntityItemTags(LibraryStandardIdentityGroup sig, SymbolSet ss, SymbolSetEntity e, SymbolSetEntityEntityType eType, EntitySubTypeType eSubType, bool omitSource, bool omitLegacy) { // Constructs a string of semicolon delimited tags that users can utilize to search // for or find a given symbol. // The information concatenated together for this comes from a given SymbolSet and // entity (type and sub type). Information includes the Label attributes, geometry // type, location of the original graphic file, the code, etc. string result = ss.Label.Replace(',', '-'); string graphic = ""; string geometry = ""; string iType = "NO_ICON"; string[] xmlTags = null; if (e == null && eType == null && eSubType != null) { result = result + ";" + "Special Entity Subtypes"; } if (e != null) { result = result + ";" + e.Label.Replace(',', '-'); iType = Convert.ToString(e.Icon); } if (eType != null) { result = result + ";" + eType.Label.Replace(',', '-'); iType = Convert.ToString(eType.Icon); } if (eSubType != null) { result = result + ";" + eSubType.Label.Replace(',', '-'); iType = Convert.ToString(eSubType.Icon); // Add the type of geometry geometry = _geometryList[(int)eSubType.GeometryType]; if (eSubType.Icon == IconType.FULL_FRAME) { if (sig != null) { graphic = GrabGraphic(eSubType.CloverGraphic, eSubType.RectangleGraphic, eSubType.SquareGraphic, eSubType.DiamondGraphic, sig.GraphicSuffix); } _notes = _notes + "icon touches frame;"; } else if (eSubType.Icon == IconType.NA) { graphic = ""; } else { graphic = eSubType.Graphic; } // Grab any custom XML tags that might exist xmlTags = eSubType.Tags; } else if (eType != null) { // Add the type of geometry geometry = _geometryList[(int)eType.GeometryType]; if (eType.Icon == IconType.FULL_FRAME) { if (sig != null) { graphic = GrabGraphic(eType.CloverGraphic, eType.RectangleGraphic, eType.SquareGraphic, eType.DiamondGraphic, sig.GraphicSuffix); } _notes = _notes + "icon touches frame;"; } else if (eType.Icon == IconType.NA) { graphic = ""; } else { graphic = eType.Graphic; } // Grab any custom XML tags that might exist xmlTags = eType.Tags; } else if (e != null) { // Add the type of geometry geometry = _geometryList[(int)e.GeometryType]; if (e.Icon == IconType.FULL_FRAME) { if (sig != null) { graphic = GrabGraphic(e.CloverGraphic, e.RectangleGraphic, e.SquareGraphic, e.DiamondGraphic, sig.GraphicSuffix); } _notes = _notes + "icon touches frame;"; } else if (e.Icon == IconType.NA) { graphic = ""; } else { graphic = e.Graphic; } // Grab any custom XML tags that might exist xmlTags = e.Tags; } // Create the unique ID/code for this object string code = BuildEntityCode(sig, ss, e, eType, eSubType); // If there is a standard identity group, add it if (sig != null) { result = result + ";" + sig.Label; } // Add any custom XML or export tags that might exist result = _configHelper.AddCustomTags(result, code, xmlTags); // Add an equivalent 2525C SIDC tag, if one exists if (!omitLegacy) { string sidcTag = BuildLegacySIDCTag(sig, ss, e, eType, eSubType); if (sidcTag != "") { result = result + ";" + sidcTag; } } // Add the icon's type result = result + ";" + iType; // Add the svg source if (!omitSource) { result = result + ";" + _configHelper.GetPath(ss.ID, FindEnum.FindEntities, true) + "\\" + graphic; } // Add the three most important pieces of information result = result + ";" + geometry; result = result + ";" + BuildEntityItemName(sig, ss, e, eType, eSubType); result = result + ";" + code; if (result.Length > 255) { // Can't have a tag string greater than 255 in length. // Human interaction will be required to resolve these on a case by case basis. _notes = _notes + "styleItemTags > 255;"; } return(result); }
protected string BuildEntityItemTags(SymbolSet ss, SymbolSetEntity e, SymbolSetEntityEntityType eType, SymbolSetEntityEntityTypeEntitySubType eSubType, bool omitSource) { // Constructs a string of semicolon delimited tags that users can utilize to search // for or find a given symbol. // The information concatenated together for this comes from a given SymbolSet and // entity (type and sub type). Information includes the Label attributes, geometry // type, location of the original graphic file, the code, etc. string result = ss.Label.Replace(',', '-') + ";" + e.Label.Replace(',', '-'); string graphic = ""; string geometry = ""; if (eType != null) { result = result + ";" + eType.Label.Replace(',', '-'); } if (eSubType != null) { result = result + ";" + eSubType.Label.Replace(',', '-'); // Add the type of geometry geometry = _geometryList[(int)eSubType.GeometryType]; // The following is a work around because our symbol system doesn't // need the export of multiple SVG files for the same symbol. // TODO: handle this differently, but for now, we export the square // graphic if there are in fact multiple files. if (eSubType.Icon == IconType.FULL_FRAME) { graphic = eSubType.SquareGraphic; _notes = _notes + "icon touches frame;"; } else if (eSubType.Icon == IconType.NA) { graphic = ""; } else { graphic = eSubType.Graphic; } } else if (eType != null) { // Add the type of geometry geometry = _geometryList[(int)eType.GeometryType]; // TODO: handle this differently, but for now, we export the square // graphic if there are in fact multiple files. if (eType.Icon == IconType.FULL_FRAME) { graphic = eType.SquareGraphic; _notes = _notes + "icon touches frame;"; } else if (eType.Icon == IconType.NA) { graphic = ""; } else { graphic = eType.Graphic; } } else if (e != null) { // Add the type of geometry geometry = _geometryList[(int)e.GeometryType]; // TODO: handle this differently, but for now, we export the square // graphic if there are in fact multiple files. if (e.Icon == IconType.FULL_FRAME) { graphic = e.SquareGraphic; _notes = _notes + "icon touches frame;"; } else if (e.Icon == IconType.NA) { graphic = ""; } else { graphic = e.Graphic; } } if (!omitSource) { result = result + ";" + _configHelper.GetPath(ss.ID, FindEnum.FindEntities, true) + "\\" + graphic; } result = result + ";" + geometry; result = result + ";" + BuildEntityItemName(ss, e, eType, eSubType); result = result + ";" + BuildEntityCode(ss, e, eType, eSubType); if (result.Length > 255) { // Can't have a tag string greater than 255 in length. // Human interaction will be required to resolve these on a case by case basis. _notes = _notes + "styleItemTags > 255;"; } return(result); }
private void _BuildEntityTypeGraphics() { string graphic = ""; string path = _configHelper.GetPath(_symbolSet.ID, FindEnum.FindEntities); if (_entityType != null) { if (_entityType.Icon == IconType.FULL_FRAME) { switch (_sig.ID) { case "SIG_UNKNOWN": graphic = _entityType.CloverGraphic; break; case "SIG_FRIEND": graphic = _entityType.RectangleGraphic; break; case "SIG_NEUTRAL": graphic = _entityType.SquareGraphic; break; case "SIG_HOSTILE": graphic = _entityType.DiamondGraphic; break; } } else if (_entityType.Graphic != "") { graphic = _entityType.Graphic; } } else if (_entity != null) { if (_entity.Icon == IconType.FULL_FRAME) { switch (_sig.ID) { case "SIG_UNKNOWN": graphic = _entity.CloverGraphic; break; case "SIG_FRIEND": graphic = _entity.RectangleGraphic; break; case "SIG_NEUTRAL": graphic = _entity.SquareGraphic; break; case "SIG_HOSTILE": graphic = _entity.DiamondGraphic; break; } } else if (_entity.Graphic != "") { graphic = _entity.Graphic; } } if (graphic != null) { _graphics.Add(_configHelper.BuildOriginalPath(path, graphic)); } }