public IEnumerable<INeTreeBuilder> GetNetreeBuilders(NeLevel level, NeTreeBuilderGroupFlags flag, int cityId, string vendor)
        {
            var lstBuld = new List<INeTreeBuilder>();
            var assembly = Assembly.GetExecutingAssembly();
            var buldTypes = assembly.GetExportedTypes()
                .Where(e => {
                    var attr = e.GetAttribute<NeTreeBuilderGroupAttribute>();
                    return attr != null && attr.Flag == flag && (attr.Level & level) == level;
                });

            foreach (var type in buldTypes)
            {
                try
                {
                    var contructInfo = type.GetConstructor(new[] { typeof(NeLevel), typeof(int), typeof(string) });
                    lstBuld.Add((INeTreeBuilder)contructInfo.Invoke(new object[] { level, cityId, vendor }));
                }
                catch (Exception ex)
                {
                    new Logger().Logging(LogLevel.Error, ex, string.Empty);
                    continue;
                }
            }

            return lstBuld;
        }
        public NeTreeViewModel(CityViewModel city, NeLevel level, NeTreeBuilderGroupFlags flag)
            : base()
        {
            NeTreeBuilders = new ObservableCollection<NeTreeBuilderViewModel>();
            RootNodes = new ObservableCollection<NeNodeViewModel>();

            Level = level;
            City = city;
        }
Beispiel #3
0
        /// <summary>
        /// 获取网元表名称
        /// </summary>
        /// <param name="netType"></param>
        /// <param name="neLevel"></param>
        /// <returns></returns>
        public static string GetNeTableSubffix(this NetType netType, NeLevel neLevel)
        {
            var tablePrefix = "CELL";

            switch (neLevel)
            {
            case NeLevel.Bsc:
                tablePrefix = "BSC";
                break;

            case NeLevel.Bts:
                tablePrefix = "BTS";
                if (netType == NetType.LTE)
                {
                    tablePrefix = "ENB";
                }
                break;

            case NeLevel.Carr:
                tablePrefix = "CARRIER";
                break;

            case NeLevel.OMC:
                tablePrefix = "OMC";
                if (netType == NetType.LTE)
                {
                    tablePrefix = "MME";
                }
                break;
            }

            switch (netType)
            {
            case NetType.LTE:
                return(string.Format("{0}_{1}_{2}", "NE", tablePrefix, "L"));

            case NetType.GSM:
                return(string.Format("{0}_{1}_{2}", "NE", tablePrefix, "G"));

            case NetType.WCDMA:
                return(string.Format("{0}_{1}_{2}", "NE", tablePrefix, "W"));

            case NetType.FIVEG:
                return(string.Format("{0}_{1}_{2}", "NE", tablePrefix, "5G"));

            default:
                return(string.Format("{0}_{1}_{2}", "NE", tablePrefix, "C"));
            }
        }
 public void ChangeNeLevel(NeLevel level)
 {
     Level = level;
     // 重新加载模式和根节点
     InitNeTreeBuilders();
 }
 public ClassicNeTreeBuilder(NeLevel neTreeLevel, int cityId, string vendorCode)
     : base(neTreeLevel, cityId, vendorCode)
 {
 }
 protected AbstractNeTreeBuilder(NeLevel neTreeLevel, int cityId, string vendorCode)
 {
     CityId = cityId;
     NeTreeLevel = neTreeLevel;
     VendorCode = vendorCode;
 }