예제 #1
0
        private void EditResourceData_Click(object sender, EventArgs e)
        {
            if (ResourceDataFileList.SelectedItems.Count != 1 || ResourceDataFileList.SelectedItems[0].Tag as ResourceDataItem == null)
            {
                return;
            }

            var dlg = new EditResourceDataEntryDialog();

            dlg.ResourceName = (ResourceDataFileList.SelectedItems[0].Tag as ResourceDataItem).ResourceName;
            dlg.ContentType  = (ResourceDataFileList.SelectedItems[0].Tag as ResourceDataItem).ContentType;
            dlg.DataType     = (ResourceDataFileList.SelectedItems[0].Tag as ResourceDataItem).DataType;
            dlg.Filename     = (ResourceDataFileList.SelectedItems[0].Tag as ResourceDataItem).Filename;

            if (dlg.ShowDialog(this) == DialogResult.OK)
            {
                (ResourceDataFileList.SelectedItems[0].Tag as ResourceDataItem).ResourceName = dlg.ResourceName;
                (ResourceDataFileList.SelectedItems[0].Tag as ResourceDataItem).ContentType  = dlg.ContentType;
                (ResourceDataFileList.SelectedItems[0].Tag as ResourceDataItem).DataType     = dlg.DataType;
                RefreshFileList();
            }
        }
예제 #2
0
        private void EditResourceData_Click(object sender, EventArgs e)
        {
            if (ResourceDataFileList.SelectedItems.Count != 1 || ResourceDataFileList.SelectedItems[0].Tag as ResourceDataItem == null)
                return;

            var dlg = new EditResourceDataEntryDialog();
            dlg.ResourceName = (ResourceDataFileList.SelectedItems[0].Tag as ResourceDataItem).ResourceName;
            dlg.ContentType = (ResourceDataFileList.SelectedItems[0].Tag as ResourceDataItem).ContentType;
            dlg.DataType = (ResourceDataFileList.SelectedItems[0].Tag as ResourceDataItem).DataType;
            dlg.Filename = (ResourceDataFileList.SelectedItems[0].Tag as ResourceDataItem).Filename;

            if (dlg.ShowDialog(this) == DialogResult.OK)
            {
                (ResourceDataFileList.SelectedItems[0].Tag as ResourceDataItem).ResourceName = dlg.ResourceName;
                (ResourceDataFileList.SelectedItems[0].Tag as ResourceDataItem).ContentType = dlg.ContentType;
                (ResourceDataFileList.SelectedItems[0].Tag as ResourceDataItem).DataType = dlg.DataType;
                RefreshFileList();
            }
        }