Example #1
0
 private void Awake()
 {
     if (instance != null && instance != this)
     {
         Destroy(this);
     }
     else
     {
         instance = this;
     }
 }
        private async Task <bool> ValidateCourse(Course course)
        {
            ErrorText = "";
            if (course.Title.IsNull())
            {
                ErrorText = "* Must provide a course name.";
            }

            if (course.Start == null || course.End == null)
            {
                ErrorText = "* Must provide a course start and end date.";
            }

            if (course.Start >= course.End)
            {
                ErrorText = "* Course start date can not be after course end date.";
            }

            if (course.Status.IsNull())
            {
                ErrorText = "* Must select a course status.";
            }

            if (course.InstructorName.IsNull())
            {
                ErrorText = "* Must provide course instructor's information.";
            }

            if (!course.InstructorEmail.IsValidEmail())
            {
                ErrorText = "* Must provide a valid email for course instructor.";
            }

            if (!course.InstructorPhone.IsValidPhoneNumber())
            {
                ErrorText = "* Must provide a valid phone number for course instructor.";
            }

            if (Term.Start > course.Start)
            {
                ErrorText = $"* Course cannot begin before term start date of {Term.Start}.";
            }

            if (Term.End < course.End)
            {
                ErrorText = $"* Course cannot end after term end date of {Term.End}.";
            }

            return(ErrorText.IsNull());
        }
Example #3
0
 private void StartValidation()
 {
     if (_syntaxCheckEnabled && _editorTree != null)
     {
         // Transfer available errors from the tree right away
         foreach (var e in _editorTree.AstRoot.Errors)
         {
             ValidationResults.Enqueue(new ValidationError(e, ErrorText.GetText(e.ErrorType), e.Location));
         }
         // Run all validators
         _cts = new CancellationTokenSource();
         _aggregator.RunAsync(_editorTree.AstRoot, ValidationResults, _cts.Token).DoNotWait();
     }
 }
Example #4
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = PrePadding?.GetHashCode() ?? 0;
         hashCode = (hashCode * 397) ^ (ValueFormat?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (Padding?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (SymbolFormat?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (PostPadding?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (ErrorText?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ Unit.GetHashCode();
         return(hashCode);
     }
 }
Example #5
0
 private void StartValidation()
 {
     if (_syntaxCheckEnabled && _editorTree != null)
     {
         // Transfer available errors from the tree right away
         foreach (var e in _editorTree.AstRoot.Errors)
         {
             ValidationResults.Enqueue(new ValidationError(e, ErrorText.GetText(e.ErrorType), e.Location, _editorTree.AstRoot.Root.TextProvider.Version));
         }
         // Run all validators
         _cts = new CancellationTokenSource();
         var projected = IsProjectedBuffer(_editorTree.EditorBuffer);
         _aggregator.RunAsync(_editorTree.AstRoot, projected, _settings.LintOptions.Enabled, ValidationResults, _cts.Token).DoNotWait();
     }
 }
Example #6
0
        private bool ValidateTerm()
        {
            ErrorText = "";

            if (NewTerm.End <= NewTerm.Start)
            {
                ErrorText = $"* Term end date must be after start date.";
            }

            if (NewTerm.Title.IsNull())
            {
                ErrorText = $"* Term must have a Title.";
            }

            return(ErrorText.IsNull());
        }
Example #7
0
        private void Parse(bool IsExplicit)
        {
            ClearDispatcherTimer();

            if (XamlDocument != null && !CodeCompletionPopup.IsOpenSomewhere)
            {
                if (XamlDocument.SourceText != null)
                {
                    bool parseSuccess = false;
                    parseSuccess = (bool)this.ContentArea.InvokeScript("ParseXaml", new object[] { XamlDocument.SourceText });

                    if (parseSuccess)
                    {
                        IsValidXaml       = true;
                        ErrorText         = null;
                        ErrorLineNumber   = 0;
                        ErrorLinePosition = 0;

                        if (Kaxaml.Properties.Settings.Default.EnableAutoBackup)
                        {
                            XamlDocument.SaveBackup();
                        }

                        DelayedSnapshot();
                    }
                    else
                    {
                        ErrorText         = (string)this.ContentArea.InvokeScript("GetLastErrorMessage", null);
                        ErrorLineNumber   = int.Parse((string)this.ContentArea.InvokeScript("GetLastErrorLineNumber", null));
                        ErrorLinePosition = int.Parse((string)this.ContentArea.InvokeScript("GetLastErrorLinePos", null));

                        ErrorText = ErrorText.Replace("\r", "");
                        ErrorText = ErrorText.Replace("\n", "");
                        ErrorText = ErrorText.Replace("\t", "");

                        // get rid of everything after "Line" if it is in the last 30 characters
                        int pos = ErrorText.LastIndexOf("[Line");
                        if (pos > 0 && pos > (ErrorText.Length - 50))
                        {
                            ErrorText = ErrorText.Substring(0, pos);
                        }

                        IsValidXaml = false;
                    }
                }
            }
        }
Example #8
0
        /// <summary>
        /// Ensure that the command returned a zero exit code.
        /// </summary>
        /// <exception cref="ExecuteException">Thrown if the exit code isn't zero.</exception>
        public void EnsureSuccess()
        {
            if (ExitCode != 0)
            {
                // We're going to use the error text as the exception message if this
                // isn't empty, otherwise we'll use the output text.

                if (ErrorText.Trim().Length > 0)
                {
                    throw new ExecuteException(ExitCode, ErrorText);
                }
                else
                {
                    throw new ExecuteException(ExitCode, OutputText);
                }
            }
        }
Example #9
0
 void ReleaseDesignerOutlets()
 {
     if (Email != null)
     {
         Email.Dispose();
         Email = null;
     }
     if (ErrorText != null)
     {
         ErrorText.Dispose();
         ErrorText = null;
     }
     if (FirstNameChoice != null)
     {
         FirstNameChoice.Dispose();
         FirstNameChoice = null;
     }
     if (LastNameChoice != null)
     {
         LastNameChoice.Dispose();
         LastNameChoice = null;
     }
     if (PasswordChoice != null)
     {
         PasswordChoice.Dispose();
         PasswordChoice = null;
     }
     if (PasswordConfirm != null)
     {
         PasswordConfirm.Dispose();
         PasswordConfirm = null;
     }
     if (Signup != null)
     {
         Signup.Dispose();
         Signup = null;
     }
     if (UsernameChoice != null)
     {
         UsernameChoice.Dispose();
         UsernameChoice = null;
     }
 }
Example #10
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.Main);
            this.Window.SetFlags(WindowManagerFlags.KeepScreenOn, WindowManagerFlags.KeepScreenOn);

            database          = new SQLiteRepository();
            configRepo        = new ConfigRepository(database);
            loginService      = new LoginService();
            errorText         = new ErrorText();
            FakeSessionDelete = new FakeSessionDelete();
            configuracion     = configRepo.GetConfig();

            b      = FindViewById <ImageButton>(Resource.Id.Enviar);
            b2     = FindViewById <ImageButton>(Resource.Id.Leer);
            b3     = FindViewById <ImageButton>(Resource.Id.Contactos);
            b4     = FindViewById <ImageButton>(Resource.Id.Configuracion);
            logout = FindViewById <Button>(Resource.Id.logout);

            try
            {
                client = loginService.Connect();
            }
            catch (Exception ex)
            {
                this.FinishAffinity();
            }

            if (client.IsUserAuthorized())
            {
                usuario = client.Session.TLUser;
            }

            service = new Intent(this, typeof(ReceiveService));
            if (!IsMyServiceRunning(service))
            {
                StartService(service);
            }

            SetVisible(true);
        }
Example #11
0
        protected override void OnResume()
        {
            base.OnResume();

            database          = new SQLiteRepository();
            contactRepository = new ContactRepository(database);
            configRepository  = new ConfigRepository(database);
            configuracion     = configRepository.GetConfig();
            errorText         = new ErrorText();

            speechReco = SpeechRecognizer.CreateSpeechRecognizer(this.ApplicationContext);
            speechReco.SetRecognitionListener(this);
            intentReco = new Intent(RecognizerIntent.ActionRecognizeSpeech);
            intentReco.PutExtra(RecognizerIntent.ExtraLanguagePreference, "es");
            intentReco.PutExtra(RecognizerIntent.ExtraCallingPackage, this.PackageName);
            intentReco.PutExtra(RecognizerIntent.ExtraLanguageModel, RecognizerIntent.LanguageModelWebSearch);
            intentReco.PutExtra(RecognizerIntent.ExtraMaxResults, 1);

            gestureDetector = new GestureDetector(this);
            toSpeech        = new TextToSpeech(this, this);
        }
Example #12
0
        protected override void OnResume()
        {
            base.OnResume();

            database          = new SQLiteRepository();
            contactRepository = new ContactRepository(database);
            messageRepository = new MessageRepository(database);
            configRepository  = new ConfigRepository(database);
            configuracion     = configRepository.GetConfig();

            errorText      = new ErrorText();
            loginService   = new LoginService();
            messageService = new MessageService();

            count = 0;
            try
            {
                client = loginService.Connect();

                if (client.IsUserAuthorized())
                {
                    usuario = client.Session.TLUser;
                }
            }
            catch (Exception ex)
            {
                this.FinishAffinity();
            }

            speechReco = SpeechRecognizer.CreateSpeechRecognizer(this.ApplicationContext);
            speechReco.SetRecognitionListener(this);
            intentReco = new Intent(RecognizerIntent.ActionRecognizeSpeech);
            intentReco.PutExtra(RecognizerIntent.ExtraLanguagePreference, "es");
            intentReco.PutExtra(RecognizerIntent.ExtraCallingPackage, this.PackageName);
            intentReco.PutExtra(RecognizerIntent.ExtraLanguageModel, RecognizerIntent.LanguageModelWebSearch);
            intentReco.PutExtra(RecognizerIntent.ExtraMaxResults, 1);

            gestureDetector = new GestureDetector(this);
            toSpeech        = new TextToSpeech(this, this);
        }
Example #13
0
        private static DialogResult DoShow(ErrorType type, ErrorText text)
        {
            string dialogMsg;
            switch (type)
            {
                case ErrorType.Error:
                    dialogMsg =
                        "\t\tERRO\n\n" +
                        text.Title + "\n\n" +
                        text.Details;
                    return MessageBox.Show(
                        dialogMsg, "TeleBajaUEA", MessageBoxButtons.OK,
                        MessageBoxIcon.Error);

                case ErrorType.Warnning:
                    dialogMsg =
                        "\t\tALERTA\n\n" +
                        text.Title + "\n\n" +
                        text.Details;
                    return MessageBox.Show(
                        dialogMsg, "TeleBajaUEA", MessageBoxButtons.OK,
                        MessageBoxIcon.Exclamation);

                case ErrorType.Info:
                    dialogMsg =
                        "\t\tATENÇÃO\n\n" +
                        text.Title + "\n\n" +
                        text.Details;
                    return MessageBox.Show(
                        dialogMsg, "TeleBajaUEA", MessageBoxButtons.OK,
                        MessageBoxIcon.Information);

                default:
                    throw new Exception("ErrorType '" +
                        Enum.GetName(typeof(ErrorType), type) +
                        "' não tem mensagem definida.");
            }
        }
Example #14
0
        public string CreateJsonData()
        {
            var statusObject = new JObject(
                new JProperty("IsSuccess", IsSuccess));

            if (!string.IsNullOrEmpty(ErrorText))
            {
                statusObject.Add(new JProperty("MessageType", "warning"));
                statusObject.Add(new JProperty("MessageText", ErrorText.EscapeHtml()));
            }

            if (!string.IsNullOrEmpty(SuccessText))
            {
                statusObject.Add(new JProperty("MessageType", "success"));
                statusObject.Add(new JProperty("MessageText", SuccessText.EscapeHtml()));
            }

            foreach (var m in _messages)
            {
                statusObject.Add(m);
            }
            return(statusObject.ToString());
        }
Example #15
0
        private void ReportError(Exception e)
        {
            IsValidXaml = false;

            if (e is XamlParseException)
            {
                XamlParseException x = (XamlParseException)e;
                ErrorLineNumber   = x.LineNumber;
                ErrorLinePosition = x.LinePosition;
            }
            else
            {
                ErrorLineNumber   = 0;
                ErrorLinePosition = 0;
            }

            Exception inner = e;

            while (inner.InnerException != null)
            {
                inner = inner.InnerException;
            }

            ErrorText = inner.Message;
            ErrorText = ErrorText.Replace("\r", "");
            ErrorText = ErrorText.Replace("\n", "");
            ErrorText = ErrorText.Replace("\t", "");

            // get rid of everything after "Line" if it is in the last 30 characters
            int pos = ErrorText.LastIndexOf("Line");

            if (pos > 0 && pos > (ErrorText.Length - 50))
            {
                ErrorText = ErrorText.Substring(0, pos);
            }
        }
Example #16
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.ContactosBloqueados);
            this.Window.SetFlags(WindowManagerFlags.KeepScreenOn, WindowManagerFlags.KeepScreenOn);

            database          = new SQLiteRepository();
            contactRepository = new ContactRepository(database);
            contactService    = new ContactService();
            loginService      = new LoginService();

            service = new Intent(this, typeof(ReceiveService));
            if (!IsMyServiceRunning(service))
            {
                StartService(service);
            }

            errorText      = new ErrorText();
            lista          = FindViewById <ListView>(Resource.Id.listView1);
            listaContactos = contactRepository.GetBlockedName();
            _adapter       = new MyAdapterBlocked(this, Resource.Layout.BloqueadosItem, listaContactos);
            lista.Adapter  = _adapter;
        }
Example #17
0
 public ErrorWindow(string errMsg)
 {
     InitializeComponent();
     ErrorText.AppendText(errMsg);
 }
Example #18
0
 // função usada quando se deseja especificar o texto de detalhe e usar
 // o título padrão
 public static DialogResult Show(ErrorType type, ErrorReason reason, string details)
 {
     ErrorText text = new ErrorText(GetText(reason).Title, details);
     return DoShow(type, text);
 }
Example #19
0
 private void ErrorCleanUp_Click(object sender, EventArgs e)
 {
     ErrorText.Clear();
 }
Example #20
0
        protected override void OnResume()
        {
            base.OnResume();

            configuracion = configRepository.GetConfig();

            loginService   = new LoginService();
            messageService = new MessageService();
            errorText      = new ErrorText();

            try
            {
                client = loginService.Connect();

                if (client.IsUserAuthorized())
                {
                    usuario = client.Session.TLUser;
                }
            }
            catch (Exception ex)
            {
                this.FinishAffinity();
            }

            try
            {
                var ch = messageRepository.GetMessages();

                if (ch.Count > 0)
                {
                    _chatsNotReaded = messageRepository.CountMessagesNotReaded();
                    var total = _chatsNotReaded.Sum(x => x.Counter);

                    if (_chatsNotReaded.Count > 0 && _chatsNotReaded.Count <= 5)
                    {
                        if (total != 1)
                        {
                            textToSpeak = $"Tiene {total} mensajes nuevos de ";
                        }
                        else
                        {
                            textToSpeak = $"Tiene ún mensaje nuevo de ";
                        }

                        for (var i = 0; i < _chatsNotReaded.Count; i++)
                        {
                            var contact = contactRepository.GetContactByPhone(_chatsNotReaded[i].FromTo);
                            if (_chatsNotReaded.Count > 1 && i == _chatsNotReaded.Count - 1)
                            {
                                if (contact != null)
                                {
                                    textToSpeak += $"y {contact.FirstName} {contact.LastName}. ";
                                }
                                else
                                {
                                    textToSpeak += $"y {_chatsNotReaded[i].FromTo}. ";
                                }
                            }
                            else
                            {
                                if (contact != null)
                                {
                                    textToSpeak += $"{contact.FirstName} {contact.LastName}, ";
                                }
                                else
                                {
                                    textToSpeak += $"{_chatsNotReaded[i].FromTo}, ";
                                }
                            }
                        }
                        if (_chatsNotReaded.Count != 1)
                        {
                            textToSpeak += "¿Quiere leerlos, entrar a una conversación, borrarla, no hacer nada o volver atrás?";
                        }
                        else
                        {
                            textToSpeak += "¿Quiere leerlo, entrar a una conversación, borrarla, no hacer nada o volver atrás?";
                        }
                    }
                    else if (_chatsNotReaded.Count > 5)
                    {
                        textToSpeak = $"Tiene {total} mensajes nuevos de más de 5 contactos. ¿Quiere leerlos, entrar a una conversación, borrarla, no hacer nada o volver atrás?";
                    }
                    else if (_chatsNotReaded.Count == 0)
                    {
                        textToSpeak = $"No tiene mensajes nuevos. ¿Quiere entrar a una conversación, borrarla, no hacer nada o volver atrás?";
                    }
                }
                else
                {
                    record      = false;
                    textToSpeak = "No tiene ninguna conversación.";
                }
            }
            catch (Exception ex)
            {
                textToSpeak = $"Ha ocurrido un error al obtener sus mensajes nuevos. ¿Quiere entrar a una conversación, borrarla, no hacer nada o volver atrás?";
            }

            speechReco = SpeechRecognizer.CreateSpeechRecognizer(this.ApplicationContext);
            speechReco.SetRecognitionListener(this);
            intentReco = new Intent(RecognizerIntent.ActionRecognizeSpeech);
            intentReco.PutExtra(RecognizerIntent.ExtraLanguagePreference, "es");
            intentReco.PutExtra(RecognizerIntent.ExtraCallingPackage, this.PackageName);
            intentReco.PutExtra(RecognizerIntent.ExtraLanguageModel, RecognizerIntent.LanguageModelWebSearch);
            intentReco.PutExtra(RecognizerIntent.ExtraMaxResults, 1);

            gestureDetector = new GestureDetector(this);
            toSpeech        = new TextToSpeech(this, this);
        }
Example #21
0
        protected override void OnResume()
        {
            base.OnResume();

            configRepository = new ConfigRepository(database);
            configuracion    = configRepository.GetConfig();

            loginService   = new LoginService();
            messageService = new MessageService();
            errorText      = new ErrorText();

            try
            {
                client = loginService.Connect();

                if (client.IsUserAuthorized())
                {
                    usuario = client.Session.TLUser;
                }
            }
            catch (Exception ex)
            {
                this.FinishAffinity();
            }

            try
            {
                _chats  = messageRepository.GetMessagesByPhoneWithoutSeen(extra);
                contact = contactRepository.GetContactByPhone(extra);
                messageRepository.MarkMessagesAsRead(extra);
                var total = _chats.Sum(x => x.Mensaje.Length);
                if (_chats.Count > 0)
                {
                    textToSpeak = $"Los mensajes nuevos de {contact.FirstName} {contact.LastName} son: ";
                    if (total < 3900)
                    {
                        for (int i = 0; i < _chats.Count; i++)
                        {
                            int j = i + 1;
                            if (i == _chats.Count - 1)
                            {
                                textToSpeak += $" y {j.ToString()} {_chats[i].Mensaje}";
                            }
                            else
                            {
                                textToSpeak += $"{j.ToString()} {_chats[i].Mensaje}, ";
                            }
                        }
                        textToSpeak += ". ¿Quiere responder?";
                        accion       = "responder";
                    }
                    else
                    {
                        LeerMensajesSinLeer();
                    }
                }
                else
                {
                    textToSpeak = "¿Quiere leer desde una fecha, buscar por un mensaje, no hacer nada o volver atrás?";
                    accion      = "leer";
                }
            }
            catch (Exception ex)
            {
                textToSpeak = "Ha ocurrido un error al acceder a la base de datos. ¿Quiere leer desde una fecha, buscar por un mensaje, no hacer nada o volver atrás?";
                accion      = "leer";
            }

            speechReco = SpeechRecognizer.CreateSpeechRecognizer(this.ApplicationContext);
            speechReco.SetRecognitionListener(this);
            intentReco = new Intent(RecognizerIntent.ActionRecognizeSpeech);
            intentReco.PutExtra(RecognizerIntent.ExtraLanguagePreference, "es");
            intentReco.PutExtra(RecognizerIntent.ExtraCallingPackage, this.PackageName);
            intentReco.PutExtra(RecognizerIntent.ExtraLanguageModel, RecognizerIntent.LanguageModelWebSearch);
            intentReco.PutExtra(RecognizerIntent.ExtraMaxResults, 1);

            gestureDetector = new GestureDetector(this);
            toSpeech        = new TextToSpeech(this, this);
        }
Example #22
0
 public static void Add(ErrorText errorText)
 {
     layer.AddObject(errorText);
 }
Example #23
0
 private void RunToolStripMenuItem_Click(object sender, EventArgs e)
 {
     ReportText.Clear();
     ErrorText.Clear();
     OutputText.Clear();
     try
     {
         File.WriteAllText(ConfigurationManager.AppSettings.Get("ErrorsFile"), string.Empty);
         if (string.IsNullOrEmpty(currFile))
         {
             MessageBox.Show("Збережіть файл перед тим як компілювати");
             return;
         }
         if (!ifSave)
         {
             Save();
         }
         tabControl.SelectedIndex = tabControl.TabPages.IndexOfKey("ReportTab");
         // Отримання і формування мен ввхідних та вихідних файлів
         var inFileName = Path.ChangeExtension(currFile, ".mc");
         if (!File.Exists(inFileName))
         {
             ReportText.AppendText($"Файл за шляхом: {inFileName} не знайдено!\r\n");
             ReportText.AppendText($"Скомпілюйте проект ще раз!\r\n");
         }
         else
         {
             var outFileName = currWay + "\\" + currName + ".mc_report";
             ReportText.AppendText("Запуск проекту почався...\r\n");
             ReportText.AppendText("Вхідний файл " + currName + ".mc.\r\n");
             ReportText.AppendText("Пошук помилок...\r\n");
             bool isError = false;
             try
             {
                 sol = new SSol();
                 sol.Run(inFileName, outFileName);
             }
             catch (MessageException ex)
             {
                 isError = true;
                 File.WriteAllText(ConfigurationManager.AppSettings.Get("ErrorsFile"), ex.Message);
             }
             ErrorText.AppendText(File.ReadAllText(ConfigurationManager.AppSettings.Get("ErrorsFile")));
             if (!isError)
             {
                 tabControl.SelectedIndex = tabControl.TabPages.IndexOfKey("OutputTab");
                 OutputText.AppendText(File.ReadAllText(outFileName));
                 ReportText.AppendText("Помилок не знайдено.\r\n");
                 ReportText.AppendText("Кінець.");
             }
             else
             {
                 tabControl.SelectedIndex = tabControl.TabPages.IndexOfKey("ErrorTab");
                 ReportText.AppendText("Упс.. знайшлись помилки.\r\n");
             }
         }
     }
     catch (Exception ex)
     {
         Logger.Log.Error(ex.Message + " " + ex.StackTrace);
         MessageBox.Show("Ой...щось пішло не так, глянь Error.log", "НЛО", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Example #24
0
        public void Initialize()
        {
            if (FieldInfo != null)
            {
                var           methodInfo    = this.GetType().GetMethod("RegisterCallbackInternal", BindingFlags.NonPublic | BindingFlags.Instance);
                var           method        = methodInfo.MakeGenericMethod(m_fieldInfo.FieldType);
                VisualElement visualElement = null;

                bool failed = false;
                Type type   = m_fieldInfo.FieldType;

                TitleAttribute titleAttrib = m_fieldInfo.GetCustomAttribute <TitleAttribute>();

                string fieldName = "";
                if (titleAttrib != null)
                {
                    fieldName = titleAttrib.Title;
                }
                else
                {
                    fieldName = m_fieldInfo.Name;
                }

                if (type == typeof(float))
                {
                    visualElement = new FloatField(fieldName);
                }
                else if (type == typeof(int))
                {
                    visualElement = new IntegerField(fieldName);
                }
                else if (type == typeof(string))
                {
                    visualElement = new TextField(fieldName);
                }
                else if (type == typeof(bool))
                {
                    visualElement = new Toggle(fieldName);
                }
                else if (type == typeof(AnimationCurve))
                {
                    visualElement = new CurveField(fieldName);
                }
                else if (type == typeof(Vector2))
                {
                    visualElement = new Vector2Field(fieldName);
                }
                else if (type == typeof(Vector3))
                {
                    visualElement = new Vector3Field(fieldName);
                }
                else if (type == typeof(Vector4))
                {
                    visualElement = new Vector4Field(fieldName);
                }
                else if (type == typeof(Color))
                {
                    visualElement = new ColorField(fieldName);
                }
                else if (type == typeof(Enum))
                {
                    visualElement = new EnumField(fieldName);
                }
                else
                {
                    failed             = true;
                    visualElement      = new ErrorText("Unsupported Field: " + FieldInfo.Name + ":" + type.Name);
                    visualElement.name = "error-text";
                }

                if (!failed)
                {
                    var          baseFieldType = typeof(BaseField <>).MakeGenericType(type);
                    PropertyInfo info          = baseFieldType.GetProperty("value");
                    info.SetValue(visualElement, m_fieldInfo.GetValue(m_fieldOwner));
                    method?.Invoke(this, new object[] { visualElement });
                }

                this.Add(visualElement);
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (BoxView != null)
            {
                BoxView.Dispose();
                BoxView = null;
            }

            if (DescriptionText != null)
            {
                DescriptionText.Dispose();
                DescriptionText = null;
            }

            if (DialogView != null)
            {
                DialogView.Dispose();
                DialogView = null;
            }

            if (EditTextBox != null)
            {
                EditTextBox.Dispose();
                EditTextBox = null;
            }

            if (ErrorMessageText != null)
            {
                ErrorMessageText.Dispose();
                ErrorMessageText = null;
            }

            if (ErrorText != null)
            {
                ErrorText.Dispose();
                ErrorText = null;
            }

            if (OkButton != null)
            {
                OkButton.Dispose();
                OkButton = null;
            }

            if (OkButtonBottomConstraint != null)
            {
                OkButtonBottomConstraint.Dispose();
                OkButtonBottomConstraint = null;
            }

            if (PopupBottomConstraint != null)
            {
                PopupBottomConstraint.Dispose();
                PopupBottomConstraint = null;
            }

            if (PopupTitle != null)
            {
                PopupTitle.Dispose();
                PopupTitle = null;
            }

            if (PopupTopConstraint != null)
            {
                PopupTopConstraint.Dispose();
                PopupTopConstraint = null;
            }
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string paymentId, ErrorText, result, postdate, tranid, auth, amt, reference;
            string ErrorNo, udf1, udf2, udf3, udf4, udf5, trackid;

            paymentId = Request["paymentid"] ?? String.Empty;
            ErrorText = Request["ErrorText"] ?? String.Empty;
            ErrorNo   = Request["Error"] ?? String.Empty;

            udf1 = Request["udf1"] ?? String.Empty;
            udf2 = Request["udf2"] ?? String.Empty;
            udf3 = Request["udf3"] ?? String.Empty;
            udf4 = Request["udf4"] ?? String.Empty;
            udf5 = Request["udf5"] ?? String.Empty;

            if (ErrorNo == String.Empty)
            {
                result    = Request["result"] ?? String.Empty;
                postdate  = Request["postdate"] ?? String.Empty;
                tranid    = Request["tranid"] ?? String.Empty;
                auth      = Request["auth"] ?? String.Empty;
                trackid   = Request["trackid"] ?? String.Empty;
                reference = Request["ref"] ?? String.Empty;
                amt       = Request["amt"] ?? String.Empty;

                String responseDetails = string.Format("HDFC Response: paymentId[{0}], ErrorText[{1}], result[{2}], postdate[{3}], tranid[{4}], auth[{5}], amt[{6}], reference[{7}], ErrorNo[{8}], udf1[{9}], udf2[{10}], udf3[{11}], udf4[{12}], udf5[{13}], trackid[{14}]",
                                                       paymentId, ErrorText, result, postdate, tranid, auth, amt, reference, ErrorNo, udf1, udf2, udf3, udf4, udf5, trackid);
                Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write(responseDetails);

                if (trackid != String.Empty)
                {
                    Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("HDFC Track ID: " + trackid);
                    Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("HDFC Result: " + Request["result"].ToString());
                    KoDTicketing.GTICKV.LogEntry(trackid.Split('_')[0], "Payment Getaway Response: " + Request["result"].ToString(), "14", trackid.Split('_')[1].Split('-')[0]);
                    /*******************Payement Gateway Error Value Code**********************/
                    #region PG_DB for ReturnReceipt
                    Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("PG_DB");
                    string bookingid = Request["trackid"].Split('_')[1].ToString().Split('-')[0].ToString();
                    int    i         = GTICKBOL.Insert_Payment_DB(Request["result"].ToString(), bookingid, "HDFC");
                    #endregion PG_DB for ReturnReceipt
                    /*********************End******************************/
                    string qstring = UpdateResponse(trackid, reference, result, postdate, auth);
                    if (!string.IsNullOrEmpty(qstring))
                    {
                        string redirectURL = "REDIRECT=" + KoDTicketingIPAddress + "Payment/Print-Receipt.aspx" + qstring;
                        Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("HDFC response redirection: " + redirectURL);
                        Response.Write(redirectURL);
                        return;
                    }
                    else
                    {
                        Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("HDFC response processing failed and resulting in empty receipt.");
                    }
                }
                else
                {
                    Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("HDFC Response contains NO track ID");
                }
                Response.Write("REDIRECT=" + KoDTicketingIPAddress + "Payment/Print-Receipt.aspx?err=pay");
            }
            else
            {
                String errorDetails = string.Format("paymentId[{0}], ErrorText[{1}], ErrorNo[{2}], udf1[{3}], udf2[{4}], udf3[{5}], udf4[{6}], udf5[{7}]",
                                                    paymentId, ErrorText, ErrorNo, udf1, udf2, udf3, udf4, udf5);
                Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("HDFC Response: " + errorDetails);
                /*******************Payement Gateway Error Value Code**********************/
                #region PG_DB for ReturnReceipt
                Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("PG_DB");
                string bookingid = Request["trackid"].Split('_')[1].ToString().Split('-')[0].ToString();
                int    i         = GTICKBOL.Insert_Payment_DB(ErrorText.ToString(), bookingid, "HDFC");
                #endregion PG_DB for ReturnReceipt
                /*********************End******************************/

                string err;
                if (Request["ErrorText"] != null)
                {
                    err = Request["ErrorText"].ToString();
                }
                else
                {
                    err = "Error occcured in processing payment through HDFC payment gateway.";
                }
                Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("HDFC Error Response: " + err);
                Response.Write("REDIRECT=" + KoDTicketingIPAddress + "Payment/Print-Receipt.aspx?err=pay");
            }
        }//!postback
    }