Ejemplo n.º 1
0
        protected override string GetAltButton(string platform, TreeAltData tree)
        {
            if (!tree.Adjustable)
            {
                return("Print");
            }

            switch (tree.Default)
            {
            case null:
                return(tree.Names[0]);

            case "KEY_PRINT":
                return("Print");

            case "KEY_PLAYBACK":
                return("Playback");

            case "KEY_FACE":
                return("Face");

            default:
                throw new InvalidOperationException($"{platform}: Unknown button {tree.Default}");
            }
        }
Ejemplo n.º 2
0
        protected override void Validate(string platform, TreeAltData tree)
        {
            if (tree.Adjustable)
            {
                if ((tree.Names == null || tree.Options == null))
                {
                    throw new InvalidOperationException($"{platform}: Mismatching button options");
                }

                if (tree.Names.Length != tree.Options.Length)
                {
                    throw new InvalidOperationException($"{platform}: Mismatching button options");
                }
            }
            else
            {
                if (tree.Names != null || tree.Options != null)
                {
                    throw new InvalidOperationException($"{platform}: Invalid button options");
                }
            }

            if (tree.Default != null && tree.Options != null && tree.Default != tree.Options[0])
            {
                throw new InvalidOperationException($"{platform}: Mismatching buttons");
            }
        }
        public AltData GetAlt(string platform, TreeAltData tree)
        {
            Validate(platform, tree);

            return(new AltData
            {
                Button = GetAltButton(platform, tree),
                Buttons = GetAltButtons(platform, tree),
            });
        }
 protected abstract string GetAltButton(string platform, TreeAltData tree);
 protected virtual string[] GetAltButtons(string platform, TreeAltData tree)
 {
     return(null);
 }
 protected virtual void Validate(string platform, TreeAltData tree)
 {
     //Do nothing
 }
Ejemplo n.º 7
0
 public AltData GetAlt(string platform, TreeAltData tree, string productName)
 {
     return(GetInnerProvider(productName).GetAlt(platform, tree));
 }
Ejemplo n.º 8
0
 protected override string[] GetAltButtons(string platform, TreeAltData tree)
 {
     return(tree.Names);
 }
 public CameraData()
 {
     Alt  = new TreeAltData();
     Card = new TreeCardData();
 }
 protected override string GetAltButton(string platform, TreeAltData tree)
 {
     return("Menu");
 }
Ejemplo n.º 11
0
 private AltData GetAlt(string platform, TreeAltData alt, string productName)
 {
     return(alt != null
         ? AltProvider.GetAlt(platform, alt, productName)
         : null);
 }