Ejemplo n.º 1
0
        protected void HandleClickedWhenSinglePropertySequenceValue(ListPropertyChoice choice)
        {
            bool fEmptyAllowed = XmlUtils.GetOptionalBooleanAttributeValue(m_configurationNode,
                                                                           "emptyAllowed", false);

            ChooseSinglePropertySequenceValue(m_mediator, choice.Value, choice.ParameterNode,
                                              this.PropertyName, fEmptyAllowed, this.PropertyTableGroup);
        }
Ejemplo n.º 2
0
 /// <summary>Gets choice's listId from its xml</summary>
 /// <returns>null if can't find it for some reason</returns>
 private string GetListIdFromListPropertyChoice(ListPropertyChoice choice)
 {
     try
     {
         return(choice.ParameterNode.SelectSingleNode("panels").SelectSingleNode("listPanel").Attributes["listId"].Value);
     }
     catch
     {
         return(null);
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Create a tab on the sidebar from a choice.
        /// </summary>
        protected void MakeAreaButton(ListPropertyChoice choice)
        {
#if USE_DOTNETBAR
            UIItemDisplayProperties display = choice.GetDisplayProperties();
            display.Text = display.Text.Replace("_", "");
            ButtonItem button = new ButtonItem(choice.Id, display.Text);
            button.Tag             = choice;
            choice.ReferenceWidget = button;

            button.ImageIndex = m_largeImages.GetImageIndex(display.ImageLabel);

            button.Text = display.Text;
            button.Name = choice.Value;

            button.ButtonStyle = eButtonStyle.ImageAndText;

            if (!display.Enabled)
            {
                button.Text = button.Text + " NA";
            }

            button.Click += new EventHandler(OnClickAreaButton);

            button.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText;
            //button.Image = ((System.Drawing.Image)(resources.GetObject("buttonItem2.Image")));
            //	button.Name = "buttonItem2";
            button.OptionGroup = "navBar";
            button.Style       = DevComponents.DotNetBar.eDotNetBarStyle.Office2003;

            button.Checked = display.Checked;

            MakePanelToGoWithButton(NavPane, button, choice);

            NavPane.Items.Add(button);
            //a button in this framework not really a Control... so I don't know how to use
            //(the same company's) balloon tip control on a sidebar button!
            //	m_mediator.SendMessage("RegisterHelpTarget", button.ContainerControl);
#else
            string tabname = GetListIdFromListPropertyChoice(choice);
            Tab    tab     = new Tab(tabname)
            {
                Enabled = choice.Enabled,
                Text    = choice.Label,
                Icon    = m_largeImages.GetImage(choice.ImageName),
                Tag     = choice,
            };
            choice.ReferenceWidget = tab;
            m_sidepane.AddTab(tab);
#endif
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Create a tab on the sidebar from a choice.
        /// </summary>
        protected void MakeAreaButton(ListPropertyChoice choice)
        {
            string tabname = GetListIdFromListPropertyChoice(choice);
            Tab    tab     = new Tab(tabname)
            {
                Enabled = choice.Enabled,
                Text    = choice.Label,
                Icon    = m_largeImages.GetImage(choice.ImageName),
                Tag     = choice,
            };

            choice.ReferenceWidget = tab;
            m_sidepane.AddTab(tab);
        }
Ejemplo n.º 5
0
		public List<ListView> GetControlsFromChoice(ListPropertyChoice choice)
		{
			List<ListView> controls = new List<ListView>();
			if (choice.ParameterNode == null)
				return null;

			foreach(XmlNode panel in choice.ParameterNode.SelectNodes("panels/listPanel"))
			{
				string listId = XmlUtils.GetManditoryAttributeValue(panel, "listId");
				string label = XmlUtils.GetManditoryAttributeValue(panel, "label");

				ListView list = MakeList(listId, label);
				controls.Add(list);
			}
			return controls;
		}
Ejemplo n.º 6
0
        private void AddControlsToPanel(ListPropertyChoice choice, NavigationPanePanel p)
        {
            ArrayList controls = AddSubControlsForButton(choice);

            p.Controls.Clear();            //DON"T DISPOSE!

            //ArrayList controls =((PanelMaker)maker).GetControlsFromChoice(choice);
            //we reversed these because we want to show them from top to bottom,
            //but the way controls work in forms, we have to actually add them in reverse order.
            if (controls != null)
            {
                controls.Reverse();
                foreach (Control control in controls)
                {
                    AddOneControlToPanel(control, p, controls.Count);
                }
            }
        }
Ejemplo n.º 7
0
        public List <ListView> GetControlsFromChoice(ListPropertyChoice choice)
        {
            List <ListView> controls = new List <ListView>();

            if (choice.ParameterNode == null)
            {
                return(null);
            }

            foreach (XmlNode panel in choice.ParameterNode.SelectNodes("panels/listPanel"))
            {
                string listId = XmlUtils.GetManditoryAttributeValue(panel, "listId");
                string label  = XmlUtils.GetManditoryAttributeValue(panel, "label");

                ListView list = MakeList(listId, label);
                controls.Add(list);
            }
            return(controls);
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Populate a control to show, for example, the list of tools, or the list of filters.
        /// </summary>
        /// <param name="group"></param>
//		protected void UpdateList(ChoiceGroup group)
//		{
//	//		Debug.WriteLine("Grp:"+group.Label);
//			ListView list = (ListView) group.ReferenceWidget;
//			foreach(ListPropertyChoice choice in group)
//			{
////				Debug.WriteLine(choice.Label);
//				//if(choice.Checked)
//					((ListViewItem)(choice.ReferenceWidget)).Selected = (choice.Checked);
////				else
////					((ListViewItem)(choice.ReferenceWidget)).Selected = (choice.Checked);
////				Debug.WriteLine("foo:");
//
//			}
//		}
        protected ArrayList AddSubControlsForButton(ListPropertyChoice choice)
        {
            ArrayList controls = new ArrayList();

            foreach (Control control in m_panelSubControls)
            {
                //				if(control.Parent !=null)
                //				{
                //					control.Parent.Controls.Remove(control);
                //					//		//			string s = control.Parent.Name;
                //				}
                if (null != choice.ParameterNode.SelectSingleNode("descendant::listPanel[@listId='" + control.Name + "']"))
                {
                    controls.Add(control);
                    //string x = control.Parent.Name;
                }
            }
            return(controls);
        }
Ejemplo n.º 9
0
        protected void MakePanelToGoWithButton(NavigationPane np, ButtonItem button, ListPropertyChoice choice)
        {
            m_suspendEvents = true;
            NavigationPanePanel p = new DevComponents.DotNetBar.NavigationPanePanel();

            p.Dock       = System.Windows.Forms.DockStyle.Fill;
            p.Location   = new System.Drawing.Point(0, 24);
            p.ParentItem = button;

            p.Style.Alignment = System.Drawing.StringAlignment.Center;
            p.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground;
            p.Style.BackColor2.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground2;
            p.Style.BackgroundImagePosition    = DevComponents.DotNetBar.eBackgroundImagePosition.Tile;
            p.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine;
            p.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
            p.Style.ForeColor.ColorSchemePart   = DevComponents.DotNetBar.eColorSchemePart.ItemText;
            p.Style.GradientAngle      = 90;
            p.Style.WordWrap           = true;
            p.StyleMouseDown.Alignment = System.Drawing.StringAlignment.Center;
            p.StyleMouseDown.WordWrap  = true;
            p.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
            p.StyleMouseOver.WordWrap  = true;
            p.TabIndex = 3;

            //			Object maker =m_mediator.PropertyTable.GetValue("PanelMaker");
            //			if (maker == null)
            //			{
            //				p.Text = "You must provide a PanelMaker in the property table to create panels";
            //				p.Name = "navigationPanePanel2";
            //			}
            //			else
            //			{
            AddControlsToPanel(choice, p);
            //			}

            //p.VisibleChanged +=new EventHandler(OnPanelVisibleChanged);
            np.Controls.Add(p);
            p.Layout       += new LayoutEventHandler(OnPanelLayout);
            m_suspendEvents = false;
        }
Ejemplo n.º 10
0
        protected void PopulateFromList()
        {
            /// Just before this group is displayed, allow the group's contents to be modified by colleagues
            //if this is a list-populated group.

            //first, we get the list as it is in the XML configuration file
            XmlNode listNode = m_configurationNode.OwnerDocument.SelectSingleNode("//list[@id='" + this.ListId + "']");

            StringTable stringTbl = null;

            if (m_mediator != null && m_mediator.HasStringTable)
            {
                stringTbl = m_mediator.StringTbl;
            }
            XCore.List list = new XCore.List(listNode, stringTbl);

            UIListDisplayProperties display = new UIListDisplayProperties(list);

            display.PropertyName = this.PropertyName;
            string wsSet = XmlUtils.GetOptionalAttributeValue(m_configurationNode, "wsSet");

            m_mediator.SendMessage("Display" + this.ListId, wsSet, ref display);

            PropertyName = display.PropertyName;

            foreach (ListItem item in list)
            {
                Add(new ListPropertyChoice(m_mediator, item, m_adapter, this));
            }

            // select the first one if none is selected
            if (
                (!m_mediator.PropertyTable.PropertyExists(this.PropertyName, this.PropertyTableGroup)) &&               // there isn't a value alread (from depersisting)
                (this.Count > 0))
            {
                ListPropertyChoice first = (ListPropertyChoice)this[0];
                //				first.OnClick(this, null);
            }
        }
Ejemplo n.º 11
0
        public void HandleItemClick(ListPropertyChoice choice)
        {
            m_mediator.SendMessage("ProgressReset", this);
            switch (this.Behavior)
            {
            case "singlePropertyAtomicValue":
                HandleClickedWhenSinglePropertyAtomicValue(choice);
                break;

            case "singlePropertySequenceValue":
                HandleClickedWhenSinglePropertySequenceValue(choice);
                break;

            case "command":
                HandleClickedWhenCommand(choice);
                break;

            default:
                Trace.Fail("The behavior '" + Behavior + "' is not supported or for some other reason was unexpected here(check capitalization).");
                break;
            }
            m_mediator.SendMessage("ProgressReset", this);
        }
Ejemplo n.º 12
0
 protected void HandleClickedWhenSinglePropertySequenceValue(ListPropertyChoice choice)
 {
     bool fEmptyAllowed = XmlUtils.GetOptionalBooleanAttributeValue(m_configurationNode,
         "emptyAllowed", false);
     ChooseSinglePropertySequenceValue(m_mediator, choice.Value, choice.ParameterNode,
         this.PropertyName, fEmptyAllowed, this.PropertyTableGroup);
 }
Ejemplo n.º 13
0
 /// <summary>Gets choice's listId from its xml</summary>
 /// <returns>null if can't find it for some reason</returns>
 private string GetListIdFromListPropertyChoice(ListPropertyChoice choice)
 {
     try
     {
         return choice.ParameterNode.SelectSingleNode("panels").SelectSingleNode("listPanel").Attributes["listId"].Value;
     }
     catch
     {
         return null;
     }
 }
Ejemplo n.º 14
0
        /// <summary>
        /// Create a tab on the sidebar from a choice.
        /// </summary>
        protected void MakeAreaButton(ListPropertyChoice choice)
        {
            string tabname = GetListIdFromListPropertyChoice(choice);
            Tab tab = new Tab(tabname)
                    {
                        Enabled = choice.Enabled,
                        Text = choice.Label,
                        Icon = m_largeImages.GetImage(choice.ImageName),
                        Tag = choice,
                    };

            choice.ReferenceWidget = tab;
            m_sidepane.AddTab(tab);
        }
Ejemplo n.º 15
0
 /// <summary>
 /// Populate a control to show, for example, the list of tools, or the list of filters.
 /// </summary>
 /// <param name="group"></param>
 //        protected void UpdateList(ChoiceGroup group)
 //        {
 //    //		Debug.WriteLine("Grp:"+group.Label);
 //            ListView list = (ListView) group.ReferenceWidget;
 //            foreach(ListPropertyChoice choice in group)
 //            {
 ////				Debug.WriteLine(choice.Label);
 //                //if(choice.Checked)
 //                    ((ListViewItem)(choice.ReferenceWidget)).Selected = (choice.Checked);
 ////				else
 ////					((ListViewItem)(choice.ReferenceWidget)).Selected = (choice.Checked);
 ////				Debug.WriteLine("foo:");
 //
 //            }
 //        }
 protected ArrayList AddSubControlsForButton(ListPropertyChoice choice)
 {
     ArrayList controls= new ArrayList ();
     foreach(Control control in m_panelSubControls)
     {
         //				if(control.Parent !=null)
         //				{
         //					control.Parent.Controls.Remove(control);
         //					//		//			string s = control.Parent.Name;
         //				}
         if (null != choice.ParameterNode.SelectSingleNode("descendant::listPanel[@listId='"+ control.Name+ "']"))
         {
             controls.Add(control);
             //string x = control.Parent.Name;
         }
     }
     return controls;
 }
Ejemplo n.º 16
0
		/// <summary>
		/// Create a tab on the sidebar from a choice.
		/// </summary>
		protected void MakeAreaButton(ListPropertyChoice choice)
		{
#if USE_DOTNETBAR
			UIItemDisplayProperties display = choice.GetDisplayProperties();
			display.Text = display.Text.Replace("_", "");
			ButtonItem button = new ButtonItem(choice.Id, display.Text);
			button.Tag = choice;
			choice.ReferenceWidget = button;

			button.ImageIndex = m_largeImages.GetImageIndex(display.ImageLabel);

			button.Text = display.Text;
			button. Name = choice.Value;

			button.ButtonStyle = eButtonStyle.ImageAndText;

			if(!display.Enabled)
				button.Text = button.Text + " NA";

			button.Click += new EventHandler(OnClickAreaButton);

			button.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText;
			//button.Image = ((System.Drawing.Image)(resources.GetObject("buttonItem2.Image")));
			//	button.Name = "buttonItem2";
			button.OptionGroup = "navBar";
			button.Style = DevComponents.DotNetBar.eDotNetBarStyle.Office2003;

			button.Checked =	display.Checked;

			MakePanelToGoWithButton(NavPane, button, choice);

			NavPane.Items.Add(button);
			//a button in this framework not really a Control... so I don't know how to use
			//(the same company's) balloon tip control on a sidebar button!
			//	m_mediator.SendMessage("RegisterHelpTarget", button.ContainerControl);
#else
			string tabname = GetListIdFromListPropertyChoice(choice);
			Tab tab = new Tab(tabname)
					{
						Enabled = choice.Enabled,
						Text = choice.Label,
						Icon = m_largeImages.GetImage(choice.ImageName),
						Tag = choice,
					};
			choice.ReferenceWidget = tab;
			m_sidepane.AddTab(tab);
#endif
		}
Ejemplo n.º 17
0
 protected void HandleClickedWhenSinglePropertyAtomicValue(ListPropertyChoice choice)
 {
     ChooseSinglePropertyAtomicValue(m_mediator, choice.Value, choice.ParameterNode, this.PropertyName, this.PropertyTableGroup);
 }
Ejemplo n.º 18
0
 /// <summary>
 /// Called when a list subitem is clicked in a list where we want to invoke a command when clicked.
 /// Passes as argument the XmlNode that comes from the list item; this may come from a list in
 /// the configuration, or have been generted by the Display{ListId}() method. In the latter case,
 /// it is up to that method to include enough information in the XmlNode to complete the command.
 /// </summary>
 /// <param name="choice"></param>
 private void HandleClickedWhenCommand(ListPropertyChoice choice)
 {
     m_mediator.SendMessage(CommandMessage, choice.ParameterNode);
 }
Ejemplo n.º 19
0
		private void AddItemHelper(string label)
		{
			var doc = new XmlDocument();
			var li = new ListItem();
			li.label = label;
			li.enabled = true;
			li.value = label;
			li.imageName = "iconName";
			li.parameterNode = doc.CreateElement(label);

			var listPropChoice = new ListPropertyChoice(m_mediator, li, m_adapter, this);
			Add(listPropChoice);
		}
Ejemplo n.º 20
0
		protected void MakePanelToGoWithButton (NavigationPane np, ButtonItem button,ListPropertyChoice choice)
		{
			m_suspendEvents = true;
			NavigationPanePanel p = new DevComponents.DotNetBar.NavigationPanePanel();
			p.Dock = System.Windows.Forms.DockStyle.Fill;
			p.Location = new System.Drawing.Point(0, 24);
			p.ParentItem = button;

			p.Style.Alignment = System.Drawing.StringAlignment.Center;
			p.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground;
			p.Style.BackColor2.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground2;
			p.Style.BackgroundImagePosition = DevComponents.DotNetBar.eBackgroundImagePosition.Tile;
			p.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine;
			p.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
			p.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemText;
			p.Style.GradientAngle = 90;
			p.Style.WordWrap = true;
			p.StyleMouseDown.Alignment = System.Drawing.StringAlignment.Center;
			p.StyleMouseDown.WordWrap = true;
			p.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
			p.StyleMouseOver.WordWrap = true;
			p.TabIndex = 3;

			//			Object maker =m_mediator.PropertyTable.GetValue("PanelMaker");
			//			if (maker == null)
			//			{
			//				p.Text = "You must provide a PanelMaker in the property table to create panels";
			//				p.Name = "navigationPanePanel2";
			//			}
			//			else
			//			{
			AddControlsToPanel(choice, p);
			//			}

			//p.VisibleChanged +=new EventHandler(OnPanelVisibleChanged);
			np.Controls.Add(p);
			p.Layout+=new LayoutEventHandler(OnPanelLayout);
			m_suspendEvents = false;

		}
Ejemplo n.º 21
0
 protected void HandleClickedWhenSinglePropertyAtomicValue(ListPropertyChoice choice)
 {
     ChooseSinglePropertyAtomicValue(m_mediator,choice.Value, choice.ParameterNode,this.PropertyName, this.PropertyTableGroup);
 }
Ejemplo n.º 22
0
 public void HandleItemClick(ListPropertyChoice choice)
 {
     m_mediator.SendMessage("ProgressReset", this);
     switch (this.Behavior)
     {
     case "singlePropertyAtomicValue":
         HandleClickedWhenSinglePropertyAtomicValue(choice);
         break;
     case "singlePropertySequenceValue":
         HandleClickedWhenSinglePropertySequenceValue(choice);
         break;
     case "command":
         HandleClickedWhenCommand(choice);
         break;
     default:
         Trace.Fail("The behavior '" + Behavior + "' is not supported or for some other reason was unexpected here(check capitalization).");
         break;
     }
     m_mediator.SendMessage("ProgressReset", this);
 }
Ejemplo n.º 23
0
		private void AddControlsToPanel(ListPropertyChoice choice, NavigationPanePanel p)
		{
			ArrayList controls =AddSubControlsForButton(choice);

			p.Controls.Clear();//DON"T DISPOSE!

			//ArrayList controls =((PanelMaker)maker).GetControlsFromChoice(choice);
			//we reversed these because we want to show them from top to bottom,
			//but the way controls work in forms, we have to actually add them in reverse order.
			if (controls != null)
			{
				controls.Reverse();
				foreach(Control control in controls)
				{

					AddOneControlToPanel(control, p, controls.Count);
				}

			}
		}
Ejemplo n.º 24
0
 /// <summary>
 /// Called when a list subitem is clicked in a list where we want to invoke a command when clicked.
 /// Passes as argument the XmlNode that comes from the list item; this may come from a list in
 /// the configuration, or have been generted by the Display{ListId}() method. In the latter case,
 /// it is up to that method to include enough information in the XmlNode to complete the command.
 /// </summary>
 /// <param name="choice"></param>
 private void HandleClickedWhenCommand(ListPropertyChoice choice)
 {
     m_mediator.SendMessage(CommandMessage, choice.ParameterNode);
 }
Ejemplo n.º 25
0
		private void AddTabHelper(string label, string val)
		{
			var doc = new XmlDocument();
			ListItem li = new ListItem();
			li.label = label;
			li.enabled = true;
			li.value = val;
			li.imageName = "iconName";

			// <parameters><panels><listPanel listId="controlName"></panels></parameters>
			doc = new XmlDocument();
			var parametersNode = doc.CreateElement("parameters");
			var panelsNode = doc.CreateElement("panels");
			var listPanelNode = doc.CreateElement("listPanel");
			listPanelNode.SetAttribute("listId", label);
			panelsNode.AppendChild(listPanelNode);
			parametersNode.AppendChild(panelsNode);

			li.parameterNode = parametersNode;

			var listPropChoice = new ListPropertyChoice(m_mediator, li, m_adapter, this);
			Add(listPropChoice);
		}