Beispiel #1
0
        private void CopyFiles()
        {
            string currentDirectory = DirHandler.Instance.CurrentDirectory;

            // Copy Css files from the Repository dir to the Output Css dir...
            FileAccesser.CopyFile(Path.Combine(currentDirectory, Ids.REPOSITORY_DIR, Ids.CSS_DIR, Ids.COMMON_CSS_FILE), Path.Combine(OutputRootDir, Ids.OUTPUT_DIR, Ids.CSS_DIR, Ids.COMMON_CSS_FILE));

            // Copy Images from the Repository dir to the Output Images dir...
            FileAccesser.CopyFile(Path.Combine(currentDirectory, Ids.REPOSITORY_DIR, Ids.IMAGES_DIR, Ids.PLUS_PNG_FILE), Path.Combine(OutputRootDir, Ids.OUTPUT_DIR, Ids.IMAGES_DIR, Ids.PLUS_PNG_FILE));
            FileAccesser.CopyFile(Path.Combine(currentDirectory, Ids.REPOSITORY_DIR, Ids.IMAGES_DIR, Ids.MINUS_PNG_FILE), Path.Combine(OutputRootDir, Ids.OUTPUT_DIR, Ids.IMAGES_DIR, Ids.MINUS_PNG_FILE));

            // Copy js files from the Repository dir to the Output JavaScript dir...
            FileAccesser.CopyFile(Path.Combine(currentDirectory, Ids.REPOSITORY_DIR, Ids.JAVASCRIPT_DIR, Ids.COMMON_JS_FILE), Path.Combine(OutputRootDir, Ids.OUTPUT_DIR, Ids.JAVASCRIPT_DIR, Ids.COMMON_JS_FILE));

            // Copy xslt files from the Repository dir to the Output XSLT dir...
            FileAccesser.CopyFile(Path.Combine(currentDirectory, Ids.REPOSITORY_DIR, Ids.XSLT_DIR, Ids.ALL_MATCHES_XSLT_FILE), Path.Combine(OutputRootDir, Ids.OUTPUT_DIR, Ids.XSLT_DIR, Ids.ALL_MATCHES_XSLT_FILE));
            FileAccesser.CopyFile(Path.Combine(currentDirectory, Ids.REPOSITORY_DIR, Ids.XSLT_DIR, Ids.ALL_PROJECT_DEFINITIONS_XSLT_FILE), Path.Combine(OutputRootDir, Ids.OUTPUT_DIR, Ids.XSLT_DIR, Ids.ALL_PROJECT_DEFINITIONS_XSLT_FILE));
            FileAccesser.CopyFile(Path.Combine(currentDirectory, Ids.REPOSITORY_DIR, Ids.XSLT_DIR, Ids.ALL_CATEGORY_DEFINITIONS_XSLT_FILE), Path.Combine(OutputRootDir, Ids.OUTPUT_DIR, Ids.XSLT_DIR, Ids.ALL_CATEGORY_DEFINITIONS_XSLT_FILE));
            FileAccesser.CopyFile(Path.Combine(currentDirectory, Ids.REPOSITORY_DIR, Ids.XSLT_DIR, Ids.ALL_RULE_DEFINITIONS_XSLT_FILE), Path.Combine(OutputRootDir, Ids.OUTPUT_DIR, Ids.XSLT_DIR, Ids.ALL_RULE_DEFINITIONS_XSLT_FILE));
            FileAccesser.CopyFile(Path.Combine(currentDirectory, Ids.REPOSITORY_DIR, Ids.XSLT_DIR, Ids.ALL_CATEGORY_DECLARATIONS_XSLT_FILE), Path.Combine(OutputRootDir, Ids.OUTPUT_DIR, Ids.XSLT_DIR, Ids.ALL_CATEGORY_DECLARATIONS_XSLT_FILE));
            FileAccesser.CopyFile(Path.Combine(currentDirectory, Ids.REPOSITORY_DIR, Ids.XSLT_DIR, Ids.ALL_LANGUAGE_DECLARATIONS_XSLT_FILE), Path.Combine(OutputRootDir, Ids.OUTPUT_DIR, Ids.XSLT_DIR, Ids.ALL_LANGUAGE_DECLARATIONS_XSLT_FILE));
            FileAccesser.CopyFile(Path.Combine(currentDirectory, Ids.REPOSITORY_DIR, Ids.XSLT_DIR, Ids.ALL_RULE_DECLARATIONS_XSLT_FILE), Path.Combine(OutputRootDir, Ids.OUTPUT_DIR, Ids.XSLT_DIR, Ids.ALL_RULE_DECLARATIONS_XSLT_FILE));
            FileAccesser.CopyFile(Path.Combine(currentDirectory, Ids.REPOSITORY_DIR, Ids.XSLT_DIR, Ids.TOC_XSLT_FILE), Path.Combine(OutputRootDir, Ids.OUTPUT_DIR, Ids.XSLT_DIR, Ids.TOC_XSLT_FILE));
            FileAccesser.CopyFile(Path.Combine(currentDirectory, Ids.REPOSITORY_DIR, Ids.XSLT_DIR, Ids.SUMMARY_XSLT_FILE), Path.Combine(OutputRootDir, Ids.OUTPUT_DIR, Ids.XSLT_DIR, Ids.SUMMARY_XSLT_FILE));
            FileAccesser.CopyFile(Path.Combine(currentDirectory, Ids.REPOSITORY_DIR, Ids.XSLT_DIR, Ids.SUB_TOC_XSLT_FILE), Path.Combine(OutputRootDir, Ids.OUTPUT_DIR, Ids.XSLT_DIR, Ids.SUB_TOC_XSLT_FILE));
            FileAccesser.CopyFile(Path.Combine(currentDirectory, Ids.REPOSITORY_DIR, Ids.XSLT_DIR, Ids.FILES_SEARCHED_XSLT_FILE), Path.Combine(OutputRootDir, Ids.OUTPUT_DIR, Ids.XSLT_DIR, Ids.FILES_SEARCHED_XSLT_FILE));

            // Copy xml files from the Repository dir to the Output dir (empty fallback files)...
            FileAccesser.CopyFile(Path.Combine(currentDirectory, Ids.REPOSITORY_DIR, Ids.SUMMARY_FILE), Path.Combine(OutputRootDir, Ids.OUTPUT_DIR, Ids.SUMMARY_FILE));
            FileAccesser.CopyFile(Path.Combine(currentDirectory, Ids.REPOSITORY_DIR, Ids.SUB_TOC_XML_FILE), Path.Combine(OutputRootDir, Ids.OUTPUT_DIR, Ids.SUB_TOC_XML_FILE));

            // Copy index file from the Repository dir to the Output dir...
            FileAccesser.CopyFile(Path.Combine(currentDirectory, Ids.REPOSITORY_DIR, Ids.INDEX_HTML_FILE), Path.Combine(OutputRootDir, Ids.OUTPUT_DIR, Ids.INDEX_HTML_FILE));
        }
        private string LoadFile(string filename)
        {
            FileAccesser fa = new FileAccesser(filename);

            fa.Load();
            return(fa.InputBuffer);
        }
Beispiel #3
0
 private void CreateDirectories()
 {
     // Create the needed directories...
     FileAccesser.CreateFullPath(Path.Combine(OutputRootDir, Ids.OUTPUT_DIR, Ids.CSS_DIR));
     FileAccesser.CreateFullPath(Path.Combine(OutputRootDir, Ids.OUTPUT_DIR, Ids.IMAGES_DIR));
     FileAccesser.CreateFullPath(Path.Combine(OutputRootDir, Ids.OUTPUT_DIR, Ids.JAVASCRIPT_DIR));
     FileAccesser.CreateFullPath(Path.Combine(OutputRootDir, Ids.OUTPUT_DIR, Ids.XSLT_DIR));
 }
        public XmlConfigLoaderProduct(ConfigManager manager) : base(manager)
        {
            Doc = null;
            IsConfigFileValid = true;


            string currentDirectory = DirHandler.Instance.CurrentDirectory;

            RulesConfigFilePath   = Path.Combine(currentDirectory, Ids.CONFIG_DIR, Ids.RULES_CONFIG_FILE);
            RulesConfigSchemaPath = Path.Combine(currentDirectory, Ids.CONFIG_DIR, Ids.RULES_CONFIG_SCHEMA_FILE);

            // Check the for existence of the configuration file...
            if (string.IsNullOrWhiteSpace(RulesConfigFilePath) || !File.Exists(RulesConfigFilePath))
            {
                // Copy default configuration file 'rules.config' from the 'Repository\examples\' to current execution dir...
                FileAccesser.CopyFile(Path.Combine(currentDirectory, Ids.REPOSITORY_DIR, Ids.EXAMPLES_DIR, Ids.RULES_CONFIG_FILE), Path.Combine(currentDirectory, Ids.CONFIG_DIR, Ids.RULES_CONFIG_FILE));

                string warnTxt = string.Format("Unable to find the configuration file. Expected to find it here: {0}. Created default file for entering settings in. Change the content of the configuration file {1} and run the application again.", RulesConfigFilePath, Ids.RULES_CONFIG_FILE);
                Log.Warning(warnTxt);

                throw new InitializationException(this, -1, warnTxt);
            }

            // Check for existence of the schema file for the configuration file...
            if (string.IsNullOrWhiteSpace(RulesConfigSchemaPath) || !File.Exists(RulesConfigSchemaPath))
            {
                string s = string.Format("Unable to find the schema validation file for the configuration file. Expected to find the schema validation file here: {0}.", RulesConfigSchemaPath);
                Log.Error(s);

                throw new InitializationException(this, -1, s);
            }

            // Load the configuration file and place the content of it in a XDocument...
            Doc = LoadConfigurationFile();
            if (Doc == null)
            {
                throw new NullReferenceException("Failed to load the configuration file.");
            }
        }
Beispiel #5
0
 private string LoadFile(string filename)
 {
     FileAccesser fa = new FileAccesser(filename);
       fa.Load();
       return fa.InputBuffer;
 }
Beispiel #6
0
 public void InitStage2()
 {
     m_FileAccesser = new FileAccesser(applicationContext);
     m_PLCalcDataVstr.FileAccesser = m_FileAccesser;
     m_RelayFileAccess = new RelayFileAccesser(applicationContext);
     m_GetRelayUEPathLoss.RelayFileAccesser = m_RelayFileAccess;
     ((PLCalcDataMngr)m_PLCalcDataMngr).FileAccesser = m_FileAccesser;
     ((PLCalcDataMngr)m_PLCalcDataMngr).RelayFileAccesser = m_RelayFileAccess;
     ICalcGain gain = ServiceHelper.Lookup<ICalcGain>(applicationContext);
     m_PLCalcDataVstr.AntennaGainCalculator = gain;
     m_ModelsMngr.PropModelCategoryList = m_PropModelCollection.PropModelCategoryList;
     m_PropModelCategoryList = m_ModelsMngr.PropModelCategoryList;
     propModelTreeUserControl.PropModelCollection = m_PropModelCollection;
     m_ModelsMngr.PropModelTree.NEPropagation = ServiceHelper.Lookup<IPropagation>(applicationContext);
     m_PropModelCollection.GisClutterDictionary = m_GeoDataObserver.GisClutterDictionary;
     m_ModelsMngr.PropModelTree.GeoDataObserver = m_GeoDataObserver;
     ((PathLosCalcMethod) m_IPTPLossCalcMethod).PropationModelMng = m_PropMng;
     ((PathLosCalcMethod) m_IPTPLossCalcMethod).GeoDataProvider = m_GeoDataObserver;
     ((PathLosCalcMethod) m_IPTPLossCalcMethod).Init();
     ((BackhaulPLCalc)m_BackhaulPLCalc).PropationModelMng = m_PropMng;
     ((BackhaulPLCalc)m_BackhaulPLCalc).GeoDataProvider = m_GeoDataObserver;
     ((BackhaulPLCalc)m_BackhaulPLCalc).Init();
     InitCellNeList();
     InitPropModels();
     m_PLCalcDataVstr.PLCalcCollection = ((PathLosCalcMethod) m_IPTPLossCalcMethod).PLCalcCollection;
 }