Beispiel #1
0
        internal ExtensionNodeDescription FindExtensionNode(string path, bool lookInDeps)
        {
            // Look in the extensions of this add-in

            foreach (Extension ext in MainModule.Extensions)
            {
                if (path.StartsWith(ext.Path + "/"))
                {
                    string subp = path.Substring(ext.Path.Length).Trim('/');
                    ExtensionNodeDescriptionCollection nodes = ext.ExtensionNodes;
                    ExtensionNodeDescription           node  = null;
                    foreach (string p in subp.Split('/'))
                    {
                        if (p.Length == 0)
                        {
                            continue;
                        }
                        node = nodes [p];
                        if (node == null)
                        {
                            break;
                        }
                        nodes = node.ChildNodes;
                    }
                    if (node != null)
                    {
                        return(node);
                    }
                }
            }

            if (!lookInDeps || OwnerDatabase == null)
            {
                return(null);
            }

            // Look in dependencies

            foreach (Dependency dep in MainModule.Dependencies)
            {
                AddinDependency adep = dep as AddinDependency;
                if (adep == null)
                {
                    continue;
                }
                Addin ad = OwnerDatabase.GetInstalledAddin(Domain, adep.FullAddinId);
                if (ad != null && ad.Description != null)
                {
                    ExtensionNodeDescription node = ad.Description.FindExtensionNode(path, false);
                    if (node != null)
                    {
                        return(node);
                    }
                }
            }
            return(null);
        }
Beispiel #2
0
        public override void AfterLoadLink()
        {
            base.AfterLoadLink();

            if (RelatedTable == null)
            {
                RelatedTable = OwnerDatabase.GetTable(new NameWithSchema(_tableOrViewSchema, _tableOrViewName));
            }
            if (RelatedView == null)
            {
                RelatedView = OwnerDatabase.GetView(new NameWithSchema(_tableOrViewSchema, _tableOrViewName));
            }
            _tableOrViewName   = null;
            _tableOrViewSchema = null;
        }
Beispiel #3
0
        public override void AfterLoadLink()
        {
            base.AfterLoadLink();

            if (RefTable == null)
            {
                RefTable       = OwnerDatabase.GetTable(new NameWithSchema(_refSchemaName, _refTableName));
                _refSchemaName = null;
                _refTableName  = null;
            }

            if (RefTable != null)
            {
                foreach (var col in RefColumns)
                {
                    col.AfterLoadLink(RefTable);
                }
            }
            else
            {
                int x = 0;
            }
        }