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


C# App.InitData方法代码示例

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


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

示例1: App

        public static IApp App(int appId, PortalSettings ownerPortalSettings)
        {
            var appStuff = new App(ownerPortalSettings, appId);

            var provider = new ValueCollectionProvider(); // use blank provider for now

            appStuff.InitData(false, provider);

            return appStuff;
        }
开发者ID:2sic,项目名称:2sxc,代码行数:10,代码来源:Factory.cs

示例2: ModuleContentBlock

        public ModuleContentBlock(ModuleInfo moduleInfo, IEnumerable<KeyValuePair<string, string>> overrideParams = null)
        {
            if(moduleInfo == null)
                throw new Exception("Need valid ModuleInfo / ModuleConfiguration of runtime");

            ModuleInfo = moduleInfo;
            ParentId = moduleInfo.ModuleID;
            ContentBlockId = ParentId;

            // url-params
            _urlParams = overrideParams ?? DnnWebForms.Helpers.SystemWeb.GetUrlParams();

            // Ensure we know what portal the stuff is coming from
            // PortalSettings is null, when in search mode
            PortalSettings = PortalSettings.Current == null || moduleInfo.OwnerPortalID != moduleInfo.PortalID
                ? new PortalSettings(moduleInfo.OwnerPortalID)
                : PortalSettings.Current;

            ZoneId = ZoneHelpers.GetZoneID(moduleInfo.OwnerPortalID) ?? 0; // new

            AppId = AppHelpers.GetAppIdFromModule(moduleInfo, ZoneId) ?? 0;// fallback/undefined YET

            if (AppId == Settings.DataIsMissingInDb)
            {
                _dataIsMissing = true;
                return;
            }

            if (AppId != 0)
            {
                // try to load the app - if possible
                App = new App(ZoneId, AppId, PortalSettings);
                ContentGroup = App.ContentGroupManager.GetContentGroupForModule(moduleInfo.ModuleID);

                if (ContentGroup.DataIsMissing)
                {
                    _dataIsMissing = true;
                    App = null;
                    return;
                }

                // use the content-group template, which already covers stored data + module-level stored settings
                Template = ContentGroup.Template;

                // set show-status of the template/view picker
                var showStatus = moduleInfo.ModuleSettings[Settings.SettingsShowTemplateChooser];
                bool show;
                if (bool.TryParse((showStatus ?? true).ToString(), out show))
                    ShowTemplateChooser = show;

                // maybe ensure that App.Data is ready
                App.InitData(SxcInstance.Environment.Permissions.UserMayEditContent, Data.ConfigurationProvider);
            }
        }
开发者ID:2sic,项目名称:2sxc,代码行数:54,代码来源:ModuleContentBlock.cs

示例3: PublicQuery

        public dynamic PublicQuery([FromUri] string appname, [FromUri] string name)
        {
            // check zone
            var zid = ZoneHelpers.GetZoneID(PortalSettings.PortalId);
            if (zid == null)
                throw new Exception("zone not found");

            // get app from appname
            var aid = AppHelpers.GetAppIdFromGuidName(zid.Value, appname, true);
            _queryApp = new App(PortalSettings, aid);

            // ensure the queries can be executed (needs configuration provider, usually given in SxcInstance, but we don't hav that here)
            var config = DataSources.ConfigurationProvider.GetConfigProviderForModule(0, _queryApp, null);
            _queryApp.InitData(false, config);
            _useModuleAndCheckModulePermissions = false;    // disable module level permission check, as there is no module which can give more permissions

            // now just run the default query check and serializer
            return Query(name);
        }
开发者ID:2sic,项目名称:2sxc,代码行数:19,代码来源:AppQueryController.cs

示例4: _constructor

        private void _constructor(IContentBlock parent, IEntity cbDefinition)
        {
            Parent = parent;
            ParseContentBlockDefinition(cbDefinition);
            ParentId = parent.ParentId;
            ContentBlockId = -cbDefinition.EntityId; // "mod:" + ParentId +  "-ent:" + cbDefinition.EntityId;

            // Ensure we know what portal the stuff is coming from
            PortalSettings = Parent.App.OwnerPortalSettings;

            ZoneId = Parent.ZoneId;

            AppId = AppHelpers.GetAppIdFromGuidName(ZoneId, _appName); // should be 0 if unknown, must test

            if (AppId == Settings.DataIsMissingInDb)
            {
                _dataIsMissing = true;
                return;
            }

            if (AppId != 0)
            {
                // try to load the app - if possible
                App = new App(ZoneId, AppId, PortalSettings);
                ContentGroup = App.ContentGroupManager.GetContentGroupOrGeneratePreview(_contentGroupGuid, _previewTemplateGuid);

                // handle cases where the content group is missing - usually because of uncomplete import
                if (ContentGroup.DataIsMissing)
                {
                    _dataIsMissing = true;
                    App = null;
                    return;
                }

                // use the content-group template, which already covers stored data + module-level stored settings
                Template = ContentGroup.Template;

                // maybe ensure that App.Data is ready
                App.InitData(SxcInstance.Environment.Permissions.UserMayEditContent, Data.ConfigurationProvider);
            }
        }
开发者ID:2sic,项目名称:2sxc,代码行数:41,代码来源:EntityContentBlock.cs


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