public override bool Execute() { try { VersionInfo version = new VersionInfo(); version.ReadFromFile(VersionFile); string fileExt = Path.GetExtension(SharedHeaderFile); if (fileExt == ".cs") { CSHeaderFile csHeader = new CSHeaderFile(version); csHeader.Write(SharedHeaderFile); } else if (fileExt == ".h") { RCHeaderFile rcHeader = new RCHeaderFile(version); rcHeader.Write(SharedHeaderFile); } else { throw new ArgumentException("Unrecognized SharedHeaderFile type."); } return(true); } catch (Exception e) { LogError(e.Message); return(false); } }
public override bool Execute() { try { VersionInfo version = new VersionInfo(); version.ReadFromFile(VersionFile); string fileExt = Path.GetExtension(SharedHeaderFile); if (fileExt == ".cs") { CSHeaderFile csHeader = new CSHeaderFile(version); csHeader.Write(SharedHeaderFile); } else if (fileExt == ".h") { RCHeaderFile rcHeader = new RCHeaderFile(version); rcHeader.Write(SharedHeaderFile); } else { throw new ArgumentException("Unrecognized SharedHeaderFile type."); } return true; } catch (Exception e) { LogError(e.Message); return false; } }