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);
            }
        }
Exemple #2
0
        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;
            }
        }