// Token: 0x06000033 RID: 51 RVA: 0x00005888 File Offset: 0x00003A88 private void TSB_ExportHeXML_Click(object sender, EventArgs e) { if (this._List_Object.Count != 0) { this.toolStrip.Enabled = false; this.uc_HeXML_DetailTreeview.Enabled = false; SaveFileDialog saveFileDialog = new SaveFileDialog(); saveFileDialog.Filter = "XML Files (*.XML)|*.XML|All files (*.*)|*.*"; saveFileDialog.FileName = "HeXML.xml"; if (saveFileDialog.ShowDialog() == DialogResult.OK) { this.toolStripStatus.Text = "Status: Saving ..."; Application.DoEvents(); LandXML_Header landXML_Header = new LandXML_Header(); RevitDocument revitDocument = new RevitDocument(); landXML_Header.Application_version = Assembly.GetExecutingAssembly().GetName().Version.ToString(); string str = string.Concat(new string[] { string.Format("{0:D2}", DateTime.Now.Year), "-", string.Format("{0:D2}", DateTime.Now.Month), "-", string.Format("{0:D2}", DateTime.Now.Day) }); string str2 = string.Concat(new string[] { string.Format("{0:D2}", DateTime.Now.Hour), ":", string.Format("{0:D2}", DateTime.Now.Minute), ":", string.Format("{0:D2}", DateTime.Now.Second) }); landXML_Header.Author_timeStamp = str + "T" + str2; bool flag = true; DisplayUnitType displayUnitType = revitDocument.Detect_UnitType(this._commandData.Application.ActiveUIDocument.Document, 0); DisplayUnitType displayUnitType2 = revitDocument.Detect_UnitType(this._commandData.Application.ActiveUIDocument.Document, 1); DisplayUnitType displayUnitType3 = revitDocument.Detect_UnitType(this._commandData.Application.ActiveUIDocument.Document, 2); revitDocument.Detect_UnitType(this._commandData.Application.ActiveUIDocument.Document, 3); string text = displayUnitType.ToString().ToLower(); if (text.Contains("feet") || text.Contains("foot") || text.Contains("inches")) { landXML_Header.Units_linearUnit = "foot"; flag = false; } else { landXML_Header.Units_linearUnit = "meter"; } string text2 = displayUnitType2.ToString().ToLower(); if (text2.Contains("feet") || text2.Contains("acres") || text2.Contains("inches")) { landXML_Header.Units_areaUnit = "squareFoot"; } else { landXML_Header.Units_areaUnit = "squareMeter"; } string text3 = displayUnitType3.ToString().ToLower(); if (text3.Contains("gallon") || text3.Contains("inch") || text3.Contains("feet") || text3.Contains("yard")) { landXML_Header.Units_volumeUnit = "cubicFeet"; } else { landXML_Header.Units_volumeUnit = "cubicMeter"; } landXML_Header.Units_angularUnit = "decimal degrees"; if (!flag) { landXML_Header.Units_pressureUnit = "inchHG"; } else { landXML_Header.Units_pressureUnit = "milliBars"; } if (!flag) { landXML_Header.Units_temperatureUnit = "fahrenheit"; } else { landXML_Header.Units_temperatureUnit = "celsius"; } new HeXML().Write(saveFileDialog.FileName, this._List_Object, landXML_Header); this.toolStripStatus.Text = "Status: The file has been written"; frm_Report frm_Report = new frm_Report(); frm_Report.FillTextBox(this._List_Object, "Protocol Export HeXML"); frm_Report.ShowDialog(); this.toolStripStatus.Text = "Status: Ready"; this.uc_HeXML_DetailTreeview.Clear(); } this.toolStrip.Enabled = true; this.uc_HeXML_DetailTreeview.Enabled = true; } this.Check_Controls(); }
/// <summary> /// отчет по расходникам /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void mni_Report_Click(object sender, EventArgs e) { frm_Report fr_Report = new frm_Report(); fr_Report.ShowDialog(); }
// Token: 0x0600002A RID: 42 RVA: 0x00004F1C File Offset: 0x0000311C private void TSB_ImportHeXML_Click(object sender, EventArgs e) { this.toolStrip.Enabled = false; this.uc_HeXML_DetailTreeview.Enabled = false; if (this._List_Object.Count != 0) { RevitDocument revitDocument = new RevitDocument(); List <string> listExisting_UniqueIDs = revitDocument.Get_FamilyParameterValue(revitDocument.MeasurementFamilyPointTypName, HeXML_Point_Strings.FamilyParameterName_UniqueID, this._commandData.Application.ActiveUIDocument.Document); HeXML_Details heXML_Details; if (this._UnitConverter == RevitDocument.UnitConverter.FeetToMeter) { heXML_Details = new HeXML_Details(HeXML_Details.UnitConverter.FeetToMeter); } else if (this._UnitConverter == RevitDocument.UnitConverter.MeterToFeet) { heXML_Details = new HeXML_Details(HeXML_Details.UnitConverter.MeterToFeet); } else { heXML_Details = new HeXML_Details(HeXML_Details.UnitConverter.None); } heXML_Details.Detect_Details(this._List_Object, listExisting_UniqueIDs); heXML_Details.Get_HeXMLPoints(); listExisting_UniqueIDs = revitDocument.Get_FamilyParameterValue(revitDocument.MeasurementFamilyPointTypName, HeXML_Point_Strings.FamilyParameterName_UniqueID, this._commandData.Application.ActiveUIDocument.Document); HeXML_Details heXML_Details2 = null; if (this._UnitConverterIntern == RevitDocument.UnitConverter.FeetToMeter) { heXML_Details2 = new HeXML_Details(HeXML_Details.UnitConverter.FeetToMeter); } if (this._UnitConverterIntern == RevitDocument.UnitConverter.MeterToFeet) { heXML_Details2 = new HeXML_Details(HeXML_Details.UnitConverter.MeterToFeet); } if (this._UnitConverterIntern == RevitDocument.UnitConverter.None) { heXML_Details2 = new HeXML_Details(HeXML_Details.UnitConverter.None); } heXML_Details2.Detect_Details(this._List_Object, listExisting_UniqueIDs); List <HeXML_Point> heXMLPoints = heXML_Details2.Get_HeXMLPoints(); if (heXMLPoints.Count != 0 || heXML_Details.List_HeXML_Point_Index_Fail.Count != 0) { revitDocument.ToolStripProgressBar = this.toolStripProgressBar; revitDocument.ToolStripStatusLabel = this.toolStripStatus; Path.GetDirectoryName(Assembly.GetAssembly(typeof(frm_HeXML_Import)).Location) + "\\" + revitDocument.MeasurementFamilyPointPath; this.toolStripStatus.Text = "Status: Loads the family"; Application.DoEvents(); Family family = null; if (family == null) { family = revitDocument.Get_Family(revitDocument.MeasurementFamilyPointName, this._commandData.Application.ActiveUIDocument.Document); } this.toolStripProgressBar.Visible = true; revitDocument.Set_HeXMLPoints(family, heXMLPoints, this._commandData.Application.ActiveUIDocument.Document, this.HeXML_Import); this.toolStripProgressBar.Visible = false; this.toolStripStatus.Text = "Status: The points were imported"; frm_Report frm_Report = new frm_Report(); frm_Report.FillTextBox(heXML_Details, "Protocol Import HeXML"); frm_Report.ShowDialog(); this.uc_HeXML_DetailTreeview.Clear(); base.Close(); } } this.Check_Controls(); this.toolStrip.Enabled = true; this.uc_HeXML_DetailTreeview.Enabled = true; }