示例#1
0
        private void Awake()
        {
            pixels        = new Color[width * height];
            texture       = PTUtils.CreateTexture(width, height, Color.clear);
            image.texture = texture;

            header = InstantiateControl <TextControl>(leftPanel);
            header.transform.SetAsFirstSibling();
            header.Initialize("Noise type:");

            InstantiateToggle(FastNoise.NoiseType.Perlin);
            InstantiateToggle(FastNoise.NoiseType.PerlinFractal);
            InstantiateToggle(FastNoise.NoiseType.Simplex);
            InstantiateToggle(FastNoise.NoiseType.SimplexFractal);
            InstantiateToggle(FastNoise.NoiseType.Cubic);
            InstantiateToggle(FastNoise.NoiseType.CubicFractal);
            InstantiateToggle(FastNoise.NoiseType.Value);
            InstantiateToggle(FastNoise.NoiseType.ValueFractal);
            InstantiateToggle(FastNoise.NoiseType.Cellular);
            InstantiateToggle(FastNoise.NoiseType.WhiteNoise);

            noise = new FastNoise();
            Generate();
            SetupSkyboxAndPalette();
        }
示例#2
0
        public DrawPad()
        {
            InitializeComponent();

            Zoom = 1;

            _shapeDrawer    = new ShapeDrawer();
            _filler         = new Filler();
            _drawingControl = new DrawingControl();
            _drawingControl.SetShapDrawer(_shapeDrawer);
            _drawingControl.ShapeCreated += DrawingControl_ShapeCreated;

            _textControl              = new TextControl(gdiArea);
            _textControl.TextCreated += TextControl_TextCreated;
            _textControl.TextChanged += TextControl_TextChanged;

            _currentCommand = DrawPadCommand.None;
            _currentShape   = null;

            _outlineWidth = 2F;
            _outlineColor = Color.Black;
            _outlineDash  = DashStyle.Solid;
            _fillColor    = Color.Transparent;
            _textFont     = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 0);

            _shapeArea = 0;
        }
示例#3
0
 public virtual void Apply()
 {
     if (Created)
     {
         TextControl.Apply(_Text);
     }
 }
    /// <summary>
    /// Method that queues an item when it's used in combat
    /// </summary>
    public void QueueItem()
    {
        //if player has not selected different action and item was not used
        if (player_action == PlayerAction.None && !SuccessUse)
        {
            item       = Player.ItemUsed;
            SuccessUse = InventoryCanvasController.instance.InventoryStartUp.UseItem(item);
            InventoryCanvasController.instance.InventoryStartUp.CreateInventorySlot();
        }

        else
        {
            TextControl TempText = InventoryCanvasController.instance.ItemDialog.GetComponent <TextControl>();
            TempText.ItemDialog.text = "You have already selected another action!";
        }

        if (!SuccessUse)
        {
            Player.ItemUsed = string.Empty;
            item            = Player.ItemUsed;
        }

        CUI.UpdatePlayerSlider(Player.GetCurrentHealth());

        // Since an item is being used, no other Player action can be taken
        //player_action = 0;

        if (!Dragon.IsDead() && dragon_action != DragonAction.None && player_action == PlayerAction.None && SuccessUse)
        {
            TakeRound();
        }
    }
示例#5
0
        private static void MediatorExample2()
        {
            var nameControl = new TextControl();
            var ageControl  = new DateControl();
            var okButton    = new ButtonControl {
                Name = "Ok", IsActive = false
            };
            var closeButton = new ButtonControl {
                Name = "Close"
            };

            var mediator = new AgeConfirmDialogMediator(ageControl, okButton);

            ageControl.Mediator = mediator;
            okButton.Mediator   = mediator;

            var dialog = new Dialog()
            {
                Controls = new Control[]
                {
                    nameControl, //0
                    ageControl,  //1
                    okButton,    //2
                    closeButton  //3
                }
            };

            (dialog.Controls[2] as ButtonControl).Click();

            (dialog.Controls[1] as DateControl).Value = new DateTime(2010, 01, 01);
            (dialog.Controls[2] as ButtonControl).Click();

            (dialog.Controls[1] as DateControl).Value = new DateTime(1990, 01, 01);
            (dialog.Controls[2] as ButtonControl).Click();
        }
示例#6
0
 // Use this for initialization
 void Start()
 {
     textControl = GameObject.Find("TextController").GetComponent <TextControl> ();
     //魔法やPlayerのレベルを取得する
     GameObject.Find("LevelController").GetComponent <LoadLevel> ().LevelUpdate();
     GameObject.Find("LevelController").GetComponent <LoadLevel> ().StatusUpdate();
 }
示例#7
0
 // Use this for initialization
 void Start()
 {
     if (m_textControl == null)
     {
         m_textControl = this.GetComponent <TextControl>();
     }
 }
示例#8
0
        public virtual Control AddTo(Control container)
        {
            TextControl t = new TextControl(this);

            container.Controls.Add(t);
            return(t);
        }
示例#9
0
 void Start()
 {
     changePuck  = FindObjectOfType <ChangePuck>();
     textControl = FindObjectOfType <TextControl>();
     won         = false;
     SceneManager.sceneLoaded += Setup;
 }
        /// <summary>
        /// Method that writes the currently selected item's description
        /// </summary>
        /// <param name="Slot">Currently selected item</param>
        public void DisplayItemDescription(Toggle Slot)
        {
            TextControl TempText = InventoryCanvasController.instance.ItemDescription.GetComponent <TextControl>();
            Item        TempItem = itemDatabase.database[Slot.gameObject.name];

            TempText.Arrow.text = TempItem.Description;
        }
示例#11
0
 public static void SetToolTipBindingPath(this TextControl textControl, Func <string> toolTipBinding)
 {
     textControl.Bind("ToolTip", new DelegateBinding <string>(
                          toolTipBinding,
                          s => { textControl.ToolTip = toolTipBinding.Invoke(); }
                          ));
 }
示例#12
0
 public static void SetTextBindingPath(this TextControl textControl, Func <string> textBinding)
 {
     textControl.Bind("Text", new DelegateBinding <string>(
                          textBinding,
                          s => { textControl.Text = textBinding.Invoke(); }
                          ));
 }
示例#13
0
        public void Gtest2SimplePasses()
        {
            // Use the Assert class to test conditions
            var x = new TextControl();

            Assert.IsTrue(x.Selectflag);
        }
        public void ControlEvent_Constructor_SetsSender()
        {
            Control expected = new TextControl(Area.None, string.Empty);
            var     eve      = new FakeControlEvent(expected);

            Assert.AreSame(expected, eve.Sender);
        }
示例#15
0
    //private CommandController m_commandController;
    // Use this for initialization
    void Start()
    {
        m_textControl = this.GetComponent <TextControl> ();
        stageSelect   = GameObject.Find("Main Camera").GetComponent <StageSelect> ();

        UpdateLines(LoadFileName);
        StartScenario();
    }
示例#16
0
 public static void Initialize()
 {
     canvas = GameObject.Find("Misc");
     if (!popupText)
     {
         popupText = Resources.Load <TextControl>("Prefabs/PopupTextParent");
     }
 }
示例#17
0
        private async Task OpenFile(string filePath)
        {
            cancelIndexingTokenSource?.Cancel();
            await TextControl.OpenFile(filePath);

            EnableMenu();
            StartOrResumeIndexing();
        }
示例#18
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Handles the Click event of the m_btnMatchSingleWord control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        /// ------------------------------------------------------------------------------------
        private void m_btnMatchSingleWord_Click(object sender, EventArgs e)
        {
            int selStart = TextControl.SelectionStart;

            ReplaceSelectedTextInCurrentEditControl(kContiguousLettersMatchExpr);
            TextControl.SelectionStart  = selStart + kContiguousLettersMatchExpr.Length;
            TextControl.SelectionLength = 0;
            TextControl.Focus();
        }
        public TextViewModel(string key, string label, string required, TextControl control)
            : base(key, label, required, control)
        {
            _control = control;

            _width       = 300;
            _pattern     = control.Pattern;
            _restriction = control.Restriction;
            _hint        = control.Hint;
        }
        private BaseGauge BuildTextControl(IGaugeItem gaugeItem)
        {
            TextControl textControl = new TextControl();

            textControl.GaugeItem = gaugeItem;

            // Add it to the page
            this.CanvasGrid.Children.Add(textControl);
            return(textControl);
        }
示例#21
0
        private async Task GoToLine()
        {
            GoToLine goToWindows = new GoToLine();

            goToWindows.ShowDialog();
            if (goToWindows.LineNumber > 0)
            {
                await TextControl.GoToLineNumber(goToWindows.LineNumber);
            }
        }
示例#22
0
        public MenuScene()
        {
            startGameBtn          = new Button(new Point(Main.WINDOW_SIZE_X / 2, Main.WINDOW_SIZE_Y / 2), "Start game!", OriginMode.Center);
            startGameBtn.OnClick += (s, e) => { Main.Instance.SceneManager.SwitchSceneEmpty(ActiveScene.Game); };

            quitGameBtn          = new Button(new Point(Main.WINDOW_SIZE_X / 2, Main.WINDOW_SIZE_Y / 2 + 100), "Quit!", OriginMode.Center);
            quitGameBtn.OnClick += (s, e) => { Main.Instance.Exit(); };

            title = new TextControl("Pac-Man", Main.NewFont, new Point(Main.WINDOW_SIZE_X / 2, 100), null, OriginMode.Center);
        }
示例#23
0
        public void Gtest1SimplePasses()
        {
            // Use the Assert class to test conditions
            var x = new TextControl();

            Assert.IsEmpty(x.chatComent.text);
            //x.chatComent.text = "Matsuno";
            //x.Selecter();
            //Assert.AreEqual(x.chatComent.color, Color.green) ;
        }
示例#24
0
        protected override Control CreateControl()
        {
            TextControl c = new TextControl();

            c.TextType   = TextControl.TextTypes.String;
            c.IsRequired = this.IsRequired;
            c.MaxLength  = this.MaxLength;
            c.MinLength  = this.MinLength;
            return(c);
        }
        protected void viewcontrol3F_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            //设置行操作的权限隐藏
            TextControl Configuration_Value = e.Row.FindControl("Configuration_Value") as TextControl;

            if (Configuration_Value != null)
            {
                Configuration_Value.SetValue(DataBinder.Eval(e.Row.DataItem, "a$Configuration_Value"));
            }
        }
示例#26
0
        protected override Control CreateControl()
        {
            TextControl c = new TextControl();

            c.TextType   = TextControl.TextTypes.Int64;
            c.IsRequired = this.IsRequired;
            c.MaxValue   = this.MaxValue;
            c.MinValue   = this.MinValue;
            return(c);
        }
示例#27
0
        public VRCEUiText(string name, Vector2 position, string text, Transform parent = null)
        {
            // Get required information
            Transform orgControl = VRCEUi.InternalUserInfoScreen.UsernameText;

            if (orgControl == null)
            {
                ExtendedLogger.LogError("Could not find Username text!");
                Success = false;
                return;
            }

            // Duplicate object
            GameObject goControl = GameObject.Instantiate(orgControl.gameObject);

            if (goControl == null)
            {
                ExtendedLogger.LogError("Could not duplicate Favorite button!");
                Success = false;
                return;
            }

            // Set UI properties
            Control     = goControl.transform;
            TextControl = Control.GetComponent <Text>().transform;

            // Remove components that may cause issues
            GameObject.DestroyImmediate(Control.GetComponent <RectTransform>());

            // Set control properties
            Text = TextControl.GetComponent <Text>();

            // Set required parts
            if (parent != null)
            {
                Control.SetParent(parent);
            }
            goControl.name = name;

            // Modify RectTransform
            Position = Control.GetComponent <RectTransform>();
            RectTransform tmpRT = orgControl.GetComponent <RectTransform>();

            Position.localScale       = tmpRT.localScale;
            Position.anchoredPosition = tmpRT.anchoredPosition;
            Position.sizeDelta        = tmpRT.sizeDelta;
            Position.localPosition    = new Vector3(position.x, position.y, 0f);
            Position.localRotation    = tmpRT.localRotation;

            // Change UI properties
            Text.text = text;

            // Finish
            Success = true;
        }
        public override void InitialiseControls()
        {
            var flow = new FlowContainerControl
            {
                VerticalAlignment   = VerticalAlignment.Center,
                HorizontalAlignment = HorizontalAlignment.Center,
                ApplyAlignment      = true,
                Padding             = new Padding(10)
            };

            var backgroundControl = new BackgroundControl
            {
                Position            = Position,
                Padding             = new Padding(3),
                ShrinkToContents    = true,
                HorizontalAlignment = HorizontalAlignment.Center,
                VerticalAlignment   = VerticalAlignment.Center
            };

            var downFlow = new FlowContainerControl {
                FlowDirection = FlowDirection.TopDown, VerticalAlignment = VerticalAlignment.Top, ShrinkToContents = true
            };
            var sideFlow = new FlowContainerControl {
                FlowDirection = FlowDirection.LeftToRight, ShrinkToContents = true
            };
            var textControl = new TextControl {
                Parameters = _caption, Margin = new Padding(1)
            };
            var buttonControl = new ButtonControl {
                Text = "Cancel"
            };

            HoveredCellName = new TextControl {
                Parameters = HoveredCellText
            };

            buttonControl.OnClick += buttonControl_OnClick;

            Controls.Add(flow);
            flow.Controls.Add(backgroundControl);

            backgroundControl.Controls.Add(downFlow);

            downFlow.Controls.Add(textControl);
            downFlow.Controls.Add(sideFlow);
            downFlow.Controls.Add(HoveredCellName);
            downFlow.Controls.Add(buttonControl);

            foreach (var cell in Entities)
            {
                sideFlow.Controls.Add(new MenuEntityControl {
                    Entity = cell, Margin = new Padding(1)
                });
            }
        }
示例#29
0
        protected override Control CreateControl()
        {
            TextControl c = new TextControl();

            c.TextType   = TextControl.TextTypes.Password;
            c.Height     = 100;
            c.IsRequired = this.IsRequired;
            c.MaxLength  = this.MaxLength;
            c.MinLength  = this.MinLength;
            return(c);
        }
        protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
        {
            base.OnRenderSizeChanged(sizeInfo);

            if (sizeInfo.WidthChanged)
            {
                try
                {
                    if (sizeInfo.NewSize.Width < 300)
                    {
                        if (widthUnder300 == false || widthUnder300 == null)
                        {
                            widthUnder300 = true;

                            clockGridCol0.Width = new GridLength(Settings.TimeFormat == TimeFormat.Standard ? 40 : 20, GridUnitType.Pixel);

                            if (clockGrid.IsInitialized)
                            {
                                for (int i = 2; i < 49; i += 2)
                                {
                                    TextControl txt = (TextControl)clockGrid.Children[i];
                                    txt.FontSize = 12;
                                    txt.Margin   = new Thickness(2, 1, 2, 1);
                                }
                            }

                            FirstColumnSizeChangedEvent(EventArgs.Empty);
                        }
                    }
                    else if (widthUnder300 == true || widthUnder300 == null)
                    {
                        widthUnder300 = false;

                        clockGridCol0.Width = new GridLength(50 /*Settings.TimeFormat == "12" ? 60 : 50*/, GridUnitType.Pixel);

                        if (clockGrid.IsInitialized)
                        {
                            for (int i = 2; i < 49; i += 2)
                            {
                                TextControl txt = (TextControl)clockGrid.Children[i];
                                txt.FontSize = 15;
                                txt.Margin   = new Thickness(5, 0, 5, 0);
                            }
                        }

                        FirstColumnSizeChangedEvent(EventArgs.Empty);
                    }
                }
                catch
                {
                    // Viewing this in design mode throws an exception for some reason.
                }
            }
        }
示例#31
0
 protected void CarregarAndamento(TextControl txtAtendimento)
 {
     txtAtendimento.Text = String.Empty;
     if (ClienteAtivo.Atendimento == null) return;
     txtAtendimento.Select(txtAtendimento.Text.Length - 1, 1);
     txtAtendimento.Selection.Load(ClienteAtivo.Atendimento, StringStreamType.HTMLFormat);
 }
示例#32
0
        public void PopularAbaAndamento(
            TextControl txtAndamento,
            TextControl txtRegistroAndamento
            )
        {
            AoBuscar += () => { GetRegistroAndamento(txtRegistroAndamento); };
            AoAdicionar += () => { GetRegistroAndamento(txtRegistroAndamento); };
            AoLimpar += () => { GetRegistroAndamento(txtRegistroAndamento); };
            AoCancelar += () => { GetRegistroAndamento(txtRegistroAndamento); };

            AntesDeSalvar += () =>
            {
                if (!String.IsNullOrWhiteSpace(txtAndamento.Text))
                {
                    Recorte recorte = new Recorte(ProcessoAtivo, Sessao.UsuarioAtual);
                    string result;
                    txtAndamento.Save(out result, StringStreamType.HTMLFormat);
                    recorte.TextoRecorte = result;
                    recorte.DataInclusao = DateTime.Now;
                    ProcessoAtivo.Recortes.Add(recorte);
                    txtAndamento.Text = String.Empty;
                    GetRegistroAndamento(txtRegistroAndamento);
                }
                return true;
            };
        }
        public ConsultaProcessoClienteEstrutura(
            Form tela,
            Action<Modelo.Processo.ModeloProcesso> fichaProcesso,
            Label navegacao,
            NumberTextBox codigoCliente,
            TextBoxBase nomeCliente,
            TextBoxBase codigoProcesso,
            TextBoxBase numeroProcesso,
            TextBoxBase numeroOrdemProcesso,
            TextBoxBase varaProcesso,
            TextBoxBase cabecaProcesso,
            TextBoxBase tipoAcaoProcesso,
            TextBoxBase reuProcesso,
            TextBoxBase dataAjuizamentoProcesso,
            ListBox responsaveisProcesso,
            TextControl objetivoProcesso,
            TextControl andamentoProcesso,
            ButtonBase botaoPesquisar,
            ButtonBase botaoAnterior,
            ButtonBase botaoProximo,
            ButtonBase botaoFichaCompleta
            )
        {
            ListaProcessos = new List<Processo>();
            ClientePesquisa = new Cliente();

            codigoCliente.GotFocus += (sender, args) => tela.BeginInvoke(new Action(() => codigoCliente.SelectAll()));
            codigoCliente.PropertyChanged += (sender, args) =>
            {
                if (args.PropertyName == "Value")
                {
                    ClientePesquisa.Id = codigoCliente.Value;
                }
            };
            ClientePesquisa.IdAlterado += (antigo, novo) => codigoCliente.Value = novo;

            nomeCliente.TextChanged += (sender, args) => ClientePesquisa.Nome = nomeCliente.Text;
            ClientePesquisa.NomeAlterado += (antigo, novo) => nomeCliente.Text = novo;

            botaoPesquisar.Click += new EventHandler(botaoPesquisar_Click);

            botaoAnterior.Click += (sender,args) => IndiceProcessoAtual--;
            botaoProximo.Click += (sender, args) => IndiceProcessoAtual++;

            botaoFichaCompleta.Click+= (sender,args)=>{
                Processo ProcessoAtual = ListaProcessos[IndiceProcessoAtual];
                if (ProcessoAtual == null) return;

                fichaProcesso(ListaProcessos[IndiceProcessoAtual]);
            };

            CarregarProcesso = new Action(() =>
            {
                if (ListaProcessos.Count > IndiceProcessoAtual)
                {
                    Processo ProcessoAtual = ListaProcessos[IndiceProcessoAtual];
                    if (ProcessoAtual == null) return;
                    ProcessoAtual.ObterColecoes();
                    codigoProcesso.Text = ProcessoAtual.Id.ToString();
                    cabecaProcesso.Text = ProcessoAtual.Cabeca.Nome;
                    numeroProcesso.Text = ProcessoAtual.NumeroProcesso;
                    numeroOrdemProcesso.Text = ProcessoAtual.NumeroOrdem;
                    reuProcesso.Text = ProcessoAtual.Reu;
                    varaProcesso.Text = ProcessoAtual.Vara;
                    var tiposAcao = TiposAcao.Listar();
                    foreach (TipoAcao tpAcao in tiposAcao)
                    {
                        if (tpAcao.Id == ProcessoAtual.TipoAcao.Id)
                        {
                            tipoAcaoProcesso.Text = tpAcao.Descricao;
                            break;
                        }
                    }
                    dataAjuizamentoProcesso.Text = ProcessoAtual.DataAjuizamentoAcao.HasValue ? ProcessoAtual.DataAjuizamentoAcao.Value.ToString("ddMMyyyy") : null;
                    responsaveisProcesso.Items.Clear();
                    responsaveisProcesso.Items.AddRange(ProcessoAtual.Responsaveis.Select((r)=>r.Advogado).ToArray());
                    CarregarObjetivo(ProcessoAtual, objetivoProcesso);
                    GetRegistroAndamento(ProcessoAtual, andamentoProcesso);
                }
                if (ListaProcessos.Count > 0)
                {
                    navegacao.Text = String.Format("{0} de {1}", IndiceProcessoAtual + 1, ListaProcessos.Count);
                }
                else
                {
                    navegacao.Text = "0 de 0";
                }
            });

            LimparCampos = new Action(() =>
            {
                codigoProcesso.Text = String.Empty;
                cabecaProcesso.Text = String.Empty;
                numeroProcesso.Text = String.Empty;
                numeroOrdemProcesso.Text = String.Empty;
                reuProcesso.Text = String.Empty;
                varaProcesso.Text = String.Empty;
                tipoAcaoProcesso.Text = String.Empty;
                dataAjuizamentoProcesso.Text = String.Empty;
            });
        }
        void GetRegistroAndamento(Processo ProcessoAtivo, TextControl txtAtendimentosRealizados)
        {
            txtAtendimentosRealizados.Text = "";
            ProcessoAtivo.Recortes.OrderByDescending((re) => re.DataInclusao).ToList().ForEach((re) =>
            {
                if (re.DataInclusao.HasValue)
                {
                    txtAtendimentosRealizados.Select(txtAtendimentosRealizados.Text.Length - 1, 1);
                    string append = re.DataInclusao.Value.ToString("dd/MM/yyyy hh:mm:ss") + " - " + re.UsuarioInclusao.Nome;

                    txtAtendimentosRealizados.Selection.Load(String.Concat("<p style='color:midnightblue;'>", append, "</p>"), StringStreamType.HTMLFormat);
                    txtAtendimentosRealizados.Select(txtAtendimentosRealizados.Text.Length - 1, 1);

                    append = re.TextoRecorte;
                    txtAtendimentosRealizados.Selection.Load(append, StringStreamType.HTMLFormat);
                    txtAtendimentosRealizados.Select(txtAtendimentosRealizados.Text.Length - 1, 1);
                }
            });
        }
 protected void CarregarObjetivo(Processo ProcessoAtivo, TextControl objetivo)
 {
     if (ProcessoAtivo.Objetivo == null) return;
     objetivo.Text = String.Empty;
     objetivo.Select(objetivo.Text.Length - 1, 1);
     objetivo.Selection.Load(ProcessoAtivo.Objetivo, StringStreamType.HTMLFormat);
 }
示例#36
0
        public void PopularAbaPrincipal(
            TextBoxBase codigo,
            TextBoxBase cabeca,
            TextBoxBase processo,
            TextBoxBase nroordem,
            TextBoxBase reu,
            TextBoxBase forumVaraComarca,
            ComboBox tipoAcao,
            MaskedTextBox dataAjuizamento,
            TextBoxBase alerta,
            TextControl objetivo)
        {
            //Bindings
            ProcessoAtivo.IdAlterado += (antigo, novo) => codigo.Text = novo.ToString();

            //Ao trocar o cabeça do processo, altera a referencia.
            ProcessoAtivo.CabecaAlterado += (antigo, novo) =>
            {
                cabeca.Text = novo.Nome;
            };

            //Ao Buscar, só altera os dados do cabeça.
            ProcessoAtivo.Cabeca.NomeAlterado += (antigo, novo) =>
            {
                cabeca.Text = novo;
            };

            processo.TextChanged += (sender, args) => { ProcessoAtivo.NumeroProcesso = processo.Text; };
            ProcessoAtivo.NumeroProcessoAlterado += (antigo, novo) => processo.Text = novo;

            nroordem.TextChanged += (sender, args) => { ProcessoAtivo.NumeroOrdem = nroordem.Text; };
            ProcessoAtivo.NumeroOrdemAlterado += (antigo, novo) => nroordem.Text = novo;

            reu.TextChanged += (sender, args) => { ProcessoAtivo.Reu = reu.Text; };
            ProcessoAtivo.ReuAlterado += (antigo, novo) => reu.Text = novo;

            forumVaraComarca.TextChanged += (sender, args) => { ProcessoAtivo.Vara = forumVaraComarca.Text; };
            ProcessoAtivo.VaraAlterado += (antigo, novo) => forumVaraComarca.Text = novo;

            tipoAcao.Items.AddRange(TiposAcao.Listar().ToArray());
            tipoAcao.SelectedIndexChanged += (sender, args) => { ProcessoAtivo.TipoAcao = tipoAcao.SelectedItem == null ? null : (TipoAcao)tipoAcao.SelectedItem; };
            ProcessoAtivo.TipoAcao.IdAlterado += (antigo, novo) =>
            {
                foreach (TipoAcao tpAcao in tipoAcao.Items)
                {
                    if (tpAcao.Id == novo)
                    {
                        tipoAcao.SelectedItem = tpAcao;
                        break;
                    }
                }
            };

            dataAjuizamento.TextChanged += (sender, args) =>
            {
                DateTime result = default(DateTime);
                if (DateTime.TryParseExact(dataAjuizamento.Text, "dd/MM/yyyy", CultureInfo.CurrentCulture, DateTimeStyles.AllowWhiteSpaces, out result))
                {
                    ProcessoAtivo.DataAjuizamentoAcao = result;
                }
            };
            ProcessoAtivo.DataAjuizamentoAcaoAlterado += (antigo, novo) => dataAjuizamento.Text = novo.HasValue ? novo.Value.ToString("ddMMyyyy") : null;

            alerta.TextChanged += (sender, args) => {
                int valor = 0;
                if (Int32.TryParse(alerta.Text, out valor))
                {
                    ProcessoAtivo.QuantidadeDiasAlerta = valor;
                }
                else if (String.IsNullOrWhiteSpace(alerta.Text))
                {
                    ProcessoAtivo.QuantidadeDiasAlerta = null;
                }
                else
                {
                    alerta.Text = ProcessoAtivo.QuantidadeDiasAlerta.HasValue ? ProcessoAtivo.QuantidadeDiasAlerta.Value.ToString() : String.Empty;
                }
            };
            ProcessoAtivo.QuantidadeDiasAlertaAlterado += (antigo, novo) => alerta.Text = novo.ToString();

            AoAdicionar += () => CarregarObjetivo(objetivo);
            AoLimpar += () => CarregarObjetivo(objetivo);
            AoBuscar += () =>
            {
                CarregarObjetivo(objetivo);
            };

            AoCancelar += () =>
            {
                CarregarObjetivo(objetivo);
            };

            AntesDeSalvar += () =>
            {
                if (ProcessoAtivo.Responsaveis.Distinct().Count() != ProcessoAtivo.Responsaveis.Count)
                {
                    DialogoAlerta.Mostrar("Erro", "Não é possível salvar um processo com 2 advogados iguais como responsáveis.",
                           MessageBoxIcon.Error,
                           MessageBoxButtons.OK);
                    return false;
                }
                if (!String.IsNullOrWhiteSpace(objetivo.Text))
                {
                    string result = String.Empty;
                    objetivo.Save(out result, StringStreamType.HTMLFormat);
                    ProcessoAtivo.Objetivo = result;
                    CarregarObjetivo(objetivo);
                }
                return true;
            };
        }
示例#37
0
 protected void CarregarObservacoes(TextControl observacao)
 {
     observacao.Text = String.Empty;
     if (ProcessoAtivo.Observacao == null) return;
     observacao.Select(observacao.Text.Length - 1, 1);
     observacao.Selection.Load(ProcessoAtivo.Observacao, StringStreamType.HTMLFormat);
 }
示例#38
0
        public void PopularAbaAtendimento(
            TextControl txtAtendimento
            )
        {
            AoBuscar += () =>
            {
                CarregarAndamento(txtAtendimento);
            };

            AoCancelar += () =>
            {
                CarregarAndamento(txtAtendimento);
            };

            AntesDeSalvar += () =>
            {
                if (!String.IsNullOrWhiteSpace(txtAtendimento.Text))
                {
                    string result = String.Empty;
                    txtAtendimento.Save(out result, StringStreamType.HTMLFormat);
                    ClienteAtivo.Atendimento = result;
                    CarregarAndamento(txtAtendimento);
                }
                return true;
            };
        }
示例#39
0
        public void PopularAbaObservacao(
            TextControl observacao
            )
        {
            AoBuscar += () =>
            {
                CarregarObservacoes(observacao);
            };

            AoCancelar += () =>
            {
                CarregarObservacoes(observacao);
            };

            AntesDeSalvar += () =>
            {
                if (!String.IsNullOrWhiteSpace(observacao.Text))
                {
                    string result = String.Empty;
                    observacao.Save(out result, StringStreamType.HTMLFormat);
                    ProcessoAtivo.Observacao = result;
                    CarregarObservacoes(observacao);
                }
                return true;
            };
        }
 public MessagePromptCoordinator(TextControl prompt, AbstractMessageBox messageBox)
 {
     this.prompt = prompt;
     this.messageBox = messageBox;
 }