Exemplo n.º 1
0
        protected override Resource ConvertToMason(T resource)
        {
            Resource r = ConvertToIssueTracker(resource);

            r.AddNamespace(new Namespace(RelTypes.NSPrefix, RelTypes.NSName));

            if (!MasonBuilderContext.PreferMinimalResponse)
            {
                string msg = string.Format("This application restarts in {0:m\\:ss} minutes", ApplicationLifeTimeManager.NextRestart - DateTime.Now);
                if (r.Meta.Description == null)
                {
                    r.Meta.Description = msg;
                }
                else
                {
                    r.Meta.Description += " [" + msg + "]";
                }
                r.Meta.AddControl(MasonBuilderContext.NewLink("documentation", "https://github.com/JornWildt/Mason", "Documentation of Mason media type (hosted on GitHub)."));
            }

            Uri     resourceCommonUri  = typeof(ResourceCommonResource).CreateUri();
            Control resourceCommonLink = MasonBuilderContext.NewLink(RelTypes.ResourceCommon, resourceCommonUri, "Common information shared by all resources");

            r.AddControl(resourceCommonLink);

            return(r);
        }