本文整理汇总了C#中MediaPortal.GUI.Library.GUIControl.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# GUIControl.GetType方法的具体用法?C# GUIControl.GetType怎么用?C# GUIControl.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MediaPortal.GUI.Library.GUIControl
的用法示例。
在下文中一共展示了GUIControl.GetType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnClicked
protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType)
{
if (control.GetType() == typeof (GUIButtonControl))
{
if (controlId > 100 && controlId <= Settings.LocalPresetsNumber + 100 &&
_setting.PresetStations[controlId - 100 - 1] != null &&
_setting.PresetStations[controlId - 100 - 1].GuidId != null)
{
DoPlay(_setting.PresetStations[controlId - 100 - 1]);
if (_setting.JumpNowPlaying)
GUIWindowManager.ActivateWindow(25652);
}
}
if (control == homeButton)
{
GUIWindowManager.ActivateWindow(25650);
}
else if (control == folderButton)
{
var s = GetPresetFolder();
if (s == noPresetFolders)
{
ErrMessage(Translation.NoPresetFoldersFound);
GUIControl.DisableControl(GetID, folderButton.GetID);
}
else if (s != null)
{
_setting.FolderId = s;
_setting.Save();
LoadLocalPresetStations();
}
}
base.OnClicked(controlId, control, actionType);
}
示例2: GetSingleLabelFromControl
private string GetSingleLabelFromControl(GUIControl control)
{
if (control.GetType() == typeof(GUILabelControl))
{
GUILabelControl label = (GUILabelControl)control;
return label.Label;
}
else if (control.GetType() == typeof(GUIFadeLabel))
{
GUIFadeLabel label = (GUIFadeLabel)control;
return label.Label;
}
return null;
}
示例3: GenerateElement
/// <summary>
/// Generates a single element based on the type of the GUIControl
/// Supported Types:
/// - GUIListControl
/// - GUITextScrollUpControl
/// - GUICheckMarkControl
/// - GUISliderControl
/// - GUICheckButton
/// - GUIButtonControl
/// - GUIFadeLabel
/// - GUIProgressControl
/// - GUITVProgressControl
/// - GUIVolumeBar
/// - GUILabelControl
/// - GUIImage
/// - GUIGroup are handled directly
/// </summary>
/// <param name="control">Control</param>
/// <returns>Element based on the GUIControl</returns>
public static BaseElement GenerateElement(GUIControl control)
{
if (control.GetType() == typeof(GUIImage))
{
return new ImageElement(control);
}
if (control.GetType() == typeof(GUILabelControl))
{
return new LabelElement(control);
}
if (control.GetType() == typeof(GUIVolumeBar))
{
return new VolumeBarElement(control);
}
if (control.GetType() == typeof(GUIProgressControl))
{
return new ProgressControlElement(control);
}
if (control.GetType() == typeof(GUITVProgressControl))
{
return new TVProgressControlElement(control);
}
if (control.GetType() == typeof(GUIFadeLabel))
{
return new FadeLabelElement(control);
}
if (control.GetType() == typeof(GUIButtonControl))
{
return new ButtonElement(control);
}
if (control.GetType() == typeof(GUICheckButton))
{
return new CheckButtonElement(control);
}
if (control.GetType() == typeof(GUISliderControl))
{
return new SliderElement(control);
}
if (control.GetType() == typeof(GUICheckMarkControl))
{
return new CheckMarkElement(control);
}
if (control.GetType() == typeof(GUITextScrollUpControl))
{
return new TextScrollUpElement(control);
}
if (control.GetType() == typeof(GUIListControl))
{
return new ListElement(control);
}
Log.Debug("VIDEOPLAYER_OSD FOUND UNEXPECTED TYPE: " + control.GetType());
return null;
}
示例4: CheckElement
private void CheckElement(GUIControl temp)
{
Log.Info(temp.GetType() + " : " + temp.GetID);
if (temp.GetID == LabelId)
{
if (temp.GetType() == typeof(GUILabelControl))
{
_label = new LabelElement(temp);
}
else
{
Log.Info("VIDEO OSD: TYPE LABEL NOT FOUND FOR LABEL_ID=10 IN FULLSCREEN WINDOW. FOUND: " + temp.GetType());
}
}
if (temp.GetID == BackgroundId)
{
if (temp.GetType() == typeof(GUIImage))
{
_background = new ImageElement(temp);
}
else
{
Log.Info("VIDEO OSD: TYPE IMAGE NOT FOUND FOR BACKGROUND_ID=0 IN FULLSCREEN WINDOW. FOUND: " + temp.GetType());
}
}
if (temp.GetID == BackgroundId2)
{
if (temp.GetType() == typeof(GUIImage))
{
_background2 = new ImageElement(temp);
}
else
{
Log.Info("VIDEO OSD: TYPE IMAGE NOT FOUND FOR BACKGROUND_ID=104 IN FULLSCREEN WINDOW. FOUND: " + temp.GetType());
}
}
if (temp.GetType() == typeof(GUIImage))
{
var imageElement = temp as GUIImage;
if (imageElement != null)
if (imageElement.FileName.Equals("osd_bg_top.png"))
{
_background3 = new ImageElement(temp);
}
}
if ((temp.GetID == ProgressId) && (temp.GetType() == typeof(GUIProgressControl) || temp.GetType() == typeof(GUILabelControl))
|| (temp.GetID > PanelStart && temp.GetID < PanelEnd))
{
if (temp.GetType() == typeof(GUIImage))
{
_imageCacheElements.Add(GenerateElement(temp));
}
else
{
_cacheElements.Add(GenerateElement(temp));
}
}
}