Пример #1
0
        private string GenerateApi(DirectoryList.ItemsData api)
        {
            var tmpl = new Template();

            tmpl.Add("|| *{VERSION}* | [{URL_BINARY} {FILE_BINARY}]  ([{URL_SOURCE} Source]) | [{URL_XML} XmlDoc] ||");
            tmpl.Add("|| [{URL_DOCU} Documentation] | " +
                     "[https://code.google.com/apis/explorer/#_s={NAME}&_v={VERSION} APIs Explorer] ||");
            string formalName    = api.Name.ToUpperFirstChar();
            string formalVersion = api.Version;
            string binFileName   = string.Format("Google.Apis.{0}.{1}.dll", formalName, formalVersion);

            // Fill in the data.
            const string RELEASE_DIR = "http://contrib.google-api-dotnet-client.googlecode.com/hg/Stable";
            const string BINARY_PATH = RELEASE_DIR + "/Generated/Bin/{0}Service/{1}";
            var          data        = new Entries();

            data.Add("URL_DOCU", api.DocumentationLink);
            data.Add("URL_BINARY", BINARY_PATH, formalName, binFileName);
            data.Add("URL_XML", BINARY_PATH, formalName, Path.ChangeExtension(binFileName, ".xml"));
            data.Add("FILE_BINARY", binFileName);
            data.Add("URL_SOURCE", RELEASE_DIR + "/Generated/Source/{0}", Path.ChangeExtension(binFileName, ".cs"));
            data.Add("NAME", api.Name);
            data.Add("VERSION", api.Version);
            return(tmpl.ToString(data));
        }
Пример #2
0
 /// <summary>
 /// Generates the service described by the specified API object.
 /// </summary>
 /// <param name="api">The API to generate.</param>
 public void GenerateService(DirectoryList.ItemsData api)
 {
     GenerateService(new Uri(api.DiscoveryLink));
 }
Пример #3
0
 public string GetApiTitle(DirectoryList.ItemsData a)
 {
     return((a.Title ?? a.Name ?? a.Description).ToUpperFirstChar());
 }