コード例 #1
0
ファイル: WControlBase.cs プロジェクト: aureliopires/gisa
		/// <summary>
		/// Default constructor.
		/// </summary>
		public WControlBase() : base()
		{		
			SetStyle(ControlStyles.ResizeRedraw,true);
			SetStyle(ControlStyles.DoubleBuffer  | ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint,true);

			m_ViewStyle = new ViewStyle();

			m_ViewStyle.StyleChanged += new ViewStyleChangedEventHandler(this.OnViewStyleChanged);
			ViewStyle.staticViewStyle.StyleChanged += new ViewStyleChangedEventHandler(this.OnStaticViewStyleChanged);
		}		
コード例 #2
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        public OutlookBar()
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            // TODO: Add any initialization after the InitForm call

            SetStyle(ControlStyles.ResizeRedraw,true);
            SetStyle(ControlStyles.DoubleBuffer  | ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint,true);

            m_pBars = new Bars(this);
            m_ViewStyle = new ViewStyle();

            m_ViewStyle.StyleChanged += new ViewStyleChangedEventHandler(this.OnViewStyleChanged);
            ViewStyle.staticViewStyle.StyleChanged += new ViewStyleChangedEventHandler(this.OnStaticViewStyleChanged);

            m_UpButtonIcon   = Core.LoadIcon("up.ico");
            m_DownButtonIcon = Core.LoadIcon("down.ico");
        }
コード例 #3
0
        internal DocumentView(DocumentViewSurface surface)
        {
            this.surface = surface;

            renderStuff = new RenderStuff(this);
            trace = new ViewControlTrace(this);
            keyActionMap = new KeyActionMap();
            renderList = new Dictionary<int, DocumentRowView>();

            createKeyCommands();

            ClearStuff();

            selectionStyle = new Style();
            selectionStyle.Foreground = Color.White;
            selectionStyle.Background = Color.Blue;

            viewStyle = new ViewStyle();
        }
コード例 #4
0
        public void ThemeThisSetVauleIsNUll()
        {
            tlog.Debug(tag, $"ThemeThisSetVauleIsNUll START");

            ViewStyle style = new ViewStyle()
            {
                Color = Color.Cyan,
            };

            theme.AddStyle("style", style);

            tlog.Debug(tag, "Count : " + theme.Count);
            tlog.Debug(tag, "theme[\"style\"] : " + theme["style"]);

            ViewStyle newStyle = null;

            theme["Style"] = newStyle;
            tlog.Debug(tag, "theme[\"style\"] : " + theme["style"]);

            tlog.Debug(tag, $"ThemeThisSetVauleIsNUll END (OK)");
        }
コード例 #5
0
 public override void ApplyStyle(ViewStyle viewStyle)
 {
     base.ApplyStyle(viewStyle);
     if (viewStyle != null && viewStyle is DefaultTitleItemStyle defaultStyle)
     {
         if (itemLabel != null)
         {
             itemLabel.ApplyStyle(defaultStyle.Label);
         }
         if (itemIcon != null)
         {
             itemIcon.ApplyStyle(defaultStyle.Icon);
         }
         if (itemSeperator != null)
         {
             itemSeperator.ApplyStyle(defaultStyle.Seperator);
             //FIXME : currently padding and margin are not applied by ApplyStyle automatically as missing binding features.
             itemSeperator.Margin = new Extents(defaultStyle.Seperator.Margin);
         }
     }
 }
コード例 #6
0
 public SearchTextViewModel()
 {
     mOsk  = Pici.Services.Get <IOsk>();
     Style = new ViewStyle("SearchBoxTextStyle");
     EnterSearchCommand = new EnterSearchCommand();
     TouchDownCommand   = new DelegateCommand((p) =>
     {
         mIsTouch = true;
         mOsk.open();
     });
     MouseDownCommand = new DelegateCommand((p) =>
     {
         if (!mIsTouch)
         {
             mOsk.open();
         }
         mIsTouch = false;
     });
     GotFocusCommand             = new DelegateCommand((p) => { EnterSearchCommand.CanExecuteProp = true; });
     LostFocusCommand            = new DelegateCommand((p) => { EnterSearchCommand.CanExecuteProp = false; });
     EnterSearchCommand.OnEnter += OnEnter;
 }
コード例 #7
0
ファイル: Control.cs プロジェクト: linuxias/TizenFX
        public Control() : base()
        {
            var       cur_type  = this.GetType();
            ViewStyle viewStyle = null;

            do
            {
                if (cur_type.Equals(typeof(Tizen.NUI.Components.Control)))
                {
                    break;
                }
                viewStyle = StyleManager.Instance.GetComponentStyle(cur_type);
                cur_type  = cur_type.BaseType;
            }while (viewStyle == null);

            if (viewStyle != null)
            {
                ApplyStyle(viewStyle);
            }

            Initialize();
        }
コード例 #8
0
        public void VisualViewConstructorWithCustomViewBehaviour()
        {
            tlog.Debug(tag, $"VisualViewConstructorWithCustomViewBehaviour START");

            ViewStyle style = new ViewStyle()
            {
                Size = new Size2D(200, 200),
                PositionUsesPivotPoint = true,
                ParentOrigin           = ParentOrigin.CenterRight,
                PivotPoint             = PivotPoint.CenterRight,
                BackgroundColor        = Color.Azure,
                Focusable = true,
            };

            var testingTarget = new VisualView(CustomViewBehaviour.DisableStyleChangeSignals, style);

            Assert.IsNotNull(testingTarget, "Can't create success object VisualView");
            Assert.IsInstanceOf <VisualView>(testingTarget, "Should be an instance of VisualView type.");

            testingTarget.Dispose();
            tlog.Debug(tag, $"VisualViewConstructorWithCustomViewBehaviour END (OK)");
        }
コード例 #9
0
ファイル: HBSViewModel.cs プロジェクト: picibird/hbs
        public HBSViewModel()
            : base("HBSRoot")
        {
            HBS.ViewModel               = this;
            HBS.Search.SearchStarting  += OnSearchStarting;
            HBS.Search.PropertyChanged += OnSearchPropertyChanged;

            LastPointerDownTime = DateTime.Now;
            PointerMode         = PointerModeOptions.GLOBAL_SYSTEM;
            Pointing.IsEnabled  = true;
            Pointing.Event     += OnPointingEvent;

            Style = new ViewStyle("HBSRootStyle");
            SearchBoxTextViewModel.EnterSearchCommand.OnEnter += OnSearchEnter;
            SearchButtonViewModel.TapBehaviour.Tap            += OnSearchButtonTap;
            SearchButtonViewModel.Clicked += OnSearchButtonClicked;

            HBS.Search.PageItemsCount = HBS.RowCount * HBS.ColumnCount - 1;
            var init = ShelfViewModel.IsRotating;

            BlackBlendingViewModel.TapBehaviour.Tap += OnBlackBlendingTap;
        }
コード例 #10
0
        public void CustomViewFocusNavigationSupport()
        {
            tlog.Debug(tag, $"CustomViewFocusNavigationSupport START");

            ViewStyle style = new ViewStyle()
            {
                Padding = new Extents(3, 3, 3, 3),
            };

            var testingTarget = new CustomView("CustomView", CustomViewBehaviour.ViewBehaviourDefault, style);

            Assert.IsNotNull(testingTarget, "Can't create success object CustomView");
            Assert.IsInstanceOf <CustomView>(testingTarget, "Should be an instance of CustomView type.");

            Assert.AreEqual(false, testingTarget.FocusNavigationSupport, "Should be equal!");

            testingTarget.FocusNavigationSupport = true;
            Assert.AreEqual(true, testingTarget.FocusNavigationSupport, "Should be equal!");

            testingTarget.Dispose();
            tlog.Debug(tag, $"CustomViewFocusNavigationSupport END (OK)");
        }
コード例 #11
0
ファイル: WComboPopUp.cs プロジェクト: aureliopires/gisa
		/// <summary>
		/// 
		/// </summary>
		/// <param name="parent"></param>
		/// <param name="viewStyle"></param>
		/// <param name="listBoxItems"></param>
		/// <param name="visibleItems"></param>
		public WComboPopUp(Control parent,ViewStyle viewStyle,object[] listBoxItems,int visibleItems,string selectedText,int dropDownWidth) : base(parent)
		{
			// This call is required by the Windows Form Designer.
			InitializeComponent();

			// TODO: Add any initialization after the InitializeComponent call

			// Store view style
			m_pViewStyle = viewStyle;

			this.Width  = dropDownWidth;
			this.Height = (m_pListBox.ItemHeight * visibleItems)+2;

			m_pListBox.BackColor = viewStyle.EditColor;
					       
			// Add items to listbox
			m_pListBox.Items.AddRange(listBoxItems);
			
			int index = m_pListBox.FindStringExact(selectedText);
			if(index > -1){
				m_pListBox.SelectedIndex = index;
			}
		}
コード例 #12
0
ファイル: Tab.cs プロジェクト: sanghyeok-oh/TizenFX
        /// <summary>
        /// Apply style to tab.
        /// </summary>
        /// <param name="viewStyle">The style to apply.</param>
        /// <since_tizen> 8 </since_tizen>
        public override void ApplyStyle(ViewStyle viewStyle)
        {
            base.ApplyStyle(viewStyle);

            TabStyle tabStyle = viewStyle as TabStyle;

            if (null != tabStyle)
            {
                if (null == underline)
                {
                    underline = new View()
                    {
                        PositionUsesPivotPoint = true,
                        ParentOrigin           = Tizen.NUI.ParentOrigin.BottomLeft,
                        PivotPoint             = Tizen.NUI.PivotPoint.BottomLeft,
                    };
                    Add(underline);
                    CreateUnderLineAnimation();
                }

                underline.ApplyStyle(Style.UnderLine);
            }
        }
コード例 #13
0
        public void ThemeAddStyle()
        {
            tlog.Debug(tag, $"ThemeAddStyle START");

            ViewStyle style = new ViewStyle()
            {
                Color = Color.Cyan,
            };

            try
            {
                theme.AddStyle("style", style);
            }
            catch (Exception e)
            {
                tlog.Debug(tag, e.Message.ToString());
                Assert.Fail("Caught Exception : Failed!");
            }

            tlog.Debug(tag, "HasStyle : " + theme.HasStyle("style"));
            tlog.Debug(tag, "RemoveStyle : " + theme.RemoveStyle("style"));

            tlog.Debug(tag, $"ThemeAddStyle END (OK)");
        }
コード例 #14
0
        public void ThemeManagerApplyExternalPlatformTheme()
        {
            tlog.Debug(tag, $"ThemeManagerApplyExternalPlatformTheme START");

            var       theme = new Theme(path);
            ViewStyle style = new ViewStyle()
            {
                Color = Color.Cyan,
            };

            theme.AddStyle("style", style);

            try
            {
                ThemeManager.ApplyExternalPlatformTheme(theme.Id, theme.Version);
            }
            catch (Exception e)
            {
                tlog.Debug(tag, e.Message.ToString());
                Assert.Fail("Caught Exception : Failed!");
            }

            tlog.Debug(tag, $"ThemeManagerApplyExternalPlatformTheme END (OK)");
        }
コード例 #15
0
        public async Task <IActionResult> ReOrder(int authorId, EReOrder reOrder, ViewStyle viewStyle)
        {
            var author = await _context.Authors.FindAsync(authorId);

            if (author.Order == null)
            {
                author.Order = 0;
            }
            if (reOrder == EReOrder.Down)
            {
                author.Order -= 1;
            }
            else if (reOrder == EReOrder.Up)
            {
                author.Order += 1;
            }
            if (author.Order < 0)
            {
                author.Order = null;
            }
            await _context.SaveChangesAsync();

            return(RedirectToAction(nameof(Index), new { viewStyle }));
        }
コード例 #16
0
ファイル: AlertDialog.cs プロジェクト: sangchul1011/TizenFX
        /// <summary>
        /// Applies style to AlertDialog.
        /// </summary>
        /// <param name="viewStyle">The style to apply.</param>
        /// <since_tizen> 9 </since_tizen>
        public override void ApplyStyle(ViewStyle viewStyle)
        {
            styleApplied = false;

            base.ApplyStyle(viewStyle);

            var alertDialogStyle = viewStyle as AlertDialogStyle;

            if (alertDialogStyle == null)
            {
                return;
            }

            // Apply Title style.
            if ((alertDialogStyle.TitleTextLabel != null) && (DefaultTitleContent is TextLabel))
            {
                ((TextLabel)DefaultTitleContent)?.ApplyStyle(alertDialogStyle.TitleTextLabel);
            }

            // Apply Message style.
            if ((alertDialogStyle.MessageTextLabel != null) && (DefaultContent is TextLabel))
            {
                ((TextLabel)DefaultContent)?.ApplyStyle(alertDialogStyle.MessageTextLabel);
            }

            // Apply ActionContent style.
            if (alertDialogStyle.ActionContent != null)
            {
                DefaultActionContent?.ApplyStyle(alertDialogStyle.ActionContent);
            }

            styleApplied = true;

            // Calculate dialog position and children's positions based on padding sizes.
            CalculatePosition();
        }
コード例 #17
0
 public override void ApplyStyle(ViewStyle viewStyle)
 {
     base.ApplyStyle(viewStyle);
     if (viewStyle != null && viewStyle is DefaultTitleItemStyle defaultStyle)
     {
         if (itemLabel != null)
         {
             itemLabel.ApplyStyle(defaultStyle.Label);
         }
         if (itemIcon != null)
         {
             itemIcon.ApplyStyle(defaultStyle.Icon);
         }
         if (itemSeperator != null)
         {
             itemSeperator.ApplyStyle(defaultStyle.Seperator);
             //FIXME : currently margin is not applied by ApplyStyle automatically.
             itemSeperator.Margin = defaultStyle.Seperator.Margin;
         }
         //FIXME : currently padding is not applied by ApplyStyle automatically.
         Extents padding = defaultStyle.Padding;
         Padding = padding;
     }
 }
コード例 #18
0
        public void ThemeMerge()
        {
            tlog.Debug(tag, $"ThemeMerge START");

            ViewStyle style = new ViewStyle()
            {
                Size      = new Size2D(100, 30),
                Focusable = true
            };
            Theme a1 = new Theme();

            a1.Version = "0.1";
            a1.AddStyle("myStyle", style);

            ViewStyle style1 = new ViewStyle()
            {
                Margin = new Extents(4, 2, 3, 7)
            };
            Theme t1 = new Theme();

            t1.Id      = "t1";
            t1.Version = "1.0";
            t1.AddStyle("myStyle", style1);

            try
            {
                a1.Merge(t1);
            }
            catch (Exception e)
            {
                tlog.Debug(tag, e.Message.ToString());
                Assert.Fail("Caught Exception: Failed!");
            }

            tlog.Debug(tag, $"ThemeMerge END (OK)");
        }
コード例 #19
0
        private void InitSubControl()
        {
            tbCrisscross.BackColor = ViewStyle.RuleToColor(eRule.crisscross);
            tbCrisscross.Tag       = eRule.crisscross;
            tbCrisscross.Click    += NowRuleClick;

            tbIll.BackColor = ViewStyle.RuleToColor(eRule.ill);
            tbIll.Tag       = eRule.ill;
            tbIll.Click    += NowRuleClick;

            tbCommon.BackColor = ViewStyle.RuleToColor(eRule.common);
            tbCommon.Tag       = eRule.common;
            tbCommon.Click    += NowRuleClick;

            tbFine.BackColor = ViewStyle.RuleToColor(eRule.fine);
            tbFine.Tag       = eRule.fine;
            tbFine.Click    += NowRuleClick;

            tbExcellent.BackColor = ViewStyle.RuleToColor(eRule.excellent);
            tbExcellent.Tag       = eRule.excellent;
            tbExcellent.Click    += NowRuleClick;

            NowRule = eRule.common;
        }
コード例 #20
0
        public void ThemeManagerGetStyle()
        {
            tlog.Debug(tag, $"ThemeManagerGetStyle START");

            var testingTarget = new Theme(path);

            Assert.IsNotNull(testingTarget, "should be not null");
            Assert.IsInstanceOf <Theme>(testingTarget, "should be an instance of testing target class!");

            ViewStyle style = new ViewStyle()
            {
                Color = Color.Cyan,
            };

            testingTarget.AddStyle("style", style);
            ThemeManager.CurrentTheme = testingTarget;

            tlog.Debug(tag, "GetStyle : " + ThemeManager.GetStyle("style"));
            tlog.Debug(tag, "GetStyle : " + ThemeManager.GetStyle(typeof(View)));
            tlog.Debug(tag, "GetUpdateStyleWithoutClone : " + ThemeManager.GetUpdateStyleWithoutClone("style"));
            tlog.Debug(tag, "GetUpdateStyleWithoutClone : " + ThemeManager.GetUpdateStyleWithoutClone(typeof(ViewStyle)));

            tlog.Debug(tag, $"ThemeManagerGetStyle END (OK)");
        }
コード例 #21
0
ファイル: AppBar.cs プロジェクト: sangchul1011/TizenFX
        /// <summary>
        /// Applies style to AppBar.
        /// </summary>
        /// <param name="viewStyle">The style to apply.</param>
        /// <since_tizen> 9 </since_tizen>
        public override void ApplyStyle(ViewStyle viewStyle)
        {
            styleApplied = false;

            base.ApplyStyle(viewStyle);

            var appBarStyle = viewStyle as AppBarStyle;

            if (appBarStyle == null)
            {
                return;
            }

            if (appBarStyle.NavigationPadding != null)
            {
                navigationPadding = new Extents(appBarStyle.NavigationPadding);
            }

            if (appBarStyle.ActionPadding != null)
            {
                actionPadding = new Extents(appBarStyle.ActionPadding);
            }

            // Apply Back Button style.
            if ((appBarStyle.BackButton != null) && (DefaultNavigationContent is Button button))
            {
                button.ApplyStyle(appBarStyle.BackButton);
            }

            // Apply Title style.
            if ((appBarStyle.TitleTextLabel != null) && (DefaultTitleContent is TextLabel textLabel))
            {
                textLabel.ApplyStyle(appBarStyle.TitleTextLabel);
            }

            // Apply ActionCellPadding style.
            if (DefaultActionContent?.Layout is LinearLayout linearLayout && appBarStyle.ActionCellPadding != null)
            {
                linearLayout.CellPadding = new Size2D(appBarStyle.ActionCellPadding.Width, appBarStyle.ActionCellPadding.Height);
            }

            // Apply Action and ActionButton styles.
            if (DefaultActionContent?.Children != null)
            {
                foreach (var action in DefaultActionContent?.Children)
                {
                    if ((action is Button) && (appBarStyle.ActionButton != null))
                    {
                        action.ApplyStyle(appBarStyle.ActionButton);
                    }
                    else if (appBarStyle.ActionView != null)
                    {
                        action.ApplyStyle(appBarStyle.ActionView);
                    }
                }
            }

            if (actionButtonStyle == null)
            {
                actionButtonStyle = (ButtonStyle)appBarStyle.ActionButton?.Clone();
            }
            else
            {
                actionButtonStyle.MergeDirectly(appBarStyle.ActionButton);
            }

            if (actionViewStyle == null)
            {
                actionViewStyle = (ViewStyle)appBarStyle.ActionView?.Clone();
            }
            else
            {
                actionViewStyle.MergeDirectly(appBarStyle.ActionView);
            }


            styleApplied = true;

            // Calculate children's positions based on padding sizes.
            CalculatePosition();
        }
コード例 #22
0
ファイル: XtraGrid.cs プロジェクト: labeuze/source
        /// <summary>Défini le style d'une colonne</summary>
        /// <param name="sStyle">style de la colonne "HAlignNear, HAlignCenter, HAlignFar, VAlignTop, VAlignCenter, VAlignBottom"</param>
        public static void SetGridColumnStyle(GridColumn col, string sStyle)
        {
            if (col == null || sStyle == null || sStyle == "") return;

            //if (gbTrace) cTrace.StartNestedLevel("SetGridColumnStyle");

            ViewStyle style = new ViewStyle();
            string[] sStyles = zsplit.Split(sStyle.ToLower(), ',', true);
            bool bStyle = false;
            for (int i = 0; i < sStyles.Length; i++)
            {
                switch (sStyles[i])
                {
                    case "halignnear":
                        bStyle = true;
                        style.HAlignment = HorzAlignment.Near;
                        break;
                    case "haligncenter":
                        bStyle = true;
                        style.HAlignment = HorzAlignment.Center;
                        break;
                    case "halignfar":
                        bStyle = true;
                        style.HAlignment = HorzAlignment.Far;
                        break;
                    case "valigntop":
                        bStyle = true;
                        style.VAlignment = VertAlignment.Top;
                        break;
                    case "valigncenter":
                        bStyle = true;
                        style.VAlignment = VertAlignment.Center;
                        break;
                    case "valignbottom":
                        bStyle = true;
                        style.VAlignment = VertAlignment.Bottom;
                        break;
                }
            }
            if (bStyle)
            {
                string sStyleName = col.Name;
                int i = 2;
                while (col.View.GridControl.Styles.Contains(sStyleName))
                {
                    sStyleName = col.Name + i.ToString();
                    i++;
                }
                style.StyleName = sStyleName;
                col.View.GridControl.Styles.Add(sStyleName, style);
                col.Style = style;
            }

            //if (gbTrace) cTrace.StopNestedLevel("SetGridColumnStyle");
        }
コード例 #23
0
        public void SetViewStyle(ViewStyle view)
        {
            if (currentViewStyle != view)
            {
                currentViewStyle = view;
                currentViewStyleChanged = true;
                Refresh();
            }

        }
コード例 #24
0
ファイル: Control.cs プロジェクト: JoogabYun/TizenFX
 internal void ApplyAttributes(View view, ViewStyle viewStyle)
 {
     view.CopyFrom(viewStyle);
 }
コード例 #25
0
 public override void ApplyStyle(ViewStyle style)
 {
     base.ApplyStyle(style);
 }
コード例 #26
0
 public ExtentHtmlReporter(string folderPath, ViewStyle viewStyle) : this(folderPath)
 {
     _viewStyle = viewStyle;
 }
コード例 #27
0
 public SearchTextViewModel()
 {
     Style = new ViewStyle("SearchBoxTextStyle");
 }
コード例 #28
0
 public Bookshelf3DViewModel()
 {
     Style = new ViewStyle("Bookshelf3DStyle");
 }
コード例 #29
0
ファイル: OpenedBookViewModel.cs プロジェクト: picibird/hbs
 public OpenedBookViewModel()
 {
     Visibility = false;
     Style      = new ViewStyle("OpenedBookStyle");
 }
コード例 #30
0
ファイル: TitleButtonVM.cs プロジェクト: UB-Mannheim/hbs
 public TitleButtonVM()
 {
     Style             = new ViewStyle("TitleButtonStyle");
     Text              = TITLE;
     TapBehaviour.Tap += OnTap;
 }
コード例 #31
0
 public LauncherVM()
 {
     Style = new ViewStyle("LauncherStyle");
 }
コード例 #32
0
 private void Init(ViewStyle style)
 {
     IsEnabled = false;
     Style     = style;
 }
コード例 #33
0
 public ChooserButtonViewModel(string filterCategory, ViewStyle style)
 {
     Name = filterCategory;
     Init(style);
 }
コード例 #34
0
 public ChooserButtonViewModel(FilterCategoryId filterCategory, ViewStyle style)
 {
     CategoryName = filterCategory;
     Init(style);
 }
コード例 #35
0
        public async Task <IActionResult> Index(string searchTerm, int state, int?pageIndex, string orderBy, int?orderType, ViewStyle viewStyle = ViewStyle.Large)
        {
            ViewBag.OrderType = orderType ?? 1;
            var authors = _context.Authors.OrderByDescending(x => x.Order).ThenBy(x => x.Name).Include(a => a.Department).AsQueryable();

            if (!string.IsNullOrEmpty(searchTerm))
            {
                ViewBag.SearchTerm = searchTerm;
                searchTerm         = searchTerm.ToLower();
                if (state == 1)
                {
                    authors = authors.Where(x => x.Name.ToLower().Contains(searchTerm));
                }
                else if (state == 2)
                {
                    authors = authors.Where(x => x.Deparment.ToLower().Contains(searchTerm));
                }
                else if (state == 3)
                {
                    authors = authors.Where(x => x.Specialized.ToLower().Contains(searchTerm));
                }
                else
                {
                    authors = authors.Where(x => x.Name.ToLower().Contains(searchTerm) ||
                                            x.Deparment.ToLower().Contains(searchTerm) ||
                                            x.Specialized.ToLower().Contains(searchTerm) ||
                                            x.PhoneNumber.Contains(searchTerm) ||
                                            x.Email.ToLower().Contains(searchTerm));
                }
            }
            if (!string.IsNullOrEmpty(orderBy) && orderType != null)
            {
                if (orderBy.ToLower().Equals("department") && orderType == 1)
                {
                    authors = authors.OrderBy(x => x.Deparment);
                }
                else
                {
                    authors = authors.OrderByDescending(x => x.Deparment);
                }
                ViewBag.OrderBy = orderBy;
            }

            var searchTypes = new List <dynamic>
            {
                new { Id = 0, Name = "Từ khóa bất kỳ" },
                new { Id = 1, Name = "Tên nhà khoa học" },
                new { Id = 2, Name = "Đơn vị công tác" },
                new { Id = 3, Name = "Chuyên ngành" }
            };

            ViewData["SearchType"] = new SelectList(searchTypes, "Id", "Name", state);
            ViewBag.ViewStyle      = viewStyle;

            return(View(await PaginatedList <Author> .CreateAsync(authors, pageIndex ?? 1, 9)));
        }
コード例 #36
0
 public BookshelfLabelsViewModel(Bookshelf3DViewModel bookShelf3D)
 {
     Bookshelf3D = bookShelf3D;
     Style       = new ViewStyle("ShelfLabelItemsViewStyle");
     CreateLabels();
 }