Exemple #1
0
        public override IQuery GetHsql(Object data)
        {
            StringBuilder  sql            = new StringBuilder("select a from MenuOptionType a    where  ");
            MenuOptionType menuoptiontype = (MenuOptionType)data;

            if (menuoptiontype != null)
            {
                Parms = new List <Object[]>();

                if (menuoptiontype.MenuOptionTypeID != 0)
                {
                    sql.Append(" a.MenuOptionTypeID = :id     and   ");
                    Parms.Add(new Object[] { "id", menuoptiontype.MenuOptionTypeID });
                }

                if (!String.IsNullOrEmpty(menuoptiontype.Name))
                {
                    sql.Append(" a.Name = :nom     and   ");
                    Parms.Add(new Object[] { "nom", menuoptiontype.Name });
                }

                if (!String.IsNullOrEmpty(menuoptiontype.Url))
                {
                    sql.Append(" a.Url = :nom1     and   ");
                    Parms.Add(new Object[] { "nom1", menuoptiontype.Url });
                }
            }

            sql = new StringBuilder(sql.ToString());
            sql.Append("1=1 order by a.MenuOptionTypeID asc ");
            IQuery query = Factory.Session.CreateQuery(sql.ToString());

            SetParameters(query);
            return(query);
        }
Exemple #2
0
 public MenuOption(MenuOptionType type, string text, ContentManager content)
 {
     font      = content.Load <SpriteFont>("small");
     position  = new Vector2();
     this.type = type;
     this.text = text;
     toggle    = Setting;
     UpdateX();
 }
Exemple #3
0
        public IList <MenuOptionType> Select(MenuOptionType data)
        {
            IList <MenuOptionType> datos = new List <MenuOptionType>();

            datos = GetHsql(data).List <MenuOptionType>();
            if (!Factory.IsTransactional)
            {
                Factory.Commit();
            }
            return(datos);
        }
            internal MenuOption(MenuOptionType type, string text, object[] entries)
            {
                Type    = type;
                Text    = text;
                Entries = entries;
                switch (type)
                {
                case MenuOptionType.ScreenResolution:
                    ScreenResolution[] castEntries = entries as ScreenResolution[];
                    for (int i = 0; i < castEntries.Length; i++)
                    {
                        if (castEntries[i].Width == Program.Renderer.Screen.Width && castEntries[i].Height == Program.Renderer.Screen.Height)
                        {
                            CurrentlySelectedOption = i;
                            return;
                        }
                    }
                    break;

                case MenuOptionType.FullScreen:
                    CurrentlySelectedOption = Interface.CurrentOptions.FullscreenMode ? 0 : 1;
                    return;

                case MenuOptionType.Interpolation:
                    CurrentlySelectedOption = (int)Interface.CurrentOptions.Interpolation;
                    return;

                case MenuOptionType.AnisotropicLevel:
                    for (int i = 0; i < Entries.Length; i++)
                    {
                        int level = int.Parse(entries[i] as string, NumberStyles.Integer);
                        if (level == Interface.CurrentOptions.AnisotropicFilteringLevel)
                        {
                            CurrentlySelectedOption = i;
                            return;
                        }
                    }
                    break;

                case MenuOptionType.AntialiasingLevel:
                    for (int i = 0; i < Entries.Length; i++)
                    {
                        int level = int.Parse(entries[i] as string, NumberStyles.Integer);
                        if (level == Interface.CurrentOptions.AntiAliasingLevel)
                        {
                            CurrentlySelectedOption = i;
                            return;
                        }
                    }
                    break;

                case MenuOptionType.ViewingDistance:
                    switch (Interface.CurrentOptions.ViewingDistance)
                    {
                    case 400:
                        CurrentlySelectedOption = 0;
                        break;

                    case 600:
                        CurrentlySelectedOption = 1;
                        break;

                    case 800:
                        CurrentlySelectedOption = 2;
                        break;

                    case 1000:
                        CurrentlySelectedOption = 3;
                        break;

                    case 1500:
                        CurrentlySelectedOption = 4;
                        break;

                    case 2000:
                        CurrentlySelectedOption = 5;
                        break;
                    }
                    return;
                }
                CurrentlySelectedOption = 0;
            }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="type">Type of menu option</param>
 /// <param name="text"></param>
 private MenuOption(MenuOptionType type, string text, MenuScreen link, MenuCommand command)
 {
     this.type = type;
     this.text = text;
     this.link = link;
     this.command = command;
 }
 public MenuOption(MenuOptionType type, string text, MenuCommand command)
     : this(type, text, null, command)
 {
 }
 public MenuOption(MenuOptionType type, string text, MenuScreen link)
     : this(type, text, link, MenuCommand.NONE)
 {
 }
 public void DeleteMenuOptionType(MenuOptionType data)
 {
     try {
     SetService();  SerClient.DeleteMenuOptionType(data); }
     finally
     {
         SerClient.Close();
         if (SerClient.State == CommunicationState.Faulted)
         SerClient.Abort(); 
     }
 }
 public MenuOptionType SaveMenuOptionType(MenuOptionType data)
 {
     try {
     SetService();  return SerClient.SaveMenuOptionType(data); }
     finally
     {
         SerClient.Close();
         if (SerClient.State == CommunicationState.Faulted)
         SerClient.Abort(); 
     }
 }
Exemple #10
0
 public MenuOptionType SelectById(MenuOptionType data)
 {
     return((MenuOptionType)base.SelectById(data));
 }
Exemple #11
0
 public Boolean Delete(MenuOptionType data)
 {
     return(base.Delete(data));
 }
Exemple #12
0
 public Boolean Update(MenuOptionType data)
 {
     return(base.Update(data));
 }
Exemple #13
0
 public MenuOptionType Save(MenuOptionType data)
 {
     return((MenuOptionType)base.Save(data));
 }
Exemple #14
0
 public MenuOption(Point Position, MenuOptionType Type, string Text)
 {
     this.Position = Position;
     this.Type     = Type;
     this.Text     = Text;
 }