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


C# TvBusinessLayer.GetGroupByName方法代码示例

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


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

示例1: Importxmlfile


//.........这里部分代码省略.........
                        catch (Exception ex)
                        {
                            recordingCount--;
                            textoutput("<RED>Could not create recording " + idRecording + " for title " + title + " and file " + fileName +  " - use \"Recording -> database ImportedFromTypeLibAttribute\" for manual import");
                            if (DEBUG)
                            {
                                textoutput("<RED>Exception message is " + ex.Message);
                            }
                            //return false;
                        }

                    }
                    textoutput(recordingCount + " recording settings imported");
                    progressbar((int)PB_action.STOP, ref PB_Import, (int)PB_part.TV_Recordings);
                }

                // Import channel groups
                if (tvgroups == true)
                {
                    progressbar((int)PB_action.START, ref PB_Import, (int)PB_part.TV_TvGroups);
                    textoutput("Importing channel group settings");

                    XmlNodeList channelGroupList = doc.SelectNodes("/tvserver/channelgroups/channelgroup");
                    channelGroupCount = 0;
                    foreach (XmlNode nodeChannelGroup in channelGroupList)
                    {
                        int idGroup = Int32.Parse(nodeChannelGroup.Attributes["IdGroup"].Value);
                        string groupName = nodeChannelGroup.Attributes["GroupName"].Value;
                        try
                        {
                            channelGroupCount++;
                            int mapcount = 0;
                            int groupSortOrder = Int32.Parse(nodeChannelGroup.Attributes["SortOrder"].Value);
                            ChannelGroup group = layer.GetGroupByName(groupName, groupSortOrder);
                            if (group == null)
                                group = new ChannelGroup(groupName, groupSortOrder);
                            group.Persist();
                            XmlNodeList mappingList = nodeChannelGroup.SelectNodes("mappings/map");
                            foreach (XmlNode nodeMap in mappingList)
                            {
                                mapcount++;
                                //string channelname = nodeMap.Attributes["ChannelName"].Value;
                                string displayname = nodeMap.Attributes["DisplayName"].Value;
                                Channel channel = mygetChannelbyName(displayname);
                                int idMap = Int32.Parse(GetNodeAttribute(nodeMap, "IdMap", "0"));
                                int sortOrder = Int32.Parse(GetNodeAttribute(nodeMap, "SortOrder", "9999"));

                                /*
                                Log.Debug("**************************");
                                Log.Debug("group.GroupName=" + group.GroupName);
                                Log.Debug("displayname=" + displayname);
                                Log.Debug("sortOrder=" + sortOrder.ToString());
                                Log.Debug("idMap=" + idMap.ToString());*/
                                if (channel != null)
                                {

                                    //GroupMap map = new GroupMap(group.IdGroup, channel.IdChannel, sortOrder);   //!!!!!!!sortorder is overwritten when setuptv is exited
                                    //POSTIMPORT += "GROUPMAPSORTORDER\t" + group.IdGroup.ToString() + "\t" + channel.IdChannel.ToString() + "\t" + sortOrder.ToString() + "\n";

                                    GroupMap map = new GroupMap(group.IdGroup, channel.IdChannel, sortOrder);
                                    map.SortOrder = sortOrder;
                                    map.Persist();

                                    /*map.SortOrder = sortOrder;
                                    Log.Debug("map.IsPersisted=" + map.IsPersisted.ToString());
                                    map.Persist();
开发者ID:huha001,项目名称:BackupSettings,代码行数:67,代码来源:BackupSettingsExportImport.cs

示例2: importButton_Click


//.........这里部分代码省略.........
                    dvbipChannel.Name = name;
                    dvbipChannel.NetworkId = networkId;
                    dvbipChannel.PmtPid = pmtPid;
                    dvbipChannel.Provider = provider;
                    dvbipChannel.ServiceId = serviceId;
                    dvbipChannel.TransportId = transportId;
                    dvbipChannel.Url = url;
                    layer.AddTuningDetails(dbChannel, dvbipChannel);
                    Log.Info("TvChannels: Added tuning details for DVB-IP channel: {0} provider: {1}", name, provider);
                    break;
                }
              }
            }
            catch (Exception exc)
            {
              Log.Error("TvChannels: Failed to add channel - {0}", exc.Message);
            }
          }
        }

        if (tvChannelGroupList != null && importtvgroups)
        {
          // Import tv channel groups
          foreach (XmlNode nodeChannelGroup in tvChannelGroupList)
          {
            try
            {
              tvChannelGroupCount++;
              string groupName = nodeChannelGroup.Attributes["GroupName"].Value;
              int groupSortOrder = Int32.Parse(nodeChannelGroup.Attributes["SortOrder"].Value);
              ChannelGroup group = null;
              if (groupName == TvConstants.TvGroupNames.AllChannels)
              {
                group = layer.GetGroupByName(groupName) ??
                        new ChannelGroup(groupName, groupSortOrder);
              }
              else
              {
                group = layer.GetGroupByName(groupName, groupSortOrder) ??
                        new ChannelGroup(groupName, groupSortOrder);
              }
              group.Persist();
              XmlNodeList mappingList = nodeChannelGroup.SelectNodes("mappings/map");
              foreach (XmlNode nodeMap in mappingList)
              {
                IList<Channel> channels = layer.GetChannelsByName(nodeMap.Attributes["ChannelName"].Value);
                int sortOrder = Int32.Parse(GetNodeAttribute(nodeMap, "SortOrder", "9999"));
                if (channels != null && channels.Count > 0)
                {
                  Channel channel = channels[0];
                  if (!channel.GroupNames.Contains(group.GroupName))
                  {
                    GroupMap map = new GroupMap(group.IdGroup, channel.IdChannel, sortOrder);
                    map.Persist();
                  }
                  else
                  {
                    foreach (GroupMap map in channel.ReferringGroupMap())
                    {
                      if (map.IdGroup == group.IdGroup)
                      {
                        map.SortOrder = sortOrder;
                        map.Persist();
                        break;
                      }
                    }
开发者ID:nio22,项目名称:MediaPortal-1,代码行数:67,代码来源:ImportExport.cs


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