/**********************************************************************************/
        // SyncConfControls and SyncConfControlsBack are pair of methods that serves the following reason:
        // We want to work with StandardConfigurationControlsCM in form of ActivityUi that has handy properties to directly access certain controls
        // But when we deserialize activity's crate storage we get StandardConfigurationControlsCM. So we need a way to 'convert' StandardConfigurationControlsCM
        // from crate storage to ActivityUI.
        // SyncConfControls takes properties of controls in StandardConfigurationControlsCM from activity's storage and copies them into ActivityUi.
        private void SyncConfControls(bool throwException)
        {
            var configurationControls = Storage.CrateContentsOfType <StandardConfigurationControlsCM>().FirstOrDefault();

            ActivityUI = CrateActivityUI();

            if (configurationControls == null)
            {
                if (throwException)
                {
                    throw new InvalidOperationException("Configuration controls crate is missing");
                }

                return;
            }

            ActivityUI.SyncWith(configurationControls);

            if (ActivityUI.Controls != null)
            {
                ActivityUI.RestoreDynamicControlsFrom(configurationControls);
            }
        }