Example #1
0
 public virtual ReSharper.NTriples.Tree.IExpression SetExpression(ReSharper.NTriples.Tree.IExpression param)
 {
     using (JetBrains.Application.WriteLockCookie.Create(this.IsPhysical()))
     {
         TreeElement current = null, next = GetNextFilteredChild(current), result = null;
         next = GetNextFilteredChild(current);
         if (next == null)
         {
             return((ReSharper.NTriples.Tree.IExpression)result);
         }
         else
         {
             if (next.NodeType == ReSharper.NTriples.Impl.Tree.TokenType.IS_KEYWORD)
             {
                 current = next;
             }
             else
             {
                 return((ReSharper.NTriples.Tree.IExpression)result);
             }
         }
         next = GetNextFilteredChild(current);
         if (next == null)
         {
             if (param == null)
             {
                 return(null);
             }
             result = current = (TreeElement)JetBrains.ReSharper.Psi.ExtensionsAPI.Tree.ModificationUtil.AddChildAfter(this, current, (JetBrains.ReSharper.Psi.Tree.ITreeNode)param);
         }
         else
         {
             if (next.NodeType == ReSharper.NTriples.Impl.Tree.ElementType.EXPRESSION)
             {
                 if (param != null)
                 {
                     result = current = (TreeElement)JetBrains.ReSharper.Psi.ExtensionsAPI.Tree.ModificationUtil.ReplaceChild(next, (JetBrains.ReSharper.Psi.Tree.ITreeNode)param);
                 }
                 else
                 {
                     current = GetNextFilteredChild(next);
                     JetBrains.ReSharper.Psi.ExtensionsAPI.Tree.ModificationUtil.DeleteChild(next);
                 }
             }
             else
             {
                 if (param == null)
                 {
                     return(null);
                 }
                 result  = (TreeElement)JetBrains.ReSharper.Psi.ExtensionsAPI.Tree.ModificationUtil.AddChildBefore(next, (JetBrains.ReSharper.Psi.Tree.ITreeNode)param);
                 current = next;
             }
         }
         return((ReSharper.NTriples.Tree.IExpression)result);
     }
 }
        public static string ToUri(this IExpression expression)
        {
            if (expression == null)
            {
                return(null);
            }

            return(GetExpressionUri(expression.IdentifiersEnumerable));
        }