Write() public method

public Write ( string filePath ) : void
filePath string
return void
示例#1
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);
            }
        }
示例#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;
            }
        }