FRBDK/GlueView/GlueView/GluxViewManager/GluxManager.cs
/// <summary>
///  Compares the previous GlueProjectSave with the current one.  
/// </summary>
/// <returns>True if the GlueProjectSaves are the same</returns>
Compares the previous GlueProjectSave with the current one.
Compares the previous GlueProjectSave with the current one .
private static bool CompareGlueProjectSaves()
		{
			if (!string.IsNullOrEmpty(mCurrentGlueFile))
			{
				int numberOfTries = 0;
				const int maxNumberOfTries = 5;
				bool succeeded = false;
				GlueProjectSave newGlueProjectSave = null;
				Exception lastException = null;
				while (numberOfTries < maxNumberOfTries)
				{
					try
					{
						newGlueProjectSave = FileManager.XmlDeserialize<GlueProjectSave>(mCurrentGlueFile);
						succeeded = true;
						break;
					}
					catch (Exception e)
					{
						System.Threading.Thread.Sleep(25);
						numberOfTries++;
						lastException = e;
					}
				}
				if (!succeeded)
				{
					MessageBox.Show("Error loading GLUX:\n\n" + lastException.ToString());
				}
				if (GlueProjectSave == null && newGlueProjectSave != null)
				{
					GlueProjectSave = newGlueProjectSave;
					return false;
				}
				var compareObjects = new CompareLogic();
				compareObjects.Config.MembersToIgnore.Add("ContainerType");
				compareObjects.Config.MembersToIgnore.Add("ImageWidth");
				compareObjects.Config.MembersToIgnore.Add("ImageHeight");
				compareObjects.Config.MembersToIgnore.Add("EquilibriumParticleCount");
				compareObjects.Config.MembersToIgnore.Add("BurstParticleCount");
				compareObjects.Config.MembersToIgnore.Add("RuntimeType");
				compareObjects.Config.MembersToIgnore.Add("EventSave");
				compareObjects.Config.MembersToIgnore.Add("SharedCodeFullFileName");
                mShouldUnloadGlux = true;
				UnloadGluxActivity();
				GlueProjectSave = newGlueProjectSave;
			}
			return false;
		}
private static bool CompareGlueProjectSaves ( ) { if ( ! string . IsNullOrEmpty ( mCurrentGlueFile ) ) { int numberOfTries = 0 ; const int maxNumberOfTries = 5 ; bool succeeded = false ; GlueProjectSave newGlueProjectSave = null ; Exception lastException = null ; while ( numberOfTries < maxNumberOfTries ) { try { newGlueProjectSave = FileManager . XmlDeserialize < GlueProjectSave > ( mCurrentGlueFile ) ; succeeded = true ; break ; } catch ( Exception e ) { System . Threading . Thread . Sleep ( 25 ) ; numberOfTries ++ ; lastException = e ; } } if ( ! succeeded ) { MessageBox . Show ( " \n \n " + lastException . ToString ( ) ) ; } if ( GlueProjectSave == null && newGlueProjectSave != null ) { GlueProjectSave = newGlueProjectSave ; return false ; } var compareObjects = new CompareLogic ( ) ; compareObjects . Config . MembersToIgnore . Add ( " " ) ; compareObjects . Config . MembersToIgnore . Add ( " " ) ; compareObjects . Config . MembersToIgnore . Add ( " " ) ; compareObjects . Config . MembersToIgnore . Add ( " " ) ; compareObjects . Config . MembersToIgnore . Add ( " " ) ; compareObjects . Config . MembersToIgnore . Add ( " " ) ; compareObjects . Config . MembersToIgnore . Add ( " " ) ; compareObjects . Config . MembersToIgnore . Add ( " " ) ; mShouldUnloadGlux = true ; UnloadGluxActivity ( ) ; GlueProjectSave = newGlueProjectSave ; } return false ; }
Compares the previous GlueProjectSave with the current one.
Compares the previous GlueProjectSave with the current one .
//ObjectFinder.GlueProject = null; // This method gets called on the primary // thread so it's okay to call UnloadGluxActivity // which is synchronous: // October 23, 2012 // I don't understand // why we call UnloadGluxActivity. // If the GlueProjectSave is null then // there is no need to unload it is there? // Unloading wipes out mNextElement, which we // don't want to do if we're loading a .glux for // the first time. //mShouldUnloadGlux = true;   //UnloadGluxActivity(); // This method gets called on the primary // thread so it's okay to call UnloadGluxActivity // which is synchronous:
True if the GlueProjectSaves are the same
True if the GlueProjectSaves are the same