Exemple #1
0
        public void Publish(RoamingProfile profile)
        {
            ISiteAdapter adapter = profile.GetProvider().Adapter;

            using (MemoryStream containerStream = new MemoryStream())
            {
                BinaryFormatter formatter = new BinaryFormatter();
                formatter.Serialize(containerStream, this);
                containerStream.Seek(0, SeekOrigin.Begin);

                ProgressMediator.ChangeProgress(Resources.Text_UI_LogText_PublishingContent, SignificantProgress.Running);
                adapter.PushFile(profile, containerStream, GetRemoteManifestPath(profile), true);
            }
        }
Exemple #2
0
        public static Manifest Load(RoamingProfile profile)
        {
            if (profile == null)
                throw new ArgumentNullException("profile");

            ISiteAdapter adapter = profile.GetProvider().Adapter;
            string remoteManifestPath = GetRemoteManifestPath(profile);

            if (!adapter.FileExists(profile, remoteManifestPath))
                return new Manifest();

            using (MemoryStream containerStream = new MemoryStream())
            {
                adapter.PullFile(profile, remoteManifestPath, containerStream);

                BinaryFormatter formatter = new BinaryFormatter();
                Manifest container = (Manifest)formatter.Deserialize(containerStream);

                return container;
            }
        }
        public static ProvisioningContainer Load(RoamingProfile profile)
        {
            if (profile == null)
                throw new ArgumentNullException("profile");

            ISiteAdapter adapter = profile.GetProvider().Adapter;
            string containerPath = GetContainerPath(profile);

            if (!adapter.FileExists(profile, containerPath))
                return new ProvisioningContainer(profile);

            using (MemoryStream containerStream = new MemoryStream())
            {
                adapter.PullFile(profile, containerPath, containerStream);

                BinaryFormatter formatter = new BinaryFormatter();
                ProvisioningContainer container = (ProvisioningContainer)formatter.Deserialize(containerStream);
                container.profile = profile;

                return container;
            }
        }
Exemple #4
0
        // TODO Into separate class!
        public static void TestModal(RoamingProfile profile)
        {
            if (profile == null)
                throw new ArgumentNullException("profile");

            try
            {
                RunModal(delegate
                {
                    profile.GetProvider().VerifyProfile(profile);
                    return null;
                });

                MessageBox.Show(Resources.MsgBox_Text_TestSuccessful, Resources.MsgBox_Title_TestSuccessful, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception)
            { }
        }
Exemple #5
0
 private void LoadProfileMethod(ref RoamingProfile profile)
 {
     ProfileNameTBOX.Text = profile.Name;
     DescriptionTBOX.Text = profile.Description;
     RemoteAddressTBOX.Text = profile.RemoteHost;
     LoginNameTBOX.Text = profile.UserName;
     LoginPasswordTBOX.Text = profile.Password;
     DatabasePasswordTBOX.Text = profile.DatabasePassword;
     DatabaseProviderLBOX.SelectedItem = profile.GetProvider();
     PreferFullSync.Checked = profile.PreferFullSync;
     
     LoadedProfile = profile;
 }