SIL.FieldWorks.TE.NotesMainWnd.Synchronize C# (CSharp) Method

Synchronize() public method

Handle import sync messages.
public Synchronize ( SyncMsg sync ) : bool
sync SyncMsg
return bool
		public override bool Synchronize(SyncMsg sync)
		{
			CheckDisposed();

			switch (sync)
			{
				case SyncMsg.ksyncStyle:
					ParaStyleListHelper.IgnoreListRefresh = true;
					CharStyleListHelper.IgnoreListRefresh = true;

					ReSynchStyleSheet();
					// REVIEW: can we skip the rest of this, if we know that a ksynchUndoRedo will
					// do it for us later?
					RefreshAllViews();

					ParaStyleListHelper.IgnoreListRefresh = false;
					CharStyleListHelper.IgnoreListRefresh = false;
					InitStyleComboBox();
					return true;
				case SyncMsg.ksyncUndoRedo:
					ParaStyleListHelper.IgnoreListRefresh = true;
					CharStyleListHelper.IgnoreListRefresh = true;

					RefreshAllViews();

					ParaStyleListHelper.IgnoreListRefresh = false;
					CharStyleListHelper.IgnoreListRefresh = false;
					InitStyleComboBox();
					return true;
				case SyncMsg.ksyncWs:
					return true; // Don't care -- do nothing
			}

			// Updating views in all windows. IHelpTopicProvider.App should never be null unless
			// running from a test.
			if (m_app != null)
				return false; // causes a RefreshAllViews, and allows caller to notify its callers.

			RefreshAllViews(); // special case for testing.
			return true;
		}
		#endregion