예제 #1
0
        public Gtk.Widget CreateAddinPreferenceWidget(Mono.Addins.Addin addin)
        {
            AddinPreferenceFactory factory = GetAddinPrefFactory(addin);

            if (factory == null)
            {
                return(null);
            }

            return(factory.CreatePreferenceWidget());
        }
예제 #2
0
        AddinPreferenceFactory GetAddinPrefFactory(Mono.Addins.Addin addin)
        {
            Mono.Addins.ExtensionNode node =
                Mono.Addins.AddinManager.GetExtensionNode("/Tomboy/AddinPreferences");

            if (node != null)
            {
                Mono.Addins.ExtensionNodeList child_nodes = node.ChildNodes;
                if (child_nodes != null)
                {
                    foreach (Mono.Addins.ExtensionNode child_node in child_nodes)
                    {
                        if (addin.Id.StartsWith(child_node.Addin.Id))
                        {
                            AddinPreferenceFactory factory =
                                ((Mono.Addins.TypeExtensionNode)child_node).GetInstance() as AddinPreferenceFactory;
                            return(factory);
                        }
                    }
                }
            }

            return(null);
        }