Author: gonzalo Date: 2006-08-10 15:42:56 -0400 (Thu, 10 Aug 2006) New Revision: 63621
Added: trunk/gnome-keyring-sharp/sample/README trunk/gnome-keyring-sharp/sample/keyring-showall.cs Modified: trunk/gnome-keyring-sharp/sample/Makefile.am Log: new test Modified: trunk/gnome-keyring-sharp/sample/Makefile.am =================================================================== --- trunk/gnome-keyring-sharp/sample/Makefile.am 2006-08-10 19:24:45 UTC (rev 63620) +++ trunk/gnome-keyring-sharp/sample/Makefile.am 2006-08-10 19:42:56 UTC (rev 63621) @@ -1,2 +1,14 @@ -EXTRA_DIST=secret.cs +SAMPLES=secret.cs keyring-showall.cs +EXTRA_DIST=$(SAMPLES) + +.cs.exe: + mcs -pkg:gnome-keyring-sharp $^ + +samples: secret.exe keyring-showall.exe + cp -uv ../src/Gnome.Keyring.dll* . || echo "ERROR: You need to run 'make install' in the toplevel directory" + +secret.exe: secret.cs + +keyring-showall.exe: keyring-showall.cs + Added: trunk/gnome-keyring-sharp/sample/README =================================================================== --- trunk/gnome-keyring-sharp/sample/README 2006-08-10 19:24:45 UTC (rev 63620) +++ trunk/gnome-keyring-sharp/sample/README 2006-08-10 19:42:56 UTC (rev 63621) @@ -0,0 +1,9 @@ + +Run + make samples + +to build the executables. + +You will need Gnome.Keyring.dll to be in this directory when running +them. + Added: trunk/gnome-keyring-sharp/sample/keyring-showall.cs =================================================================== --- trunk/gnome-keyring-sharp/sample/keyring-showall.cs 2006-08-10 19:24:45 UTC (rev 63620) +++ trunk/gnome-keyring-sharp/sample/keyring-showall.cs 2006-08-10 19:42:56 UTC (rev 63621) @@ -0,0 +1,56 @@ +// +// keyring-showall.cs +// +// Authors: +// Gonzalo Paniagua Javier ([EMAIL PROTECTED]) +// +// (C) Copyright 2006 Novell, Inc. (http://www.novell.com) +// + +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +using System; +using System.Collections; +using Gnome.Keyring; + +public class Test { + static void Main () + { + foreach (string s in Ring.GetKeyrings ()) { + KeyringInfo kinfo = Ring.GetKeyringInfo (s); + Console.WriteLine (kinfo); + foreach (int id in Ring.ListItemIDs (s)) { + ItemData item = Ring.GetItemInfo (s, id); + Console.WriteLine (" Item ID: {0}\n" + + " Type: {1}\n" + + " Secret: {2}\n" + + " Attributes:", + item.ItemID, item.Type, item.Secret); + Hashtable tbl = item.Attributes; + foreach (string key in tbl.Keys) { + Console.WriteLine (" {0} = {1}", key, tbl [key]); + } + } + Console.WriteLine (); + } + } +} + Property changes on: trunk/gnome-keyring-sharp/sample/keyring-showall.cs ___________________________________________________________________ Name: svn:eol-style + native _______________________________________________ Mono-patches maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-patches
