/// <summary>
 /// Gets the application categories.
 /// </summary>
 /// <param name="application">The riviera application.</param>
 /// <param name="baseCategories">The nameless base categories.</param>
 /// <returns>The application categories</returns>
 public static CategoryDefinition[] GetApplicationCategories(this RivieraApplication application, CategoryDefinition[] baseCategories)
 {
     return(baseCategories.Union(new CategoryDefinition[]
     {
         new CategoryDefinition(CAT_ROOT, new KeyValuePair <string, string>[]
         {
             new KeyValuePair <string, string>(PROP_PROJECT_NAME, ""),
             new KeyValuePair <string, string>(PROP_3D_MODE_ENABLED, false.ToString()),
             new KeyValuePair <string, string>(PROP_ARNES_ENABLED, true.ToString())
         }),
         new CategoryDefinition(CAT_LOGIN, new KeyValuePair <string, string>[]
         {
             new KeyValuePair <string, string>(PROP_CRED_USERNAME, ""),
             new KeyValuePair <string, string>(PROP_CRED_PASSWORD, ""),
             new KeyValuePair <string, string>(PROP_CRED_COMPANY, ""),
             new KeyValuePair <string, string>(PROP_CRED_PROJECTID, ""),
         }),
         new CategoryDefinition(CAT_DANTE, new KeyValuePair <string, string>[]
         {
             new KeyValuePair <string, string>(PROP_DAN_MDB_PATH, ""),
             new KeyValuePair <string, string>(PROP_DAN_ASOC_PATH, ""),
             new KeyValuePair <string, string>(PROP_DAN_ASOC, ""),
             new KeyValuePair <string, string>(PROP_DAN_MOD_PATH, ""),
             new KeyValuePair <string, string>(PROP_DAN_UNITS, "0"),
         })
     }).ToArray());
 }
 /// <summary>
 /// Creates the oracle connection file.
 /// </summary>
 /// <param name="app">The application.</param>
 public static void CreateOracleConnectionFile(this RivieraApplication app, OracleConnectionData data)
 {
     if (!File.Exists(app.OracleConnectionFile.FullName))
     {
         File.Create(app.OracleConnectionFile.FullName).Close();
     }
     data.Save(app.OracleConnectionFile.FullName);
     app.OracleConnection = data;
 }
        /// <summary>
        /// Initializes the database.
        /// </summary>
        /// <param name="app">The riviera application.</param>
        /// <param name="database">The database to initialize on the application.</param>
        public static void InitDatabase(this RivieraApplication app, params RivieraDatabase[] database)
        {
            var databaseLoaded = app.Database.DatabaseLoaded;

            app.Database = new RivieraDatabase();
            app.Database.DatabaseLoaded = databaseLoaded;
            DesignLine[]            spLines = new DesignLine[] { DesignLine.Bordeo };
            RivieraDesignDatabase[] dbs     = new RivieraDesignDatabase[] { new BordeoDesignDatabase() };
            for (int i = 0; i < spLines.Length; i++)
            {
                app.Database.LineDB.Add(spLines[i], dbs[i]);
            }
            WinAppInitializer win = new WinAppInitializer();

            win.Show();
            app.Database.Init(win);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Sets the path.
        /// </summary>
        /// <param name="app">The application.</param>
        /// <param name="path">The path.</param>
        /// <param name="strPath">The string path.</param>
        public static void SetPath(this RivieraApplication app, DaNTePath path, String strPath)
        {
            switch (path)
            {
            case DaNTePath.DANTE_BASES:
                app[CAT_DANTE][PROP_DAN_MDB_PATH] = strPath;
                break;

            case DaNTePath.ASOC_DIR:
                app[CAT_DANTE][PROP_DAN_ASOC_PATH] = strPath;
                break;

            case DaNTePath.ASOC_MDB:
                app[CAT_DANTE][PROP_DAN_ASOC] = new FileInfo(strPath).Name;
                break;

            case DaNTePath.MOD_DIR:
                app[CAT_DANTE][PROP_DAN_MOD_PATH] = strPath;
                break;
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// Gets the path.
        /// </summary>
        /// <param name="app">The application.</param>
        /// <param name="path">The application desired path.</param>
        /// <returns>The path as string</returns>
        public static string GetPath(this RivieraApplication app, DaNTePath path, string dftl_pth = null)
        {
            string  pth       = null;
            Boolean isDirPath = true;

            switch (path)
            {
            case DaNTePath.DANTE_BASES:
                pth       = app[CAT_DANTE][PROP_DAN_MDB_PATH];
                isDirPath = false;
                break;

            case DaNTePath.ASOC_DIR:
                pth = app[CAT_DANTE][PROP_DAN_ASOC_PATH];
                break;

            case DaNTePath.ASOC_MDB:
                pth       = Path.Combine(app[CAT_DANTE][PROP_DAN_ASOC_PATH], app[CAT_DANTE][PROP_DAN_ASOC]);
                isDirPath = false;
                break;

            case DaNTePath.MOD_DIR:
                pth = app[CAT_DANTE][PROP_DAN_MOD_PATH];
                break;

            case DaNTePath.DANTE_DIR:
                pth = new FileInfo(app[CAT_DANTE][PROP_DAN_MDB_PATH]).DirectoryName;
                break;
            }
            if ((dftl_pth != null) && ((isDirPath && !Directory.Exists(pth)) || (!isDirPath && !File.Exists(pth))))
            {
                return(dftl_pth);
            }
            else
            {
                return(pth);
            }
        }