Exemplo n.º 1
0
        private bool checkUniqueIdentifier(string value, SharedMemoryVariable shmVar)
        {
            if (!SharedMemoryVariableList.IsUniqueIdentifier(value, shmVar))
            {
                MessageBox.Show("The entered name already exists as a shared memory variable.\n\nPlease enter a unique name.", "Validation Failed", MessageBoxButton.OK, MessageBoxImage.Information);

                ShmVarsEditor.boolHasInvalidValue = true;
                ShmVarsEditor.strNewValidValue    = ShmVarsEditor.GetUniqueVarName();
                shmVar.Name = ShmVarsEditor.strNewValidValue;
                return(false);
            }

            return(true);
        }
Exemplo n.º 2
0
        private bool checkIECIdentifier(string value, SharedMemoryVariable shmVar)
        {
            if (!SharedMemoryVariableList.IsValidIECIdentifier(value))
            {
                MessageBox.Show("The entered name is not a valid IEC 61131 identifier.\n\nPlease enter a valid name.", "Validation Failed", MessageBoxButton.OK, MessageBoxImage.Information);

                ShmVarsEditor.boolHasInvalidValue = true;
                ShmVarsEditor.strNewValidValue    = ShmVarsEditor.GetUniqueVarName();
                shmVar.Name = ShmVarsEditor.strNewValidValue;
                return(false);
            }

            return(true);
        }