Esempio n. 1
0
        public SoapEditorProxy(Connections.ConnectionData connData, ServiceDescription description, XmlSchemaSet schemas)
        {
            _connData = connData;
            _descrip  = description;
            _schemas  = schemas;
            _helper   = new XmlCompletionDataProvider(schemas, "http://schemas.xmlsoap.org/soap/envelope/"
                                                      , "soapenv", () => "xmlns:soap=\"" + description.TargetNamespace + "\""
                                                      , e => (e.Name == "Envelope" && e.QualifiedName.Namespace == "http://schemas.xmlsoap.org/soap/envelope/") ||
                                                      TypeMatchesAction(e.QualifiedName, this.Action));

            _baseUrl = new Uri(_connData.Url).GetLeftPart(UriPartial.Path);
            switch (_connData.Authentication)
            {
            case Connections.Authentication.Windows:
                _cred = CredentialCache.DefaultNetworkCredentials;
                break;

            case Connections.Authentication.Explicit:
                _cred = new NetworkCredential(_connData.UserName, _connData.Password);
                break;
            }

            _actionUrls = _descrip.Services.OfType <Service>()
                          .SelectMany(s => s.Ports.OfType <Port>().Where(SoapPort))
                          .SelectMany(p => _descrip.Bindings[p.Binding.Name].Operations.OfType <OperationBinding>())
                          .Select(o => new { Name = o.Name, Address = o.Extensions.OfType <SoapOperationBinding>().First().SoapAction })
                          .Distinct()
                          .ToDictionary(a => a.Name, a => a.Address);
        }
    public SoapEditorProxy(Connections.ConnectionData connData, ServiceDescription description, XmlSchemaSet schemas)
    {
      _connData = connData;
      _descrip = description;
      _schemas = schemas;
      _helper = new XmlCompletionDataProvider(schemas, "http://schemas.xmlsoap.org/soap/envelope/"
        , "soapenv", () => "xmlns:soap=\"" + description.TargetNamespace + "\""
        , e => (e.Name == "Envelope" && e.QualifiedName.Namespace == "http://schemas.xmlsoap.org/soap/envelope/")
          || TypeMatchesAction(e.QualifiedName, this.Action));

      _baseUrl = new Uri(_connData.Url).GetLeftPart(UriPartial.Path);
      switch (_connData.Authentication)
      {
        case Connections.Authentication.Windows:
          _cred = CredentialCache.DefaultNetworkCredentials;
          break;
        case Connections.Authentication.Explicit:
          _cred = new NetworkCredential(_connData.UserName, _connData.Password);
          break;
      }

      _actionUrls = _descrip.Services.OfType<Service>()
        .SelectMany(s => s.Ports.OfType<Port>().Where(SoapPort))
        .SelectMany(p => _descrip.Bindings[p.Binding.Name].Operations.OfType<OperationBinding>())
        .Select(o => new { Name = o.Name, Address = o.Extensions.OfType<SoapOperationBinding>().First().SoapAction })
        .Distinct()
        .ToDictionary(a => a.Name, a => a.Address);
    }
Esempio n. 3
0
 public void Dispose()
 {
     _helper          = null;
     _foldingManager  = null;
     _foldingStrategy = null;
     if (_foldingUpdateTimer != null)
     {
         _foldingUpdateTimer.Stop();
     }
     _foldingUpdateTimer = null;
 }
Esempio n. 4
0
 public void Dispose()
 {
   _helper = null;
   _foldingManager = null;
   _foldingStrategy = null;
   if (_foldingUpdateTimer != null)
     _foldingUpdateTimer.Stop();
   _foldingUpdateTimer = null;
 }
 public void SetContext(IEditorHelper parent, EditorWinForm control)
 {
     _parent  = parent;
     _control = control;
 }
 public void SetContext(IEditorHelper parent, CodeEditor control)
 {
   _parent = parent;
   _control = control;
 }
 public void SetContext(IEditorHelper parent, EditorWinForm control)
 {
   _parent = parent;
   _control = control;
 }
Esempio n. 8
0
        public void saveChanges()
        {
            using (var db = new RadioPlayer())
            {
                tbl_track track = null;

                if (!this._isCreateMode)
                {
                    var id = Convert.ToInt32(this.txtID.Text);
                    track = db.tbl_track.Where(t => t.track_id == id).FirstOrDefault();
                    if (track == null)
                    {
                        this._mainInterface.statusText = $"ERROR: ID '{this.txtID.Text}' does not exist.";
                        return;
                    }
                }
                else
                {
                    track = new tbl_track();
                }

                track.title             = this.txtTitle.Text;
                track.subtitle          = this.txtSubtitle.Text;
                track.bitrate           = this.txtBitrate.Text;
                track.publisher         = this.txtPublisher.Text;
                track.parental_advisory = (bool)this.checkboxPAL.IsChecked;
                track.folder_path       = this.txtFolder.Text;
                track.file_name         = this.txtFileName.Text;
                track.duration          = Convert.ToInt32(this.txtDuration.Text);
                track.format_id         = ((tbl_format)this.selectorFormat.item).format_id;
                track.filesize          = Convert.ToInt64(this.txtFileSize.Text);
                track.date_recorded     = this.dateRecorded.SelectedDate;
                track.date_released     = this.dateReleased.SelectedDate;
                track.likes             = Convert.ToInt32(this.txtLikes.Text);
                track.dislikes          = Convert.ToInt32(this.txtDislikes.Text);
                track.artists           = this.stringifyList(this.listArtists);
                track.composers         = this.stringifyList(this.listComposers);
                track.keywords          = this.stringifyList(this.listKeywords);

                // Sort out the genre mappings.
                List <tbl_genremap> genresToUnmap;
                List <tbl_genre>    genresToMap;
                IEditorHelper.getMappings <tbl_genremap, tbl_genre>(
                    out genresToUnmap, out genresToMap, this.listGenres.items.Select(i => i as tbl_genre),
                    track.tbl_genremap, (map, value) => map.genre_id == value.genre_id
                    );
                foreach (var toUnmap in genresToUnmap)
                {
                    db.tbl_genremap.Remove(toUnmap);
                }
                foreach (var toMap in genresToMap)
                {
                    tbl_genremap map = new tbl_genremap();
                    map.tbl_track = track;
                    map.tbl_genre = toMap;
                    db.tbl_genremap.Add(map);
                }

                // Sort out the mood mappings.
                List <tbl_moodmap> moodsToUnmap;
                List <tbl_mood>    moodsToMap;
                IEditorHelper.getMappings <tbl_moodmap, tbl_mood>(
                    out moodsToUnmap, out moodsToMap, this.listMoods.items.Select(i => i as tbl_mood),
                    track.tbl_moodmap, (map, value) => map.mood_id == value.mood_id
                    );
                foreach (var toUnmap in moodsToUnmap)
                {
                    db.tbl_moodmap.Remove(toUnmap);
                }
                foreach (var toMap in moodsToMap)
                {
                    tbl_moodmap map = new tbl_moodmap();
                    map.tbl_track = track;
                    map.tbl_mood  = toMap;
                    db.tbl_moodmap.Add(map);
                }

                if (this._isCreateMode)
                {
                    db.tbl_track.Add(track);
                }
                db.SaveChanges();
            }
        }