Beispiel #1
0
        /// <summary>
        /// 根据CodeGenID找到关联信息打开编辑器,如果是内建编辑器会找不到CodeGen信息 这时候再重写一下GetCodeGen函数即可
        /// </summary>
        /// <param name="codeGenID"></param>
        /// <returns></returns>
        public virtual IMultipleWindow OpenOutlinkWindow(int codeGenID)
        {
            //TODO: 这里先暂时这样处理
            var editorName = EditorConfig.GetCodeGenConfig().SearchByOrderKey(codeGenID).EditorName;

            IMultipleWindow e = Data.CurrentAssembly.CreateInstance(editorName) as IMultipleWindow;

            return(e);
        }
 public override CodeGen GetCodeGenInfo()
 {
     return(EditorConfig.GetCodeGenConfig().SearchByOrderKey(42));
 }
Beispiel #3
0
        /// <summary>
        /// 重新加载外链类缓存
        /// </summary>
        protected virtual void ReloadOutLinkChache()
        {
            if (outLinkRawData == null)
            {
                outLinkRawData = new Dictionary <int, object>();
            }
            else
            {
                outLinkRawData.Clear();
            }

            for (int i = 0; i < Data.CurrentClassFieldsCache.Count; i++)
            {
                //Bug fix: 自动做默认参数初始化
                if (Data.CurrentClassFieldsCache[i].config_editor_setting == null)
                {
                    Data.CurrentClassFieldsCache[i].config_editor_setting = new ControlProperty();
                    continue;
                }

                if (outLinkRawData.ContainsKey(Data.CurrentClassFieldsCache[i].config_editor_setting.OutCodeGenEditorID))
                {
                    continue;
                }

                if (Data.CurrentClassFieldsCache[i].config_editor_setting.OutCodeGenEditorID == 0)
                {
                    continue;
                }


                //重写外联编辑器逻辑
                var codeGenInfo = EditorConfig.GetCodeGenConfig()
                                  .SearchByOrderKey(Data.CurrentClassFieldsCache[i].config_editor_setting.OutCodeGenEditorID);

                if (codeGenInfo == null)
                {
                    Log("Can't find id In CodeGen Table" + Data.CurrentClassFieldsCache[i].config_editor_setting.OutCodeGenEditorID);
                    continue;
                }

                //查找非编辑器命名控件下
                Type classType = ReflectionHelper.GetCurrentAssemblyType(codeGenInfo.ClassType);

                //查找编辑器命名控件下
                if (classType == null)
                {
                    classType = GetType(codeGenInfo.ClassType);
                }


                if (classType == null)
                {
                    Log("Can't find calss " + codeGenInfo.ClassType);
                    continue;
                }

                var modelRaw = ConfigContainerFactory.GetInstance(codeGenInfo.ContainerType)
                               .LoadConfig(classType, codeGenInfo.InOutPath);

                if (modelRaw == null)
                {
                    Log(string.Format("Loading OutLink Class [{0}] Data failed !", codeGenInfo.ClassType));
                    return;
                }

                outLinkRawData.Add(Data.CurrentClassFieldsCache[i].config_editor_setting.OutCodeGenEditorID, modelRaw);

                Log(string.Format("Loading OutLink Class [{0}] Data Success !", codeGenInfo.ClassType));
            }
        }