当前位置: 首页>>代码示例>>C#>>正文


C# ListItem.SetLabel方法代码示例

本文整理汇总了C#中MediaPortal.UI.Presentation.DataObjects.ListItem.SetLabel方法的典型用法代码示例。如果您正苦于以下问题:C# ListItem.SetLabel方法的具体用法?C# ListItem.SetLabel怎么用?C# ListItem.SetLabel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MediaPortal.UI.Presentation.DataObjects.ListItem的用法示例。


在下文中一共展示了ListItem.SetLabel方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SettingChanged

 protected override void SettingChanged()
 {
   _items.Clear();
   SkinConfigSetting skinSetting = (SkinConfigSetting) _setting;
   foreach (SkinManagement.Skin skin in skinSetting.Skins)
   {
     ListItem skinItem = new ListItem(KEY_NAME, skin.ShortDescription);
     skinItem.SetLabel(KEY_TECHNAME, skin.Name);
     ISkinResourceBundle resourceBundle;
     string preview = skin.GetResourceFilePath(skin.PreviewResourceKey, false, out resourceBundle);
     if (preview == null)
     {
       Theme defaultTheme = skin.DefaultTheme;
       if (defaultTheme != null)
         preview = defaultTheme.GetResourceFilePath(skin.PreviewResourceKey, false, out resourceBundle);
     }
     skinItem.SetLabel(KEY_IMAGESRC, preview);
     _items.Add(skinItem);
     if (skinSetting.CurrentSkinName == skin.Name)
     {
       skinItem.Selected = true;
       _choosenItem = skinItem;
     }
   }
   _items.FireChange();
   base.SettingChanged();
 }
开发者ID:chekiI,项目名称:MediaPortal-2,代码行数:27,代码来源:SkinConfigurationController.cs

示例2: RefreshUserList

 /// <summary>
 /// this will turn the _users list into the _usersExposed list
 /// </summary>
 private void RefreshUserList()
 {
   IList<IUser> users = ServiceRegistration.Get<IUserService>().GetUsers();
   // clear the exposed users list
   Users.Clear();
   // add users to expose them
   foreach (IUser user in users)
   {
     if (user == null)
     {
       continue;
     }
     ListItem buff = new ListItem();
     buff.SetLabel("UserName", user.UserName);
     buff.SetLabel("UserImage", user.UserImage);
     if (user.NeedsPassword)
     {
       buff.SetLabel("NeedsPassword", "true");
     }
     else
     {
       buff.SetLabel("NeedsPassword", "false");
     }
     buff.SetLabel("LastLogin", user.LastLogin.ToString("G"));
     Users.Add(buff);
   }
   // tell the skin that something might have changed
   Users.FireChange();
 }
开发者ID:davinx,项目名称:MediaPortal-2,代码行数:32,代码来源:LoginModel.cs

示例3: SettingChanged

 protected override void SettingChanged()
 {
   _items.Clear();
   ThemeConfigSetting themeSetting = (ThemeConfigSetting) _setting;
   foreach (Theme theme in themeSetting.Themes)
   {
     ListItem themeItem = new ListItem(KEY_NAME, theme.ShortDescription);
     themeItem.SetLabel(KEY_TECHNAME, theme.Name);
     ISkinResourceBundle resourceBundle;
     string preview = theme.GetResourceFilePath(theme.PreviewResourceKey, false, out resourceBundle);
     themeItem.SetLabel(KEY_IMAGESRC, preview);
     _items.Add(themeItem);
     if (themeSetting.CurrentThemeName == theme.Name)
     {
       themeItem.Selected = true;
       _choosenItem = themeItem;
     }
   }
   _items.FireChange();
   base.SettingChanged();
 }
开发者ID:joconno4,项目名称:MediaPortal-2,代码行数:21,代码来源:ThemeConfigurationController.cs

示例4: Init

        public static void Init()
        {
            items.Clear();
              var oneItemSelected = false;

              foreach (var cd in GoogleMovies.GoogleMovies.Data.List)
              {
            var item = new ListItem();
            item.AdditionalProperties[NAME] = cd.Current.Id;
            item.SetLabel("Name", cd.Current.Name + " - " + cd.Current.Address);
            items.Add(item);
            if (oneItemSelected) continue;
            CinemaHome.SelectCinema(cd.Current.Id);
            oneItemSelected = true;
              }
              items.FireChange();
        }
开发者ID:BigGranu,项目名称:Cinema_MP2,代码行数:17,代码来源:DlgSelectCinema.cs

示例5: AddConfigSettings

 /// <summary>
 /// Adds all supported settings in the specified <paramref name="sectionOrGroupNode"/> to the specified
 /// <paramref name="settingsList"/>. For each setting, a <see cref="ListItem"/> will be created
 /// with the setting text as name and a command which triggers the method <see cref="ShowConfigItem"/>
 /// with the according setting location.
 /// </summary>
 /// <param name="sectionOrGroupNode">Section or group node, whose contained settings should be added.</param>
 /// <param name="settingsList">List where the extracted settings will be added to.</param>
 protected void AddConfigSettings(IConfigurationNode sectionOrGroupNode, ItemsList settingsList)
 {
   foreach (IConfigurationNode childNode in sectionOrGroupNode.ChildNodes)
   {
     if (childNode.ConfigObj is ConfigSetting)
     {
       ConfigSetting setting = (ConfigSetting) childNode.ConfigObj;
       if (!setting.Visible || !IsSettingSupported(setting))
         continue;
       string location = childNode.Location;
       ListItem item = new ListItem(KEY_NAME, setting.SettingMetadata.Text)
       {
           Command = new MethodDelegateCommand(() => ShowConfigItem(location))
       };
       item.SetLabel(KEY_HELPTEXT, setting.SettingMetadata.HelpText);
       item.Enabled = setting.Enabled;
       TrackItemVisibleEnabledProperty(setting.VisibleProperty);
       TrackItemVisibleEnabledProperty(setting.EnabledProperty);
       settingsList.Add(item);
     }
     if (childNode.ConfigObj is ConfigGroup)
       AddConfigSettings(childNode, settingsList);
   }
 }
开发者ID:chekiI,项目名称:MediaPortal-2,代码行数:32,代码来源:ConfigurationModel.cs

示例6: SelectedItemChangedprocessing

        public void SelectedItemChangedprocessing()
        {
            try
            {

                mymessage = mymessages.GetTvMessageFilteredAtIndex(_focusedMessage);
                Log.Debug("_focusedMessage=" + _focusedMessage.ToString());
                Log.Debug("mymessage.title="+mymessage.title);
                Log.Debug("mymessage.start=" + mymessage.start.ToString());
               

                _dialogMenuItemList.Clear();

                DialogHeader = PluginGuiLocalizeStrings.Get(3200);

                ListItem myitem1 = new ListItem();
                myitem1.SetLabel("Name", PluginGuiLocalizeStrings.Get(3500)); //Goto TV (1)
                myitem1.Command = new MethodDelegateCommand(() =>
                {
                    IScreenManager mycommandscreenManager = ServiceRegistration.Get<IScreenManager>();
                    mycommandscreenManager.CloseTopmostDialog();
                    EvaluateSelectedItem(mymessage, (int)MenuItems.GotoTv);
                });
                _dialogMenuItemList.Add(myitem1);
                
                ListItem myitem2 = new ListItem();
                myitem2.SetLabel("Name", PluginGuiLocalizeStrings.Get(1053)); //Create TvWish with Title in Email Mode
                myitem2.Command = new MethodDelegateCommand(() =>
                {
                    IScreenManager mycommandscreenManager = ServiceRegistration.Get<IScreenManager>();
                    mycommandscreenManager.CloseTopmostDialog();
                    EvaluateSelectedItem(mymessage, (int)MenuItems.CreateTvWishEmail);
                });
                _dialogMenuItemList.Add(myitem2);

                ListItem myitem3 = new ListItem();
                myitem3.SetLabel("Name", PluginGuiLocalizeStrings.Get(1054)); //Create TvWish with Title in ViewOnly Mode
                myitem3.Command = new MethodDelegateCommand(() =>
                {
                    IScreenManager mycommandscreenManager = ServiceRegistration.Get<IScreenManager>();
                    mycommandscreenManager.CloseTopmostDialog();
                    EvaluateSelectedItem(mymessage, (int)MenuItems.CreateTvWishViewOnly);
                });
                _dialogMenuItemList.Add(myitem3);
                
                ListItem myitem4 = new ListItem();
                myitem4.SetLabel("Name", PluginGuiLocalizeStrings.Get(1055)); //Create TvWish with All in Email Mode
                myitem4.Command = new MethodDelegateCommand(() =>
                {
                    IScreenManager mycommandscreenManager = ServiceRegistration.Get<IScreenManager>();
                    mycommandscreenManager.CloseTopmostDialog();
                    EvaluateSelectedItem(mymessage, (int)MenuItems.CreateTvWishAllEmail);
                });
                _dialogMenuItemList.Add(myitem4);
                
                ListItem  myitem5 = new ListItem();
                myitem5.SetLabel("Name", PluginGuiLocalizeStrings.Get(1056)); //Create TvWish with All in ViewOnly Mode
                myitem5.Command = new MethodDelegateCommand(() =>
                {
                    IScreenManager mycommandscreenManager = ServiceRegistration.Get<IScreenManager>();
                    mycommandscreenManager.CloseTopmostDialog();
                    EvaluateSelectedItem(mymessage, (int)MenuItems.CreateTvWishAllViewOnly);
                });
                _dialogMenuItemList.Add(myitem5);
                
                if ((mymessage.type == MessageType.Deleted.ToString()) || (mymessage.type == MessageType.Conflict.ToString()))
                {
                    ListItem myitem6 = new ListItem();
                    myitem6.SetLabel("Name", PluginGuiLocalizeStrings.Get(3503)); //Delete message
                    myitem6.Command = new MethodDelegateCommand(() =>
                    {
                        IScreenManager mycommandscreenManager = ServiceRegistration.Get<IScreenManager>();
                        mycommandscreenManager.CloseTopmostDialog();
                        EvaluateSelectedItem(mymessage, (int)MenuItems.DeleteMessage);
                    });
                    _dialogMenuItemList.Add(myitem6);
                    
                }
                else if ((mymessage.type == MessageType.Emailed.ToString()) || (mymessage.type == MessageType.Viewed.ToString()) || (mymessage.type == MessageType.Scheduled.ToString()))
                {
                    ListItem myitem6 = new ListItem();
                    myitem6.SetLabel("Name", PluginGuiLocalizeStrings.Get(3503)); //Delete message
                    myitem6.Command = new MethodDelegateCommand(() =>
                    {
                        IScreenManager mycommandscreenManager = ServiceRegistration.Get<IScreenManager>();
                        mycommandscreenManager.CloseTopmostDialog();
                        EvaluateSelectedItem(mymessage, (int)MenuItems.DeleteMessage);
                    });
                    _dialogMenuItemList.Add(myitem6);
                    

                    bool scheduleExists = false;
                    //check all schedules
                    Log.Debug("check all schedules:");
                    foreach (Schedule myschedule in Schedule.ListAll())
                    {
                        Log.Debug("mymessage.title=" + mymessage.title);
                        Log.Debug("myschedule.ProgramName=" + myschedule.ProgramName);
                        Log.Debug("mymessage.channel_id=" + mymessage.channel_id.ToString());
                        Log.Debug("myschedule.IdChannel=" + myschedule.IdChannel.ToString());
//.........这里部分代码省略.........
开发者ID:huha001,项目名称:TvWishList,代码行数:101,代码来源:Result_GUI.cs

示例7: UpdateShutdownItems

    private void UpdateShutdownItems()
    {
      _shutdownItems.Clear();
      if (_shutdownItemList != null)
      {
        for (int i = 0; i < _shutdownItemList.Count; i++)
        {
          SystemStateItem si = _shutdownItemList[i];

          ListItem item = new ListItem();
          item.SetLabel(Consts.KEY_NAME, Consts.GetResourceIdentifierForMenuItem(si.Action));

          item.AdditionalProperties[Consts.KEY_IS_CHECKED] = si.Enabled;
          item.AdditionalProperties[Consts.KEY_IS_DOWN_BUTTON_FOCUSED] = i == _focusedDownButton;
          item.AdditionalProperties[Consts.KEY_IS_UP_BUTTON_FOCUSED] = i == _focusedUpButton;
          item.AdditionalProperties[Consts.KEY_INDEX] = i;
          _shutdownItems.Add(item);
        }
        _focusedDownButton = -1;
        _focusedUpButton = -1;
      }
      _shutdownItems.FireChange();
    }
开发者ID:jgauffin,项目名称:MediaPortal-2,代码行数:23,代码来源:SystemStateConfigurationModel.cs

示例8: UpdateShutdownItems

    private void UpdateShutdownItems()
    {
      _shutdownItems.Clear();
      if (ShutdownItemList != null)
      {
        for (int i = 0; i < ShutdownItemList.Count; i++)
        {
          SystemStateItem si = ShutdownItemList[i];

          // hide disabled items
          if (!si.Enabled)
            continue;

          ListItem item = new ListItem();
          item.SetLabel(Consts.KEY_NAME, Consts.GetResourceIdentifierForMenuItem(si.Action));

          item.AdditionalProperties[Consts.KEY_INDEX] = i;
          _shutdownItems.Add(item);
        }
      }
      _shutdownItems.FireChange();
    }
开发者ID:jgauffin,项目名称:MediaPortal-2,代码行数:22,代码来源:SystemStateModel.cs

示例9: UpdateListItems

        public void UpdateListItems()
        {
            Log.Debug("ResultGUI: UpdateListItems() started");

            
            //StatusLabel( "sort=" + _sort.ToString() + "  _sortreverse=" + _sortreverse.ToString());
            Log.Debug("[TVWishListMP GUI_List]:UpdateListItems  mymessages.filename=" + mymessages.filename);
            // sort messages    
            Log.Debug("mp list window before sorting messages: TvMessages.Count=" + mymessages.ListAllTvMessages().Count.ToString());
            mymessages.sortmessages(mymessages.Sort, mymessages.SortReverse);
            //filter messages
            mymessages.filtermessages(mymessages.Email, mymessages.Deleted, mymessages.Conflicts, mymessages.Scheduled, mymessages.Recorded, mymessages.View, false);
            Log.Debug("mp list window after filtering messages: TvMessages.Count=" + mymessages.ListAllTvMessages().Count.ToString());
            Log.Debug("mp list window after filtering messages: TvMessagesFiltered.Count=" + mymessages.ListAllTvMessagesFiltered().Count.ToString());

            //display messages
            

            //update status:

            if (mymessages.FilterName == "")
            {
                myTvWishes.StatusLabel(PluginGuiLocalizeStrings.Get(4404)); //All Tv Wishes
            }
            else
            {
                TvWish mywish = null;
                try
                {
                    mywish = myTvWishes.RetrieveById(mymessages.FilterName);
                }
                catch
                {//nothing
                }

                if (mywish != null)
                {
                    myTvWishes.StatusLabel(String.Format(PluginGuiLocalizeStrings.Get(4405), mywish.name));
                }
                else
                {
                    Log.Error("Could not retrieve tvwish for mymessages.FilterName=" + mymessages.FilterName);
                }
            }

            _skinItemList.Clear();

            int ctr = 0;

            try
            {
                Log.Debug("[TVWishListMP GUI_List]:UpdateListItems message number found: mymessages.ListAllTvMessagesFiltered().Count=" + mymessages.ListAllTvMessagesFiltered().Count.ToString());

                foreach (xmlmessage mymessage in mymessages.ListAllTvMessagesFiltered())
                {
                    
                    string listitem = "";

                    if (_UserListItemFormat != "")
                        listitem = mymessages.FormatMessage(mymessage, _UserListItemFormat); //user defined listitem format
                    else if (myTvWishes.ViewOnlyMode == false)
                        listitem = mymessages.FormatMessage(mymessage, PluginGuiLocalizeStrings.Get(3904));  //Email listitemformat
                    else
                        listitem = mymessages.FormatMessage(mymessage, PluginGuiLocalizeStrings.Get(3905));  //View Only listitemformat

                    

                    listitem = listitem.Replace("||", "\n");
                    string[] labels = listitem.Split('\n');
                    Log.Debug("listitem=" + listitem);
                    Log.Debug("labels.Length=" + labels.Length.ToString());


                    string label = string.Empty;
                    string label2 = string.Empty;

                    if (labels.Length == 2)
                    {
                        label = labels[0];
                        label2 = labels[1];
                    }
                    else
                    {
                        label = listitem;
                    }

                    ListItem myitem = new ListItem();
                    myitem.SetLabel("Name", label);
                    myitem.SetLabel("Value", label2);
                    myitem.SetLabel("Index", ctr.ToString()); //index for myTvWishes starting with 0
                    myitem.Command = new MethodDelegateCommand(() =>
                    {
                        //button lock
                        if (myTvWishes.ButtonActive)
                        {
                            myTvWishes.StatusLabel(PluginGuiLocalizeStrings.Get(1200));  //Waiting for old process to finish   "Previous Operation Is Still Running"
                            return;
                        }
                        myTvWishes.ButtonActive = true; //lock buttons
                        SelectedItemChanged(myitem);
//.........这里部分代码省略.........
开发者ID:huha001,项目名称:TvWishList,代码行数:101,代码来源:Result_GUI.cs

示例10: UpdateListItems

        public void UpdateListItems()
        {
            Log.Debug("MainGUI: UpdateListItems() started");

            _skinItemList.Clear();
            

            try
            {
                int ctr = 0;
                foreach (TvWish mywish in myTvWishes.ListAll())
                {
                    string listitem = "";
                    Log.Debug("UpdateListItem name=" + mywish.name);
                    if (_UserListItemFormat != "")
                        listitem = FormatTvWish(mywish, _UserListItemFormat); //user defined listitem format
                    else if (myTvWishes.ViewOnlyMode == false)
                        listitem = FormatTvWish(mywish, PluginGuiLocalizeStrings.Get(1904));  //Email listitemformat
                    else
                        listitem = FormatTvWish(mywish, PluginGuiLocalizeStrings.Get(1905));  //View Only listitemformat

                    listitem = listitem.Replace("||", "\n");
                    string[] labels = listitem.Split('\n');
                    Log.Debug("listitem=" + listitem);
                    Log.Debug("labels.Length=" + labels.Length.ToString());

                    string label = string.Empty;
                    string label2 = string.Empty;

                    if (labels.Length == 2)
                    {
                        label = labels[0];  
                        label2 = labels[1];
                    }
                    else
                    {
                        label = listitem;
                    }

                    ListItem myitem = new ListItem();
                    myitem.SetLabel("Name", label);
                    myitem.SetLabel("Value", label2);
                    myitem.SetLabel("Index", ctr.ToString()); //index for myTvWishes starting with 0
                    myitem.Command = new MethodDelegateCommand(() =>
                    {
                        SelectedItemChanged(myitem);
                    });
                    _skinItemList.Add(myitem);
                    ctr++;

                }
                if (myTvWishes.ListAll().Count == 0)
                {
                    ListItem myitem = new ListItem();
                    myitem.SetLabel("Name", PluginGuiLocalizeStrings.Get(4301)); //"No items found"
                    _skinItemList.Add(myitem);

                    //update skin
                    TextBoxSkin = string.Empty;
                }



                Log.Debug("_focusedTvWish=" + _focusedTvWish.ToString());
                Log.Debug("_skinItemList.Count=" + _skinItemList.Count.ToString());
                if ((_focusedTvWish >= 0) && (_focusedTvWish < _skinItemList.Count))
                {
                    Log.Debug("Selecting _focusedTvWish="+_focusedTvWish.ToString());
                    _skinItemList[_focusedTvWish].Selected = true;
                }


                Log.Debug("[TVWishListMP]:UpdateListItems message number found:_skinItemList.Count=" + _skinItemList.Count.ToString());
            }
            catch (Exception exc)
            {
                ListItem myitem = new ListItem();
                myitem.SetLabel("Name",PluginGuiLocalizeStrings.Get(4302));   //Error in creating item list
                myitem.SetLabel("Value", "-1");
                myitem.SetLabel("Index", "-1");
                _skinItemList.Add(myitem);
                Log.Error("Error in creating item list - exception was:" + exc.Message);
            }

            SkinItemList.FireChange();
        }
开发者ID:huha001,项目名称:TvWishList,代码行数:86,代码来源:Main_GUI.cs

示例11: Init

        public void Init()
        {
            var settingsManager = ServiceRegistration.Get<ISettingsManager>();
              var _apps = settingsManager.Load<Apps>();
              var _groups = new List<string>();

              items.Clear();

              foreach (var a in _apps.AppsList)
              {
            if (!_groups.Contains(a.Group))
            {
              _groups.Add(a.Group);
              var item = new ListItem();
              item.AdditionalProperties[GROUP] = a.Group;
              item.SetLabel("Name", a.Group);
              items.Add(item);
            }
              }
              items.FireChange();
        }
开发者ID:BigGranu,项目名称:AppLauncher_MP2,代码行数:21,代码来源:DlgAppLauncherGroups.cs

示例12: AddAllCinemas

 private void AddAllCinemas()
 {
     foreach (var c in _allCinemas)
       {
     var item = new ListItem();
     item.AdditionalProperties[NAME] = c.Id;
     item.SetLabel("Text", c.Name + " - " + c.Address);
     if (IsCinemaSelected(c))
     {
       item.Selected = true;
     }
     Cinemas.Add(item);
       }
 }
开发者ID:BigGranu,项目名称:Cinema_MP2,代码行数:14,代码来源:CinemaSettings.cs

示例13: FillDailyImages

 private static void FillDailyImages(PictureInfos pi)
 {
     var item = new ListItem();
       item.AdditionalProperties[IMAGE_PATH] = pi.ImageOffline;
       item.SetLabel("Path", pi.ImageOffline);
       item.SetLabel("Titel", pi.Titel);
       item.SetLabel("Photographer", pi.Photographer);
       item.SetLabel("Category", pi.Category);
       item.SetLabel("Date", pi.Date);
       item.SetLabel("Description", pi.Description);
       item.Selected = true;
       DailyImages.Add(item);
 }
开发者ID:BigGranu,项目名称:PictureOfTheDay_MP2,代码行数:13,代码来源:Home.cs

示例14: CreateServerItem

 protected ListItem CreateServerItem(ServerDescriptor sd)
 {
   ListItem result = new ListItem();
   SystemName system = sd.GetPreferredLink();
   result.SetLabel(Consts.KEY_NAME, LocalizationHelper.Translate(Consts.RES_SERVER_FORMAT_TEXT,
       sd.ServerName, system.HostName));
   result.SetLabel(Consts.KEY_SERVER_NAME, sd.ServerName);
   result.SetLabel(Consts.KEY_SYSTEM, system.HostName);
   result.AdditionalProperties[Consts.KEY_SERVER_DESCRIPTOR] = sd;
   result.Command = new MethodDelegateCommand(() => ChooseNewHomeServerAndClose(result));
   return result;
 }
开发者ID:HeinA,项目名称:MediaPortal-2,代码行数:12,代码来源:ServerAttachmentModel.cs

示例15: AddListItem

 private static void AddListItem(ItemsList list, CitySetupInfo city)
 {
   if (city == null)
     return;
   ListItem item = new ListItem();
   item.SetLabel("Name", city.Name);
   item.SetLabel("Id", city.Id);
   item.SetLabel("Detail", city.Detail);
   list.Add(item);
 }
开发者ID:davinx,项目名称:MediaPortal-2,代码行数:10,代码来源:WeatherSetupModel.cs


注:本文中的MediaPortal.UI.Presentation.DataObjects.ListItem.SetLabel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。