Ejemplo n.º 1
0
		public static void Main (string[] args)
		{
			IPluginArray<TestPluginFather> arr = PluginLoader<TestPluginFather>.Load ("./plugins");
			if (arr.PluginCount == 0) 
				return;
			foreach (TestPluginFather i in arr) {
				ConfigureManager cfg = new ConfigureManager (i);
				cfg["w"] = "q";
				cfg["url"] = "http=uuusss=jjj";
				cfg.SaveAllConfig ();
			}
			Console.WriteLine (arr.PluginCount);
		}
Ejemplo n.º 2
0
 public virtual bool Loading()
 {
     ConfigureManager cfg = new ConfigureManager (this);
     bool isChange = false;
     if (cfg.IsConfigKeyExists ("Address")) {
         this.DatabaseAddr = cfg ["Address"];
     } else {
         cfg ["Address"] = "127.0.0.1";
         isChange = true;
     }
     if (cfg.IsConfigKeyExists ("Ports")) {
         this.DatabasePorts = cfg ["Ports"];
     } else {
         cfg ["Ports"] = "3306";
         isChange = true;
     }
     if (cfg.IsConfigKeyExists ("User")) {
         this.DatabaseUser = cfg ["User"];
     } else {
         cfg ["User"] = "******";
         isChange = true;
     }
     if (cfg.IsConfigKeyExists ("Password")) {
         this.DatabasePassword = cfg ["Password"];
     } else {
         cfg ["Password"] = "******";
         isChange = true;
     }
     if (cfg.IsConfigKeyExists ("Database")) {
         this.DefaultDatabse = cfg ["Database"];
     } else {
         cfg ["Database"] = "Default";
         isChange = true;
     }
     if (isChange) {
         cfg.SaveAllConfig ();
     }
     return true;
 }
Ejemplo n.º 3
0
 public override bool Loading()
 {
     //the version field is the Plugin GUID
     this.date.VersionHash = this.GetGUID ();
     ConfigureManager cfg = new ConfigureManager (this);
     int min = 100;
     int max = 200;
     if (cfg.IsConfigKeyExists ("MinCount") && cfg.IsConfigKeyExists ("MaxCount")) {
         min = Convert.ToInt32 (cfg ["MinCount"]);
         max = Convert.ToInt32 (cfg ["MaxCount"]);
     } else {
         cfg ["MinCount"] = 100.ToString ();
         cfg ["MaxCount"] = 200.ToString ();
         cfg.SaveAllConfig ();
     }
     this.setOtherArgs (min, max);
     return true;
 }