protected override void OnActivate()
        {
            this.SelectedCountry = this.State.BasicAccountInfoStep.SelectedCountry;
            this.SetCommittedValue(PaymentInstrumentPropertyEditor.Country, SelectedCountry);
            this.SetCommittedValue(PaymentInstrumentPropertyEditor.Language, State.BasicAccountInfoStep.SelectedLanguage);
            this.SetCommittedValue(PaymentInstrumentPropertyEditor.Email, this.State.ContactInfoParentStep.GetCommittedValue(BaseContactInfoPropertyEditor.Email));
            base.OnActivate();
            this.ServiceDeactivationRequestsDone = false;
            MetadataEditProperty property1 = this.WizardPropertyEditor.GetProperty(PaymentInstrumentPropertyEditor.AccountHolderName);
            MetadataEditProperty property2 = this.WizardPropertyEditor.GetProperty(PaymentInstrumentPropertyEditor.PhoneNumber);
            MetadataEditProperty property3 = this.WizardPropertyEditor.GetProperty(PaymentInstrumentPropertyEditor.PhoneExtension);
            MetadataEditProperty property4 = this.WizardPropertyEditor.GetProperty(PaymentInstrumentPropertyEditor.PostalCode);

            if (string.IsNullOrEmpty(property1.Value))
            {
                string committedValue1 = this.State.ContactInfoParentStep.GetCommittedValue(BaseContactInfoPropertyEditor.FirstName) as string;
                string committedValue2 = this.State.ContactInfoParentStep.GetCommittedValue(BaseContactInfoPropertyEditor.LastName) as string;
                string format          = Shell.LoadString(StringId.IDS_ACCOUNT_CREATION_NAME_FORMAT);
                property1.Value = string.Format(format, committedValue1, committedValue2);
            }
            property4.State = SelectedCountry;
            if (string.IsNullOrEmpty(property4.Value))
            {
                property4.Value = this.State.BasicAccountInfoStep.GetCommittedValue(BasicAccountInfoPropertyEditor.PostalCode) as string;
            }
            if (string.IsNullOrEmpty(property2.Value))
            {
                property2.Value = this.State.ContactInfoParentStep.GetCommittedValue(BaseContactInfoPropertyEditor.PhoneNumber) as string;
            }
            if (!string.IsNullOrEmpty(property3.Value))
            {
                return;
            }
            property3.Value = this.State.ContactInfoParentStep.GetCommittedValue(BaseContactInfoPropertyEditor.PhoneExtension) as string;
        }
 private void SetPropertyToMedia(MetadataEditProperty property)
 {
     foreach (object media in _mediaList)
     {
         this._source.Set(media, property.Descriptor, property.Descriptor.ConvertFromString(property.Value, property.State));
     }
 }
 public void Undo()
 {
     foreach (PropertyDescriptor providerProperty in s_dataProviderProperties)
     {
         MetadataEditProperty property = this.GetProperty(providerProperty);
         property.Value    = property.OriginalValue;
         property.Modified = false;
     }
 }
        public void SetPropertyState(PropertyDescriptor descriptor, object state)
        {
            MetadataEditProperty property = this.GetProperty(descriptor);

            if (property == null)
            {
                return;
            }
            property.State = state;
        }
        public object GetPropertyData(PropertyDescriptor descriptor)
        {
            object obj = null;
            MetadataEditProperty property = this.GetProperty(descriptor);

            if (property != null)
            {
                obj = property.ConvertToData();
            }
            return(obj);
        }
 public override void Commit()
 {
     base.Commit();
     foreach (ProfilePropertyDescriptor providerProperty in s_dataProviderProperties)
     {
         MetadataEditProperty property = this.GetProperty(providerProperty);
         if (property.Modified)
         {
             ComposerHelper.ManageProfile(providerProperty.ServiceName, providerProperty.GetServiceValue(property.Value), new MessagingCallback(this.OnCommitComplete), property);
         }
     }
 }
        public MetadataEditProperty GetProperty(string descriptorName)
        {
            MetadataEditProperty metadataEditProperty1 = null;

            foreach (MetadataEditProperty metadataEditProperty2 in this._propertyMap.Values)
            {
                if (metadataEditProperty2.Descriptor.DescriptorName.Equals(descriptorName, StringComparison.InvariantCultureIgnoreCase))
                {
                    metadataEditProperty1 = metadataEditProperty2;
                    break;
                }
            }
            return(metadataEditProperty1);
        }
示例#8
0
        protected bool SetExternalError(string propertyName, HRESULT hr)
        {
            bool flag = false;
            MetadataEditProperty metadataEditProperty = null;

            if (this._wizardPropertyEditor != null)
            {
                metadataEditProperty = this._wizardPropertyEditor.GetProperty(propertyName);
            }
            if (metadataEditProperty != null)
            {
                flag = true;
                metadataEditProperty.ExternalError = hr;
            }
            return(flag);
        }
示例#9
0
        protected bool SetExternalError(PropertyDescriptor descriptor, HRESULT hr)
        {
            bool flag = false;
            MetadataEditProperty metadataEditProperty = null;

            if (this._wizardPropertyEditor != null)
            {
                metadataEditProperty = this._wizardPropertyEditor.GetProperty(descriptor);
            }
            if (metadataEditProperty != null)
            {
                flag = true;
                metadataEditProperty.ExternalError = hr;
            }
            return(flag);
        }
示例#10
0
 public virtual void Commit()
 {
     foreach (PropertyDescriptor property1 in _properties)
     {
         MetadataEditProperty property2 = this._propertyMap[property1];
         if (property2.Modified)
         {
             this.SetPropertyToMedia(property2);
         }
     }
     if (!this._source.NeedsCommit)
     {
         return;
     }
     foreach (object media in _mediaList)
     {
         this._source.Commit(media);
     }
 }