Beispiel #1
0
        private static object CreateSettingsForProject(ITreeConfigNode node, IAppProject tt, Dictionary <string, object> dic_apgs, bool isShortVersion)
        {
            TypeBuilder tbAppGen = SettingsTypeBuilder.GetTypeBuilder(); // type builder for app generators

            foreach (var ttt in tt.ListAppProjectGenerators)
            {
                if (!string.IsNullOrWhiteSpace(ttt.PluginGuid))
                {
                    if (!string.IsNullOrWhiteSpace(ttt.PluginGeneratorGuid))
                    {
                        var nds       = (IGetNodeSetting)node;
                        var nsettings = nds.GetSettings(ttt.Guid);
                        dic_apgs[ttt.Name] = nsettings;
                        SettingsTypeBuilder.CreateProperty(tbAppGen, ttt.Name, nsettings.GetType(), ttt.NameUi, ttt.Description);
                    }
                }
            }
            SettingsTypeBuilder.CreateToString(tbAppGen, "Project");
            Type apgsType  = tbAppGen.CreateType();
            var  objAppGen = Activator.CreateInstance(apgsType);

            foreach (var dt in dic_apgs)
            {
                apgsType.InvokeMember(dt.Key, BindingFlags.SetProperty, null, objAppGen, new object[] { dt.Value });
            }
            return(objAppGen);
        }
Beispiel #2
0
        protected override void EndVisit(IAppProject cn)
        {
            var p = (AppProject)cn;

            if (p.IsHasMarkedForDeletion)
            {
                var lst = p.ListAppProjectGenerators.ToList();
                foreach (var t in lst)
                {
                    if (t.IsMarkedForDeletion)
                    {
                        p.ListAppProjectGenerators.Remove(t);
                    }
                }
            }
        }
 public List <ValidationPluginMessage> ValidateOnSelection(IAppProject prj)
 {
     return(new List <ValidationPluginMessage>());
 }
Beispiel #4
0
        public static string GetOuputFilePath(string currentCfgFolderPath, IAppSolution ts, IAppProject tp, string relativePathToGenFolder, string fileName)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append(currentCfgFolderPath);
            var folder = Path.GetDirectoryName(ts.RelativeAppSolutionPath);

            if (folder?.Length > 0)
            {
                sb.Append(folder);
                sb.Append("\\");
            }
            folder = Path.GetDirectoryName(tp.RelativeAppProjectPath);
            if (folder?.Length > 0)
            {
                sb.Append(folder);
                sb.Append("\\");
            }
            if (!string.IsNullOrWhiteSpace(relativePathToGenFolder))
            {
                sb.Append(relativePathToGenFolder);
                if (relativePathToGenFolder[relativePathToGenFolder.Length - 1] != '\\')
                {
                    sb.Append("\\");
                }
            }
            sb.Append(fileName);
            return(sb.ToString());
        }
Beispiel #5
0
 public static string GetOuputFilePath(string currentCfgFolderPath, IAppSolution ts, IAppProject tp, IAppProjectGenerator tpg, string fileName)
 {
     return(GetOuputFilePath(currentCfgFolderPath, ts, tp, tpg.RelativePathToGenFolder, fileName));
 }
Beispiel #6
0
 protected virtual void BeginVisit(IAppProject tt)
 {
 }
Beispiel #7
0
 protected virtual void EndVisit(IAppProject tt)
 {
 }