Esempio n. 1
0
        public InputDataSource(RowCollectionMenager rowCollectionMenager, SettingsMenager2 settingsMenager2)
        {
            InitializeComponent();
            this.rowCollectionMenager = rowCollectionMenager;
            this.settingsMenager2 = settingsMenager2;
            cbDataSource.SelectedIndex = 0;

            try
            {
                ///
                ///   ovo extraktirati u metodu ili u klasu od data object menagera nekoga
                ///
                ///
                string dataObjectPath = Common.BuildPath(GenericTemplate.moduleParams.DataPath, GenericTemplate.constModuleDataFolder, GenericTemplate.constDataObjectsFolder);
                string fileName;
                string[] fileList = Directory.GetFiles(dataObjectPath, "*.xml");

                foreach (string item in fileList)
                {
                    fileName = Common.ExtractFileFromPath(item);
                    fileName = fileName.Replace(".xml", "");
                    lbDataObjectList.Items.Add(fileName);
                }

                LoadSettingsFromSettingsMenager();
            }
            catch (Exception ex)
            {
                ModuleLog.Write(ex, this, "InputDataSource", ModuleLog.LogType.ERROR);
            }
        }
Esempio n. 2
0
 public static void Init()
 {
     if (settings == null)
     {
         settings = new SettingsMenager2(GenericTemplate.constModuleName, "UberToolsModule", "1.0.0.0");
     }
 }
 public SettingsMenagerStructure2(string name, string hardName, string value, string defaultValue, SettingsMenager2.Type type)
 {
     this.name = name;
     this.hardName = hardName;
     this.type = type;
     this.value = value;
     this.defaultValue = defaultValue;
 }
        public TemplatesManager(TreeView treeView, string templateFolder, SettingsMenager settingsMenager, SettingsMenager2 settingsMenager2)
        {
            this.treeView = treeView;
            this.templateFolder = templateFolder;
            this.settingsManager = settingsMenager;

            this.settingsManager2 = settingsMenager2;
            try
            {
                // make template folder
                Common.MakeAllSubFolders(templateFolder);
            }
            catch (Exception ex)
            {
                ModuleLog.Write(ex, this, "TemplatesManager", ModuleLog.LogType.ERROR);
            }
        }
Esempio n. 5
0
        public ModuleMainForm()
        {
            string templateFolder;
            InitializeComponent();

            try
            {
                // init mode settings
                Settings.Init();
                Settings.Setting.LoadFromFile(Common.BuildPath(GenericTemplate.moduleParams.DataPath, GenericTemplate.constModuleDataFolder) + Settings.FILE_NAME);

                // init and load tagsStorage object
                TagsLoader tagsLoader = new TagsLoader(Common.BuildPath(GenericTemplate.moduleParams.DataPath, GenericTemplate.constModuleDataFolder) + GenericTemplate.constTagsXMLFileName);
                this.tagsStorage = tagsLoader.LoadTags();

                // WindwosTools controls
                twtToolsWindowsTemplates = new ToolsWindowsTemplates();
                twttoolsWindowsTags = new ToolsWindowsTags(this.tagsStorage);
                twttoolsWindowsTags.AddControl(tbtemplateHeader);
                twttoolsWindowsTags.AddControl(tbtemplateBody);
                twttoolsWindowsTags.AddControl(tbtemplateFooter);
                twttoolsWindowsTags.AddControl(tbTemplateVariables);
                twttoolsWindowsTags.AddControl(tbTemplateComment);
                twttoolsWindowsTags.AddControl(tbFileDestinationFolder);
                twttoolsWindowsTags.AddControl(tbFileDestinationFile);

                // general default settings
                cbDataDestination.SelectedIndex = 0;

                // set icon
                this.Icon = global::UberTools.Modules.GenericTemplate.Properties.Resources.WindowsTable;

                // create settings menager object and add all controls
                templateFolder = Common.BuildPath(GenericTemplate.moduleParams.DataPath, GenericTemplate.constModuleDataFolder, GenericTemplate.constTemplateFolder);
                settingsMenager = new SettingsMenager();
                settingsMenager.Add(tbtemplateBody);
                settingsMenager.Add(tbtemplateHeader);
                settingsMenager.Add(tbtemplateFooter);
                settingsMenager.Add(tbTemplateVariables);
                settingsMenager.Add(tbTemplateComment);
                settingsMenager.Add(tbFileDestinationFolder);
                settingsMenager.Add(tbFileDestinationFile);
                settingsMenager.Add(chbDestinationFileAppend);
                settingsMenager.Add(cbDataDestination);
                settingsMenager.Add(cbEncoding);

                //// create settings menager version 2 object and add all controls
                settingsMenager2 = new SettingsMenager2(GenericTemplate.constModuleName, "UberToolsModule", "1.0.0.0");
                //settingsMenager2.Items.Add(new SettingsMenagerStructure2(tbtemplateBody, "tbtemplateBody", SettingsMenager2.Type.Textbox));
                settingsMenager2.Refresh += new EventHandler(settingsMenager2_Refresh);
                settingsMenager2.Update += new EventHandler(settingsMenager2_Update);

                // new instance template menager
                templatesMenager = new TemplatesManager(twtToolsWindowsTemplates.TreeViewControl, templateFolder, settingsMenager, settingsMenager2);
                this.twtToolsWindowsTemplates.ImageListControl = this.ilGeneral;
                templatesMenager.LoadAll();

                // set templateMenager to templateControl
                twtToolsWindowsTemplates.TemplatesMenager = templatesMenager;
                this.twtToolsWindowsTemplates.ImageListControl = this.ilGeneral;

                // Create new rowCollection object and bound it to container
                rowCollectionMenager = new RowCollectionMenager(panel1, this.settingsMenager2);
                foreach (EncodingMenager encoding in EncodingMenager.GetEnumerator())
                {
                    cbEncoding.Items.Add(encoding);
                }
                cbEncoding.SelectedIndex = cbEncoding.Items.Count - 2;

                // new instance of hoveringwindows
                autoComplete = new AutoComplete(this, this.tagsStorage);
                autoComplete.AddControl(tbtemplateHeader);
                autoComplete.AddControl(tbtemplateBody);
                autoComplete.AddControl(tbtemplateFooter);
                autoComplete.AddControl(tbTemplateVariables);
                autoComplete.AddControl(tbTemplateComment);
                autoComplete.AddControl(tbFileDestinationFolder);
                autoComplete.AddControl(tbFileDestinationFile);

                //// syntax color init
                //colorMenager = new ColorMenager_old();
                //colorMenager.Controls.Add(tbTemplateVariables);

                // SyntaxHighlightingMenager settings
                syntaxHighlightingMenager = new SyntaxHighlightingMenager(tagsStorage);
                syntaxHighlightingMenager.Controls.Add(tbTemplateVariables);
                syntaxHighlightingMenager.Controls.Add(tbtemplateBody);
                syntaxHighlightingMenager.Controls.Add(tbtemplateHeader);
                syntaxHighlightingMenager.Controls.Add(tbtemplateFooter);
                syntaxHighlightingMenager.Controls.Add(tbFileDestinationFolder);
                syntaxHighlightingMenager.Controls.Add(tbFileDestinationFile);

                // load last loadet template
                if (Settings.Setting.LoadSetting(Settings.SettingName.ActiveTemplateName.ToString(), "") != "")
                {
                    templatesMenager.Load(Settings.Setting.LoadSetting(Settings.SettingName.ActiveTemplateName.ToString(), ""));
                }

            }
            catch (Exception ex)
            {
                ModuleLog.Write(ex, this, "ModuleMainForm", ModuleLog.LogType.ERROR);
            }
        }