Example #1
0
        public static bool Init(string strGuid, string strUserScopeID, string strAppID)
        {
            TheScopeManager.SetApplicationID(strAppID); // SDK Non-Commercial ID. FOR COMMERCIAL APP GET THIS ID FROM C-LABS!

            TheBaseAssets.MyServiceHostInfo = new TheServiceHostInfo(cdeHostType.Application)
            {
                ApplicationName  = "AppHostTest",             // Friendly Name of Application
                cdeMID           = TheCommonUtils.CGuid(strGuid),
                Title            = "My-Relay (C)  2019",      // Title of this Host Service
                ApplicationTitle = "AppHostTest",             // Title visible in the NMI Portal
                CurrentVersion   = 1.0001,                    // Version of this Service, increase this number when you publish a new version that the store displays the correct update icon
                SiteName         = "http://cloud.c-labs.com", // Link to the main Cloud Node of this host. this is not required and for documentation only

                ISMMainExecutable = "AppHostTest",            // Name of the executable (without .exe)

                ServiceRoute = "https://cloud.c-labs.com",
            };

            strScopeID = strUserScopeID;

            settings = new TheBaseAppSettings();

            // Directly add keys to settings table.
            settings.AddKey("UseTcpListenerInsteadOfHttpListener", true);
            settings.SetKeyUnlessAlreadySet("DEBUGLEVEL", eDEBUG_LEVELS.OFF);

            // Select either user manager or scope manager. But not both!!
            settings.InitUserManager();
            // strScopeID = settings.InitScopeManager(strScopeID, 255);

            // Rely on helper functions to initialize other settings.
            settings.InitEnvironmentVarSettings(true, true);
            settings.DisableCodeSigningValidation(true);
            settings.InitClientBinPersistence(false);

            // Initialize ports for web server and web sockets.
            settings.InitWebPorts(8720, 8721);

            return(true);
        }
Example #2
0
        public static bool Init(string strGuid, string strUserScopeID, string strAppID, ushort usPort, string strCloudServiceRoute, bool bEnableRest, bool bEnableMeshRequest, bool bEnableMeshResponse)
        {
            TheScopeManager.SetApplicationID(strAppID); // SDK Non-Commercial ID. FOR COMMERCIAL APP GET THIS ID FROM C-LABS!

            TheBaseAssets.MyServiceHostInfo = new TheServiceHostInfo(cdeHostType.Application)
            {
                ApplicationName  = "AppHostTest",             // Friendly Name of Application
                cdeMID           = TheCommonUtils.CGuid(strGuid),
                Title            = "My-Relay",                // Title of this Host Service
                ApplicationTitle = "AppHostTest",             // Title visible in the NMI Portal
                CurrentVersion   = 1.0001,                    // Version of this Service, increase this number when you publish a new version that the store displays the correct update icon
                SiteName         = "http://cloud.c-labs.com", // Link to the main Cloud Node of this host. this is not required and for documentation only

                ISMMainExecutable = "AppHostTest",            // Name of the executable (without .exe)
            };

            strScopeID = strUserScopeID;

            MySettings = new TheBaseAppSettings();

            ushort usWsPort = usPort;

            usWsPort++;

            // Initialize ports for web server and web sockets.
            MySettings.InitWebPorts(usPort, usWsPort);

            MySettings.AddKey("CloudServiceRoute", strCloudServiceRoute);

            MySettings.AddKey("DontVerifyTrust", "true");
            // Web-to-Mesh Settings:
            // CDMyWebToMeshSample_EnableREST
            //  +++ In CDMyWebToMeshSample plugin, whether to be REST server.
            MySettings.SetKeyUnlessAlreadySet("CDMyWebToMeshSample_EnableREST", bEnableRest);

            // CDMyWebToMeshSample_EnableMeshDataQuery
            //   +++ In CDMyWebToMeshSample plugin, whether to look for
            //       requested REST data in other nodes or whether to provide
            //       it locally.
            MySettings.SetKeyUnlessAlreadySet("CDMyWebToMeshSample_EnableMeshDataQuery", bEnableMeshRequest);

            // CDMyWebToMeshSample_EnableMeshDataResponse
            //   +++ In CDMyWebToMeshSample plugin, whether to look for
            //       requested REST data in other nodes or whether to provide
            //       it locally.
            MySettings.SetKeyUnlessAlreadySet("CDMyWebToMeshSample_EnableMeshDataResponse", bEnableMeshResponse);

            // Directly add keys to settings table.
            MySettings.SetKeyUnlessAlreadySet("DEBUGLEVEL", eDEBUG_LEVELS.VERBOSE);

            MySettings.SetKeyUnlessAlreadySet("EventViewerScope", strScopeID);
            MySettings.SetKeyUnlessAlreadySet("EventViewerMode", "StandardEventViewer");



            // Rely on helper functions to initialize other settings.
            MySettings.InitEnvironmentVarSettings(true, true);
            MySettings.DisableCodeSigningValidation(true);
            MySettings.InitClientBinPersistence(false);

            return(true);
        }