internal void EnforceUniqueName (WebDeployTarget target)
		{
			if (settingName)
				return;
			
			bool foundSameName = false;
			if (!string.IsNullOrEmpty (target.Name)) {
				foreach (WebDeployTarget c in this)
					if (c != target && c.Name == target.Name)
						foundSameName = true;
			}
			if (!foundSameName)
				return;
			
			int newIndex = 1;
			do {
				string newName = MonoDevelop.Core.GettextCatalog.GetString ("Web Deploy Target {0}", newIndex);
				if (ContainsName (newName) < 0) {
					settingName = true;
					target.name = newName;
					settingName = false;
					return;
				}
				newIndex++;
			} while (newIndex < int.MaxValue);
			throw new InvalidOperationException ("Ran out of indices for default target names.");
		}
Example #2
0
        protected override void OnRemove(int index, object value)
        {
            WebDeployTarget target = (WebDeployTarget)value;

            target.parent = null;
            base.OnRemove(index, value);
        }
Example #3
0
        protected override void OnInsert(int index, object value)
        {
            WebDeployTarget target = (WebDeployTarget)value;

            target.parent = this;
            EnforceUniqueName(target);
            base.OnInsert(index, value);
        }
Example #4
0
        protected override void OnSet(int index, object oldValue, object newValue)
        {
            WebDeployTarget target = (WebDeployTarget)newValue;

            target.parent = this;
            EnforceUniqueName(target);
            base.OnSet(index, oldValue, newValue);
        }
		protected virtual void AddActivated (object sender, System.EventArgs e)	
		{
			WebDeployTarget newTarget = new WebDeployTarget ();
			localCollection.Add (newTarget);
			TreeIter newIter = targetList.AppendValues (newTarget.GetMarkup(), newTarget);
			targetView.Selection.SelectIter (newIter);
			RunEditor (newTarget);
			UpdateTextForIter (newIter);
		}
		public void Load (WebDeployTarget target)
		{
			nameEntry.Text = target.Name;
			FileCopyConfiguration fConfig = null;
			try {
				fConfig = target.FileCopier == null? null : target.FileCopier.Clone ();
			} catch (InvalidOperationException) {// if the handler can't be found
			}
			selector.Configuration = fConfig;
		}
        public override bool Equals(object o)
        {
            WebDeployTarget other = o as WebDeployTarget;

            if (other != null)
            {
                return(fileCopier == other.fileCopier && name == other.name);
            }
            return(false);
        }
        protected virtual void EditActivated(object sender, System.EventArgs e)
        {
            TreeIter iter;

            if (targetView.Selection.GetSelected(out iter))
            {
                WebDeployTarget target = (WebDeployTarget)targetList.GetValue(iter, LISTCOL_TARGET);
                RunEditor(target);
                UpdateTextForIter(iter);
            }
        }
Example #9
0
        public void Load(WebDeployTarget target)
        {
            nameEntry.Text = target.Name;
            FileCopyConfiguration fConfig = null;

            try {
                fConfig = target.FileCopier == null? null : target.FileCopier.Clone();
            } catch (InvalidOperationException) {            // if the handler can't be found
            }
            selector.Configuration = fConfig;
        }
        protected virtual void AddActivated(object sender, System.EventArgs e)
        {
            WebDeployTarget newTarget = new WebDeployTarget();

            localCollection.Add(newTarget);
            TreeIter newIter = targetList.AppendValues(newTarget.GetMarkup(), newTarget);

            targetView.Selection.SelectIter(newIter);
            RunEditor(newTarget);
            UpdateTextForIter(newIter);
        }
        void RunEditor(WebDeployTarget target)
        {
            var targetEditor = new WebDeployTargetEditor();

            targetEditor.Load(target);
            targetEditor.Show();

            if (MonoDevelop.Ide.MessageService.ShowCustomDialog(targetEditor, (Gtk.Window)Toplevel) == (int)ResponseType.Ok)
            {
                targetEditor.Save(target);
            }
        }
        protected virtual void RemoveActivated(object sender, System.EventArgs e)
        {
            TreeIter iter;

            if (targetView.Selection.GetSelected(out iter))
            {
                WebDeployTarget targetToRemove = (WebDeployTarget)targetList.GetValue(iter, LISTCOL_TARGET);
                localCollection.Remove(targetToRemove);
                targetList.Remove(ref iter);
            }

            if (targetList.IterIsValid(iter) || (localCollection.Count > 0 && targetList.IterNthChild(out iter, localCollection.Count - 1)))
            {
                targetView.Selection.SelectIter(iter);
            }
        }
Example #13
0
        internal void EnforceUniqueName(WebDeployTarget target)
        {
            if (settingName)
            {
                return;
            }

            bool foundSameName = false;

            if (!string.IsNullOrEmpty(target.Name))
            {
                foreach (WebDeployTarget c in this)
                {
                    if (c != target && c.Name == target.Name)
                    {
                        foundSameName = true;
                    }
                }
            }
            if (!foundSameName)
            {
                return;
            }

            int newIndex = 1;

            do
            {
                string newName = MonoDevelop.Core.GettextCatalog.GetString("Web Deploy Target {0}", newIndex);
                if (ContainsName(newName) < 0)
                {
                    settingName = true;
                    target.name = newName;
                    settingName = false;
                    return;
                }
                newIndex++;
            }while (newIndex < int.MaxValue);
            throw new InvalidOperationException("Ran out of indices for default target names.");
        }
Example #14
0
 static public void Deploy(AspNetAppProject project, WebDeployTarget target, ConfigurationSelector configuration)
 {
     Deploy(project, new WebDeployTarget[] { target }, configuration);
 }
Example #15
0
 public int Add(WebDeployTarget target)
 {
     return(List.Add(target));
 }
		void RunEditor (WebDeployTarget target)
		{
			var targetEditor = new WebDeployTargetEditor ();
			targetEditor.Load (target);
			targetEditor.Show ();
			
			if (MonoDevelop.Ide.MessageService.ShowCustomDialog (targetEditor, (Gtk.Window) Toplevel) == (int) ResponseType.Ok)
				targetEditor.Save (target);
		}
		static public void Deploy (AspNetAppProject project, WebDeployTarget target, ConfigurationSelector configuration)
		{
			Deploy (project, new WebDeployTarget[] { target }, configuration);
		}
Example #18
0
 public void Remove(WebDeployTarget target)
 {
     List.Remove(target);
 }
		public void Remove (WebDeployTarget target)
		{
			List.Remove (target);
		}
		public int Add (WebDeployTarget target)
		{
			return List.Add (target);
		}
        void UpdateTextForIter(TreeIter iter)
        {
            WebDeployTarget target = (WebDeployTarget)targetList.GetValue(iter, LISTCOL_TARGET);

            targetList.SetValue(iter, LISTCOL_TEXT, target.GetMarkup());
        }
Example #22
0
 public void Save(WebDeployTarget target)
 {
     target.Name       = nameEntry.Text;
     target.FileCopier = selector.Configuration;
 }
		public void Save (WebDeployTarget target)
		{
			target.Name = nameEntry.Text;
			target.FileCopier = selector.Configuration;
		}