using CollaborativePlatformMain.DFEntity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace CollaborativePlatformMain.Form
{
///
/// FloorDrawingForm.xaml 的交互逻辑
///
public partial class FloorDrawingForm : Window
{
///
/// 父级窗体
///
public UploadDrawingForm UploadDrawingForm;
///
/// 窗体数据
///
public List FloorDatas = new List();
///
/// 楼层管理器
///
public FloorDrawingForm(UploadDrawingForm uploadDrawingForm)
{
InitializeComponent();
UploadDrawingForm = uploadDrawingForm;
}
///
/// 窗体初始化
///
///
///
private void Window_Loaded(object sender, RoutedEventArgs e)
{
Dictionary keyValuePairs = new Dictionary();
keyValuePairs.Add(0, "墙体");
keyValuePairs.Add(1, "门窗");
keyValuePairs.Add(2, "房间标签");
keyValuePairs.Add(3, "车位");
int num = 1;
for (int i = 0; i < 5; i++)
{
List layerDatas = new List();
for (int j = 0; j < 4; j++)
{
FloorLayerData layerData = new FloorLayerData(keyValuePairs[j]);
layerDatas.Add(layerData);
num++;
}
FloorDatas.Add(new FloorLayerData("F" + i, "", layerDatas));
}
sv_floor.ItemsSource = null;
sv_floor.ItemsSource = FloorDatas;
}
///
/// 窗体关闭事件
///
///
///
private void Window_Closed(object sender, EventArgs e)
{
UploadDrawingForm.Visibility = Visibility.Visible;
}
///
/// 楼层鼠标点击事件
///
///
///
private void tb_FloorName_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
TextBlock textBlock = sender as TextBlock;
if (textBlock == null) return;
FloorLayerData floorLayerData = textBlock.DataContext as FloorLayerData;
if (floorLayerData == null) return;
sv_layer.ItemsSource = null;
sv_layer.ItemsSource = floorLayerData.SubDatas;
}
///
/// 图层鼠标点击事件
///
///
///
private void tb_LayerName_PreviewMouseLeftButtonDown_1(object sender, MouseButtonEventArgs e)
{
}
///
/// 确定事件
///
///
///
private void bt_determine_Click(object sender, RoutedEventArgs e)
{
UploadDrawingForm.ArchLayerDatas = FloorDatas;
UploadDrawingForm.bt_xaunze.Background = Brushes.Green;
Dictionary keyValuePairs = new Dictionary();
keyValuePairs.Add(0, "风管");
keyValuePairs.Add(1, "风机");
keyValuePairs.Add(2, "风口");
keyValuePairs.Add(3, "水管");
List warmDatas = new List();
int num = 1;
for (int i = 0; i < 5; i++)
{
List layerDatas = new List();
for (int j = 0; j < 4; j++)
{
FloorLayerData layerData = new FloorLayerData(keyValuePairs[j]);
layerDatas.Add(layerData);
num++;
}
warmDatas.Add(new FloorLayerData("F" + i, "", layerDatas));
}
UploadDrawingForm.WarmLayerDatas = warmDatas;
this.Close();
}
}
}