importclrclr.AddReference("cAlgo.API")fromcAlgo.APIimport*fromSystemimportActiondefgetTextBlock(text):textBlock=TextBlock()textBlock.Text=texttextBlock.Margin=Thickness(5)returntextBlockclassTest():definitialize(self):api.Application.ColorThemeChanged+=self.on_application_color_theme_changedapi.Application.UserTimeOffsetChanged+=self.on_application_user_time_offset_changedapi.Application.LanguageChanged+=self.on_application_language_changedself.draw_application_info()defdraw_application_info(self):grid=Grid(5,2)grid.BackgroundColor=Color.Goldenrodgrid.HorizontalAlignment=HorizontalAlignment.Centergrid.VerticalAlignment=VerticalAlignment.Centergrid.AddChild(getTextBlock("Version"),0,0)grid.AddChild(getTextBlock(str(api.Application.Version)),0,1)grid.AddChild(getTextBlock("Theme"),1,0)self.themeTextBlock=getTextBlock(str(api.Application.ColorTheme))grid.AddChild(self.themeTextBlock,1,1)grid.AddChild(getTextBlock("User Time Offset"),2,0)self.userTimeOffsetTextBlock=getTextBlock(str(api.Application.UserTimeOffset))grid.AddChild(self.userTimeOffsetTextBlock,2,1)grid.AddChild(getTextBlock("Environment Type"),3,0)grid.AddChild(getTextBlock(str(api.Application.EnvironmentType)),3,1)grid.AddChild(getTextBlock("Language"),4,0)self.languageTextBlock=getTextBlock(api.Application.Language.TwoLetterCode)grid.AddChild(self.languageTextBlock,4,1)api.Chart.AddControl(grid)defon_application_user_time_offset_changed(self,obj):self.userTimeOffsetTextBlock.Text=str(obj.UserTimeOffset)defon_application_color_theme_changed(self,obj):self.themeTextBlock.Text=str(obj.ColorTheme)defon_application_language_changed(self,args):self.languageTextBlock.Text=api.Application.Language.TwoLetterCode