private void tsmiProperties1_Click(object sender, EventArgs e) { var lvwFiles = AllFiles; //显示属性窗口 //右边窗体中没有文件/文件夹被选中 if (lvwFiles.SelectedItems.Count == 0) { return; } //右边窗体中有文件/文件夹被选中 else { try { //显示被选中的第一个文件/文件夹的属性 AttributeForm attributeForm = new AttributeForm(lvwFiles.SelectedItems[0].Tag.ToString()); attributeForm.Show(); } catch (Exception ex) { MessageBox.Show(ex.Message); } } }
protected AttributeRecord(AttributeType attributeType, string name, bool isResident, ushort instance) { m_attribueType = attributeType; m_name = name; m_attributeForm = isResident ? AttributeForm.Resident : AttributeForm.NonResident; m_instance = instance; }
private void 打开属性表ToolStripMenuItem_Click(object sender, EventArgs e) { ITable table = _toccSelectedLayer as ITable; if (table != null) { if (_attributeForm == null || _attributeForm.IsDisposed) { _attributeForm = new AttributeForm(); _attributeForm.FeatureLocation += _attributeForm_FeatureLocation; } else { _attributeForm.FeatureLocation -= _attributeForm_FeatureLocation; _attributeForm.FeatureLocation += _attributeForm_FeatureLocation; _attributeForm.Activate();//之前已打开,则给予焦点,置顶。 } if (!_attributeForm.Visible) { _attributeForm.Show(this); } IFeatureLayerDefinition featureLyrDef = _toccSelectedLayer as IFeatureLayerDefinition; string whereClause = featureLyrDef?.DefinitionExpression; _attributeForm.LoadAttribute(_toccSelectedLayer as IFeatureLayer, whereClause); } }
private void 打开表格属性表TToolStripMenuItem_Click(object sender, EventArgs e) { if (imagelistBoxTables.SelectedIndex < 0) { return; } string tableName = imagelistBoxTables.SelectedItem.ToString(); var table = Tables.FirstOrDefault(v => ((IObjectClass)v).AliasName == tableName); if (table != null) { if (AttributeForm == null || AttributeForm.IsDisposed) { AttributeForm = new AttributeForm(); } else { AttributeForm.Activate();//之前已打开,则给予焦点,置顶。 } if (!AttributeForm.Visible) { AttributeForm.Show(this); } AttributeForm.LoadAttribute(table); } }
private void 查询属性ToolStripMenuItem_Click(object sender, EventArgs e) { if (this.mapViewer1.MainMapControl.LayerCount == 0) { return; } var form = new AttributeForm(); form.LoadAttribute(this.mapViewer1.MainMapControl.GetLayers().First() as ITable); form.Show(this); }
protected AttributeRecord(byte[] buffer, int offset) { m_attribueType = (AttributeType)LittleEndianConverter.ToUInt32(buffer, offset + 0x00); m_recordLengthOnDisk = LittleEndianConverter.ToUInt32(buffer, offset + 0x04); m_attributeForm = (AttributeForm)ByteReader.ReadByte(buffer, offset + 0x08); m_nameLength = ByteReader.ReadByte(buffer, offset + 0x09); ushort nameOffset = LittleEndianConverter.ToUInt16(buffer, offset + 0x0A); Flags = (AttributeFlags)LittleEndianConverter.ToUInt16(buffer, offset + 0x0C); m_instance = LittleEndianConverter.ToUInt16(buffer, offset + 0x0E); if (m_nameLength > 0) { m_name = ByteReader.ReadUTF16String(buffer, offset + nameOffset, m_nameLength); } }
public static AttributeRecord FromBytes(byte[] buffer, int offset) { AttributeType attributeType = (AttributeType)LittleEndianConverter.ToUInt32(buffer, offset + 0x00); AttributeForm attributeForm = (AttributeForm)ByteReader.ReadByte(buffer, offset + 0x08); if (attributeForm == AttributeForm.Resident) { if (attributeType == AttributeType.StandardInformation) { return(new StandardInformationRecord(buffer, offset)); } else if (attributeType == AttributeType.FileName) { return(new FileNameAttributeRecord(buffer, offset)); } else if (attributeType == AttributeType.VolumeName) { return(new VolumeNameRecord(buffer, offset)); } else if (attributeType == AttributeType.VolumeInformation) { return(new VolumeInformationRecord(buffer, offset)); } else if (attributeType == AttributeType.IndexRoot) { return(new IndexRootRecord(buffer, offset)); } else { return(new ResidentAttributeRecord(buffer, offset)); } } else // Non-resident { if (attributeType == AttributeType.IndexAllocation) { return(new IndexAllocationRecord(buffer, offset)); } else { return(new NonResidentAttributeRecord(buffer, offset)); } } }
protected AttributeRecord(byte[] buffer, int offset) { m_attribueType = (AttributeType)LittleEndianConverter.ToUInt32(buffer, offset + 0x00); m_recordLengthOnDisk = LittleEndianConverter.ToUInt32(buffer, offset + 0x04); m_attributeForm = (AttributeForm)ByteReader.ReadByte(buffer, offset + 0x08); m_nameLength = ByteReader.ReadByte(buffer, offset + 0x09); ushort nameOffset = LittleEndianConverter.ToUInt16(buffer, offset + 0x0A); Flags = (AttributeFlags)LittleEndianConverter.ToUInt16(buffer, offset + 0x0C); Instance = LittleEndianConverter.ToUInt16(buffer, offset + 0x0E); if (m_nameLength > 0) { m_name = ByteReader.ReadUTF16String(buffer, offset + nameOffset, m_nameLength); } if (m_recordLengthOnDisk % 8 > 0) { throw new InvalidDataException("Corrupt attribute, record not aligned to 8-byte boundary"); } }
protected AttributeRecord(AttributeType attributeType, string name, bool isResident) { m_attribueType = attributeType; m_name = name; m_attributeForm = isResident ? AttributeForm.Resident : AttributeForm.NonResident; }
private void ShowAttribute(IGeometry geometry) { if (FeatureLayer != null) { IArray array = AttributeHelper.Identify(FeatureLayer.FeatureClass, geometry, WhererClause); if (array != null) { IFeatureIdentifyObj featureIdentifyObj = array.get_Element(0) as IFeatureIdentifyObj; IIdentifyObj identifyObj = featureIdentifyObj as IIdentifyObj; IRowIdentifyObject rowIdentifyObj = featureIdentifyObj as IRowIdentifyObject; IFeature feature = rowIdentifyObj.Row as IFeature; if (feature != null) { Twinkle(feature); if (Father.operateMode == OperateMode.None) { if (this.BusFlag) { axMapControl.Map.ClearSelection(); Father.Analyze2(feature); } else { AttributeForm form = new AttributeForm(feature, FeatureLayer.FeatureClass, Father.RoadHistoryFeatureClass, Father.RoadNodeFeatureClass, LayerName); form.ShowDialog(this.Father); } } else if (Father.operateMode == OperateMode.Edit) { var form = new OperateForm(FeatureLayer.FeatureClass, feature); form.ShowDialog(Father); } else if (Father.operateMode == OperateMode.Delete) { if (MessageBox.Show("你确定要删除当前选择的", "警告", MessageBoxButtons.OKCancel) == DialogResult.OK) { feature.Delete(); Father.MapRefresh(); } } else if (Father.operateMode == OperateMode.Add) { var form = new OperateForm(FeatureLayer.FeatureClass, feature.Shape); form.ShowDialog(Father); } } } } }
/// <summary> /// 表格(ArcGIS ITable)列表控件 /// </summary> /// <param name="attributeForm">属性表窗口</param> public TableListBox(AttributeForm attributeForm) { InitializeComponent(); AttributeForm = attributeForm; Tables = new List <ITable>(); }