예제 #1
0
 [Admin] public static bool using_Custom_WebRoot(this TM_FileStorage tmFileStorage)
 {
     admin.demand();
     return(tmFileStorage.notNull() &&
            TM_FileStorage.Custom_WebRoot.notNull() &&
            TM_FileStorage.Custom_WebRoot == tmFileStorage.webRoot());
 }
예제 #2
0
        /*public static string                             path_XmlLibraries(this TM_Xml_Database tmXmlDatabase)
         * {
         *  return TM_FileStorage.Current.notNull() ?  TM_FileStorage.Current.Path_XmlLibraries : null;
         * }*/

        [Admin] public static TM_Xml_Database   tmXmlDatabase(this TM_FileStorage tmFileStorage)
        {
            UserRole.Admin.demand();
            return((tmFileStorage.notNull())
                        ? tmFileStorage.TMXmlDatabase
                        : null);
        }
예제 #3
0
 [Admin] public static TM_Server         tmServer(this TM_FileStorage tmFileStorage)
 {
     UserRole.Admin.demand();
     return((tmFileStorage.notNull())
                 ? tmFileStorage.Server
                 : null);
 }
예제 #4
0
 public static string            path_SiteData(this TM_FileStorage tmFileStorage)
 {
     if (tmFileStorage.notNull())
     {
         return(tmFileStorage.Path_SiteData);
     }
     return(null);
 }
예제 #5
0
 public static string                                xmlDB_Path_Library_XmlFile(this TM_FileStorage tmFileStorage, guidanceExplorer guidanceExplorer)
 {
     if (tmFileStorage.notNull())
     {
         return(tmFileStorage.guidanceExplorers_Paths().value(guidanceExplorer));
     }
     return(null);
 }
예제 #6
0
 /// <summary>
 /// Forces tmFileStorage.Path_UserData to be set to a specific folder
 ///
 /// Note: If <code>path_SiteData</code> folder doesn't exist, the value is not changed
 /// </summary>
 /// <param name="tmFileStorage"></param>
 /// <param name="path_SiteData"></param>
 /// <returns></returns>
 [Admin] public static TM_FileStorage   set_Path_SiteData(this TM_FileStorage tmFileStorage, string path_SiteData)
 {
     admin.demand();
     if (tmFileStorage.notNull() && path_SiteData.folderExists())
     {
         tmFileStorage.Path_SiteData = path_SiteData;
     }
     return(tmFileStorage);
 }
예제 #7
0
 /// <summary>
 /// Forces tmFileStorage.WebRoot to be set to a specific folder
 ///
 /// Note: If <code>webRoot</code> folder doesn't exist, the value is not changed
 /// </summary>
 /// <param name="tmFileStorage"></param>
 /// <param name="webRoot"></param>
 /// <returns></returns>
 [Admin] public static TM_FileStorage   set_WebRoot(this TM_FileStorage tmFileStorage, string webRoot)
 {
     admin.demand();
     if (tmFileStorage.notNull() && webRoot.folderExists())
     {
         tmFileStorage.WebRoot = webRoot;
     }
     return(tmFileStorage);
 }
예제 #8
0
        [Admin] public static bool using_Custom_Path_XmlDatabase(this TM_FileStorage tmFileStorage)
        {
            admin.demand();
            var tmStatus = TM_Status.Current;

            return(tmFileStorage.notNull() &&
                   TM_FileStorage.Custom_Path_XmlDatabase.notNull() &&
                   TM_FileStorage.Custom_Path_XmlDatabase == tmFileStorage.webRoot());
        }
예제 #9
0
 /// <summary>
 /// returns value of tmFileStorage.WebRoot
 /// </summary>
 /// <param name="tmFileStorage"></param>
 /// <returns></returns>
 [Admin] public static string   webRoot(this TM_FileStorage tmFileStorage)
 {
     admin.demand();
     if (tmFileStorage.notNull())
     {
         return(tmFileStorage.WebRoot);
     }
     return(null);
 }
예제 #10
0
 /// <summary>
 /// Forces tmFileStorage.Path_XmlDatabase to be set to a specific folder
 ///
 /// Note: If <code>path_XmlDatabase</code> folder doesn't exist, the value is not changed
 /// </summary>
 /// <param name="tmFileStorage"></param>
 /// <param name="path_XmlDatabase"></param>
 /// <returns></returns>
 [Admin] public static TM_FileStorage   set_Path_XmlDatabase(this TM_FileStorage tmFileStorage, string path_XmlDatabase)
 {
     admin.demand();
     if (tmFileStorage.notNull() && path_XmlDatabase.folderExists())
     {
         tmFileStorage.Path_XmlDatabase = path_XmlDatabase;
     }
     return(tmFileStorage);
 }
예제 #11
0
        /// <summary>
        /// Forces tmFileStorage.Path_UserData to be set to a specific folder
        ///
        /// Note: If <code>path_UserData</code> folder doesn't exist, the value is not changed
        /// </summary>
        /// <param name="tmFileStorage"></param>
        /// <param name="path_UserData"></param>
        /// <returns></returns>
        [Admin] public static TM_FileStorage   set_Path_UserData(this TM_FileStorage tmFileStorage, string path_UserData)
        {
            admin.demand();
            if (tmFileStorage.notNull() && path_UserData.folderExists())
            {
                tmFileStorage.Path_UserData = path_UserData;

                "TeamMentor.Git".assembly()
                .type("TM_UserData_Git_ExtensionMethods")
                .invokeStatic("setup_UserData_Git_Support", tmFileStorage);
            }
            return(tmFileStorage);
        }
예제 #12
0
 /// <summary>
 /// Sets the tmFileStorage.WebRoot
 ///
 /// If the TM_FileStorage.Custom_WebRoot is set and the folder exists, then that value will be used.
 /// If not, TM_FileStorage.Custom_WebRoot will be set to AppDomain.CurrentDomain.BaseDirectory
 /// </summary>
 /// <param name="tmFileStorage"></param>
 /// <returns></returns>
 [Admin] public static TM_FileStorage   set_WebRoot(this TM_FileStorage tmFileStorage)
 {
     admin.demand();
     if (tmFileStorage.notNull())
     {
         if (TM_FileStorage.Custom_WebRoot.folderExists())
         {
             tmFileStorage.WebRoot = TM_FileStorage.Custom_WebRoot;
         }
         else
         {
             tmFileStorage.WebRoot = AppDomain.CurrentDomain.BaseDirectory;
         }
     }
     return(tmFileStorage);
 }
예제 #13
0
 public static TM_UserData       userData(this TM_FileStorage tmFileStorage)
 {
     return(tmFileStorage.notNull()
                 ? tmFileStorage.UserData
                 : null);
 }
예제 #14
0
 /*[Admin] public static string            path_XmlDatabase(this TM_Xml_Database tmDatabase)
  * {
  *  UserRole.Admin.demand();
  *  return TM_FileStorage.Current.path_XmlDatabase();
  * }*/
 [Admin] public static string            path_XmlLibraries(this TM_FileStorage tmFileStorage)
 {
     UserRole.Admin.demand();
     return(tmFileStorage.notNull() ? tmFileStorage.Path_XmlLibraries : null);
 }
예제 #15
0
 public static string                    path_XmlDatabase(this TM_FileStorage tmFileStorage)
 {
     return(tmFileStorage.notNull() ? tmFileStorage.Path_XmlDatabase : null);
 }