示例#1
0
		protected override void OnChildNodeAdded (ExtensionNode node)
		{
			PolicyResourceNode res = (PolicyResourceNode) node;
			using (System.IO.StreamReader reader = res.GetStream ())
				res.AddedKeys = polSet.AddSerializedPolicies (reader);
			base.OnChildNodeAdded (node);
		}
示例#2
0
 /// <summary>
 /// Called when a child node is removed
 /// </summary>
 /// <param name="node">
 /// Removed node.
 /// </param>
 protected virtual void OnChildNodeRemoved(ExtensionNode node)
 {
     if (extensionNodeChanged != null)
     {
         extensionNodeChanged(this, new ExtensionNodeEventArgs(ExtensionChange.Remove, node));
     }
 }
示例#3
0
 internal void AttachExtensionNode(ExtensionNode enode)
 {
     this.extensionNode = enode;
     if (extensionNode != null)
     {
         extensionNode.SetTreeNode(this);
     }
 }
示例#4
0
        public void RemoveExtensionNodeHandler(string path, ExtensionNodeEventHandler handler)
        {
            ExtensionNode node = GetExtensionNode(path);

            if (node == null)
            {
                throw new InvalidOperationException("Extension node not found in path: " + path);
            }
            node.ExtensionNodeChanged -= handler;
        }
示例#5
0
        public object[] GetExtensionObjects(string path, Type arrayElementType, bool reuseCachedInstance)
        {
            ExtensionNode node = GetExtensionNode(path);

            if (node == null)
            {
                throw new InvalidOperationException("Extension node not found in path: " + path);
            }
            return(node.GetChildObjects(arrayElementType, reuseCachedInstance));
        }
        protected override void Run()
        {
            base.Run();

            /* Obtenemos una referencia al Addins para poder acceder a los recursos almacenados en la misma carpeta */
            foreach (ExtensionNode node in AddinManager.GetExtensionNodes("/MonoDevelop/Ide/MainMenu/Project"))
                if(node.Id == "ListOptions")
                    myNode = node;

            /** Agregamos el metodo stopServer para que se ejecute cuando el MonoDevelop se este cerrando **/
            MonoDevelop.Ide.IdeApp.Exiting += stopServer;

            try
            {
                /**Llamamos a stopServer para que detenga el servidor en caso que se este ejecuntando **/
                if(serverXSP != null)
                    stopServer(null, null);

                /** Ejecutamos el servidor XSP **/
                if(runServer() == -1)
                {
                    MessageDialog md = new MessageDialog(null, DialogFlags.Modal, MessageType.Error, ButtonsType.Close, "Could not start the server");
               		md.Run();
               		md.Destroy();
                    return;
                }

                /** Dormimos el proceso 3 segundos para darle tiempo a que cargue por completo el servidor **/
                Thread.Sleep(3000);
                /** Ejecutamos el firefox para que cargue la pagina de suscripcion **/
                if(runFirefox() == -1)
                {
                    MessageDialog md = new MessageDialog(null, DialogFlags.Modal, MessageType.Error, ButtonsType.Close, "Could not start the server");
               		md.Run();
               		md.Destroy();
                    stopServer(null, null);
                    return;
                }
            }
            catch(Exception ex)
            {
                MessageDialog md = new MessageDialog(null, DialogFlags.Modal, MessageType.Error, ButtonsType.Close, "Could not start the server");
               	md.Run();
               	md.Destroy();
            }
        }
		public UnitTestOptionsDialog (Gtk.Window parent, Properties properties) : base (parent, properties, "/MonoDevelop/NUnit/UnitTestOptions/GeneralOptions", false)
		{
			this.Title = GettextCatalog.GetString ("Unit Test Options");
		
			test = properties.Get<UnitTest>("UnitTest");
			configurationNode = AddinManager.GetExtensionNode("/MonoDevelop/NUnit/UnitTestOptions/ConfigurationOptions");
			
			TreeIter iter;
			if (store.GetIterFirst (out iter)) {
				OptionsDialogSection section = store.GetValue (iter, 0) as OptionsDialogSection;
				
				if (section != null && section.Id == "Configurations") {
					FillConfigurations (iter);
				}
			}
			ExpandCategories ();
			if (firstSection != null)
				ShowPage (firstSection);
		}
 void RemovePadNode(ExtensionNode node)
 {
     if (node is PadCodon)
         RemovePad ((PadCodon) node);
     else if (node is CategoryNode) {
         foreach (ExtensionNode cn in node.ChildNodes)
             RemovePadNode (cn);
     }
 }
		void ShowPadNode (ExtensionNode node)
		{
			if (node is PadCodon) {
				PadCodon pad = (PadCodon) node;
				RegisterPad (pad);
			}
			else if (node is CategoryNode) {
				foreach (ExtensionNode cn in node.ChildNodes)
					ShowPadNode (cn);
			}
		}
示例#10
0
		protected override void OnChildNodeRemoved (ExtensionNode node)
		{
			PolicyResourceNode res = (PolicyResourceNode) node;
			polSet.RemoveAll (res.AddedKeys);
			base.OnChildNodeRemoved (node);
		}
示例#11
0
		internal void AttachExtensionNode (ExtensionNode enode)
		{
			this.extensionNode = enode;
			if (extensionNode != null)
				extensionNode.SetTreeNode (this);
		}
示例#12
0
		internal static object ParseCommandId (ExtensionNode codon)
		{
			string id = codon.Id;
			if (id.StartsWith ("@", StringComparison.Ordinal))
				return id.Substring (1);
			else
				return id;
示例#13
0
		internal static object ParseCommandId (ExtensionNode codon)
		{
			string id = codon.Id;
			if (id.StartsWith ("@"))
				return id.Substring (1);

			return id;
/*			Type enumType = null;
			string typeName = id;
			
			int i = id.LastIndexOf (".");
			if (i != -1)
				typeName = id.Substring (0,i);
				
			enumType = codon.Addin.GetType (typeName);
				
			if (enumType == null)
				enumType = Type.GetType (typeName);

			if (enumType == null)
				enumType = typeof(Command).Assembly.GetType (typeName);

			if (enumType == null || !enumType.IsEnum)
				throw new InvalidOperationException ("Could not find an enum type for the command '" + id + "'.");
				
			try {
				return Enum.Parse (enumType, id.Substring (i+1));
			} catch {
				throw new InvalidOperationException ("Could not find an enum value for the command '" + id + "'.");
			}*/
		}
        /* Metodo a ejecutarse al pulsar OK */
        private void dialogResponde(object sender, ResponseArgs args)
        {
            if(args.ResponseId == Gtk.ResponseType.Ok)
            {
                dlgDatabaseConfiguration config = (dlgDatabaseConfiguration)sender;

                if(!config.validateDataConnection(2))
                    return;

                if(!config.getConnectionStringString())
                    return;

                connectionString = config.connectionString;

                if(!TestConnection())
                    return;

                /* Obtenemos la referencia al proyecto actual para modificar el webconfig o crearlo si este no existe */
                startupProject = IdeApp.ProjectOperations.CurrentSelectedProject;

                /* Obtenemos la ruta del directorio del projecto en un MonoDevelop.Core.FilePath */
                projectPath = startupProject.FileName.ParentDirectory;

                /* Obtenemos una referencia al Addins para poder acceder a los recursos almacenados en la misma carpeta */
                foreach (ExtensionNode node in AddinManager.GetExtensionNodes("/MonoDevelop/Ide/MainMenu/Project"))
                    if(node.Id == "ListOptions")
                        myNode = node;

                if(addReference())
                    if(createDatabase())
                        if(createWebConfig())
                            if(modifyWebConfig())
                            {
                                MessageDialog md = new MessageDialog(null, DialogFlags.Modal, MessageType.Info, ButtonsType.Close, "Configuration Finished");
                       			md.Run();
                       			md.Destroy();
                                return;
                            }
            }
        }
示例#15
0
 public ExtensionNodeEventArgs(ExtensionChange change, ExtensionNode node)
 {
     this.node   = node;
     this.change = change;
 }
示例#16
0
        void LoadExtensionElement(TreeNode tnode, string addin, ExtensionNodeDescriptionCollection extension, ref int curPos, BaseCondition parentCondition, bool inComplextCondition, ArrayList addedNodes)
        {
            foreach (ExtensionNodeDescription elem in extension)
            {
                if (inComplextCondition)
                {
                    parentCondition     = ReadComplexCondition(elem, parentCondition);
                    inComplextCondition = false;
                    continue;
                }

                if (elem.NodeName == "ComplexCondition")
                {
                    LoadExtensionElement(tnode, addin, elem.ChildNodes, ref curPos, parentCondition, true, addedNodes);
                    continue;
                }

                if (elem.NodeName == "Condition")
                {
                    Condition cond = new Condition(elem, parentCondition);
                    LoadExtensionElement(tnode, addin, elem.ChildNodes, ref curPos, cond, false, addedNodes);
                    continue;
                }

                string after = elem.GetAttribute("insertafter");
                if (after.Length > 0)
                {
                    int i = tnode.Children.IndexOfNode(after);
                    if (i != -1)
                    {
                        curPos = i + 1;
                    }
                }
                string before = elem.GetAttribute("insertbefore");
                if (before.Length > 0)
                {
                    int i = tnode.Children.IndexOfNode(before);
                    if (i != -1)
                    {
                        curPos = i;
                    }
                }

                // Find the type of the node in this extension
                ExtensionNodeType ntype = AddinManager.SessionService.FindType(tnode.ExtensionNodeSet, elem.NodeName, addin);

                if (ntype == null)
                {
                    AddinManager.ReportError("Node '" + elem.NodeName + "' not allowed in extension: " + tnode.GetPath(), addin, null, false);
                    continue;
                }

                string id = elem.GetAttribute("id");
                if (id.Length == 0)
                {
                    id = AutoIdPrefix + (++internalId);
                }

                TreeNode cnode = new TreeNode(id);

                ExtensionNode enode = ReadNode(cnode, addin, ntype, elem);
                if (enode == null)
                {
                    continue;
                }

                cnode.Condition        = parentCondition;
                cnode.ExtensionNodeSet = ntype;
                tnode.InsertChildNode(curPos, cnode);
                addedNodes.Add(cnode);

                if (cnode.Condition != null)
                {
                    Context.RegisterNodeCondition(cnode, cnode.Condition);
                }

                // Load children
                if (elem.ChildNodes.Count > 0)
                {
                    int cp = 0;
                    LoadExtensionElement(cnode, addin, elem.ChildNodes, ref cp, parentCondition, false, addedNodes);
                }

                curPos++;
            }
            if (Context.FireEvents)
            {
                tnode.NotifyChildrenChanged();
            }
        }
		protected virtual void OnChildNodeRemoved (ExtensionNode node)
		{
			if (extensionNodeChanged != null)
				extensionNodeChanged (this, new ExtensionNodeEventArgs (ExtensionChange.Remove, node));
		}
示例#18
0
 public void CopyTo(ExtensionNode[] array, int index)
 {
     if (list != null)
         list.CopyTo (array, index);
 }
示例#19
0
 void ShowPadNode(ExtensionNode node)
 {
     if (node is PadCodon) {
         PadCodon pad = (PadCodon) node;
         AddPad (pad, pad.DefaultPlacement, pad.DefaultStatus);
     }
     else if (node is CategoryNode) {
         foreach (ExtensionNode cn in node.ChildNodes)
             ShowPadNode (cn);
     }
 }
		protected override void OnChildNodeRemoved (ExtensionNode node)
		{
			base.OnChildNodeRemoved (node);
			regex = null;
		}
		public ExtensionNodeEventArgs (ExtensionChange change, ExtensionNode node)
		{
			this.node = node;
			this.change = change;
		}
示例#22
0
        void LoadExtensionElement(TreeNode tnode, string addin, ExtensionNodeDescriptionCollection extension, ModuleDescription module, ref int curPos, BaseCondition parentCondition, bool inComplextCondition, List <TreeNode> addedNodes)
        {
            foreach (ExtensionNodeDescription elem in extension)
            {
                if (inComplextCondition)
                {
                    parentCondition     = ReadComplexCondition(elem, parentCondition);
                    inComplextCondition = false;
                    continue;
                }

                if (elem.NodeName == "ComplexCondition")
                {
                    LoadExtensionElement(tnode, addin, elem.ChildNodes, module, ref curPos, parentCondition, true, addedNodes);
                    continue;
                }

                if (elem.NodeName == "Condition")
                {
                    Condition cond = new Condition(AddinEngine, elem, parentCondition);
                    LoadExtensionElement(tnode, addin, elem.ChildNodes, module, ref curPos, cond, false, addedNodes);
                    continue;
                }

                var            pnode          = tnode;
                ExtensionPoint extensionPoint = null;
                while (pnode != null && (extensionPoint = pnode.ExtensionPoint) == null)
                {
                    pnode = pnode.Parent;
                }

                string after = elem.GetAttribute("insertafter");
                if (after.Length == 0 && extensionPoint != null && curPos == -1)
                {
                    after = extensionPoint.DefaultInsertAfter;
                }
                if (after.Length > 0)
                {
                    int i = tnode.Children.IndexOfNode(after);
                    if (i != -1)
                    {
                        curPos = i + 1;
                    }
                }
                string before = elem.GetAttribute("insertbefore");
                if (before.Length == 0 && extensionPoint != null && curPos == -1)
                {
                    before = extensionPoint.DefaultInsertBefore;
                }
                if (before.Length > 0)
                {
                    int i = tnode.Children.IndexOfNode(before);
                    if (i != -1)
                    {
                        curPos = i;
                    }
                }

                // If node position is not explicitly set, add the node at the end
                if (curPos == -1)
                {
                    curPos = tnode.Children.Count;
                }

                // Find the type of the node in this extension
                ExtensionNodeType ntype = addinEngine.FindType(tnode.ExtensionNodeSet, elem.NodeName, addin);

                if (ntype == null)
                {
                    addinEngine.ReportError("Node '" + elem.NodeName + "' not allowed in extension: " + tnode.GetPath(), addin, null, false);
                    continue;
                }

                string id = elem.GetAttribute("id");
                if (id.Length == 0)
                {
                    id = AutoIdPrefix + (++internalId);
                }

                TreeNode cnode = new TreeNode(addinEngine, id);

                ExtensionNode enode = ReadNode(cnode, addin, ntype, elem, module);
                if (enode == null)
                {
                    continue;
                }

                cnode.Condition        = parentCondition;
                cnode.ExtensionNodeSet = ntype;
                tnode.InsertChildNode(curPos, cnode);
                addedNodes.Add(cnode);

                if (cnode.Condition != null)
                {
                    Context.RegisterNodeCondition(cnode, cnode.Condition);
                }

                // Load children
                if (elem.ChildNodes.Count > 0)
                {
                    int cp = 0;
                    LoadExtensionElement(cnode, addin, elem.ChildNodes, module, ref cp, parentCondition, false, addedNodes);
                }

                curPos++;
            }
            if (Context.FireEvents)
            {
                tnode.NotifyChildrenChanged();
            }
        }