Click here to Skip to main content
15,891,033 members
Articles / Programming Languages / C#

The Favalias Application

Rate me:
Please Sign up or sign in to vote.
4.92/5 (27 votes)
30 Sep 20037 min read 70.8K   2.6K   52  
Favalias application enables you to manage your favorites web sites in an XML file and to launch your favorites application using aliases. You can also make your own addins (in any .NET language) to call your own code.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
	<head>
		<title></title>
		<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
		<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
		<meta content="VisualStudio.HTML" name="ProgId">
		<meta content="Microsoft Visual Studio .NET 7.1" name="Originator">
		<style> H1 { font-size=100%; margin: 0px 0px 0px 0px; border-width: 0px; padding: 0 .4em .3em .4em; background-color: #99aaff; color: black; }
		</style>
	</head>
	<body>
		<H1 align="center">Favalias Documentation</H1>
		<H5 align="left">URL : <A href="http://sourceforge.net/projects/favalias">http://sourceforge.net/projects/favalias</A>&nbsp;</H5>
		<H5 align="right">email : <A href="mailto:jcmag@yahoo.com">jcmag@yahoo.com</A></H5>
		<H3 align="left">About</H3>
		<P align="left">The Favalias application enables you to launch your favorites 
			application using <A href="#aliases">aliases</A> (if you type "iis", it will 
			launch IIS Manager, "word" will launch MS Word, "query" will launch MS Sql 
			Server&nbsp;Query Analyser...) and manage your <A href="#favorites">favorites</A>
			web sites in an XML file (so you can use them with any browser). You can also 
			perform a Google search by typing any other text.</P>
		<P align="left">You can make <A href="#addins">addins</A> (written in any .NET 
			language) to call your own code using an alias. For example : typing "pwd" will 
			call some code that generate a strong password, "babel en_fr" will call the 
			Babelfish web service to translate&nbsp;a sentence from English to French, 
			"htmlenc" will encode a string into&nbsp;an html string...&nbsp;
		</P>
		<P align="left">The Favalias application appears in the StatusArea, so you can 
			launch your applications or web sites quickly. You can also use a shortcut key 
			("win-S" by default) to activate it.</P>
		<H3 align="left">Preferences</H3>
		<UL>
			<LI>
			You can specify the files used to store your favorites web sites and aliases.
			<LI>
			You can specify your favorite browser.
			<LI>
				<DIV align="left">You can change the shortcut key used to activate Favalias.</DIV>
			<LI>
				<DIV align="left">You can specify a proxy.</DIV>
			<LI>
				<DIV align="left">
					<DIV align="left">You can change the transparency of the main form with the slider.</DIV>
				</DIV>
			</LI>
		</UL>
		<H3 align="left"><a id="aliases">Aliases</a></H3>
		<UL>
			<LI>
				<DIV align="left">Built-in commands :</DIV>
			</LI>
			<UL>
				<LI>
					<DIV align="left">"<FONT color="#ff3300">!</FONT>" : reload the aliases file.</DIV>
				<LI>
					<DIV align="left">"<FONT color="#ff3300">run <EM>anApplication withArguments</EM></FONT>" 
						: run an application, you could transmit some arguments.</DIV>
				<LI>
					<DIV align="left">"<FONT color="#ff3300"><EM>aURL</EM></FONT>" : if "<EM>aURL" </EM>
						starts with "www." or "http://" or "https://", it will launch your browser to 
						see the specified url. You can hit "ctrl+Enter" to complete the URL (it will 
						add automatically&nbsp;www. and .com like the IE address bar).</DIV>
				</LI>
			</UL>
			<LI>
				<DIV align="left">
					You can drag'n drop some text from another application.</DIV>
			<LI>
				<DIV align="left">
					Ctrl-J and Ctrl-N enable you to navigate in the command history. "<FONT color="#ff3300">cls</FONT>" 
					will clear this history.</DIV>
			<LI>
				<DIV align="left">Favalias uses an auto-complete combobox, so it will show you all 
					your aliases, and you can quickly complete a command by pressing&nbsp;the "tab" 
					key.
				</DIV>
			<LI>
				<DIV align="left">The Favalias application is shipped with a&nbsp;demo 
					file,&nbsp;examine it to see how to add your&nbsp;own aliases (go to 
					"Options-Edit aliases").&nbsp;You can use environment variables (like 
					%ProgramFiles%&nbsp;or %SystemRoot%)&nbsp;and %BROWSER% to launch the browser 
					you have configured in the "preferences" menu.</DIV>
			<LI>
				<DIV align="left">You can also launch your aliases using the "aliases" menu.</DIV>
			</LI>
		</UL>
		<P align="left">&nbsp;</P>
		<H3 align="left"><A id="favorites">Favorites</A></H3>
		<UL>
			<LI>
				<DIV align="left">You can quickly add a favorite by drag'n drop (with the Ctrl key 
					pressed)&nbsp;a link from your browser onto the Favalias form.</DIV>
			<LI>
				<DIV align="left">To manage your favorites, go to "Options-Edit favorites".</DIV>
			<LI>
				<DIV align="left">To load the favicons (if the web sites provide one), click 
					"Options-Load favicons". It will launch asynchronous web requests to retrieve 
					them.</DIV>
			</LI>
		</UL>
		<H3 align="left"><a id="addins">Addins</a></H3>
		<P align="left">Go to "Options-Edit aliases" to choose the addins you want to use. 
			This form displays the applications available in the 'addins' directory.</P>
		<P align="left">Addins available with Favalias :</P>
		<UL>
			<LI>
				<DIV align="left">
					<DIV align="left">"<FONT color="#ff3300">gg</FONT>" : perform a Google search.</DIV>
				</DIV>
			<LI>
				<DIV align="left">
					<DIV align="left">"<FONT color="#ff3300">alarm</FONT>" : display a message when it is time.</DIV>
				</DIV>
			<LI>				<DIV align="left">
					<DIV align="left">"<FONT color="#ff3300">pwd <EM>length</EM></FONT>" : generate a 
						strong password of the given length (for example : "pwd 10" could generate 
						"khN9P%4je1").</DIV>
				</DIV>
			<LI>
				"<FONT color="#ff3300">md5 <EM>filePath</EM></FONT>" : generate an MD5 hash 
			value for the specified file.
			<LI>
				<DIV align="left">"<FONT color="#ff3300">sysinfo</FONT>" : display the environment 
					variables set on your machine.</DIV>
			<LI>
				<DIV align="left">"<FONT color="#ff3300">htmlenc</FONT>/<FONT color="#ff3300">htmldec</FONT>" 
					: encode/decode strings in html strings</DIV>
			<LI>
				<DIV align="left">"<FONT color="#ff3300">urlenc</FONT>/<FONT color="#ff3300">urldec</FONT>" 
					: encode/decode strings in URL-encoded strings</DIV>
			<LI>
				<DIV align="left">"<FONT color="#ff3300">babel</FONT>" : translate words using the 
					Babelfish service</DIV>
			<LI>
				<DIV align="left">"<FONT color="#ff3300">lingo</FONT>" : translate words using 
					WorldLingo web site</DIV>
			<LI>
				<DIV align="left">"<FONT color="#ff3300">sqlconnec</FONT>" : a SQL Server 
					ConnectionString builder</DIV>
			</LI>
		</UL>
		<P align="left">You can develop your own functions to extend the Favalias 
			application. To do such addins, follow these instructions :</P>
		<UL>
			<LI>
				<DIV align="left">Create a class (with your favorite .NET language) ; this class 
					must implement the "<FONT color="#993300">Favalias.Interfaces.IFavaliasAddin</FONT>" 
					interface. To do that you have to reference the FavaliasInterfaces.dll.</DIV>
			<LI>
				<DIV align="left">&nbsp;Implement the following method : <FONT color="#993300">public 
						void Execute(string[] args, Hashtable parameters)</FONT><FONT color="#000000">. 
						"args" will contain the arguments transmitted with the alias, 
						and&nbsp;"parameters" will contain :&nbsp;the alias name used to called this 
						addin ("aliasName" key), the user's browser ("browser" key), the proxy IP and 
						port ("proxyIP" and "proxyPort" keys), the application folder ("appFolder"), 
						the user's favalias&nbsp;application data folder ("appDataFolder"), the addins 
						folder ("addinsFolder").</FONT></DIV>
			<LI>
				<DIV align="left">Create a file named "aliases.xml" and add xml configuration for 
					your addin (see the Addins project to see an example). The most important 
					XmlElement is "Command" where you must type "<FONT color="#993300">dll <EM>assemblyName</EM>
						<EM>className</EM></FONT>". "<EM>assemblyName</EM>" is the name of your dll 
					(without the .dll extension), and "<EM>className</EM>" is the full name of your 
					class (with the namespace). You can specify an icon for your addin, use the 
					"icon" element to reference your icon that must be embedded in the dll.</DIV>
			<LI>
				<DIV align="left">Compile your class in a dll and embed the "aliases.xml" file in 
					it (in VS.NET choose "Embedded resource" for the "Build Action" 
					property&nbsp;of the file, or use /resource with your compiler).</DIV>
			<LI>
				<DIV align="left">Copy this dll in the [AppFolder]\Addins folder ([AppFolder] is 
					[ProgramFilesFolder]\Magnon\Favalias by default).</DIV>
			<LI>
				<DIV align="left">
					Launch Favalias,&nbsp;go to "options-edit addins", select your addin 
					command(s)&nbsp;and try it !</DIV>
			</LI>
		</UL>
		<P align="left">New in v0.5 : you can develop ".exe" addin and specify whether you 
			want to launch it in a new process (use "<FONT color="#ff3300">exe <EM>yourExeName </EM>
				/p</FONT>") or in the same process as Favalias (in a new AppDomain, don't 
			specify /p).</P>
		<P align="left">(If you want some examples, see the Addins and 
			SystemInfoAddin&nbsp;projects that are shipped with the source code).</P>
		<P align="left">&nbsp;</P>
		<H5 align="right">email : <A href="mailto:jcmag@yahoo.com">jcmag@yahoo.com</A></H5>
		<H5 align="right">URL : <A href="http://sourceforge.net/projects/favalias">http://sourceforge.net/projects/favalias</A>
		</H5>
		<P align="right">&nbsp;</P>
	</body>
</html>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
France France
I am an MCSD.NET and MCT. I give a lot of Microsoft Trainings (www.bdcworld.com) in France.

Comments and Discussions