Ejemplo n.º 1
0
        public DynamicBlock(DBDefinition definition, params object[] args)
            : base((string)args[0], args[1] as IContainerBlockWeb)
        {
            createConnectors(definition.Connectors.ToArray());

            //no service is added because they are executed when a request is made
            this.definition = definition;
        }
Ejemplo n.º 2
0
        public override void Execute()
        {
            BlockHandle handle = new BlockHandle(id.ValueText);
            DBDefinition definition = new DBDefinition();

            foreach (DefBlockBodyItem bodyItem in body)
            {
                bodyItem.Fill(definition);
            }

            if (baseType.Handle != null)
            {
                definition.BaseType = baseType.Handle;
            }

            //register the dynamic block so in future commands
            //user can instantiate it using: block command
            ExecutionContext.Current.RegisterDynamicBlock(handle, definition);
        }
Ejemplo n.º 3
0
        public override void Fill(DBDefinition definition)
        {
            DBServiceDefinition serviceDef = new DBServiceDefinition();

            if (optArgList.HasValue)
            {
                foreach (Identifier argTitle in optArgList.Value)
                {
                    serviceDef.Args.Add(argTitle.ValueText);
                }
            }

            bool hasReturn = false;

            foreach (DefBlockServiceLine item in body)
            {
                DBSLineDefinition dbslid = item.getDefinition();
                serviceDef.Body.Add(dbslid);

                hasReturn = dbslid.IsReturn;
            }

            definition.Services[this.id.ValueText] = serviceDef;
        }
Ejemplo n.º 4
0
 public override void Fill(DBDefinition definition)
 {
     definition.Connectors.Add(id.ValueText);
 }
Ejemplo n.º 5
0
 //context is used to lookup values
 public virtual void Fill(DBDefinition definition)
 {
 }
Ejemplo n.º 6
0
 public void AddBlock(BlockHandle handle, DBDefinition blockDef)
 {
     blocks[handle] = blockDef;
 }
Ejemplo n.º 7
0
        public void RegisterDynamicBlock(BlockHandle handle, DBDefinition def)
        {
            if (parent != null)
            {
                //brokers are only kept at root level context
                parent.RegisterDynamicBlock(handle, def);
            }

            dynamicBlockBroker.AddBlock(handle, def);
        }