Пример #1
0
        /// <summary>
        /// Sets the given uri's and establish the connection according RFC.
        ///
        /// Throws IOException if there was a connection problem.
        /// </summary>
        /// <param name="uris">the to-path to use.</param>
        public void SetToPath(List <Uri> uris)
        {
            if (ToPath != null && ToPath.Count > 0)
            {
                throw new IllegalUseException("SetToPath can only be called once!");
            }

            foreach (Uri uri in uris)
            {
                if (RegexMSRP.IsMsrpUri(uri))
                {
                    ToPath.Add(uri);
                }
                else
                {
                    throw new IllegalUseException(string.Format("Invalid To-URI: {0}", uri));
                }
            }
            Connection.AddEndPoint(GetNextURI(), LocalAddress);

            TransactionManager = Connection.TransactionManager;
            TransactionManager.AddSession(this);
            TransactionManager.Initialize(this);

            _stack.AddActiveSession(this);

            _logger.Debug(string.Format("Added {0} toPaths with URI[0]={1}", _toPath.Count.ToString(), uris[0].ToString()));
        }
Пример #2
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = base.GetHashCode();
         hashCode = (hashCode * 397) ^ (SelectedSource != null ? SelectedSource.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ToPath != null ? ToPath.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ OverwriteFile.GetHashCode();
         hashCode = (hashCode * 397) ^ (FromPath != null ? FromPath.GetHashCode() : 0);
         return(hashCode);
     }
 }
Пример #3
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = base.GetHashCode();
         hashCode = (hashCode * 397) ^ (SelectedSource != null ? SelectedSource.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Files != null ? Files.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ IncludeMediaInfo.GetHashCode();
         hashCode = (hashCode * 397) ^ IsRecursive.GetHashCode();
         hashCode = (hashCode * 397) ^ IncludeDeleted.GetHashCode();
         hashCode = (hashCode * 397) ^ (ToPath != null ? ToPath.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (DisplayName != null ? DisplayName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ IsFilesSelected.GetHashCode();
         hashCode = (hashCode * 397) ^ IsFoldersSelected.GetHashCode();
         hashCode = (hashCode * 397) ^ IsFilesAndFoldersSelected.GetHashCode();
         return(hashCode);
     }
 }
Пример #4
0
        public async void Action()
        {
            try
            {
                ApplyButton.Enabled = false;
                Model.Update();
                File.Copy(FromPath, ToPath, true);
                File.Copy(FromPath.Replace(".dll", ".pdb"), ToPath.Replace(".dll", ".pdb"), true);
                await Task.Delay(100);

                ApplyButton.BackColor = Color.LightGreen;
                Model.Update();
                await Task.Delay(200);
            }
            finally
            {
                ApplyButton.ResetBackColor();
                ApplyButton.Enabled = true;
                Model.Update();
            }
        }