Ejemplo n.º 1
0
        private void GenModelCode(object sender, EventArgs args)
        {
            var codeFrm = new ShowCodeFrm();
            var model   = ModelManager.Instance().GetModel(this.FileId.Value);
            //var ns = "";
            //var p = this.Parent as FolderNode;
            //if (p != null)
            //{
            //    ns = p.NameSpace;
            //}

            var module = ModelManager.Instance().MakeSureParseModule(model.File);

            if (module == null)
            {
                System.Windows.Forms.MessageBox.Show("模块还没解析");
                return;
            }

            var builder = new IndentStringBuilder();

            //module.NameSpace = ns;
            ((WorkflowDB)module).RenderModel(builder);
            codeFrm.SetText(builder.ToString());
            codeFrm.Show();
        }
Ejemplo n.º 2
0
        private void ValidateModel(object sender, EventArgs args)
        {
            var codeFrm = new ShowCodeFrm();
            var model   = ModelManager.Instance().GetModel(this.FileId.Value);

            var module  = ModelManager.Instance().MakeSureParseModule(model.File);
            var builder = new IndentStringBuilder();

            ((ViewModelDB)module).Render(builder);
            codeFrm.SetText(builder.ToString());
            codeFrm.Show();
        }
Ejemplo n.º 3
0
        private void ValidateModel(object sender, EventArgs args)
        {
            var codeFrm = new ShowCodeFrm();
            var model   = ModelManager.Instance().GetModel(this.FileId.Value);

            var module = ModelManager.Instance().MakeSureParseModule(model.File);

            if (module == null)
            {
                System.Windows.Forms.MessageBox.Show("模块还未生成");
                return;
            }

            var builder = new IndentStringBuilder();

            ((WorkflowDB)module).Render(builder);
            codeFrm.SetText(builder.ToString());
            codeFrm.Show();
        }
Ejemplo n.º 4
0
        void eventSource_Generate(BaseNode node, StringBuilder builder)
        {
            var frm = new ShowCodeFrm();

            frm.SetText(builder.ToString());
            frm.ShowDialog();
            //this.panelOutput.Controls.Clear();
            ////this.panelWorkArea.Controls.Remove(this.textEditor);
            //this.textEditor = new TextEditorControl();
            //this.textEditor.Dock = DockStyle.Fill;
            //this.panelOutput.Controls.Add(this.textEditor);
            //this.textEditor.Document.HighlightingStrategy = HighlightingStrategyFactory.CreateHighlightingStrategy("C#");
            ////this.textEditor.Document.Remove(0, this.textEditor.Document.TextLength);
            ////this.textEditor.Validate();
            ////this.textEditor.Update();
            ////this.textEditor.ActiveTextAreaControl.TextArea.Update();
            //this.textEditor.Document.TextContent = builder.ToString();
            ////this.textEditor.Text = builder.ToString();
        }
Ejemplo n.º 5
0
        private void Mnu_GenerateDBCode(object sender, EventArgs args)
        {
            var codeFrm = new ShowCodeFrm();
            var model   = ModelManager.Instance().GetModel(this.FileId.Value);
            var module  = ModelManager.Instance().MakeSureParseModule(model.File);

            if (module == null)
            {
                System.Windows.Forms.MessageBox.Show("模块还没解析");
                return;
            }

            var builder = new IndentStringBuilder();

            //module.NameSpace = ns;
            ((DmModelDB)module).RenderSql(builder);
            codeFrm.SetText(builder.ToString());
            codeFrm.Show();
        }
Ejemplo n.º 6
0
 void eventSource_Generate(BaseNode node, StringBuilder builder)
 {
     var frm = new ShowCodeFrm();
     frm.SetText(builder.ToString());
     frm.ShowDialog();
     //this.panelOutput.Controls.Clear();
     ////this.panelWorkArea.Controls.Remove(this.textEditor);
     //this.textEditor = new TextEditorControl();
     //this.textEditor.Dock = DockStyle.Fill;
     //this.panelOutput.Controls.Add(this.textEditor);
     //this.textEditor.Document.HighlightingStrategy = HighlightingStrategyFactory.CreateHighlightingStrategy("C#");
     ////this.textEditor.Document.Remove(0, this.textEditor.Document.TextLength);
     ////this.textEditor.Validate();
     ////this.textEditor.Update();
     ////this.textEditor.ActiveTextAreaControl.TextArea.Update();
     //this.textEditor.Document.TextContent = builder.ToString();
     ////this.textEditor.Text = builder.ToString();
 }