コード例 #1
0
ファイル: EditorWindow.xaml.cs プロジェクト: sunfom/DeXign
        private async void Deploy_Execute(object sender, ExecutedRoutedEventArgs e)
        {
            var proj = this.Model.SelectedProject;

            if (proj == null)
            {
                MessageBox.Show("대상 프로젝트를 찾을 수 없습니다.", "DeXign", MessageBoxButton.OK);
                return;
            }

            this.BeginDebugging("업로드중...");

            await t.Task.Delay(200);

            // 저장
            proj.Save();

            var jsLogicUnit = new LogicGeneratorUnit(GlobalModel.Instance.SelectedProject.ServerComponents);
            var jsGenerator = new JSGenerator(jsLogicUnit, null, null);

            string[] jsFunctions = jsGenerator.Generate().ToArray();

            for (int i = 0; i < jsFunctions.Length; i++)
            {
                var res = await DXLambda.Deploy(GlobalModel.Instance.User, jsFunctions[i]);

                GlobalModel.Instance.CompileProgress = (i + 1d) / jsFunctions.Length;
            }

            this.EndDebugging();

            await t.Task.Delay(200);

            GlobalModel.Instance.IsDebugging = false;
        }
コード例 #2
0
        private static CSharpGenerator CreateLogicGenerator(DXCompileParameter parameter)
        {
            var logicUnit = new LogicGeneratorUnit(parameter.Components);

            var assemblyInfo = new CodeGeneratorAssemblyInfo()
            {
                Title = parameter.Option.ApplicationName
            };

            var manifest = new CodeGeneratorManifest()
            {
                RootNamespace   = parameter.Option.RootNamespace,
                ApplicationName = parameter.Option.ApplicationName
            };

            // Logic Generator
            return(new CSharpGenerator(
                       logicUnit,
                       manifest,
                       assemblyInfo));
        }
コード例 #3
0
ファイル: WPFCompiler.cs プロジェクト: sunfom/DeXign
        private static CSharpGenerator CreateTemplateLogicGenerator(DXCompileParameter parameter)
        {
            // Template 컴포넌트 구분 필요함
            var logicUnit = new LogicGeneratorUnit(Enumerable.Empty <PBinderHost>());

            var assemblyInfo = new CodeGeneratorAssemblyInfo()
            {
                Title = parameter.Option.ApplicationName
            };

            var manifest = new CodeGeneratorManifest()
            {
                RootNamespace   = parameter.Option.RootNamespace,
                ApplicationName = parameter.Option.ApplicationName
            };

            // Logic Generator
            return(new CSharpGenerator(
                       logicUnit,
                       manifest,
                       assemblyInfo));
        }