Exemple #1
0
        public void AddAddinDependency()
        {
            DotNetProject p    = CurrentNode.GetParentDataItem(typeof(Project), true) as DotNetProject;
            AddinData     data = AddinData.GetAddinData(p);

            ExtensionSelectorDialog dlg = new ExtensionSelectorDialog(data.AddinRegistry, null, data.CachedAddinManifest.IsRoot, true);

            if (dlg.Run() == (int)Gtk.ResponseType.Ok)
            {
                AddinAuthoringService.AddReferences(data, dlg.GetSelection());
            }
            dlg.Destroy();
        }
        public void OnAddExtension()
        {
            DotNetProject p    = CurrentNode.GetParentDataItem(typeof(Project), true) as DotNetProject;
            AddinData     data = AddinData.GetAddinData(p);

            AddinDescription        desc = data.LoadAddinManifest();
            ExtensionSelectorDialog dlg  = new ExtensionSelectorDialog(data.AddinRegistry, null, desc.IsRoot, false);

            if (dlg.Run() == (int)ResponseType.Ok)
            {
                foreach (object ob in dlg.GetSelection())
                {
                    Console.WriteLine("pp s: " + ob);
                }
            }
            dlg.Destroy();
        }
        protected virtual void OnButtonAddClicked(object sender, System.EventArgs e)
        {
            ExtensionSelectorDialog dlg = new ExtensionSelectorDialog(data.AddinRegistry, adesc, adesc.IsRoot, false);

            if (dlg.Run() == (int)Gtk.ResponseType.Ok)
            {
                foreach (object ob in dlg.GetSelection())
                {
                    AddinDescription desc = null;
                    if (ob is ExtensionPoint)
                    {
                        ExtensionPoint ep  = (ExtensionPoint)ob;
                        Extension      ext = new Extension(ep.Path);
                        adesc.MainModule.Extensions.Add(ext);
                        desc = (AddinDescription)ep.Parent;
                    }
                    else if (ob is ExtensionNodeDescription)
                    {
                        ExtensionNodeDescription node = (ExtensionNodeDescription)ob;
                        desc = node.ParentAddinDescription;
                        string path = "";
                        while (node != null && !(node.Parent is Extension))
                        {
                            if (!node.IsCondition)
                            {
                                path = "/" + node.Id + path;
                            }
                            node = node.Parent as ExtensionNodeDescription;
                        }
                        Extension eext = (Extension)node.Parent;
                        Extension ext  = new Extension(eext.Path + "/" + node.Id + path);
                        adesc.MainModule.Extensions.Add(ext);
                    }
                    if (adesc.AddinId != desc.AddinId && !adesc.MainModule.DependsOnAddin(desc.AddinId))
                    {
                        adesc.MainModule.Dependencies.Add(new AddinDependency(desc.AddinId));
                    }
                }
                NotifyChanged();
                Fill();
            }
            dlg.Destroy();
        }
		protected virtual void OnButtonAddClicked(object sender, System.EventArgs e)
		{
			ExtensionSelectorDialog dlg = new ExtensionSelectorDialog (data.AddinRegistry, adesc, adesc.IsRoot, false);
			if (dlg.Run () == (int) Gtk.ResponseType.Ok) {
				foreach (object ob in dlg.GetSelection ()) {
					AddinDescription desc = null;
					if (ob is ExtensionPoint) {
						ExtensionPoint ep = (ExtensionPoint) ob;
						Extension ext = new Extension (ep.Path);
						adesc.MainModule.Extensions.Add (ext);
						desc = (AddinDescription) ep.Parent;
					}
					else if (ob is ExtensionNodeDescription) {
						ExtensionNodeDescription node = (ExtensionNodeDescription) ob;
						desc = node.ParentAddinDescription;
						string path = "";
						while (node != null && !(node.Parent is Extension)) {
							if (!node.IsCondition)
								path = "/" + node.Id + path;
							node = node.Parent as ExtensionNodeDescription;
						}
						Extension eext = (Extension) node.Parent;
						Extension ext = new Extension (eext.Path + "/" + node.Id + path);
						adesc.MainModule.Extensions.Add (ext);
					}
					if (adesc.AddinId != desc.AddinId && !adesc.MainModule.DependsOnAddin (desc.AddinId))
						adesc.MainModule.Dependencies.Add (new AddinDependency (desc.AddinId));
				}
				NotifyChanged ();
				Fill ();
			}
			dlg.Destroy ();
		}
		public void OnAddExtension ()
		{
			DotNetProject p = CurrentNode.GetParentDataItem (typeof(Project), true) as DotNetProject;
			AddinData data = AddinData.GetAddinData (p);
			
			AddinDescription desc = data.LoadAddinManifest ();
			ExtensionSelectorDialog dlg = new ExtensionSelectorDialog (data.AddinRegistry, null, desc.IsRoot,  false);
			if (dlg.Run () == (int) ResponseType.Ok) {
				foreach (object ob in dlg.GetSelection ())
					Console.WriteLine ("pp s: " + ob);
			}
			dlg.Destroy ();
		}
		public void AddAddinDependency ()
		{
			DotNetProject p = CurrentNode.GetParentDataItem (typeof(Project), true) as DotNetProject;
			AddinData data = AddinData.GetAddinData (p);
			
			ExtensionSelectorDialog dlg = new ExtensionSelectorDialog (data.AddinRegistry, null, data.CachedAddinManifest.IsRoot,  true);
			if (dlg.Run () == (int) Gtk.ResponseType.Ok) {
				AddinAuthoringService.AddReferences (data, dlg.GetSelection ());
			}
			dlg.Destroy ();
		}