コード例 #1
0
        public override void Save(XmlDocument doc, XmlNode node, MpeParser parser, MpeControl reference)
        {
            base.Save(doc, node, parser, reference);
            // Remove Width and Height
            parser.RemoveNode(node, "width");
            parser.RemoveNode(node, "height");

            MpeCheckBox checkbox = null;

            if (reference != null && reference is MpeCheckBox)
            {
                checkbox = (MpeCheckBox)reference;
            }

            // Label
            label.Save(doc, node, parser, checkbox != null ? checkbox.label : null);
            parser.SetValue(doc, node, "type", Type.ToString());

            // TextureChecked
            if (checkbox == null || checkbox.TextureChecked == null || checkbox.TextureChecked.Equals(TextureChecked) == false
                )
            {
                if (TextureChecked == null)
                {
                    parser.SetValue(doc, node, "textureCheckmark", "-");
                }
                else
                {
                    parser.SetValue(doc, node, "textureCheckmark", TextureChecked.Name);
                }
            }
            // Texture
            if (checkbox == null || checkbox.Texture == null || checkbox.Texture.Equals(Texture) == false)
            {
                if (Texture == null)
                {
                    parser.SetValue(doc, node, "textureCheckmarkNoFocus", "-");
                }
                else
                {
                    parser.SetValue(doc, node, "textureCheckmarkNoFocus", Texture.Name);
                }
            }
            // TextureSize
            if (checkbox == null || checkbox.TextureSize != TextureSize)
            {
                parser.SetInt(doc, node, "MarkWidth", TextureSize.Width);
                parser.SetInt(doc, node, "MarkHeight", TextureSize.Height);
            }
            // Shadow
            parser.SetValue(doc, node, "shadow", "no");
            // Save Correct Type
            //parser.SetValue(doc, node, "type", parser.ControlTypeToXmlString(Type));
            //parser.SetValue(doc, node, "type", Type.ToString());
        }
コード例 #2
0
        public override void Save(XmlDocument doc, XmlNode node, MpeParser parser, MpeControl reference)
        {
            base.Save(doc, node, parser, reference);

            MpeLabel label = null;

            if (reference != null && reference is MpeLabel)
            {
                label = (MpeLabel)reference;
            }

            // Fix the Left Position
            if (Alignment == MpeControlAlignment.Right)
            {
                parser.SetInt(doc, node, "posX", Right);
            }
            // Fix the Width and Height
            parser.RemoveNode(node, "width");
            parser.RemoveNode(node, "height");
            // Text
            parser.SetValue(doc, node, "label", Text);
            // Font
            if (label == null || !label.Font.Name.Equals(Font.Name))
            {
                parser.SetValue(doc, node, "font", Font.Name);
            }
            // Alignment
            if (label == null || label.Alignment != Alignment)
            {
                parser.SetValue(doc, node, "align", Alignment.ToString().ToLower());
            }
            // Color
            if (label == null || label.TextColor != TextColor)
            {
                parser.SetColor(doc, node, "textcolor", TextColor);
            }
            // DisabledColor
            if (label == null || label.DisabledColor != DisabledColor)
            {
                parser.SetColor(doc, node, "disabledcolor", DisabledColor);
            }
        }
コード例 #3
0
 public override void Save(XmlDocument doc, XmlNode node, MpeParser parser, MpeControl reference)
 {
     if (doc != null && node != null)
     {
         base.Save(doc, node, parser, reference);
         if (AutoSize)
         {
             parser.RemoveNode(node, "width");
             parser.RemoveNode(node, "height");
         }
         MpeImage image = null;
         if (reference != null && reference is MpeImage)
         {
             image = (MpeImage)reference;
         }
         // For the reference image, the texture should be set to the default screen background
         if (IsReference)
         {
             parser.SetValue(doc, node, "texture", (MpeScreen.TextureBack != null ? MpeScreen.TextureBack.Name : "-"));
         }
         else
         {
             parser.SetValue(doc, node, "texture", (Texture != null ? Texture.Name : "-"));
         }
         if (image == null || image.Centered != Centered)
         {
             parser.SetValue(doc, node, "centered", Centered ? "yes" : "no");
         }
         if (image == null || image.Filtered != Filtered)
         {
             parser.SetValue(doc, node, "filtered", Filtered ? "yes" : "no");
         }
         if (image == null || image.KeepAspectRatio != KeepAspectRatio)
         {
             parser.SetValue(doc, node, "keepaspectratio", KeepAspectRatio ? "yes" : "no");
         }
         if (image == null || image.ColorKey != ColorKey)
         {
             parser.SetInt(doc, node, "colorkey", ColorKey);
         }
     }
 }
コード例 #4
0
ファイル: MpeCheckBox.cs プロジェクト: arangas/MediaPortal-1
    public override void Save(XmlDocument doc, XmlNode node, MpeParser parser, MpeControl reference)
    {
      base.Save(doc, node, parser, reference);
      // Remove Width and Height
      parser.RemoveNode(node, "width");
      parser.RemoveNode(node, "height");

      MpeCheckBox checkbox = null;
      if (reference != null && reference is MpeCheckBox)
      {
        checkbox = (MpeCheckBox) reference;
      }

      // Label
      label.Save(doc, node, parser, checkbox != null ? checkbox.label : null);
      parser.SetValue(doc, node, "type", Type.ToString());

      // TextureChecked
      if (checkbox == null || checkbox.TextureChecked == null || checkbox.TextureChecked.Equals(TextureChecked) == false
        )
      {
        if (TextureChecked == null)
        {
          parser.SetValue(doc, node, "textureCheckmark", "-");
        }
        else
        {
          parser.SetValue(doc, node, "textureCheckmark", TextureChecked.Name);
        }
      }
      // Texture
      if (checkbox == null || checkbox.Texture == null || checkbox.Texture.Equals(Texture) == false)
      {
        if (Texture == null)
        {
          parser.SetValue(doc, node, "textureCheckmarkNoFocus", "-");
        }
        else
        {
          parser.SetValue(doc, node, "textureCheckmarkNoFocus", Texture.Name);
        }
      }
      // TextureSize
      if (checkbox == null || checkbox.TextureSize != TextureSize)
      {
        parser.SetInt(doc, node, "MarkWidth", TextureSize.Width);
        parser.SetInt(doc, node, "MarkHeight", TextureSize.Height);
      }
      // Shadow
      parser.SetValue(doc, node, "shadow", "no");
      // Save Correct Type
      //parser.SetValue(doc, node, "type", parser.ControlTypeToXmlString(Type));
      //parser.SetValue(doc, node, "type", Type.ToString());
    }
コード例 #5
0
ファイル: MpeLabel.cs プロジェクト: arangas/MediaPortal-1
    public override void Save(XmlDocument doc, XmlNode node, MpeParser parser, MpeControl reference)
    {
      base.Save(doc, node, parser, reference);

      MpeLabel label = null;
      if (reference != null && reference is MpeLabel)
      {
        label = (MpeLabel) reference;
      }

      // Fix the Left Position
      if (Alignment == MpeControlAlignment.Right)
      {
        parser.SetInt(doc, node, "posX", Right);
      }
      // Fix the Width and Height
      parser.RemoveNode(node, "width");
      parser.RemoveNode(node, "height");
      // Text
      parser.SetValue(doc, node, "label", Text);
      // Font
      if (label == null || !label.Font.Name.Equals(Font.Name))
      {
        parser.SetValue(doc, node, "font", Font.Name);
      }
      // Alignment
      if (label == null || label.Alignment != Alignment)
      {
        parser.SetValue(doc, node, "align", Alignment.ToString().ToLower());
      }
      // Color
      if (label == null || label.TextColor != TextColor)
      {
        parser.SetColor(doc, node, "textcolor", TextColor);
      }
      // DisabledColor
      if (label == null || label.DisabledColor != DisabledColor)
      {
        parser.SetColor(doc, node, "disabledcolor", DisabledColor);
      }
    }
コード例 #6
0
ファイル: MpeImage.cs プロジェクト: arangas/MediaPortal-1
 public override void Save(XmlDocument doc, XmlNode node, MpeParser parser, MpeControl reference)
 {
   if (doc != null && node != null)
   {
     base.Save(doc, node, parser, reference);
     if (AutoSize)
     {
       parser.RemoveNode(node, "width");
       parser.RemoveNode(node, "height");
     }
     MpeImage image = null;
     if (reference != null && reference is MpeImage)
     {
       image = (MpeImage) reference;
     }
     // For the reference image, the texture should be set to the default screen background
     if (IsReference)
     {
       parser.SetValue(doc, node, "texture", (MpeScreen.TextureBack != null ? MpeScreen.TextureBack.Name : "-"));
     }
     else
     {
       parser.SetValue(doc, node, "texture", (Texture != null ? Texture.Name : "-"));
     }
     if (image == null || image.Centered != Centered)
     {
       parser.SetValue(doc, node, "centered", Centered ? "yes" : "no");
     }
     if (image == null || image.Filtered != Filtered)
     {
       parser.SetValue(doc, node, "filtered", Filtered ? "yes" : "no");
     }
     if (image == null || image.KeepAspectRatio != KeepAspectRatio)
     {
       parser.SetValue(doc, node, "keepaspectratio", KeepAspectRatio ? "yes" : "no");
     }
     if (image == null || image.ColorKey != ColorKey)
     {
       parser.SetInt(doc, node, "colorkey", ColorKey);
     }
   }
 }