示例#1
0
        private void InitializeDataSource(string dataSourceName, string path)
        {
            this.CurrentBindingSource = (IBindingSourceModel)this.dataSourceModel;
            DataSourceItem dataSourceItem1 = (DataSourceItem)null;

            foreach (DataSourceItem dataSourceItem2 in this.dataSourceModel.Model.DataSources)
            {
                if (dataSourceItem2.DataSourceNode.Name == dataSourceName)
                {
                    dataSourceItem1 = dataSourceItem2;
                    break;
                }
            }
            if (dataSourceItem1 == null)
            {
                return;
            }
            this.dataSourceModel.Model.SelectionContext.SetSelection((DataModelItemBase)dataSourceItem1);
            DataSchemaItem itemFromPath = dataSourceItem1.SchemaItem.GetItemFromPath(path);

            if (itemFromPath == null)
            {
                return;
            }
            dataSourceItem1.SchemaItem.SelectedItem = itemFromPath;
            itemFromPath.ExpandAncestors();
        }
示例#2
0
        private void InitializeExplicitDataContext(string path)
        {
            this.CurrentBindingSource = (IBindingSourceModel)this.explicitDataContextModel;
            DataSchemaItem itemFromPath = this.explicitDataContextModel.SchemaItem.GetItemFromPath(path);

            if (itemFromPath == null)
            {
                return;
            }
            this.explicitDataContextModel.SchemaItem.SelectedItem = itemFromPath;
            itemFromPath.ExpandAncestors();
        }
示例#3
0
        private void InitializeElementName(string elementName, string path)
        {
            this.CurrentBindingSource = (IBindingSourceModel)this.elementPropertyModel;
            if (elementName == null)
            {
                return;
            }
            ElementBindingSourceNode elementNodeByName = this.elementPropertyModel.FindElementNodeByName(elementName);

            if (elementNodeByName == null)
            {
                return;
            }
            elementNodeByName.ExpandAncestors();
            this.elementPropertyModel.SelectedNode = elementNodeByName;
            DataSchemaItem itemFromPath = elementNodeByName.SchemaItem.GetItemFromPath(path);

            if (itemFromPath == null)
            {
                return;
            }
            elementNodeByName.SchemaItem.SelectedItem = itemFromPath;
            itemFromPath.ExpandAncestors();
        }