private void treeView_ItemDrag(object sender, ItemDragEventArgs e)
        {
            Binding binding = ((TreeNode)e.Item).Tag as Binding;

            if (binding != null)
            {
                DoDragDrop(Identifier.CreateNonVerbatim(binding.Name).ToSource(), DragDropEffects.Copy);
            }
        }
Exemple #2
0
        public static string FormatBindingList(Binding[] bindings)
        {
            StringBuilder sb = new StringBuilder();
            foreach (Binding binding in bindings)
            {
                if (sb.Length > 0)
                    sb.Append(", ");

                sb.Append(binding.GetFullName());
            }
            return sb.ToString();
        }
Exemple #3
0
 void IErrorReporter.AmbiguousReference(SourceRange sourceRange, Identifier identifier, Binding[] candidates)
 {
     string message = String.Format(CultureInfo.CurrentCulture, Resources.AmbiguousReference, identifier, FormattingHelpers.FormatBindingListWithCategory(candidates));
     HandleError(sourceRange, ErrorId.AmbiguousReference, message);
 }
Exemple #4
0
        public static ArgumentException BindingWithSameNameAlreadyInCollection(string paramName, Binding binding)
        {
            if (paramName == null)
                throw new ArgumentNullException("paramName");

            if (binding == null)
                throw new ArgumentNullException("binding");

            string message = String.Format(CultureInfo.CurrentCulture, Resources.BindingWithSameNameAlreadyInCollection, binding.Name);
            return new ArgumentException(message, paramName);
        }