public ReferencesTableDataFrame(TableDataFrame masterFrame, ReferenceViewDefinition refdef, BedRow masterRow)
        {
            InitializeComponent();
            //ParentFrame = parentFrame;
            //m_parentFrame = parentFrame;
            MasterFrame = masterFrame;
            m_baseView  = masterFrame.TabularData;
            m_refdef    = refdef;
            m_masterRow = masterRow;
            var src = m_baseView.DatabaseSource.GetTable(m_refdef.TableName);

            State = new TableRelatedState();
            DataStatePer.AdditionalCondition = m_refdef.GetCondition(m_masterRow);
            DataStatePer.TableData           = src.GetTabularData();

            //RefreshCurrentViewNoRedock();
            //MainWindow.Instance.RunInMainWindow(RefreshCurrentViewNoRedock);
            //btnReferences.Enabled = false;
            //TabularData = src.GetTabularDataAndReuse();
            //LoadDependendData();
        }
Beispiel #2
0
        //public override string UsageEventName
        //{
        //    get { return "data_browser"; }
        //}

        //public override bool AllowClose()
        //{
        //    if (Detached) return false;
        //    return base.AllowClose();
        //}

        //protected override void DisallowedClose()
        //{
        //    Detached = true;
        //}

        private void LoadDataFromNode()
        {
            bool             loaded     = false;
            var              tabdataobj = m_selectedObject.FindTabularDataObject();
            ITabularDataView data       = null;

            if (tabdataobj != null)
            {
                data = tabdataobj.GetTabularData(ConnPack);
            }
            if (data == null && m_selectedObject != null && m_selectedObject.HasTabularData)
            {
                data = m_selectedObject.GetTabularData();
                if (data != null)
                {
                    data.ChangeConnection(ConnPack);
                }
            }
            if (data != null)
            {
                string key = data.GetConnectionKey();
                try
                {
                    m_currentTableKey = key + "#" + data.TableSource.Database.DatabaseName + "#" + data.TableSource.FullName.ToString() + "#" + data.FixedPerspective;
                }
                catch
                {
                    try
                    {
                        m_currentTableKey = key + "#" + data.TableSource.FullName.ToString() + "#" + data.FixedPerspective;
                    }
                    catch
                    {
                        m_currentTableKey = null;
                    }
                }
                if (m_currentTableKey == null)
                {
                    State = new TableRelatedState();
                }
                else
                {
                    if (m_tablesCache.ContainsKey(m_currentTableKey))
                    {
                        State = m_tablesCache[m_currentTableKey];
                        State.HistoryPosition = 0;
                    }
                    else
                    {
                        State = new TableRelatedState();
                        m_tablesCache[m_currentTableKey] = State;
                    }
                }
                DataStatePer.TableData = data;
                if (data != null && data.FixedPerspective != null)
                {
                    DataStatePer.UseFixedPerspective(data.FixedPerspective);
                }
                RefreshCurrentView();
                loaded = true;
            }

            if (!loaded)
            {
                TabularData = null;
            }
            UpdateHint();
            UpdateCellDataView();
            UpdateState();
        }