コード例 #1
0
 public static bool library_Install_From_Zip(this TM_Proxy tmProxy, string zipFile)
 {
     return(tmProxy.invoke_Static <bool>(typeof(FileStorage_Libraries),
                                         "xmlDB_Libraries_ImportFromZip",
                                         tmProxy.TmFileStorage,
                                         zipFile, ""));
 }
コード例 #2
0
        public static bool  library_Delete(this  TM_Proxy tmProxy, string libraryName)
        {
            var library = tmProxy.TmXmlDatabase.tmLibrary(libraryName);

            if (library.isNull())
            {
                return(false);
            }
            return(tmProxy.invoke_Static <bool>(typeof(TM_Xml_Database_ExtensionMethods_XmlDataSources_GuidanceExplorer),
                                                "xmlDB_DeleteGuidanceExplorer",
                                                tmProxy.TmXmlDatabase,
                                                library.Id));
        }
コード例 #3
0
        public static TBot_Brain tbot_Brain(this TM_Proxy tmProxy)
        {
            if (tmProxy.isNull())
            {
                return(null);
            }
            var tbotBrain = tmProxy.invoke_Static <TBot_Brain>(typeof(TBot_Brain), "Create");

            if (tmProxy.tbot_Brain_TBotScriptsFolder().folder_Not_Exists())
            {
                var path_TBotScripts = tmProxy.apiCassini.webRoot().pathCombine("Tbot");
                tmProxy.tbot_Brain_TBotScriptsFolder(path_TBotScripts);
                tmProxy.tbot_Brain_SetAvailableScripts();
            }
            return(tbotBrain);
        }
コード例 #4
0
        [Test] public void invoke_Static()
        {
            tmProxy.invoke_Static <string>   (typeof(TM_Status), "get_Version").assert_Not_Null()
            .assert_Equal(typeof(TM_Status).assembly().version());
            tmProxy.invoke_Static <TM_Status>(typeof(TM_Status), "get_Current").assert_Not_Null();

            tmProxy.invoke_Static <int>(typeof(TM_Status), "get_Version").assert_Default();      // bad cast
            tmProxy.invoke_Static <TM_Status>(typeof(TM_Status), "get_Version").assert_Null();   // bad cast
            tmProxy.invoke_Static <string>   (typeof(TM_Status), "get_Current").assert_Null();   // bad cast
            tmProxy.invoke_Static <string>(typeof(TM_Status), "get_AAAAAAA").assert_Null();      // bad method
        }
コード例 #5
0
        public static AuthToken     user_AuthToken_Add(this TM_Proxy tmProxy, TMUser tmUser)
        {
            //var authToken = tmProxy.invoke_Static(typeof(TokenAuthentication_ExtensionMethods), "add_AuthToken", tmUser);

            return(tmProxy.invoke_Static <AuthToken>(typeof(TokenAuthentication_ExtensionMethods), "add_AuthToken", tmUser));
        }
コード例 #6
0
 public static TMUser  user(this TM_Proxy tmProxy, string userName)
 {
     return(tmProxy.invoke_Static <TMUser>(typeof(TM_UserData_Ex_Users), "tmUser", userName));
 }
コード例 #7
0
 public static TMUser  user(this TM_Proxy tmProxy, int userId)
 {
     return(tmProxy.invoke_Static <TMUser>(typeof(TM_UserData_Ex_Users), "tmUser", userId));
 }
コード例 #8
0
 public static TMUser        user_Make_Admin(this TM_Proxy tmProxy, TMUser tmUser)
 {
     return(tmProxy.invoke_Static <TMUser>(typeof(TMUser_ExtensionMethods), "make_Admin", tmUser));
 }
コード例 #9
0
 public static bool          user_Logout(this TM_Proxy tmProxy, TMUser tmUser)
 {
     return(tmProxy.invoke_Static <bool>(typeof(TM_UserData_Ex_ActiveSessions), "logout", tmUser));
 }
コード例 #10
0
 public static TResult                   invoke_Static <TResult>  (this TM_Proxy tmProxy, Type targetType, string staticMethod, params object[] invocationParameters)
 {
     return(tmProxy.invoke_Static(targetType, staticMethod, invocationParameters)
            .cast <TResult>());
 }
コード例 #11
0
 public static string                    cache_Reload__Data(this TM_Proxy tmProxy)
 {
     tmProxy.gui_ResetCache();
     return(tmProxy.invoke_Static <string>(typeof(TM_Xml_Database_FileStorage), "reloadData", tmProxy.TmFileStorage));
 }
コード例 #12
0
 public static TResult                   get_Property_Static <T, TResult>(this TM_Proxy tmProxy, string propertyName)
 {
     return(tmProxy.invoke_Static <TResult>(typeof(T), "get_{0}".format(propertyName.upperCaseFirstLetter())));
 }
コード例 #13
0
 public static Dictionary <string, string> tbot_Brain_SetAvailableScripts(this TM_Proxy tmProxy)
 {
     return(tmProxy.invoke_Static <Dictionary <string, string> >(typeof(TBot_Brain), "SetAvailableScripts"));
 }
コード例 #14
0
 public static TM_Library                library_New(this TM_Proxy tmProxy)
 {
     return(tmProxy.invoke_Static <TM_Library>(typeof(TM_Xml_Database_ExtensionMethods_XML_DataSources_TM_Library), "new_TmLibrary", tmProxy.TmXmlDatabase));
 }
コード例 #15
0
 public static TeamMentor_Article        article_New(this TM_Proxy tmProxy, Guid libraryId)
 {
     return(tmProxy.invoke_Static <TeamMentor_Article>(typeof(TM_Xml_Database_ExtensionMethods_XmlDataSources_GuidanceItem), "xmlDB_RandomGuidanceItem", tmProxy.TmXmlDatabase, libraryId));
 }
コード例 #16
0
 public static TMUser        user_New(this TM_Proxy tmProxy, string userName)
 {
     return(tmProxy.invoke_Static <TMUser>(typeof(Users_Creation), "createUser", userName));
 }
コード例 #17
0
        public static TMUser        user_New(this TM_Proxy tmProxy, string userName, string password)
        {
            var userId = tmProxy.invoke_Static <int>(typeof(Users_Creation), "newUser", tmProxy.TmUserData, userName, password);

            return(tmProxy.user(userId));
        }
コード例 #18
0
 public static TM_Proxy  set_Property_Static <T>(this TM_Proxy tmProxy, string propertyName, object value)
 {
     tmProxy.invoke_Static(typeof(T), "set_{0}".format(propertyName.upperCaseFirstLetter()), new  [] { value });
     return(tmProxy);
 }