コード例 #1
0
        private int GetInstanceAppId(int zoneId)
        {
            var wrapLog = Log.Call <int>(parameters: $"{zoneId}");

            var module = UnwrappedContents ?? throw new Exception("instance is not ModuleInfo");

            var msg    = $"get appid from instance for Z:{zoneId} Mod:{module.ModuleID}";
            var zoneRt = new ZoneRuntime().Init(zoneId, Log);

            if (IsPrimary)
            {
                var appId = zoneRt.DefaultAppId;
                return(wrapLog($"{msg} - use Default app: {appId}", appId));
            }

            if (module.ModuleSettings.ContainsKey(Settings.ModuleSettingApp))
            {
                var guid  = module.ModuleSettings[Settings.ModuleSettingApp].ToString();
                var appId = zoneRt.FindAppId(guid);
                return(wrapLog($"{msg} AppG:{guid} = app:{appId}", appId));
            }

            Log.Add($"{msg} not found = null");
            return(wrapLog("not found", Eav.Constants.AppIdEmpty));
        }
コード例 #2
0
        private int GetInstanceAppId(int zoneId)
        {
            var zoneRt = new ZoneRuntime().Init(zoneId, Log);

            if (IsPrimary)
            {
                return(zoneRt.DefaultAppId);
            }

            if (!_settings.ContainsKey(Settings.ModuleSettingApp))
            {
                return(Eav.Constants.AppIdEmpty);
            }

            var guid  = _settings[Settings.ModuleSettingApp] ?? "";
            var appId = zoneRt.FindAppId(guid);

            return(appId);
        }