コード例 #1
0
		/// <summary>
		/// Makes sure a message box is managed by this manager.
		/// </summary>
		/// <param name="wmb"></param>
		private CustomMessageBox Accept(WF.Player.Core.MessageBox wmb)
		{
			CustomMessageBox cmb = null;
			
			// Checks if this instance already manages this message box.
			// If not, starts to manage the box.
			KeyValuePair<CustomMessageBox, WF.Player.Core.MessageBox> pair = _WherigoMessageBoxes.SingleOrDefault(kv => kv.Value == wmb);
			if (pair.Value == wmb)
			{
				// The target message box exists already.
				cmb = pair.Key;
			}
			else
			{
				// Creates a target message box.
				cmb = new CustomMessageBox()
				{
					Caption = App.Current.Model.Core.Cartridge.Name,
					//Message = wmb.Text,
					Content = new Controls.WherigoMessageBoxContentControl() { MessageBox = wmb },
					LeftButtonContent = wmb.FirstButtonLabel ?? "OK",
					RightButtonContent = wmb.SecondButtonLabel
				};

				// Registers events.
				RegisterEventHandlers(cmb);

				// Adds the pair to the dictionary.
				_WherigoMessageBoxes.Add(cmb, wmb);
			}

			return cmb;
		}
コード例 #2
0
		/// <summary>
		/// Constructs a new savegame metadata container for a Cartridge, using metadata
		/// from a GWS metadata container.
		/// </summary>
		/// <param name="tag">Cartridge to save.</param>
		/// <param name="gwsMetadata">Metadata of a GWS file.</param>
		public CartridgeSavegame(CartridgeTag tag, WF.Player.Core.Formats.GWS.Metadata gwsMetadata, string gwsFilename)
		{
			Timestamp = gwsMetadata.SaveCreateDate;
			Name = gwsMetadata.SaveName;
			HashColor = GetHashColor(Name);
			SetFileProperties(tag, gwsFilename);
		}
コード例 #3
0
        public async Task <WF> Add(WF workFlow)
        {
            /// check next line
            _wFContext.WorkFlows.Add(workFlow);
            await _wFContext.SaveChangesAsync();

            return(workFlow);
        }
コード例 #4
0
		/// <summary>
		/// Displays a message box from a Wherigo game. If a message box is on-screen, it is dismissed.
		/// </summary>
		/// <param name="mbox"></param>
		public void Show(WF.Player.Core.MessageBox mbox)
		{
			if (mbox == null)
			{
				throw new ArgumentNullException("mbox");
			}

			Accept(mbox).Show();
		}
コード例 #5
0
 public async Task <bool> Update(WF workFlow)
 {
     _wFContext.Update(workFlow); //Change Tracker : only change the state
     try
     {
         await _wFContext.SaveChangesAsync();
     }
     catch (Exception ex)
     {
     }
     return(true);
 }
コード例 #6
0
		/// <summary>
		/// Displays a message box from a Wherigo game. 
        /// If a message box is on-screen, it is dismissed.
		/// </summary>
		/// <param name="mbox"></param>
		public void Show(WF.Player.Core.MessageBox mbox)
		{
			if (mbox == null)
			{
				throw new ArgumentNullException("mbox");
			}

			CustomMessageBox mb = Accept(mbox);
			if (mb != null)
			{
				mb.Show();
			}
		}
コード例 #7
0
ファイル: fShowDocWF.cs プロジェクト: trancongvy/SGDDev17CDT
 public fShowDocWF(DataMasterDetail _data)
 {
     InitializeComponent();
     graph                    = Pic.CreateGraphics();
     wF                       = new WF(_data.DrTable["sysTableID"].ToString());
     lTask                    = wF.lTask;
     lAction                  = wF.lAction;
     BgC                      = this.BackColor;
     _Data                    = _data;
     this.Paint              += new PaintEventHandler(fShowDocWF_Paint);
     this.Resize             += new EventHandler(fShowDocWF_Resize);
     this.ResizeEnd          += new EventHandler(fShowDocWF_ResizeEnd);
     this.MaximumSizeChanged += new EventHandler(fShowDocWF_MaximumSizeChanged);
     this.ResizeRedraw        = true;
     this.Activated          += new EventHandler(fShowDocWF_Activated);
     Pic.Resize              += new EventHandler(Pic_Resize);
     Pic.Paint               += new PaintEventHandler(Pic_Paint);
     //DrawAll();
 }
コード例 #8
0
ファイル: ZonePoint.cs プロジェクト: chier01/WF.Player.Core
		internal ZonePoint(WF.Player.Core.Data.IDataContainer data)
			: base(data)
		{
		}
コード例 #9
0
ファイル: WF_WorkOpt_OneWork.cs プロジェクト: splanton/CCFlow
        /// <summary>
        /// 返回打开路径
        /// </summary>
        /// <returns></returns>
        public string FrmGuide_Init()
        {
            WF en = new WF(this.context);

            return(en.Runing_OpenFrm());
        }
コード例 #10
0
		/// <summary>
		/// Adds an extra data to BugSense describing a cartridge.
		/// </summary>
		/// <param name="cart"></param>
		public static void AddBugSenseCrashExtraData(WF.Player.Core.Cartridge cart)
		{
			var extraDataList = BugSenseHandler.Instance.CrashExtraData;

			string guid = cart.Guid;
			if (guid != null)
			{
				extraDataList.Add(new BugSense.Core.Model.CrashExtraData("cartGuid", guid)); 
			}

			string name = cart.Name;
			if (name != null)
			{
				extraDataList.Add(new BugSense.Core.Model.CrashExtraData("cartName", name.Trim()));
			}

            string engineGameState = "<unknown>";
            Models.WherigoModel model = App.Current.Model;
            if (model != null)
            {
                Models.WFCoreAdapter core = model.Core;
                if (core != null)
                {
                    engineGameState = core.GameState.ToString();
                }
            }
            extraDataList.Add(new BugSense.Core.Model.CrashExtraData("engineGameState", engineGameState));
		}
コード例 #11
0
		void OnOrientationChanged (object sender, WF.Player.Location.OrientationChangedEventArgs e)
		{
			if (Math.Abs(Main.GPS.Bearing - _lastBearing) > 2) {
				_lastBearing = Main.GPS.Bearing;
				_refresh.Call();
			}
		}
コード例 #12
0
ファイル: CCMobile.cs プロジェクト: gzcw/MyWebApplication
 public string Start_Init()
 {
     BP.WF.HttpHandler.WF wfPage = new WF(this.context);
     return(wfPage.Start_Init());
 }
コード例 #13
0
ファイル: CCMobile.cs プロジェクト: gzcw/MyWebApplication
        /// <summary>
        /// 会签列表
        /// </summary>
        /// <returns></returns>
        public string HuiQianList_Init()
        {
            WF wf = new WF(this.context);

            return(wf.HuiQianList_Init());
        }
コード例 #14
0
        private void OnWherigoObjectChanged(WF.Player.Core.Thing wherigoObject)
        {
            // Updates the vector.
            LocationVector vector = null;
            if (wherigoObject != null)
            {
                vector = wherigoObject.VectorFromPlayer;
            }

            bool vectorChanged = Vector != vector;
            Vector = vector;
            if (!vectorChanged)
            {
                RefreshFromVector(vector);
            }
        }
コード例 #15
0
		void OnOrientationChanged (object sender, WF.Player.Location.OrientationChangedEventArgs e)
		{
			RotateCamera((float)Main.GPS.Bearing);
		}
コード例 #16
0
		void OnLocationChanged (object sender, WF.Player.Location.LocationChangedEventArgs e)
		{
			if (_followLocation)
				this.FocusOnLocation();
			UpdateDistanceLine();
		}
コード例 #17
0
		/// <summary>
		/// Displays a message box. If a message box is currently on-screen, it will be cancelled.
		/// </summary>
		/// <param name="mbox"></param>
		public void ShowMessageBox(WF.Player.Core.MessageBox mbox)
		{
			// Delegates this to the message box manager.
			MessageBoxManager.Show(mbox);
		}
コード例 #18
0
		/// <summary>
		/// Is called, when an location changed event occures.
		/// </summary>
		/// <param name="sender">Sender.</param>
		/// <param name="e">Event arguments.</param>
		private void OnRefreshLocation(Object sender, WF.Player.Location.LocationChangedEventArgs e)
		{
			GPSLocation loc = Main.GPS.Location;

			if (engine != null && !loc.Equals(engine.Latitude, engine.Longitude, engine.Altitude, engine.Accuracy))
				engine.RefreshLocation (loc.Latitude, loc.Longitude, loc.Altitude, loc.Accuracy);
		}
コード例 #19
0
		/// <summary>
		/// Adds an extra data to BugSense describing a cartridge.
		/// </summary>
		/// <param name="cart"></param>
		public static void AddBugSenseCrashExtraData(WF.Player.Core.Cartridge cart)
		{
			var extraDataList = BugSenseHandler.Instance.CrashExtraData;
			extraDataList.Add(new BugSense.Core.Model.CrashExtraData("cartGuid", cart.Guid));
			extraDataList.Add(new BugSense.Core.Model.CrashExtraData("cartName", cart.Name));
		}
コード例 #20
0
ファイル: CCMobile.cs プロジェクト: gzcw/MyWebApplication
 /// <summary>
 /// 流程单表单查看.
 /// </summary>
 /// <returns>json</returns>
 public string FrmView_Init()
 {
     BP.WF.HttpHandler.WF wf = new WF(this.context);
     return(wf.FrmView_Init());
 }
コード例 #21
0
ファイル: CCMobile.cs プロジェクト: gzcw/MyWebApplication
 public string Login_Init()
 {
     BP.WF.HttpHandler.WF ace = new WF(this.context);
     return(ace.Login_Init());
 }
コード例 #22
0
		public void OnLocationChanged(object sender, WF.Player.Location.LocationChangedEventArgs e)
		{
			var textCoordText = FindViewById<TextView> (Resource.Id.textCoordText);
			textCoordText.Text = e.Location.HasAccuracy ? GetString (Resource.String.main_active_location) : GetString (Resource.String.main_last_known_location);

			var textCoords = FindViewById<TextView> (Resource.Id.textCoords);
			textCoords.Text = e.Location.ToString();

			var textAccuracy = FindViewById<TextView> (Resource.Id.textAccuracy);
			textAccuracy.Text = String.Format ("{0:0} m", e.Location.Accuracy);
		}
コード例 #23
0
ファイル: UIObject.cs プロジェクト: chier01/WF.Player.Core
		internal UIObject(WF.Player.Core.Data.IDataContainer data, RunOnClick runOnClick)
			: base(data)
		{
			_runOnClick = runOnClick;
		}
コード例 #24
0
ファイル: Timer.cs プロジェクト: chier01/WF.Player.Core
		internal Timer(WF.Player.Core.Data.IDataContainer data)
			: base(data)
		{
		}
コード例 #25
0
		/// <summary>
		/// Raises the location changed event.
		/// </summary>
		/// <param name="sender">Sender.</param>
		/// <param name="e">E.</param>
		void OnLocationChanged (object sender, WF.Player.Location.LocationChangedEventArgs e)
		{
			RefreshLocation();
		}
コード例 #26
0
        /// <summary>
        /// Log a User Activity.
        /// </summary>
        /// <param name="ISOTimestamp"></param>
        /// <param name="actionDescription">A string describing the System Activity performed by the component. Example:
        ///     <example>"BankAccountTableView component refreshed datastore."</example></param>
        /// <param name="userActivity">A key word defined by each software component or application indicating which
        ///     software-centric function is is most likely indicated by the this user activity. See the Activity Logging
        ///     API for a standard set of user activity key words. </param>
        /// <param name="userWorkflowState">
        ///     This value must be one of the Workflow Codes defined in this library. See the Activity Logging API
        ///     for definitions of each workflow code. Example:
        ///         <example>
        ///         ac = new ActivityLogger();
        ///         ...
        ///         userWorkflowState = ac.WF.SEARCH
        ///         </example>
        /// </param>
        /// <param name="softwareMetadata">Any key/value pairs that will clarify or paramterize this system activity.</param>
        /// <returns>A JSON log message.</returns>
        /// <remarks>
        /// <see cref="registerActivityLogger"/> MUST be called before calling this function. Use <code>logUserActivity</code>
        /// to log actions initiated by an explicit user action. For example, if a software component refreshes a
        /// data store when the user clicks a Reshresh UI element, that activity should be logged as a User Activity.
        /// However, if the datastore was refreshed automatically after a certain time span, that activity should NOT
        /// be logged as a User Activity, but rather as a System Activity.
        /// </remarks>
        public String logUserActivity(String ISOTimestamp, String actionDescription, String userActivity, WF userWorkflowState, Dictionary <String, String> softwareMetadata = null)
        {
            Dictionary <String, object> recastMetaData = null;

            if (softwareMetadata != null)
            {
                recastMetaData = new Dictionary <string, object>();
                foreach (String key in softwareMetadata.Keys)
                {
                    recastMetaData.Add(key, softwareMetadata[key]);
                }
            }

            return(logUserActivity <Object>(ISOTimestamp, actionDescription, userActivity, userWorkflowState, recastMetaData));
        }
コード例 #27
0
ファイル: WF_WorkOpt_OneWork.cs プロジェクト: splanton/CCFlow
        public string TimeBase_OpenFrm()
        {
            WF en = new WF(this.context);

            return(en.Runing_OpenFrm());
        }
コード例 #28
0
        /// <summary>
        /// Log a User Activity, with optionally nested metadata.
        /// </summary>
        /// <param name="ISOTimestamp"></param>
        /// <param name="actionDescription">A string describing the System Activity performed by the component. Example:
        ///     <example>"BankAccountTableView component refreshed datastore."</example></param>
        /// <param name="userActivity">A key word defined by each software component or application indicating which
        ///     software-centric function is is most likely indicated by the this user activity. See the Activity Logging
        ///     API for a standard set of user activity key words. </param>
        /// <param name="userWorkflowState">
        ///     This value must be one of the Workflow Codes defined in this library. See the Activity Logging API
        ///     for definitions of each workflow code. Example:
        ///         <example>
        ///         ac = new ActivityLogger();
        ///         ...
        ///         userWorkflowState = ac.WF.SEARCH
        ///         </example>
        /// </param>
        /// <param name="softwareMetadata">Any key/value pairs that will clarify or paramterize this system activity. These values can be nested.</param>
        /// <returns>A JSON log message.</returns>
        /// <remarks>
        /// <see cref="registerActivityLogger"/> MUST be called before calling this function. Use <code>logUserActivity</code>
        /// to log actions initiated by an explicit user action. For example, if a software component refreshes a
        /// data store when the user clicks a Reshresh UI element, that activity should be logged as a User Activity.
        /// However, if the datastore was refreshed automatically after a certain time span, that activity should NOT
        /// be logged as a User Activity, but rather as a System Activity.
        /// </remarks>
        public String logUserActivity <T>(String ISOTimestamp, String actionDescription, String userActivity, WF userWorkflowState, Dictionary <String, T> softwareMetadata = null)
        {
            Dictionary <String, Object> UserActivityMessage = new Dictionary <string, object>();

            writeHeader(UserActivityMessage);

            UserActivityMessage.Add("timestamp", ISOTimestamp);
            UserActivityMessage.Add("type", "USERACTION ");

            Dictionary <String, Object> parms = new Dictionary <string, object>();

            parms.Add("desc", actionDescription);
            parms.Add("activity", userActivity);
            parms.Add("wf_state", (int)userWorkflowState);
            parms.Add("wf_version", workflowCodingVersion);

            UserActivityMessage.Add("parms", parms);
            UserActivityMessage.Add("metadata", softwareMetadata);

            return(convertToJSON(UserActivityMessage));
        }
コード例 #29
0
ファイル: WF_WorkOpt_OneWork.cs プロジェクト: splanton/CCFlow
 public string Runing_OpenFrm()
 {
     BP.WF.HttpHandler.WF wf = new WF(this.context);
     return(wf.Runing_OpenFrm());
 }
コード例 #30
0
		/// <summary>
		/// Executes the selected command.
		/// </summary>
		/// <param name="command">Command to execute.</param>
		private async void ExecuteCommand(WF.Player.Core.Command command)
		{
			if (command == null)
			{
				return;
			}

			// Notify user
			App.Click();

			if (command.CmdWith) 
			{
				if (command.TargetObjects.Count > 0) 
				{
					// There are one or more targets for this command
					var cfg = new ActionSheetConfig().SetTitle(command.Text);

					foreach (Thing t in command.TargetObjects)
					{
						cfg.Add(
							t.Name, 
							() => 
							{
								App.Click();
								command.Execute(t);
							});
					}

					cfg.Cancel = new ActionSheetOption(Catalog.GetString("Cancel"), App.Click);

					UserDialogs.Instance.ActionSheet(cfg);
				} 
				else 
				{
					// There are no target for this command
					await UserDialogs.Instance.AlertAsync(command.EmptyTargetListText, command.Text, Catalog.GetString("Ok"));
					App.Click();
				}
			} 
			else 
			{
				command.Execute();
			}
		}
コード例 #31
0
		/// <summary>
		/// Associates a logger to this instance.
		/// </summary>
		/// <remarks>If a logger already is associated, it will be disposed.</remarks>
		/// <param name="logger"></param>
		public void StartLogging(WF.Player.Core.Formats.GWL logger)
		{
			lock (_SyncRoot)
			{
				if (_Logger != null)
				{
					DisposeLogger();
				}

				_Logger = logger;
			}
		}
コード例 #32
0
ファイル: MapViewModel.cs プロジェクト: Surfoo/WF.Player
		public Pin AddPin(WF.Player.Core.ZonePoint pos, string name = null, string description = null)
		{
			Pin pin = null;

			if (map != null)
			{
				pin = new Pin();

				pin.Label = name;
				pin.Address = description;
				pin.Type = PinType.Place;
				pin.Position = new Position(pos.Latitude, pos.Longitude);

				map.Pins.Add(pin);
			}

			return pin;
		}
コード例 #33
0
ファイル: Input.cs プロジェクト: chier01/WF.Player.Core
		internal Input(WF.Player.Core.Data.IDataContainer data, RunOnGetInput onGetInput)
			: base(data)
		{
			_runOnGetInput = onGetInput;
		}
コード例 #34
0
		protected override void OnCoreGameStateChanged(WF.Player.Core.Engines.EngineGameState oldState, WF.Player.Core.Engines.EngineGameState newState)
		{			
			// If the engine is stopping or pausing, enables screen lock again.
			if (newState == WF.Player.Core.Engines.EngineGameState.Stopping || newState == WF.Player.Core.Engines.EngineGameState.Pausing)
			{
				App.Current.ViewModel.IsScreenLockEnabled = false;
			}

			// Refreshes the blocking progress bar.
			RefreshProgressBar(newState);
		}
コード例 #35
0
ファイル: Root.master.cs プロジェクト: hassyfit/ApexRepo
        protected void cbCreateCAR_Callback(object source, CallbackEventArgs e)
        {
            // Create a new CAR here and redirect to its page...
            eCAR3Entities pContext = new eCAR3Entities();
            CARMaster     pCAR     = new CARMaster();

            string[] parameters = e.Parameter.Split(';');

            string orgInformation   = parameters[0]; // orgId + '|' + locName + '|' + orgPath;
            string orgId            = orgInformation.Split('|')[0];
            string orgLocationName  = orgInformation.Split('|')[1];
            string orgPath          = orgInformation.Split('|')[2];
            var    divisonCharacter = orgPath.Substring(0, 1).ToUpper();

            //var threeCharacterLocation = orgLocationName.Replace(/\s +/ g, '').replace(/\./ g, '').substring(0, 3).toUpperCase();
            var threeCharacterLocation   = orgLocationName.Substring(0, 3).ToUpper();
            var twoDigitYear             = DateTime.Now.Year.ToString().Substring(2, 2); // produces two digit year -- Ex. 2019 = "19"
            var threeDigitUniqueSequence = "XXX";                                        // The database trigger will make this a unique sequential number.
            var projectNumber            = divisonCharacter + '-' + threeCharacterLocation + '-' + twoDigitYear + '-' + threeDigitUniqueSequence;

            string pillarInformation = parameters[1]; // pillarId + '|' + pillarName + '|' + decr;
            string pillarId          = pillarInformation.Split('|')[0];
            string pillarName        = pillarInformation.Split('|')[1];
            string pillarDescr       = pillarInformation.Split('|')[2];

            pCAR.OrgId           = orgId;
            pCAR.ProjectNumber   = projectNumber;
            pCAR.CreatedByUserId = UserId;
            pCAR.CreatedByName   = UserDisplayName;
            pCAR.ProjectTitle    = txtTitle.Text;
            pCAR.CreateTime      = DateTime.Now;
            pCAR.ProjectTypeId   = cbProjectType.Value.ToString(); // Set the dropdown ProjectTypeId
            pCAR.InterestRate    = 0.000;                          // Updated Interest Rate to 0.000
            pCAR.ExchangeRate    = 0;                              // Updated Exchange Rate to 0
            pCAR.UsefulLifeYears = 0;                              // Updated Useful Life Years to 0
            pCAR.LeaseTermYears  = 0;                              // Updated Lease Term Years to 0
            pCAR.NPV             = 0;                              // Updated NPV to 0
            pCAR.IRR             = 0;                              // Updated IRR to 0
            pCAR.CurrencyTypeId  = 1;                              // Updated Currency Type to U.S. Dollar

            //Set Desc fields to empty
            pCAR.ProjectDesc          = "";
            pCAR.ProjectReason        = "";
            pCAR.ProjectJustification = "";
            pCAR.FiscalYear           = DateTime.Now.Year;      // Updated Fiscal Year to current year
            pCAR.PillarId             = pillarId;               // Set the dropdown PillarId
            pCAR.Status = "Active";

            pContext.CARMasters.Add(pCAR);
            pContext.SaveChanges(); // TODD: If we could remove this it may speed things up a bit.

            // We now have the CAR Id
            AddCostSheet(pContext, pCAR.CARId, 1);
            AddCostSheet(pContext, pCAR.CARId, 2);
            AddCostSheet(pContext, pCAR.CARId, 3);
            AddCostSheet(pContext, pCAR.CARId, 4);

            // Bootstrap the workflow process
            // This should probably not be here
            // This should be a function in the workflow engine!
            WFEngine pEngine = GetWFEngine();

            WF pWF = pEngine.CreateWorkflow(pCAR.CARId);

            // This call assigns the workflow to an individual user
            string sURL = pEngine.Assign(pWF, "Create", "CREATE", UserId, null, pCAR.CARId.ToString());

            // Redirect the users browser to the newly create CAR.
            //ASPxWebControl.RedirectOnCallback(sURL); // I removed this because the line below may be a tiny bit faster.
            cbCreateCAR.JSProperties ["cp_result"] = sURL; // Return to the client side where the JavaScript redirects to this CAR page.
        }
コード例 #36
0
ファイル: Character.cs プロジェクト: chier01/WF.Player.Core
		internal Character(WF.Player.Core.Data.IDataContainer data, RunOnClick runOnClick)
			: base(data, runOnClick)
		{
		}
コード例 #37
0
		/// <summary>
		/// Handles the position changed.
		/// </summary>
		/// <param name="sender">Sender of event.</param>
		/// <param name="e">Position event arguments.</param>
		private void HandlePositionChanged(object sender, WF.Player.Services.Geolocation.PositionEventArgs e)
		{
			double heading = 0;

			if (e.Position.Heading != null)
			{
				// Show always to north
				heading = 360.0 - (double)e.Position.Heading;
			}

			var vec = geoMathHelper.VectorToPoint(new ZonePoint(e.Position.Latitude, e.Position.Longitude, 0), target);

			Direction = (double)((vec.Bearing + heading) % 360);
			Distance = vec.Distance.Value;
		}
コード例 #38
0
ファイル: Thing.cs プロジェクト: chier01/WF.Player.Core
		internal Thing(WF.Player.Core.Data.IDataContainer data, RunOnClick runOnClick)
			: base(data, runOnClick)
		{
		}
コード例 #39
0
		/// <summary>
		/// Refreshes the progress bar depending on the game state.
		/// </summary>
		/// <param name="engineGameState"></param>
		private void RefreshProgressBar(WF.Player.Core.Engines.EngineGameState gameState)
		{
			// Computes the message to display.
			string message = null;
			switch (gameState)
			{
				case WF.Player.Core.Engines.EngineGameState.Stopping:
					message = "Stopping cartridge...";
					break;

				case WF.Player.Core.Engines.EngineGameState.Starting:
					message = "Starting game...";
					break;

				case WF.Player.Core.Engines.EngineGameState.Restoring:
					message = "Restoring game...";
					break;

				case WF.Player.Core.Engines.EngineGameState.Saving:
					message = "Saving cartridge...";
					break;

				case WF.Player.Core.Engines.EngineGameState.Playing:
					// message = null;
					break;

				case WF.Player.Core.Engines.EngineGameState.Initializing:
					message = "Loading cartridge...";
					break;

				default:
					message = ProgressBarStatusText ?? "";
					break;
			}

			// If we need to display a progress message, do it.
			ProgressBarStatusText = message;
			IsProgressBarVisible = message != null;
		}
コード例 #40
0
		/// <summary>
		/// Makes sure a message box is managed by this manager.
		/// </summary>
		/// <param name="wmb"></param>
		private CustomMessageBox Accept(WF.Player.Core.MessageBox wmb)
		{
			// Ignore if the engine is not ready.
			if (!App.Current.Model.Core.IsReady)
			{
				System.Diagnostics.Debug.WriteLine("MessageBoxManager: Ignored Wherigo message box because Engine is not ready.");
				return null;
			}
			
			CustomMessageBox cmb = null;
			
			// Checks if this instance already manages this message box.
			// If not, starts to manage the box.
			KeyValuePair<CustomMessageBox, WF.Player.Core.MessageBox> pair = _wherigoMessageBoxes.SingleOrDefault(kv => kv.Value == wmb);
			if (pair.Value == wmb)
			{
				// The target message box exists already.
				cmb = pair.Key;
			}
			else
			{
				// Creates a target message box.
				cmb = new CustomMessageBox()
				{
					Caption = App.Current.Model.Core.Cartridge.Name,
					//Message = wmb.Text,
					Content = new Controls.WherigoMessageBoxContentControl() { MessageBox = wmb },
					LeftButtonContent = wmb.FirstButtonLabel ?? "OK",
					RightButtonContent = wmb.SecondButtonLabel
				};

				// Registers events.
				RegisterEventHandlersForWig(cmb);

				// Adds the pair to the dictionary.
				bool hadMessageBoxes;
				lock (_syncRoot)
                {
					hadMessageBoxes = HasMessageBox;
					_wherigoMessageBoxes.Add(cmb, wmb); 
                }

                // Sends an event if it changed.
				if (!hadMessageBoxes)
				{
					RaiseHasMessageBoxChanged(); 
				}
			}

			return cmb;
		}