示例#1
0
        public ActGenerateFileFromTemplateEditPage(Act act)
        {
            InitializeComponent();
            TemplatesFilesPath = System.IO.Path.Combine(WorkSpace.Instance.Solution.Folder, @"Documents\Templates\");
            OutputFilesPath    = System.IO.Path.Combine(WorkSpace.Instance.Solution.Folder, @"Documents\OutputFiles\");
            this.mAct          = (ActGenerateFileFromTemplate)act;
            GingerCore.General.FillComboFromEnumObj(FileActionComboBox, mAct.FileAction);
            GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(FileActionComboBox, ComboBox.TextProperty, mAct, ActGenerateFileFromTemplate.Fields.FileAction);
            GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(DataFileNameTextBox, TextBox.TextProperty, mAct, ActGenerateFileFromTemplate.Fields.DataFileName);
            TemplateFileNamComboBox.SelectedValue = System.IO.Path.GetFileName(mAct.TemplateFileName) != null?System.IO.Path.GetFileName(mAct.TemplateFileName) : null;

            OutputFileNameTextBox.Init(Context.GetAsContext(mAct.Context), mAct.GetOrCreateInputParam(ActGenerateFileFromTemplate.Fields.OutputFileName));

            FillTemplateFileNamComboBox();
            if (!Directory.Exists(OutputFilesPath))
            {
                Directory.CreateDirectory(OutputFilesPath);
            }
        }
示例#2
0
        public ActGenerateFileFromTemplateEditPage(Act act)
        {
            InitializeComponent();
            TemplatesFilesPath = System.IO.Path.Combine(App.UserProfile.Solution.Folder, @"Documents\Templates\");
            OutputFilesPath    = System.IO.Path.Combine(App.UserProfile.Solution.Folder, @"Documents\OutputFiles\");
            this.mAct          = (ActGenerateFileFromTemplate)act;
            App.FillComboFromEnumVal(FileActionComboBox, mAct.FileAction);
            App.ObjFieldBinding(FileActionComboBox, ComboBox.TextProperty, mAct, ActGenerateFileFromTemplate.Fields.FileAction);
            App.ObjFieldBinding(DataFileNameTextBox, TextBox.TextProperty, mAct, ActGenerateFileFromTemplate.Fields.DataFileName);
            TemplateFileNamComboBox.SelectedValue = System.IO.Path.GetFileName(mAct.TemplateFileName) != null?System.IO.Path.GetFileName(mAct.TemplateFileName) : null;

            OutputFileNameTextBox.Init(mAct.GetOrCreateInputParam(ActGenerateFileFromTemplate.Fields.OutputFileName));

            FillTemplateFileNamComboBox();
            if (!Directory.Exists(OutputFilesPath))
            {
                Directory.CreateDirectory(OutputFilesPath);
            }
        }