我正在戴尔桌面上安装Ubuntu 13.10.我已经安装了sqldeveloper并在我的Desktop/dir中创建了一个sqldeveoper.desktop文件来启动该程序.见下面的代码.我的问题是:在我的桌面屏幕上,我看到.desktop文件是一个sqldeveloper图标(带有绿色箭头的圆形db图标).我双击图标,程序启动.图标出现在我的Unity栏中,然后图像变为'?' 问号符号.
任何想法为什么会这样?icon.png(图像)位于桌面文件指向的位置.也许文件没有从Unity栏中正确看到路径?
sqldeveloper.desktop代码:
[Desktop Entry]
Type=Application
Version=1.0
Name=SQL Developer
GenericName=Oracle Development Environment
Comment=Proprietary environment for managing Oracle databases
Exec=sqldeveloper %F
Icon=/opt/sqldeveloper/icon.png
Terminal=false
Categories=Development;IDE;
StartupNotify=true
Run Code Online (Sandbox Code Playgroud)
感谢您的任何指导.JohnC
在大多数现代JS框架中,松散耦合UI组件的最佳实践是Pub/Sub的一些实现.
我的问题是这不会使调试,维护你的应用程序更加困难,而依赖注入可以实现相同的结果(松散耦合)?
例如,我的组件应该在单击时打开一个对话框.这需要发生,否则UI将显示为已损坏.对我来说,让组件显式调用某些对话框服务似乎更具可读性.在野外,我看到这个问题解决了更多与pub sub,所以也许我错过了一些东西.
当同时使用这两种方法时,哪些地方可以在事件触发事件或使用注入服务实现该操作时绘制线?
c# dependency-injection ioc-container inversion-of-control light-inject
我有一个ServiceStack API应用程序,它使用Simple Injector作为其IoC容器.我需要某些组件才能拥有"按网络请求"的生活方式.
我在这里查看了Simple Injector文档,发现它没有一个,而是两个与'每个web请求'相对应的生活方式:
这让我很困惑,因为我一直认为所有ASP.NET应用程序都使用相同的基本管道,并且通过插入HTTP模块,每个Web请求实现了IoC容器.为什么Web API应用程序会有所不同?
任何人都可以了解哪个最适合ServiceStack API应用程序?
dependency-injection perwebrequest servicestack simple-injector
这真的是对这个问题的跟进.其中一个Simple Injector开发人员指出了一个关于Simple Injector的有用信息,我认为让它更易于访问是件好事.
那么,使用Web API 1和.NET 4.0支持Simple Injector是否有任何技术障碍?源代码很容易下载和编译.它似乎工作得很好.
我已经更新到structuremap 3,现在我不能使用FillAllPropertiesOfType进行setter注入.
它是否已被弃用,我应该使用什么呢?
c# structuremap dependency-injection ioc-container structuremap3
我从给定的网站下载了Vuforia SDK和示例代码,但它正在给出
<QCAR/QCAR.h> file not found
我在我的ubuntu桌面上安装了unity 5.但是当我运行它时,它不是这样的,即没有显示文本.
我有一个暴露类似的类型的DLL
public class MyDbContext {
[...]
}
Run Code Online (Sandbox Code Playgroud)
在这个库中我还有一个IPackage实现,它MyDbContext在容器中注册就像
public void RegisterServices( Container container ) {
container.Register<MyDbContext>( Lifestyle.Scoped );
}
Run Code Online (Sandbox Code Playgroud)
然后从两种不同类型的应用程序引用该程序集: - web api项目 - asp.net mvc应用程序
这是web api项目的初始化
var container = new Container();
container.Options.DefaultScopedLifestyle = new AsyncScopedLifestyle();
InitializeContainer( container );
container.RegisterWebApiControllers( GlobalConfiguration.Configuration );
container.Verify();
Run Code Online (Sandbox Code Playgroud)
这是mvc应用程序的初始化
var container = new Container();
container.Options.DefaultScopedLifestyle = new WebRequestLifestyle();
InitializeContainer( container );
container.RegisterMvcControllers( Assembly.GetExecutingAssembly() );
container.Verify();
Run Code Online (Sandbox Code Playgroud)
当我从Rebus队列(在mvc应用程序中)收到消息时,容器尝试实例化这样的消息处理程序
public class MyHandler : BaseMessageHandler, IHandleMessages<MyMessage>, IHandleMessages<IFailed<MyMessage>>
{
public MyHandler( ILog logger, MyDbContext context …Run Code Online (Sandbox Code Playgroud) 我正在使用简单的注入器,但IDependencyResolver在 .net core 2 中找不到,使用IServiceProvider而不是使用是正确的选择IDependencyResolver,因为没有“ IDependencyScope BeginScope()” IserviceProvider,我有点困惑是否使用IServiceProvider。我读了 .net core 2.0有更好的内置 DI 支持,但不确定如何利用它。
public class SimpleInjectorWebApiDependencyResolver : IDependencyResolver
{
private readonly Container container;
public SimpleInjectorWebApiDependencyResolver(Container container)
{
this.container = container;
}
[DebuggerStepThrough]
public IDependencyScope BeginScope() // what should i use instead of IdependencyScope in .Net Core
{
return this;
}
[DebuggerStepThrough]
public object GetService(Type serviceType)
{
return ((IServiceProvider)this.container).GetService(serviceType);
}
[DebuggerStepThrough]
public IEnumerable<object> GetServices(Type serviceType)
{
//return this.container.GetAllInstances(serviceType);
IServiceProvider provider = …Run Code Online (Sandbox Code Playgroud) c# dependency-injection simple-injector dependency-resolver asp.net-core-2.0
c# ×5
events ×1
icons ×1
ios ×1
javascript ×1
light-inject ×1
linux ×1
objective-c ×1
rebus ×1
servicestack ×1
structuremap ×1
ubuntu ×1
ubuntu-13.10 ×1
ubuntu-unity ×1
vuforia ×1
wine ×1
xcode ×1