Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MmLanguageManager.GetAllLanguages() method problem
Message
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
00866719
Message ID:
00866891
Vues:
19
Nuri,

>I try to get all records Language tables, and i've been tried to use one class inherited mmLanguageManager class methods GetAllLanguages and taken a exception "A database key must be specified", but i can use GetMessage method mmBusinessForm base class. how can i use GetMessage method If i did not set spesified database key?
>
>regards
>
>PS: Localizing Applications help documents and source files, database tables and fields is different, have you got new help documents? and also i can not find SQL Script for Localizing in wizard directory.

Localization in MM .NET has not been completely implemented yet...we have most of the major plumbing in place, but our next release will complete all localization functionality.

For now, if you want to call the language manager's GetAllLanguages() method without getting the database key error, you need to do the following:

1. Create a subclass of mmLanguageManager at the application level, and in the constructor of the subclass, set the database key. For example, in C#:
using System;

using OakLeaf.MM.Main.Managers;

namespace OakLeaf.MM.NorthwindSample.Main.Business
{
	/// <summary>
	/// Summary description for MyLanguageManager.
	/// </summary>
	public class MyLanguageManager : mmLanguageManager
	{
		public MyLanguageManager()
		{
			this.DatabaseKey = "Northwind";
		}
	}
}
And in VB .NET:
Namespace OakLeaf.MM.NorthwindSample.Main.Business
   Public Class MyLanguageManager
      Inherits mmLanguageManager
      
      Public Sub New()
         Me.DatabaseKey = "Northwind"
      End Sub 
   End Class 
End Namespace
2. Override the factory method in Factory.cs or Factory.vb that creates the language manager:

In C#:
public class Factory : OakLeaf.MM.Main.Windows.Forms.mmFactoryDesktop
{
	public override OakLeaf.MM.Main.Managers.mmLanguageManager CreateLanguageManager()
	{
		return new MyLanguageManager();
	}
}
And in VB .NET:
Public Class Factory
   Inherits OakLeaf.MM.Main.Windows.Forms.mmFactoryDesktop
   
   Public Overrides Function CreateLanguageManager() As OakLeaf.MM.Main.Managers.mmLanguageManager
      Return New MyLanguageManager()
   End Function 
End Class
Regarding the SQL script file, I'll e-mail that to you directly...we neglected to include it in the last version!

Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform