コード例 #1
0
        IDecisionTree IDecisionTree.Clone()
        {
            SakwaMapping  mapping = SakwaMappings.Count > 1 ? SakwaMappings[0] : null;
            IDecisionTree result  = new IDecisionTreeImpl(appAssembly, mapping, PostNodeInitialize);

            return(result);
        }
コード例 #2
0
        protected void InitMapping()
        {
            SakwaMapping mapping = new SakwaMapping("0.0");

            mapping.SakwaObjectMapping.Add(typeof(IBaseNodeImpl).ToString(), typeof(IBaseNodeImpl).ToString());
            mapping.SakwaObjectMapping.Add(typeof(IRootNodeImpl).ToString(), typeof(IRootNodeImpl).ToString());

            mapping.SakwaObjectMapping.Add(typeof(CharVariableImpl).ToString(), typeof(CharVariableImpl).ToString());
            mapping.SakwaObjectMapping.Add(typeof(NumericVariableImpl).ToString(), typeof(NumericVariableImpl).ToString());
            mapping.SakwaObjectMapping.Add("sakwa.IntVariableImpl", typeof(NumericVariableImpl).ToString());
            mapping.SakwaObjectMapping.Add(typeof(EnumVariableImpl).ToString(), typeof(EnumVariableImpl).ToString());
            mapping.SakwaObjectMapping.Add(typeof(BoolVariableImpl).ToString(), typeof(BoolVariableImpl).ToString());
            mapping.SakwaObjectMapping.Add(typeof(DateVariableImpl).ToString(), typeof(DateVariableImpl).ToString());

            mapping.SakwaObjectMapping.Add(typeof(IDomainObjectImpl).ToString(), typeof(IDomainObjectImpl).ToString());
            mapping.SakwaObjectMapping.Add(typeof(IExpressionImpl).ToString(), typeof(IExpressionImpl).ToString());
            mapping.SakwaObjectMapping.Add("sakwa.IAssignmentImpl", typeof(IExpressionImpl).ToString());
            mapping.SakwaObjectMapping.Add(typeof(IBranchImpl).ToString(), typeof(IBranchImpl).ToString());

            mapping.SakwaObjectMapping.Add(typeof(IDataObjectImpl).ToString(), typeof(IDataObjectImpl).ToString());
            mapping.SakwaObjectMapping.Add(typeof(IDataSourceImpl).ToString(), typeof(IDataSourceImpl).ToString());
            mapping.SakwaObjectMapping.Add(typeof(IDataDefinitionImpl).ToString(), typeof(IDataDefinitionImpl).ToString());

            IDecisionTreeInterface.SakwaMappings.Add(mapping);
        }
コード例 #3
0
        IBaseNode IDecisionTree.CreateNewNode(string type)
        {
            SakwaMapping mapping = Mapping;

            if (mapping != null)
            {
                type = mapping.StringAsBaseNode(type);
            }

            IBaseNode result = null;

            if (appAssembly != null)
            {
                result = (IBaseNode)appAssembly.CreateInstance(type);
            }

            if (result == null)
            {
                result = (IBaseNode)Assembly.GetCallingAssembly().CreateInstance(type);
            }

            if (result != null)
            {
                result.Tree = this;

                if (PostNodeInitialize != null)
                {
                    PostNodeInitialize.Invoke(result);
                }
            }

            return(result);
        }
コード例 #4
0
        string IDecisionTree.BaseNodePersistName(IBaseNode baseNode)
        {
            SakwaMapping mapping = Mapping;

            if (mapping != null)
            {
                return(mapping.BaseNodeAsString(baseNode));
            }

            return(typeof(IBaseNodeImpl).ToString());
        }
コード例 #5
0
        public IDecisionTreeImpl(Assembly assembly, SakwaMapping mapping, PostNodeInitialize nodeInitialization)
        {
            NodeType    = eNodeType.Tree;
            appAssembly = assembly;

            InitMapping();
            if (mapping != null)
            {
                SakwaMappings.Insert(0, mapping);
            }

            PostNodeInitialize = nodeInitialization;
        }
コード例 #6
0
        public IDecisionTreeImpl(Assembly assembly, SakwaMapping mapping, PostNodeInitialize nodeInitialization, string rootName)
        {
            NodeType    = eNodeType.Tree;
            appAssembly = assembly;

            InitMapping();
            if (mapping != null)
            {
                this.SakwaMappings.Insert(0, mapping);
            }

            PostNodeInitialize = nodeInitialization;

            IDecisionTreeInterface.RootNode = IDecisionTreeInterface.CreateNewNode(eNodeType.Root, null, rootName);
        }
コード例 #7
0
        } //FloatingForm IApplication.GetFloatingForm( ...

        IDecisionTree IApplication.NewDescisionTree(string rootName, PostNodeInitialize nodeInitialization)
        {
            Assembly asm = Assembly.GetCallingAssembly();

            SakwaMapping mapping = new SakwaMapping("0.0");

            mapping.SakwaObjectMapping.Add(typeof(IBaseNodeImpl).ToString(), typeof(UI_BaseNode).ToString());
            mapping.SakwaObjectMapping.Add(typeof(IRootNodeImpl).ToString(), typeof(UI_RootNode).ToString());

            mapping.SakwaObjectMapping.Add(typeof(CharVariableImpl).ToString(), typeof(UI_CharVariable).ToString());
            mapping.SakwaObjectMapping.Add(typeof(NumericVariableImpl).ToString(), typeof(UI_NumericVariable).ToString());
            mapping.SakwaObjectMapping.Add("sakwa.IntVariableImpl", typeof(UI_NumericVariable).ToString());
            mapping.SakwaObjectMapping.Add(typeof(EnumVariableImpl).ToString(), typeof(UI_EnumVariable).ToString());
            mapping.SakwaObjectMapping.Add(typeof(BoolVariableImpl).ToString(), typeof(UI_BoolVariable).ToString());
            mapping.SakwaObjectMapping.Add(typeof(DateVariableImpl).ToString(), typeof(UI_DateVariable).ToString());

            mapping.SakwaObjectMapping.Add(typeof(IDomainObjectImpl).ToString(), typeof(UI_DomainObject).ToString());
            mapping.SakwaObjectMapping.Add(typeof(IExpressionImpl).ToString(), typeof(UI_Expression).ToString());
            mapping.SakwaObjectMapping.Add("sakwa.IAssignmentImpl", typeof(UI_Expression).ToString());
            mapping.SakwaObjectMapping.Add(typeof(IBranchImpl).ToString(), typeof(UI_Branch).ToString());

            mapping.SakwaObjectMapping.Add(typeof(IDataObjectImpl).ToString(), typeof(UI_DataObject).ToString());
            mapping.SakwaObjectMapping.Add(typeof(IDataSourceImpl).ToString(), typeof(UI_DataSource).ToString());
            mapping.SakwaObjectMapping.Add(typeof(IDataDefinitionImpl).ToString(), typeof(UI_DataDefinition).ToString());

            if (nodeInitialization == null)
            {
                nodeInitialization = Result_PostNodeInitialize;
            }

            IDecisionTree result = rootName != ""
                ? new IDecisionTreeImpl(asm, mapping, nodeInitialization, rootName)
                : new IDecisionTreeImpl(asm, mapping, nodeInitialization);

            result.LinkSubtreeError += LinkSubtreeError;

            return(result);
        } //IApplication.NewDescisionTree