Example #1
0
        /// <summary>
        ///     Add a symbol to the global symbol table that maps to the passed in item.
        /// </summary>
        /// <param name="symbol"></param>
        /// <param name="item"></param>
        internal void AddSymbol(Symbol symbol, EFElement item)
        {
            if (!_symbolTable.ContainsKey(symbol))
            {
                var list = new List <EFElement>(1);
                list.Add(item);
                _symbolTable.Add(symbol, list);
            }
            else
            {
                var current = LookupSymbol(symbol);
                if (current.Identity != item.Identity)
                {
                    // duplicate symbol.  Add the new item to the list
                    _symbolTable[symbol].Add(item);

                    // make it ready to display to the user
                    var displayableSymbol = EFNormalizableItem.ConvertSymbolToExternal(symbol);

                    // add an duplicate symbol error
                    var msg       = String.Format(CultureInfo.CurrentCulture, Resources.NORMALIZE_DUPLICATE_SYMBOL_DEFINED, displayableSymbol);
                    var errorInfo = new ErrorInfo(
                        ErrorInfo.Severity.ERROR, msg, item, ErrorCodes.NORMALIZE_DUPLICATE_SYMBOL_DEFINED, ErrorClass.ResolveError);
                    AddError(errorInfo);
                }
            }
        }
        internal RefactorRenameDialog(EFNormalizableItem objectToRename)
        {
            ArgumentValidation.CheckForNullReference(objectToRename, "objectToRename");

            InitializeComponent();
            _objectToRename = objectToRename;
            this.newNameTextBox.Text = objectToRename.Name.Value;
            this.Loaded += OnLoaded;
        }
        internal EFRefactoringOperation(
            EFNormalizableItem objectToRename, string newName, EFRenameContributorInput contributorInput, IServiceProvider serviceProvider)
            : base(serviceProvider)
        {
            Debug.Assert(contributorInput != null, "contributorInput != null");

            _contributorInput = contributorInput;
            _newName = newName;
            _objectToRename = objectToRename;
        }
Example #4
0
 /// <summary>
 ///     NOTE: This will replace the entire RefName with this item's name, replacing any
 ///     list that might be there.  If you want to maintain the list, call SetRefName(IEnumerable<T> items).
 /// </summary>
 /// <param name="item"></param>
 internal override void SetRefName(EFNormalizableItem item)
 {
     if (item == null)
     {
         SetXAttributeValue(null);
     }
     else
     {
         SetXAttributeValue(item.GetRefNameForBinding(this));
     }
 }
        private static void RefactorRenameElementInDesignerOnly(EFNormalizableItem namedObject, string newName, bool showPreview)
        {
            Debug.Assert(namedObject != null, "namedObject != null");
            Debug.Assert(newName != null, "namedObject != newName");

            var input = new EFRenameContributorInput(namedObject, newName, namedObject.Name.Value);
            var refactoringOperation = new EFRefactoringOperation(
                namedObject,
                newName,
                input,
                new ServiceProviderHelper(PackageManager.Package.GetService(typeof(IServiceProvider)) as IServiceProvider));

            refactoringOperation.HasPreviewWindow = showPreview;
            refactoringOperation.DoOperation();
        }
Example #6
0
 /// <summary>
 ///     Sets the RefName property of this binding to point to the item.
 /// </summary>
 /// <param name="item"></param>
 internal abstract void SetRefName(EFNormalizableItem item);
Example #7
0
 internal override RenameCommand CreateRenameCommand(EFNormalizableItem element, string newName, bool uniquenessIsCaseSensitive)
 {
     return(new EntityDesignRenameCommand(element, newName, uniquenessIsCaseSensitive));
 }
Example #8
0
 internal abstract RenameCommand CreateRenameCommand(EFNormalizableItem element, string newName, bool uniquenessIsCaseSensitive);
Example #9
0
 internal abstract RenameCommand CreateRenameCommand(EFNormalizableItem element, string newName, bool uniquenessIsCaseSensitive);
 internal override RenameCommand CreateRenameCommand(EFNormalizableItem element, string newName, bool uniquenessIsCaseSensitive)
 {
     return new EntityDesignRenameCommand(element, newName, uniquenessIsCaseSensitive);
 }