コード例 #1
0
		private void MergeContent(CommandItem command)
		{
			if (command == null || command.Content == null)
				return;

			MergeContentFile(command.Content);
		}
コード例 #2
0
		private void SetTitle(CommandItem command)
		{
			if (command == null)
				return;

			HtmlMeta metaKeywords = null;
			HtmlMeta metaDescription = null;
			foreach (Control control in base.Header.Controls)
			{
				if (!(control is HtmlMeta))
					continue;
				HtmlMeta meta = control as HtmlMeta;
				string metaName = meta.Name.ToLower();
				if (string.Compare(metaName, "keywords") == 0)
					metaKeywords = meta;
				else
				if (string.Compare(metaName, "description") == 0)
					metaDescription = meta;
			}

			if (metaKeywords == null)
			{
				metaKeywords = new HtmlMeta();
				metaKeywords.Name = "keywords";
				base.Header.Controls.Add(metaKeywords);
			}

			if (metaDescription == null)
			{
				metaDescription = new HtmlMeta();
				metaDescription.Name = "description";
				base.Header.Controls.Add(metaDescription);
			}

			metaDescription.Content = command.Name + ". " + metaDescription.Content;
			metaKeywords.Content = command.Name + ", " + metaKeywords.Content;
			base.Title += " " + command.Name;
		}