本文整理汇总了C#中IResourceHandler类的典型用法代码示例。如果您正苦于以下问题:C# IResourceHandler类的具体用法?C# IResourceHandler怎么用?C# IResourceHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IResourceHandler类属于命名空间,在下文中一共展示了IResourceHandler类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnInit
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
_resourceHandler = IoC.Get<IResourceHandler>();
//_resourceHandler.AddjQuery(Page);
_resourceHandler.AddjQueryNivoSlider(Page);
_resourceHandler.AddNivoSliderStyleSheet(Page);
AddThemeStylesheet();
}
示例2: RegisterHandler
public virtual bool RegisterHandler(string url, IResourceHandler handler)
{
Uri uri;
if (Uri.TryCreate(url, UriKind.Absolute, out uri))
{
Handlers.AddOrUpdate(uri.ToString(), handler, (k, v) => handler);
return true;
}
return false;
}
示例3: RegisterHandler
public virtual bool RegisterHandler(string url, IResourceHandler handler)
{
Uri uri;
if (Uri.TryCreate(url, UriKind.Absolute, out uri)) {
lock (Handlers) {
Handlers[uri.ToString()] = handler;
}
return true;
}
return false;
}
示例4: GlobalSettingsPresenter
public GlobalSettingsPresenter(
IGlobalSettingsView view,
ITranslator translator,
IGlobalSettingsRepository globalSettingsRepository,
IResourceHandler resourceHandler)
{
if (view == null) throw new ArgumentNullException("view");
if (translator == null) throw new ArgumentNullException("translator");
if (globalSettingsRepository == null) throw new ArgumentNullException("globalSettingsRepository");
if (resourceHandler == null) throw new ArgumentNullException("resourceHandler");
_view = view;
_translator = translator;
_globalSettingsRepository = globalSettingsRepository;
_resourceHandler = resourceHandler;
_view.SaveGlobalSettings += SaveGlobalSettings;
_view.ResetGlobalSettings += ResetGlobalSettings;
}
示例5: PageTypePickerPresenter
public PageTypePickerPresenter(
IPageTypePickerView view,
ITranslator translator,
IResourceHandler resourceHandler,
IPageTypeWrapper pageType,
HttpContextBase context)
{
if (view == null) throw new ArgumentNullException("view");
if (translator == null) throw new ArgumentNullException("translator");
if (resourceHandler == null) throw new ArgumentNullException("resourceHandler");
if (pageType == null) throw new ArgumentNullException("pageType");
if (context == null) throw new ArgumentNullException("context");
_view = view;
_translator = translator;
_resourceHandler = resourceHandler;
_pageType = pageType;
_context = context;
_log = Log.For(this);
}
示例6: UserSettingsPresenter
public UserSettingsPresenter(
IUserSettingsView view,
ITranslator translator,
IGlobalSettingsRepository globalSettingsRepository,
IResourceHandler resourceHandler,
HttpContextBase context)
{
if (view == null) throw new ArgumentNullException("view");
if (translator == null) throw new ArgumentNullException("translator");
if (globalSettingsRepository == null) throw new ArgumentNullException("globalSettingsRepository");
if (resourceHandler == null) throw new ArgumentNullException("resourceHandler");
if (context == null) throw new ArgumentNullException("context");
_view = view;
_translator = translator;
_globalSettingsRepository = globalSettingsRepository;
_resourceHandler = resourceHandler;
_context = context;
_log = Log.For(this);
_view.LoadUserSettings += HandleLoadSettings;
_view.SaveUserSettings += HandleSaveSettings;
}
示例7: OnEndLoad
protected override void OnEndLoad ()
{
// The resource handler policy may have changed after loading, so reset any
// previously allocated resource handler
resourceHandler = null;
// Just after loading, the resource Ids are using the file format's policy.
// They have to be converted to the new policy
IResourceHandler handler = ItemHandler as IResourceHandler;
if (handler != null)
MigrateResourceIds (handler, ResourceHandler);
base.OnEndLoad ();
}
示例8: SetItemHandler
internal override void SetItemHandler (ISolutionItemHandler handler)
{
if (ProjectExtensionUtil.GetItemHandler (this) == null) {
// Initial assignment of the item handler
base.SetItemHandler (handler);
return;
}
IResourceHandler rh = ResourceHandler;
base.SetItemHandler (handler);
resourceHandler = null;
// A change in the file format may imply a change in the resource naming policy.
// Make sure that the resource Id don't change.
MigrateResourceIds (rh, ResourceHandler);
}
示例9: OnEndLoad
protected override void OnEndLoad ()
{
// The resource handler policy may have changed after loading, so reset any
// previously allocated resource handler
resourceHandler = null;
// Just after loading, the resource Ids are using the file format's policy.
// They have to be converted to the new policy
IResourceHandler handler = ItemHandler as IResourceHandler;
if (handler != null)
MigrateResourceIds (handler, ResourceHandler);
if (String.IsNullOrEmpty (defaultNamespace))
defaultNamespace = SanitisePotentialNamespace (Name);
base.OnEndLoad ();
}
示例10: GetResourceId
internal string GetResourceId (IResourceHandler resourceHandler)
{
if (string.IsNullOrEmpty (resourceId))
return resourceHandler.GetDefaultResourceId (this);
return resourceId;
}
示例11: PageExplorerAdapter
public PageExplorerAdapter()
{
_translator = IoC.Get<ITranslator>();
_resourceHandler = IoC.Get<IResourceHandler>();
_roleStrategy = IoC.Get<IRoleStrategy>();
}
示例12: ConversionManager
public ConversionManager(IResourceHandler fileHandler, IResourceHandler registryHandler, IEncoder encoder)
{
_fileHandler = fileHandler;
_registryHandler = registryHandler;
_encoder = encoder;
}
示例13: UpdateResourceHandler
public void UpdateResourceHandler (bool keepOldIds)
{
IResourceHandler oldHandler = resourceHandler;
resourceHandler = null;
if (keepOldIds && oldHandler != null)
MigrateResourceIds (oldHandler, ResourceHandler);
}
示例14: MigrateResourceIds
void MigrateResourceIds (IResourceHandler oldHandler, IResourceHandler newHandler)
{
if (oldHandler.GetType () != newHandler.GetType ()) {
// If the file format has a default resource handler different from the one
// choosen for this project, then all resource ids must be converted
foreach (ProjectFile file in Files.Where (f => f.BuildAction == BuildAction.EmbeddedResource)) {
if (file.Subtype == Subtype.Directory)
continue;
string oldId = file.GetResourceId (oldHandler);
string newId = file.GetResourceId (newHandler);
string newDefault = newHandler.GetDefaultResourceId (file);
if (oldId != newId) {
if (newDefault == oldId)
file.ResourceId = null;
else
file.ResourceId = oldId;
} else {
if (newDefault == oldId)
file.ResourceId = null;
}
}
}
}
示例15: RegisterHandler
public virtual void RegisterHandler(string url, IResourceHandler handler)
{
Handlers[url] = handler;
}