예제 #1
0
        private void btnExcluirVertice_Delete_Click(object sender, RoutedEventArgs e)
        {
            thriftGrafo.Vertice v = new thriftGrafo.Vertice();

            v.Nome      = Convert.ToInt32(txtNomeVertice_Delete.Text);
            v.Cor       = Convert.ToInt32(txtCorVertice_Delete.Text);
            v.Descricao = txtDescricaoVertice_Delete.Text;
            v.Peso      = Convert.ToDouble(txtPesoVertice_Delete.Text);

            Retorno r = client.deleteVertice(v);

            if (r.Sucesso)
            {
                txtNomeVertice_Delete.Text      = "";
                txtCorVertice_Delete.Text       = "";
                txtDescricaoVertice_Delete.Text = "";
                txtPesoVertice_Delete.Text      = "";
                txtNomeVertice_Delete.IsEnabled = true;
                MessageBox.Show(r.Mensagem);
            }
            else
            {
                txtNomeVertice_Delete.IsEnabled = true;
                MessageBox.Show(r.Mensagem);
            }
        }
예제 #2
0
        private void btnInserirVertice_Click(object sender, RoutedEventArgs e)
        {
            thriftGrafo.Vertice v1 = new thriftGrafo.Vertice();

            v1.Nome      = Convert.ToInt32(txtNomeVertice.Text);
            v1.Cor       = Convert.ToInt32(txtCorVertice.Text);
            v1.Descricao = txtDescricaoVertice.Text;
            v1.Peso      = Convert.ToDouble(txtPesoVertice.Text);

            Retorno r = client.insertVertice(v1);

            if (r.Sucesso)
            {
                txtNomeVertice.Text      = "";
                txtCorVertice.Text       = "";
                txtDescricaoVertice.Text = "";
                txtPesoVertice.Text      = "";
                MessageBox.Show(r.Mensagem);
            }
            else
            {
                MessageBox.Show(r.Mensagem);
            }
        }
예제 #3
0
        public void Read(TProtocol iprot)
        {
            iprot.IncrementRecursionDepth();
            try
            {
                TField field;
                iprot.ReadStructBegin();
                while (true)
                {
                    field = iprot.ReadFieldBegin();
                    if (field.Type == TType.Stop)
                    {
                        break;
                    }
                    switch (field.ID)
                    {
                    case 1:
                        if (field.Type == TType.List)
                        {
                            {
                                Vertices = new List <Vertice>();
                                TList _list0 = iprot.ReadListBegin();
                                for (int _i1 = 0; _i1 < _list0.Count; ++_i1)
                                {
                                    Vertice _elem2;
                                    _elem2 = new Vertice();
                                    _elem2.Read(iprot);
                                    Vertices.Add(_elem2);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 2:
                        if (field.Type == TType.List)
                        {
                            {
                                Arestas = new List <Aresta>();
                                TList _list3 = iprot.ReadListBegin();
                                for (int _i4 = 0; _i4 < _list3.Count; ++_i4)
                                {
                                    Aresta _elem5;
                                    _elem5 = new Aresta();
                                    _elem5.Read(iprot);
                                    Arestas.Add(_elem5);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    default:
                        TProtocolUtil.Skip(iprot, field.Type);
                        break;
                    }
                    iprot.ReadFieldEnd();
                }
                iprot.ReadStructEnd();
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }