コード例 #1
0
        public void OnAddExtension()
        {
            DotNetProject project = (DotNetProject)CurrentNode.DataItem;

            if (project == null)
            {
                return;
            }
            AddinData data = project.GetAddinData();

            if (project == null)
            {
                return;
            }

            AddinDescription adesc = data.CachedAddinManifest;

            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));
                    }
                }
                adesc.Save();
            }
            dlg.Destroy();
        }
コード例 #2
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();
        }
コード例 #3
0
        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();
        }
コード例 #4
0
		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 ();
		}
コード例 #5
0
		public void OnAddExtension ()
		{
			DotNetProject project = (DotNetProject) CurrentNode.DataItem;
			if (project == null)
				return;
			AddinData data = project.GetAddinData ();
			if (project == null)
				return;
			
			AddinDescription adesc = data.CachedAddinManifest;
			
			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));
				}
				adesc.Save ();
			}
			dlg.Destroy ();
		}
コード例 #6
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 ();
		}