snipt

Ctrl+h for KB shortcuts

C#

Configure Unity container from dll config

1
2
3
4
5
var dllPath = Assembly.GetExecutingAssembly().Location;
var configuration = ConfigurationManager.OpenExeConfiguration(dllPath);
var unityConfigSection = (UnityConfigurationSection)configuration.GetSection(UnityConfigurationSection.SectionName);
IUnityContainer container = new UnityContainer();
container.LoadConfiguration(unityConfigSection);
https://snipt.net/embed/aab28560aee9237502bd2210df123a5e/
/raw/aab28560aee9237502bd2210df123a5e/
aab28560aee9237502bd2210df123a5e
csharp
C#
5
2019-06-26T12:36:01
True
False
False
Jul 23, 2013 at 04:36 AM
/api/public/snipt/69133/
configure-unity-container-from-dll-config
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="kt">var</span> <span class="n">dllPath</span> <span class="p">=</span> <span class="n">Assembly</span><span class="p">.</span><span class="n">GetExecutingAssembly</span><span class="p">().</span><span class="n">Location</span><span class="p">;</span> </span><span id="L-2"><a name="L-2"></a><span class="kt">var</span> <span class="n">configuration</span> <span class="p">=</span> <span class="n">ConfigurationManager</span><span class="p">.</span><span class="n">OpenExeConfiguration</span><span class="p">(</span><span class="n">dllPath</span><span class="p">);</span> </span><span id="L-3"><a name="L-3"></a><span class="kt">var</span> <span class="n">unityConfigSection</span> <span class="p">=</span> <span class="p">(</span><span class="n">UnityConfigurationSection</span><span class="p">)</span><span class="n">configuration</span><span class="p">.</span><span class="n">GetSection</span><span class="p">(</span><span class="n">UnityConfigurationSection</span><span class="p">.</span><span class="n">SectionName</span><span class="p">);</span> </span><span id="L-4"><a name="L-4"></a><span class="n">IUnityContainer</span> <span class="n">container</span> <span class="p">=</span> <span class="k">new</span> <span class="n">UnityContainer</span><span class="p">();</span> </span><span id="L-5"><a name="L-5"></a><span class="n">container</span><span class="p">.</span><span class="n">LoadConfiguration</span><span class="p">(</span><span class="n">unityConfigSection</span><span class="p">);</span> </span></pre></div> </td></tr></table>
"dll config", "runtime configuration", unity

Text only

Set sloppy focus and no autoraise on gnome3 and unity

1
2
3
4
5
6
# http://askubuntu.com/questions/64605/how-do-i-set-focus-follows-mouse
gsettings set org.gnome.desktop.wm.preferences focus-mode 'sloppy'
gsettings set org.gnome.desktop.wm.preferences auto-raise false

Optionally, turn off raise on clic:
gsettings set org.gnome.desktop.wm.preferences raise-on-click false
https://snipt.net/embed/923ece101dfffe2c76a85a65dcc0361b/
/raw/923ece101dfffe2c76a85a65dcc0361b/
923ece101dfffe2c76a85a65dcc0361b
text
Text only
6
2019-06-25T00:17:11
True
False
False
Dec 13, 2012 at 03:48 PM
/api/public/snipt/51787/
set-sloppy-focus-on-gnome3-and-unity
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a># http://askubuntu.com/questions/64605/how-do-i-set-focus-follows-mouse </span><span id="L-2"><a name="L-2"></a>gsettings set org.gnome.desktop.wm.preferences focus-mode &#39;sloppy&#39; </span><span id="L-3"><a name="L-3"></a>gsettings set org.gnome.desktop.wm.preferences auto-raise false </span><span id="L-4"><a name="L-4"></a> </span><span id="L-5"><a name="L-5"></a>Optionally, turn off raise on clic: </span><span id="L-6"><a name="L-6"></a>gsettings set org.gnome.desktop.wm.preferences raise-on-click false </span></pre></div> </td></tr></table>
gnome, ubuntu, unity