Exemplo n.º 1
0
 private void Fill()
 {
     SelectTemplate.Clear();
     SelectTemplate.AddItem(EmptyTemplate, NodeMarkup.Localize.HeaderPanel_ApplyTemplate);
     foreach (var template in TemplateManager.GetTemplates(StyleGroup))
     {
         SelectTemplate.AddItem(template, template.ToStringWithShort());
     }
 }
Exemplo n.º 2
0
        private void AddApplyTemplate()
        {
            SelectTemplate = AddUIComponent <TemplateDropDown>();

            SelectTemplate.atlas                = TextureUtil.InMapEditorAtlas;
            SelectTemplate.height               = 20;
            SelectTemplate.width                = 150;
            SelectTemplate.listBackground       = "TextFieldPanel";
            SelectTemplate.itemHeight           = 20;
            SelectTemplate.itemHover            = "TextFieldPanelHovered";
            SelectTemplate.itemHighlight        = "ListItemHighlight";
            SelectTemplate.normalBgSprite       = "InfoDisplay";
            SelectTemplate.hoveredBgSprite      = "InfoDisplayHover";
            SelectTemplate.listWidth            = 150;
            SelectTemplate.listHeight           = 700;
            SelectTemplate.listPosition         = UIDropDown.PopupListPosition.Below;
            SelectTemplate.clampListToScreen    = true;
            SelectTemplate.foregroundSpriteMode = UIForegroundSpriteMode.Stretch;
            SelectTemplate.popupColor           = new Color32(45, 52, 61, 255);
            SelectTemplate.popupTextColor       = new Color32(170, 170, 170, 255);
            SelectTemplate.textScale            = 0.7f;
            SelectTemplate.textFieldPadding     = new RectOffset(8, 0, 6, 0);
            SelectTemplate.textColor            = Color.black;
            SelectTemplate.popupColor           = Color.white;
            SelectTemplate.popupTextColor       = Color.black;
            SelectTemplate.verticalAlignment    = UIVerticalAlignment.Middle;
            SelectTemplate.horizontalAlignment  = UIHorizontalAlignment.Left;
            SelectTemplate.itemPadding          = new RectOffset(5, 0, 5, 0);
            SelectTemplate.filteredItems        = new int[] { 0 };
            SelectTemplate.eventDropdownOpen   += DropdownOpen;
            SelectTemplate.eventDropdownClose  += DropdownClose;

            var button = SelectTemplate.AddUIComponent <UIButton>();

            button.atlas                   = TextureUtil.InGameAtlas;
            button.text                    = string.Empty;
            button.size                    = SelectTemplate.size;
            button.relativePosition        = new Vector3(0f, 0f);
            button.textVerticalAlignment   = UIVerticalAlignment.Middle;
            button.textHorizontalAlignment = UIHorizontalAlignment.Left;
            button.normalFgSprite          = "IconDownArrow";
            button.hoveredFgSprite         = "IconDownArrowHovered";
            button.pressedFgSprite         = "IconDownArrowPressed";
            button.focusedFgSprite         = "IconDownArrowFocused";
            button.disabledFgSprite        = "IconDownArrowDisabled";
            button.foregroundSpriteMode    = UIForegroundSpriteMode.Scale;
            button.horizontalAlignment     = UIHorizontalAlignment.Right;
            button.verticalAlignment       = UIVerticalAlignment.Middle;
            button.textScale               = 0.8f;
            button.eventClick             += (UIComponent component, UIMouseEventParameter eventParam) => Fill();

            SelectTemplate.triggerButton = button;
        }
Exemplo n.º 3
0
        public override void StaticSqlStringCache(SqlModel model, Type type)
        {
            GsOperator gs = new GsOperator(typeof(SqlEntity <>), type);

            gs["SetPrimary"] = MebOperator.Setter(type, model.PrimaryKey);
            gs["Table"]      = model.TableName;
            gs["Primary"]    = model.PrimaryKey;

            CountTemplate count = new CountTemplate();

            gs["SelectCount"]      = count.SelectCount(model);
            gs["SelectCountWhere"] = count.SelectCountWhere(model);


            SelectTemplate select = new SelectTemplate();

            gs["SelectAll"]          = select.SelectAll(model);
            gs["SelectAllWhere"]     = select.SelectAllWhere(model);
            gs["SelectAllByPrimary"] = select.SelectAllByPrimary(model);
            gs["SelectAllIn"]        = select.SelectAllIn(model);


            UpdateTemplate update = new UpdateTemplate();

            gs["UpdateAllWhere"]     = update.UpdateWhere(model);
            gs["UpdateAllByPrimary"] = update.UpdateByPrimary(model);


            InsertTemplate insert = new InsertTemplate();

            gs["InsertAll"] = insert.Insert(model);


            DeleteTemplate delete = new DeleteTemplate();

            gs["DeleteWhere"]     = delete.DeleteWhere(model);
            gs["DeleteByPrimary"] = delete.DeleteByPrimary(model);

            RepeateTemplate repeate      = new RepeateTemplate();
            var             repeateModel = model.ModelWithAttr <NoRepeateAttribute>();

            gs["RepeateCount"]    = repeate.RepeateCount(repeateModel);
            gs["RepeateId"]       = repeate.RepeateId(repeateModel);
            gs["RepeateEntities"] = repeate.RepeateEntities(repeateModel);
        }
        public StartWindow()
        {
            InitializeComponent();

            SelectTemplate conn = new SelectTemplate(@"Data Source=App_Data\DataBase\PageOptions\PageOptions.sdf");
            int? select = conn.Select();
            switch (select)
            {
                case null:
                    FBlock.Source = new Uri("SelectPage.xaml", UriKind.Relative);
                    break;
                case TemplateType.template_0:
                    FBlock.Source = new Uri("Page/SetPage_0/CompletePage_0.xaml", UriKind.Relative);
                    break;
                case TemplateType.template_1:
                    FBlock.Source = new Uri("Page/SetPage_1/CompletePage_1.xaml", UriKind.Relative);
                    break;
            }
        }
Exemplo n.º 5
0
 private void saveTemplate(int template)
 {
     SelectTemplate selectTemplate = new SelectTemplate(@"Data Source=App_Data\DataBase\PageOptions\PageOptions.sdf");
     selectTemplate.Delete();
     selectTemplate.Insert(template);
 }
Exemplo n.º 6
0
 /// <summary>
 /// Add Sql Template
 /// </summary>
 /// <param name="template"></param>
 /// <returns></returns>
 public SelectTemplate AddTemplate(SelectTemplate template)
 {
     return(template);
 }
Exemplo n.º 7
0
        private void NextPage()
        {
            var parent = VisualTreeHelper.GetParent(this.grid);
            while (!(parent is System.Windows.Controls.Page))
            {
                parent = VisualTreeHelper.GetParent(parent);
            }
            System.Windows.Controls.Page page = parent as System.Windows.Controls.Page;

            SelectTemplate selectTemplate = new SelectTemplate(@"Data Source=App_Data\DataBase\PageOptions\PageOptions.sdf");
            int? template = selectTemplate.Select();
            switch (template)
            {
                case TemplateType.template_0:
                    page.NavigationService.Navigate(new Uri("Page/SetPage_0/CompletePage_0.xaml", UriKind.Relative));
                    break;
                case TemplateType.template_1:
                    page.NavigationService.Navigate(new Uri("Page/SetPage_1/CompletePage_1.xaml", UriKind.Relative));
                    break;
                case TemplateType.template_2:
                    break;
                case TemplateType.template_3:
                    break;
                case TemplateType.template_4:
                    break;
                case TemplateType.template_5:
                    break;
            }
        }