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


C# GUIControl.SetThumbAnimations方法代码示例

本文整理汇总了C#中MediaPortal.GUI.Library.GUIControl.SetThumbAnimations方法的典型用法代码示例。如果您正苦于以下问题:C# GUIControl.SetThumbAnimations方法的具体用法?C# GUIControl.SetThumbAnimations怎么用?C# GUIControl.SetThumbAnimations使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MediaPortal.GUI.Library.GUIControl的用法示例。


在下文中一共展示了GUIControl.SetThumbAnimations方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: UpdateControlWithXmlData


//.........这里部分代码省略.........
            }
          }

          object newValue = null;

          if (correspondingMember.MemberType == MemberTypes.Field)
          {
            newValue = ConvertXmlStringToObject(element.Name, text, ((FieldInfo)correspondingMember).FieldType);
          }
          else if (correspondingMember.MemberType == MemberTypes.Property)
          {
            newValue = ConvertXmlStringToObject(element.Name, text, ((PropertyInfo)correspondingMember).PropertyType);
          }

          try
          {
            if (correspondingMember.MemberType == MemberTypes.Field)
            {
              ((FieldInfo)correspondingMember).SetValue(control, newValue);
            }
            else if (correspondingMember.MemberType == MemberTypes.Property)
            {
              ((PropertyInfo)correspondingMember).SetValue(control, newValue, null);
            }
          }
          catch (Exception e)
          {
            Log.Info("Couldn't place {0}, which is {1} in {2}. Exception:{3}",
                     newValue, newValue.GetType(), correspondingMember, e);
          }
        }
        else
        {
          if (char.IsUpper(element.Name[0]))
          {
            PropertyInfo propertyInfo;

            if (element.Name.IndexOf('.') != -1)
            {
              propertyInfo = controlType.GetProperty(element.Name.Split('.')[1]);
            }
            else
            {
              propertyInfo = controlType.GetProperty(element.Name);
            }

            if (propertyInfo == null)
            {
              Log.Info("GUIControlFactory.UpdateControlWithXmlData: '{0}' does not contain a definition for '{1}'",
                       controlType, element.Name);
              return;
            }

            string xml = element.OuterXml;

            if (xml.IndexOf("Button.") != -1)
            {
              xml = xml.Replace("Button.", "GUIControl.");
            }
            else if (xml.IndexOf("Window.") != -1)
            {
              xml = xml.Replace("Window.", "GUIWindow.");
            }

            XamlParser.LoadXml(xml, XmlNodeType.Element, control, filename);
          }
        }
      }

      //Set parent control's visible condition as ours wn if we're children of a group
      if (!hasVisiblecondition)
      {
        XmlNode parentNode = pControlNode.ParentNode;
        if (IsGroupControl(parentNode))
        {
          XmlDocument tempDoc = new XmlDocument();
          XmlNode elem = tempDoc.CreateElement("visible");
          int iVisibleCondition = 0;
          bool allowHiddenFocus = true;
          string parentVisiblecondition = GetVisibleConditionXML(parentNode);
          if (!string.IsNullOrEmpty(parentVisiblecondition) && parentVisiblecondition != "yes" &&
              parentVisiblecondition != "no")
          {
            elem.InnerText = parentVisiblecondition;
            XmlNode visibleNode = pControlNode.OwnerDocument.ImportNode(elem, true);
            pControlNode.AppendChild(visibleNode);
            GetConditionalVisibility(visibleNode, control, ref iVisibleCondition, ref allowHiddenFocus);
            control.SetVisibleCondition(iVisibleCondition, allowHiddenFocus);
          }
        }
      }
      if (animations.Count > 0)
      {
        control.SetAnimations(animations);
      }
      if (thumbAnimations.Count > 0)
      {
        control.SetThumbAnimations(thumbAnimations);
      }
    }
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:101,代码来源:GUIControlFactory.cs


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