Beispiel #1
0
 public void OnSelecType(string typeName)
 {
     config.selectedType = typeName;
     selectedType        = ReflectUtils.GetTypeByName(typeName);
     selectedProperties  = selectedType.GetUIManProperties();
     baseTypePopup       = new EditablePopup(arrSupportType, selectedType.BaseType.Name, OnChangeBaseType);
     currentScriptPath   = CodeGenerationHelper.GetScriptPathByType(selectedType);
     handlerScriptPath   = CodeGenerationHelper.GeneratPathWithSubfix(currentScriptPath, ".Handler.cs");
     CachePropertiesDrawer();
 }
Beispiel #2
0
        public void GenerateViewModelHandler(string scriptPath)
        {
            string handlerScriptPath = CodeGenerationHelper.GeneratPathWithSubfix(scriptPath, ".Handler.cs");
            string handlerCode       = "";

            if (string.IsNullOrEmpty(handlerCode))
            {
                handlerCode = CodeGenerationHelper.GenerateViewModelHandler(typeName, baseType);
            }
            else
            {
                handlerCode = handlerCode.Replace(": " + typeName, ": " + baseType);
            }
            CodeGenerationHelper.SaveScript(handlerScriptPath, handlerCode, false, typeName, baseType);
        }