mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-04 19:47:22 +00:00
Moved all extension methods into extension blocks (#1155)
This commit is contained in:
1 parent
acc7d09fa2
commit
c0a75f39ac
138 files changed
+5884
-4954
No files matched your search
@@ -11,20 +11,23 @@ internal static class TemplateSlideExtensions
|
||||
/// </summary>
|
||||
private const int MAX_SLIDE_TITLE_CHARACTERS = 60;
|
||||
|
||||
/// <summary>
|
||||
/// How the forms name a slide of the template: by its number and its title, and what is special about it.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The title tells the slides apart at a glance, since a template rarely gives its slides more
|
||||
/// than a title. A long one is cut, so that the label stays on one line.
|
||||
/// </remarks>
|
||||
public static string Label(this TemplateSlide slide)
|
||||
extension(TemplateSlide slide)
|
||||
{
|
||||
var title = slide.Title.Length > MAX_SLIDE_TITLE_CHARACTERS ? $"{slide.Title[..MAX_SLIDE_TITLE_CHARACTERS].TrimEnd()}…" : slide.Title;
|
||||
var label = title.Length > 0 ? string.Format(TB("Slide {0}: {1}"), slide.Number, title) : string.Format(TB("Slide {0}"), slide.Number);
|
||||
if (slide.IsHidden)
|
||||
label = $"{label} ({TB("hidden")})";
|
||||
/// <summary>
|
||||
/// How the forms name a slide of the template: by its number and its title, and what is special about it.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The title tells the slides apart at a glance, since a template rarely gives its slides more
|
||||
/// than a title. A long one is cut, so that the label stays on one line.
|
||||
/// </remarks>
|
||||
public string Label()
|
||||
{
|
||||
var title = slide.Title.Length > MAX_SLIDE_TITLE_CHARACTERS ? $"{slide.Title[..MAX_SLIDE_TITLE_CHARACTERS].TrimEnd()}…" : slide.Title;
|
||||
var label = title.Length > 0 ? string.Format(TB("Slide {0}: {1}"), slide.Number, title) : string.Format(TB("Slide {0}"), slide.Number);
|
||||
if (slide.IsHidden)
|
||||
label = $"{label} ({TB("hidden")})";
|
||||
|
||||
return label;
|
||||
return label;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user