private void ServerHostPropertyPage_Load(object sender, EventArgs e) { IEnumServerObjectConfiguration configurations = this.AGSServerConnectionAdmin.ServerObjectAdmin.GetConfigurations(); configurations.Reset(); for (IServerObjectConfiguration configuration2 = configurations.Next(); configuration2 != null; configuration2 = configurations.Next()) { object obj2; object obj3; configuration2.Properties.GetAllProperties(out obj2, out obj3); } IEnumServerMachine machines = this.AGSServerConnectionAdmin.ServerObjectAdmin.GetMachines(); machines.Reset(); IServerMachine machine2 = machines.Next(); string[] items = new string[3]; while (machine2 != null) { items[0] = (machine2 as IServerMachine3).Name; items[1] = (machine2 as IServerMachine3).AdminURL; items[2] = "已启动"; ListViewItem item = new ListViewItem(items) { Tag = machine2 }; this.lstDir.Items.Add(item); machine2 = machines.Next(); } }
public void Apply() { if (this.iserverObjectConfiguration_0 == null) { this.iserverObjectConfiguration_0 = (this.iagsserverConnection_0 as IAGSServerConnectionAdmin).ServerObjectAdmin.CreateConfiguration(); } this.iserverObjectConfiguration_0.Name = this.txtSOName.Text; this.iserverObjectConfiguration_0.TypeName = this.cboSOType.Text; this.iserverObjectConfiguration_0.Description = this.txtDescription.Text; this.iserverObjectConfiguration_0.StartupType = (esriStartupType)this.cboStartupType.SelectedIndex; }
public void EditServerObjectProperties(int int_2) { frmServerObjectPropertySheet sheet = new frmServerObjectPropertySheet(); this.iserverObjectConfiguration_0 = (this.iagsserverConnection_0 as IAGSServerConnectionAdmin).get_ServerObjectConfiguration( this.iagsserverObjectName_0.Name, this.iagsserverObjectName_0.Type); sheet.AGSConnectionAdmin = this.iagsserverConnection_0 as IAGSServerConnectionAdmin; sheet.ServerObjectConfig = this.iserverObjectConfiguration_0; sheet.Status = this.Status; sheet.ShowDialog(); this.iserverObjectConfiguration_0 = null; }
protected override void OnClick() { IGxApplication gxApplication = (IGxApplication)ArcCatalog.Application; IGxAGSObject3 agsObject3 = (IGxAGSObject3)gxApplication.SelectedObject; IServerObjectConfiguration config = agsObject3.ServerObjectConfiguration; IPropertySet propSet = config.Properties; GetProperties(propSet); //Look at each property and value in the Property Set object (logged to output) string path = (string)config.Properties.GetProperty("FilePath"); string mxdPath = ""; string keyString = ".MapServer"; if (path.Contains(keyString)) { int indexOf = path.IndexOf(keyString); string editPath = path.Remove(indexOf + keyString.Length) + "\\extracted\\manifest.xml"; XmlDocument xmlDoc = new XmlDocument(); // Read the manifest.xml file to get the full MXD file path xmlDoc.Load(editPath); XmlNodeList nodes = xmlDoc.SelectNodes("//OnPremisePath"); foreach (XmlNode item in nodes) { if (item.ParentNode.Name == "SVCResource" && item.InnerText.Contains(".mxd")) { mxdPath = item.InnerText; //Store the MXD file path in this variable } } } MessageBox.Show(mxdPath); //String token = GetToken(m_token); //string logresponse = GetLog(m_logurl, token); //MessageBox.Show(logresponse.ToString()); }
private void btnNext_Click(object sender, EventArgs e) { switch (this.int_0) { case 0: if (!(this.sogeneralPropertyPage_0.SOName.Trim() == "")) { this.sogeneralPropertyPage_0.Visible = false; if (this.iserverObjectConfiguration_0 == null) { this.iserverObjectConfiguration_0 = this.sogeneralPropertyPage_0.CreateServerObjectConfig(); this.sodocumentPropertyPage_0.ServerObjectConfiguration = this.iserverObjectConfiguration_0; this.sopoolPropertyPage_0.ServerObjectConfiguration = this.iserverObjectConfiguration_0; this.soprocessManagementPropertyPage_0.ServerObjectConfiguration = this.iserverObjectConfiguration_0; this.sosummaryPropertyPage_0.ServerObjectConfiguration = this.iserverObjectConfiguration_0; } this.sogeneralPropertyPage_0.Apply(); this.sodocumentPropertyPage_0.Visible = true; this.btnLast.Enabled = true; break; } MessageBox.Show("请输入Server object名字!"); return; case 1: if (!(this.sodocumentPropertyPage_0.Docunment.Trim() == "")) { this.sodocumentPropertyPage_0.Apply(); this.sodocumentPropertyPage_0.Visible = false; this.sopoolPropertyPage_0.Visible = true; break; } MessageBox.Show("请设定地图文档!"); return; case 2: this.sopoolPropertyPage_0.Apply(); this.sopoolPropertyPage_0.Visible = false; this.soprocessManagementPropertyPage_0.Visible = true; break; case 3: this.soprocessManagementPropertyPage_0.Apply(); this.soprocessManagementPropertyPage_0.Visible = false; this.sosummaryPropertyPage_0.Visible = true; this.btnNext.Text = "完成"; break; case 4: try { (this.iagsserverConnection_0 as IAGSServerConnectionAdmin).ServerObjectAdmin.AddConfiguration( this.iserverObjectConfiguration_0); if (this.sosummaryPropertyPage_0.isStart) { (this.iagsserverConnection_0 as IAGSServerConnectionAdmin).ServerObjectAdmin .StartConfiguration(this.iserverObjectConfiguration_0.Name, this.iserverObjectConfiguration_0.TypeName); } } catch (Exception exception) { MessageBox.Show(exception.ToString()); Logger.Current.Error("", exception, ""); } base.DialogResult = DialogResult.OK; base.Close(); return; } this.int_0++; }