コード例 #1
0
        /// <summary>
        /// Creates all the specified virtual resources.
        /// </summary>
        public override void Start()
        {
            // Install all print queues for the specified user.
            InstallRemotePrinters();
            InstallLocalPrinters();

            // Perform user specific setup, but don't actually start the Office Worker on the
            // Citrix server.  Wait until the ExecuteResources is called for that.  This will
            // better simulate a simultaneous load on the Citrix server.

            ChangeResourceState(_credential.ResourceInstanceId, RuntimeState.Starting);

            ChangeMachineStatusMessage("Configuring User");
            ConfigureUserGroups(_credential);
            CitrixSessionManager.ConfigureLocalUserGroups(_credential, _citrixServer);

            ChangeMachineStatusMessage("Resetting Citrix");
            CitrixSessionManager.ResetCitrixSession(_credential.UserName, _citrixServer);

            // If a value is provided for the published app, then start it first.
            if (!string.IsNullOrEmpty(_worker.PublishedApp))
            {
                CitrixSessionManager.StartPublishedApp(_credential, _citrixServer, _worker.PublishedApp);
            }

            ChangeMachineStatusMessage("Starting Citrix User");
            StartCitrixUserSession();
        }
コード例 #2
0
        void VirtualResourceEventBus_OnStartMainRun(object sender, VirtualResourceEventBusRunArgs e)
        {
            TraceFactory.Logger.Debug("Attempting to start the Citrix Published Application");

            // Now the actual Citrix published app must be started.
            ChangeMachineStatusMessage("Starting Published App");
            CitrixSessionManager.StartPublishedApp(_credential, _citrixServer, _worker.PublishedApp);

            ChangeResourceState(RuntimeState.Running);
        }