コード例 #1
0
        public Default(
            IPackageData packageData
            )
        {
            kind  = IdentifierKind.Package;
            id    = AttributeOps.GetObjectId(this);
            group = AttributeOps.GetObjectGroup(this);

            if (packageData != null)
            {
                EntityOps.MaybeSetGroup(
                    this, packageData.Group);

                name            = packageData.Name;
                description     = packageData.Description;
                indexFileName   = packageData.IndexFileName;
                provideFileName = packageData.ProvideFileName;
                flags           = packageData.Flags;
                clientData      = packageData.ClientData;
                loaded          = packageData.Loaded;

                VersionStringDictionary ifNeeded = packageData.IfNeeded;

                if (ifNeeded != null)
                {
                    this.ifNeeded = ifNeeded; // use (or "attach to") their versions.
                }
                else
                {
                    this.ifNeeded = new VersionStringDictionary(); // brand new package, create new list.
                }
                token = packageData.Token;
            }
        }
コード例 #2
0
        public Default(
            ILambdaData lambdaData
            )
        {
            kind  = IdentifierKind.Lambda;
            id    = AttributeOps.GetObjectId(this);
            group = AttributeOps.GetObjectGroup(this);

            if (lambdaData != null)
            {
                EntityOps.MaybeSetGroup(
                    this, lambdaData.Group);

                name        = lambdaData.Name;
                description = lambdaData.Description;
                flags       = lambdaData.Flags;
                clientData  = lambdaData.ClientData;
                arguments   = lambdaData.Arguments;
                body        = lambdaData.Body;
                location    = lambdaData.Location;
                token       = lambdaData.Token;
            }

            callback = null;
        }
コード例 #3
0
ファイル: Default.cs プロジェクト: jdruin/F5Eagle
        public Default(
            IOperatorData operatorData
            )
        {
            kind  = IdentifierKind.Operator;
            id    = AttributeOps.GetObjectId(this);
            group = AttributeOps.GetObjectGroup(this);

            if (operatorData != null)
            {
                EntityOps.MaybeSetGroup(
                    this, operatorData.Group);

                name        = operatorData.Name;
                description = operatorData.Description;
                clientData  = operatorData.ClientData;
                typeName    = operatorData.TypeName;
                lexeme      = operatorData.Lexeme;
                operands    = operatorData.Operands;
                types       = operatorData.Types;
                flags       = operatorData.Flags;
                plugin      = operatorData.Plugin;
                token       = operatorData.Token;
            }
        }
コード例 #4
0
ファイル: Default.cs プロジェクト: jdruin/F5Eagle
        public Default(
            IObjectTypeData objectTypeData
            )
        {
            kind  = IdentifierKind.ObjectType;
            id    = AttributeOps.GetObjectId(this);
            group = AttributeOps.GetObjectGroup(this);

            if (objectTypeData != null)
            {
                EntityOps.MaybeSetGroup(
                    this, objectTypeData.Group);

                name        = objectTypeData.Name;
                description = objectTypeData.Description;
                clientData  = objectTypeData.ClientData;
                type        = objectTypeData.Type;
                token       = objectTypeData.Token;
            }
        }
コード例 #5
0
ファイル: Default.cs プロジェクト: jdruin/F5Eagle
        public Default(
            IResolveData resolveData
            )
        {
            kind  = IdentifierKind.Resolve;
            id    = AttributeOps.GetObjectId(this);
            group = AttributeOps.GetObjectGroup(this);

            if (resolveData != null)
            {
                EntityOps.MaybeSetGroup(
                    this, resolveData.Group);

                name        = resolveData.Name;
                description = resolveData.Description;
                clientData  = resolveData.ClientData;
                interpreter = resolveData.Interpreter;
                token       = resolveData.Token;
            }
        }
コード例 #6
0
ファイル: Default.cs プロジェクト: jdruin/F5Eagle
        public Default(
            ITraceData traceData
            )
        {
            kind = IdentifierKind.Trace;

            //
            // VIRTUAL: Id of the deepest derived class.
            //
            id = AttributeOps.GetObjectId(this);

            //
            // VIRTUAL: Group of the deepest derived class.
            //
            group = AttributeOps.GetObjectGroup(this);

            //
            // NOTE: Is the supplied trace data valid?
            //
            if (traceData != null)
            {
                EntityOps.MaybeSetGroup(
                    this, traceData.Group);

                name         = traceData.Name;
                description  = traceData.Description;
                typeName     = traceData.TypeName;
                methodName   = traceData.MethodName;
                bindingFlags = traceData.BindingFlags;
                methodFlags  = traceData.MethodFlags;
                token        = traceData.Token;
                traceFlags   = traceData.TraceFlags;
                plugin       = traceData.Plugin;
                clientData   = traceData.ClientData;
            }

            callback = null;
        }
コード例 #7
0
ファイル: Default.cs プロジェクト: jdruin/F5Eagle
        public Default(
            IObjectData objectData,
            object value,
            IClientData valueData
            )
        {
            kind  = IdentifierKind.Object;
            id    = AttributeOps.GetObjectId(this);
            group = AttributeOps.GetObjectGroup(this);

            if (objectData != null)
            {
                EntityOps.MaybeSetGroup(
                    this, objectData.Group);

                name                    = objectData.Name;
                description             = objectData.Description;
                clientData              = objectData.ClientData;
                type                    = objectData.Type;
                objectFlags             = objectData.ObjectFlags;
                referenceCount          = objectData.ReferenceCount;
                temporaryReferenceCount = objectData.TemporaryReferenceCount;

#if NATIVE && TCL
                interpName = objectData.InterpName;
#endif

#if DEBUGGER && DEBUGGER_ARGUMENTS
                executeArguments = objectData.ExecuteArguments;
#endif

                token = objectData.Token;
            }

            this.value     = value;
            this.valueData = valueData;
        }
コード例 #8
0
ファイル: Default.cs プロジェクト: jdruin/F5Eagle
        public Default(
            ISubCommandData subCommandData
            )
        {
            kind = IdentifierKind.SubCommand;

            //
            // VIRTUAL: Id of the deepest derived class.
            //
            id = AttributeOps.GetObjectId(this);

            //
            // VIRTUAL: Group of the deepest derived class.
            //
            group = AttributeOps.GetObjectGroup(this);

            //
            // NOTE: Is the supplied command data valid?
            //
            if (subCommandData != null)
            {
                EntityOps.MaybeSetGroup(
                    this, subCommandData.Group);

                name            = subCommandData.Name;
                description     = subCommandData.Description;
                commandFlags    = subCommandData.CommandFlags;
                subCommandFlags = subCommandData.Flags;
                command         = subCommandData.Command;
                clientData      = subCommandData.ClientData;
                token           = subCommandData.Token;
            }

            callback    = null;
            subCommands = null;
            syntax      = null;
        }
コード例 #9
0
ファイル: Default.cs プロジェクト: jdruin/F5Eagle
        public Default(
            IFunctionData functionData
            )
        {
            kind  = IdentifierKind.Function;
            id    = AttributeOps.GetObjectId(this);
            group = AttributeOps.GetObjectGroup(this);

            if (functionData != null)
            {
                EntityOps.MaybeSetGroup(
                    this, functionData.Group);

                name        = functionData.Name;
                description = functionData.Description;
                clientData  = functionData.ClientData;
                typeName    = functionData.TypeName;
                arguments   = functionData.Arguments;
                types       = functionData.Types;
                flags       = functionData.Flags;
                plugin      = functionData.Plugin;
                token       = functionData.Token;
            }
        }
コード例 #10
0
ファイル: Default.cs プロジェクト: jdruin/F5Eagle
        /// <summary>
        ///   This is the constructor used by the core library to create an
        ///   instance of the plugin, passing the necessary data to be used
        ///   for initializing the plugin.
        /// </summary>
        ///
        /// <param name="pluginData">
        ///   An instance of the plugin data component used to hold the data
        ///   necessary to fully initialize the plugin instance.  This
        ///   parameter may be null.  Derived plugins are free to override
        ///   this constructor; however, they are very strongly encouraged to
        ///   call this constructor (i.e. the base class constructor) in that
        ///   case.
        /// </param>
        public Default(
            IPluginData pluginData
            )
        {
            kind = IdentifierKind.Plugin;

            //
            // VIRTUAL: Id of the deepest derived class.
            //
            id = AttributeOps.GetObjectId(this);

            //
            // VIRTUAL: Group of the deepest derived class.
            //
            group = AttributeOps.GetObjectGroup(this);

            //
            // NOTE: Is the supplied plugin data valid?
            //
            if (pluginData != null)
            {
                EntityOps.MaybeSetGroup(
                    this, pluginData.Group);

                name         = pluginData.Name;
                description  = pluginData.Description;
                flags        = pluginData.Flags;
                clientData   = pluginData.ClientData;
                version      = pluginData.Version;
                uri          = pluginData.Uri;
                appDomain    = pluginData.AppDomain;
                assembly     = pluginData.Assembly;
                assemblyName = pluginData.AssemblyName;
                fileName     = pluginData.FileName;
                typeName     = pluginData.TypeName;
            }

            //
            // NOTE: Are we going to use their command list or create an
            //       entirely new list?
            //
            if ((pluginData != null) && (pluginData.Commands != null))
            {
                commands = pluginData.Commands;
            }
            else
            {
                commands = new CommandDataList();
            }

            //
            // NOTE: Are we going to use their policy list or create an
            //       entirely new list?
            //
            if ((pluginData != null) && (pluginData.Policies != null))
            {
                policies = pluginData.Policies;
            }
            else
            {
                policies = new PolicyDataList();
            }

            //
            // NOTE: Are we going to use their command tokens or create an
            //       entirely new list?
            //
            if ((pluginData != null) && (pluginData.CommandTokens != null))
            {
                commandTokens = pluginData.CommandTokens;
            }
            else
            {
                commandTokens = new LongList();
            }

            //
            // NOTE: Are we going to use their command tokens or create an
            //       entirely new list?
            //
            if ((pluginData != null) && (pluginData.FunctionTokens != null))
            {
                functionTokens = pluginData.FunctionTokens;
            }
            else
            {
                functionTokens = new LongList();
            }

            //
            // NOTE: Are we going to use their policy tokens or create an
            //       entirely new list?
            //
            if ((pluginData != null) && (pluginData.PolicyTokens != null))
            {
                policyTokens = pluginData.PolicyTokens;
            }
            else
            {
                policyTokens = new LongList();
            }

            //
            // NOTE: Are we going to use their trace tokens or create an
            //       entirely new list?
            //
            if ((pluginData != null) && (pluginData.TraceTokens != null))
            {
                traceTokens = pluginData.TraceTokens;
            }
            else
            {
                traceTokens = new LongList();
            }

            //
            // NOTE: Are we going to use the resource manager they specified or
            //       create a new one based on the plugin name and assembly?
            //
            if ((pluginData != null) && (pluginData.ResourceManager != null))
            {
                resourceManager = pluginData.ResourceManager;
            }
            else
            {
                //
                // NOTE: If the assembly is null we are probably loaded into an
                //       isolated application domain.  Therefore, in that case,
                //       and only in that case, since we are executing in the
                //       target application domain, load the assembly based on
                //       the assembly name and then use that to create the
                //       resource manager.  However, do not simply set the
                //       assembly field of this plugin to any non-null value
                //       because we do not want to cause issues with the
                //       interpreter plugin manager later.  Also, skip attempts
                //       to create a resource manager if the NoResources flag
                //       has been set on the plugin.
                //
                if (!FlagOps.HasFlags(flags, PluginFlags.NoResources, true))
                {
                    if (assembly != null)
                    {
                        resourceManager = RuntimeOps.NewResourceManager(
                            assembly);
                    }
                    else if (assemblyName != null)
                    {
                        resourceManager = RuntimeOps.NewResourceManager(
                            assemblyName);
                    }
                }
            }

            //
            // NOTE: Are we going to use the auxiliary data they specified or
            //       create a new one?
            //
            if ((pluginData != null) && (pluginData.AuxiliaryData != null))
            {
                auxiliaryData = pluginData.AuxiliaryData;
            }
            else
            {
                if (!FlagOps.HasFlags(
                        flags, PluginFlags.NoAuxiliaryData, true))
                {
                    auxiliaryData = new ObjectDictionary();
                }
            }

            //
            // NOTE: Also store the plugin token (which may be zero at this
            //       point).
            //
            if (pluginData != null)
            {
                token = pluginData.Token;
            }
        }