protected override void ShallowCopyFrom (XObject copyFrom)
		{
			base.ShallowCopyFrom (copyFrom);
			var copyFromAtt = (XClosingTag) copyFrom;
			//immutable types
			Name = copyFromAtt.Name;
		}
Esempio n. 2
0
		protected override void ShallowCopyFrom (XObject copyFrom)
		{
			base.ShallowCopyFrom (copyFrom);
			var copyFromAtt = (XAttribute) copyFrom;
			//immutable types
			Name = copyFromAtt.Name;
			Value = copyFromAtt.Value;
		}
Esempio n. 3
0
		protected override void ShallowCopyFrom (XObject copyFrom)
		{
			base.ShallowCopyFrom (copyFrom);
			var copyFromEl = (XElement) copyFrom;
			Name = copyFromEl.Name; //XName is immutable value type
			//include attributes
			foreach (var a in copyFromEl.Attributes)
				Attributes.AddAttribute ((XAttribute) a.ShallowCopy ());
		}
Esempio n. 4
0
		protected override void ShallowCopyFrom (XObject copyFrom)
		{
			base.ShallowCopyFrom (copyFrom);
			XDocType copyFromDT = (XDocType) copyFrom;
			//immutable types
			RootElement = copyFromDT.RootElement;
			PublicFpi = copyFromDT.PublicFpi;
			InternalDeclarationRegion = copyFromDT.InternalDeclarationRegion;
			Uri = copyFromDT.Uri;
		}
		public override bool KeyPress (Gdk.Key key, char keyChar, Gdk.ModifierType modifier)
		{
			Tracker.UpdateEngine ();
			if (razorDocument == null)
				return NonCSharpCompletion (key, keyChar, modifier);

			var n = Tracker.Engine.Nodes.Peek ();
			if (prevNode is RazorExpression && !(n is RazorExpression))
				updateNeeded = true;
			prevNode = n;

			var state = Tracker.Engine.CurrentState;
			int off = document.Editor.Caret.Offset;

			char previousChar = off > 0 ? document.Editor.GetCharAt (off - 1) : ' ';
			char beforePrevious = off > 1 ? document.Editor.GetCharAt (off - 2) : ' ';

			// Determine completion context here, before calling base method to set the context correctly

			// Rule out Razor comments, html, transition sign (@) and e-mail addresses
			if (state is RazorCommentState || (previousChar != '@' && !(state is RazorState))  || keyChar == '@'
				|| (previousChar == '@' && Char.IsLetterOrDigit (beforePrevious)))
				return NonCSharpCompletion (key, keyChar, modifier);

			// Determine if we are inside generics
			if (previousChar == '<') {
				var codeState = state as RazorCodeFragmentState;
				if (codeState == null || !codeState.IsInsideGenerics)
					return NonCSharpCompletion (key, keyChar, modifier);
			}
			// Determine whether we begin an html tag or generics
			else if (keyChar == '<' && (n is XElement || !Char.IsLetterOrDigit (previousChar)))
				return NonCSharpCompletion (key, keyChar, modifier);
			// Determine whether we are inside html text or in code
			else if (previousChar != '@' && n is XElement && !(state is RazorSpeculativeState) && !(state is RazorExpressionState))
			    return NonCSharpCompletion (key, keyChar, modifier);

			// We're in C# context
			InitializeCodeCompletion ();
			SwitchToHidden ();

			bool result;
			try {
				result = base.KeyPress (key, keyChar, modifier);
				if (/*EnableParameterInsight &&*/ (keyChar == ',' || keyChar == ')') && CanRunParameterCompletionCommand ())
				    base.RunParameterCompletionCommand ();
			} finally {
				SwitchToReal ();
			}

			return result;
		}
		protected override void ShallowCopyFrom (XObject copyFrom)
		{
			base.ShallowCopyFrom (copyFrom);
			WebFormsDirective copyFromEl = (WebFormsDirective)copyFrom;
			name = copyFromEl.name; //XName is immutable value type
		}
Esempio n. 7
0
		protected virtual void ShallowCopyFrom (XObject copyFrom)
		{
			region = copyFrom.region; //immutable value type
		}
Esempio n. 8
0
 protected virtual void ShallowCopyFrom(XObject copyFrom)
 {
     region = copyFrom.region;             //immutable value type
 }