示例#1
0
 public string CreateModel(CreateModelProps modprops)
 {
     object[] results = this.Invoke("CreateModel", new object[] {
         modprops
     });
     return((string)(results[0]));
 }
示例#2
0
 /// <remarks/>
 public void CreateModelAsync(CreateModelProps modprops, object userState)
 {
     if ((this.CreateModelOperationCompleted == null))
     {
         this.CreateModelOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateModelOperationCompleted);
     }
     this.InvokeAsync("CreateModel", new object[] {
         modprops
     }, this.CreateModelOperationCompleted, userState);
 }
示例#3
0
            public override void RunCommand()
            {
                if (!LicenseTool.FeatureAllowedMsg(VersionedDbFeature.Test))
                {
                    Logging.Error("Database Versioning edition required");
                    return;
                }

                var vdb = new VersionDb(Vdb);

                var api    = new jsdm.Api();
                var create = new jsdm.CreateModelProps();

                api.Url          = String.Format("{0}?login={1}&password={2}", Url, Login, Password);
                create.Name      = Model;
                create.Dialect   = vdb.Dialect.DialectName;
                create.Versioned = true;
                string model = api.CreateModel(create);

                for (int i = 0; i < vdb.Versions.Count; i++)
                {
                    var ver = vdb.Versions[i];
                    using (var sr = new StreamReader(ver.GetFile()))
                    {
                        Logging.Info("Uploading version " + ver.Name);
                        string content = sr.ReadToEnd();
                        if (i > 0)
                        {
                            api.AddModelVersion(model, new Plugin.versiondb.jsdm.CreateVersionProps
                            {
                                Name    = ver.Name,
                                Ordinal = i + 1
                            });
                        }
                        api.ImportDbStructure(model, i + 1, content, true);
                    }
                }
                Logging.Info("Created mode with key " + model);
            }
示例#4
0
 /// <remarks/>
 public void CreateModelAsync(CreateModelProps modprops)
 {
     this.CreateModelAsync(modprops, null);
 }