コード例 #1
0
ファイル: ERollingType.cs プロジェクト: ym1100/siteserver-cms
        public static ListItem GetListItem(ERollingType type, bool selected)
        {
            var item = new ListItem(GetText(type), GetValue(type));

            if (selected)
            {
                item.Selected = true;
            }
            return(item);
        }
コード例 #2
0
ファイル: ERollingType.cs プロジェクト: ym1100/siteserver-cms
 public static bool Equals(ERollingType type, string typeStr)
 {
     if (string.IsNullOrEmpty(typeStr))
     {
         return(false);
     }
     if (string.Equals(GetValue(type).ToLower(), typeStr.ToLower()))
     {
         return(true);
     }
     return(false);
 }
コード例 #3
0
 public AdvertisementFloatImageInfo(bool isCloseable, EPositionType positionType, int positionX, int positionY, ERollingType rollingType, string navigationUrl, string imageUrl, int height, int width)
 {
     IsCloseable   = isCloseable;
     PositionType  = positionType;
     PositionX     = positionX;
     PositionY     = positionY;
     RollingType   = rollingType;
     NavigationUrl = navigationUrl;
     ImageUrl      = imageUrl;
     Height        = height;
     Width         = width;
 }
コード例 #4
0
 public static string GetText(ERollingType type)
 {
     if (type == ERollingType.Static)
     {
         return("静止不动");
     }
     if (type == ERollingType.FollowingScreen)
     {
         return("跟随窗体滚动");
     }
     if (type == ERollingType.FloatingInWindow)
     {
         return("在窗体中不断移动");
     }
     throw new Exception();
 }
コード例 #5
0
 public static string GetValue(ERollingType type)
 {
     if (type == ERollingType.Static)
     {
         return("Static");
     }
     if (type == ERollingType.FollowingScreen)
     {
         return("FollowingScreen");
     }
     if (type == ERollingType.FloatingInWindow)
     {
         return("FloatingInWindow");
     }
     throw new Exception();
 }
コード例 #6
0
ファイル: EPositionType.cs プロジェクト: yankaics/cms-1
 public static void AddListItems(ListControl listControl, ERollingType rollingType)
 {
     if (listControl != null)
     {
         if (rollingType == ERollingType.Static)
         {
             listControl.Items.Add(GetListItem(EPositionType.LeftTop, false));
             listControl.Items.Add(GetListItem(EPositionType.LeftBottom, false));
             listControl.Items.Add(GetListItem(EPositionType.RightTop, false));
             listControl.Items.Add(GetListItem(EPositionType.RightBottom, false));
         }
         else if (rollingType == ERollingType.FollowingScreen)
         {
             listControl.Items.Add(GetListItem(EPositionType.LeftBottom, false));
             listControl.Items.Add(GetListItem(EPositionType.RightBottom, false));
         }
         else if (rollingType == ERollingType.FloatingInWindow)
         {
             listControl.Items.Add(GetListItem(EPositionType.LeftTop, false));
         }
     }
 }
コード例 #7
0
 public static bool Equals(string typeStr, ERollingType type)
 {
     return(Equals(type, typeStr));
 }
コード例 #8
0
 private static bool Equals(ERollingType type, string typeStr)
 {
     return(!string.IsNullOrEmpty(typeStr) && string.Equals(GetValue(type).ToLower(), typeStr.ToLower()));
 }