当前位置: 首页>>代码示例>>C#>>正文


C# GUIControl.GetType方法代码示例

本文整理汇总了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);
        }
开发者ID:andrewjswan,项目名称:mediaportal-tunein,代码行数:35,代码来源:PresetsGUI.cs

示例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;
        }
开发者ID:Kucheek,项目名称:WifiRemote,代码行数:15,代码来源:MpDialog.cs

示例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;
 }
开发者ID:MisterD81,项目名称:MyMPlayer,代码行数:72,代码来源:BaseWindow.cs

示例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));
     }
       }
 }
开发者ID:MisterD81,项目名称:MyMPlayer,代码行数:58,代码来源:FullscreenWindow.cs


注:本文中的MediaPortal.GUI.Library.GUIControl.GetType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。