示例#1
0
        /// <summary>
        /// 依据节点类型创建"空白"的数据信息对象,其HasBeenLoadFromStorage属性为false
        /// (无需数据存储的节点,如OnlyText例此,其HasBeenLoadFromStorage始终为true)
        /// </summary>
        /// <param name="treeNodeType"></param>
        /// <returns></returns>
        public static NodeDataObject CreateDataInfoNode(String treeNodeType, String EFConnectionString)
        {
            NodeDataObject nodeDataObject = new NodeDataObject();

            if (treeNodeType == "InfoNode")
            {
                InfoNodeDataInfo info = new InfoNodeDataInfo()
                {
                    MainWindow = _mainWindow
                };
                InfoNodeAccess access = new InfoNodeAccess(EFConnectionString);
                info.SetRootControlDataAccessObj(access);

                nodeDataObject.DataItem = info;
                //设置数据未装入标记
                nodeDataObject.DataItem.HasBeenLoadFromStorage = false;

                nodeDataObject.AccessObject = access;
            }
            if (treeNodeType == "LabelNode")
            {
                LabelNodeDataInfo info = new LabelNodeDataInfo()
                {
                    MainWindow = _mainWindow
                };
                LabelNodeAccess accessObj = new LabelNodeAccess(EFConnectionString);
                info.SetRootControlDataAccessObj(accessObj);
                nodeDataObject.DataItem = info;
                //设置数据未装入标记
                nodeDataObject.DataItem.HasBeenLoadFromStorage = false;
                nodeDataObject.AccessObject = accessObj;
            }
            return(nodeDataObject);
        }
示例#2
0
        public void AddLabel(InfoNodeAccess access, InfoNodeDataInfo dataInfo)
        {
            var labelWindow = new LabelWindow(this, curDbInfoTab, access, dataInfo);

            labelWin = labelWindow;
            labelWindow.Show();
        }
示例#3
0
 public LabelWindow(MainWindow mainWindow, DBInfoTab curDbInfoTab, InfoNodeAccess access, InfoNodeDataInfo datainfo)
 {
     InitializeComponent();
     labeltree.TreeNodeType = "LabelNode";
     MainWin           = mainWindow;
     this.curDbInfoTab = curDbInfoTab;
     // SelectedInfoNodeDataObj = curDbInfoTab.CurrentTreeView.SelectedItem.NodeData ;
     InfoNodeAccessObj   = access;
     InfoNodeDataInfoObj = datainfo;
     LoadLabelTree();
 }