Summary description for SummaryCommandControl.
Inheritance: System.Windows.Forms.UserControl, IFWDisposable
示例#1
0
		/// <summary>
		/// Construct one, using the "part ref" element (caller) that
		/// invoked the "slice" node that specified this editor.
		/// </summary>
		/// <param name="caller"></param>
		/// <param name="node"></param>
		public SummarySlice(ICmObject obj, XmlNode caller, XmlNode node, StringTable stringTbl)
			: base()
		{
			string paramType = XmlUtils.GetOptionalAttributeValue(node.ParentNode, "paramType");
			if (paramType == "LiteralString")
			{
				// Instead of the parameter being a layout name, it is literal text which will be
				// the whole contents of the slice, with standard properties.
				string text = XmlUtils.GetManditoryAttributeValue(caller, "label");
				if (stringTbl != null)
					text = stringTbl.LocalizeAttributeValue(text);
				m_view = new LiteralLabelView(text, this);
				m_fLiteralString = true;
			}
			else
			{
				string layout = XmlUtils.GetOptionalAttributeValue(caller, "param");
				if (layout == null)
					layout = XmlUtils.GetManditoryAttributeValue(node, "layout");
				m_view = new SummaryXmlView(obj.Hvo, layout, stringTbl, this);
			}
			UserControl mainControl = new UserControl();
			m_view.Dock = DockStyle.Left;
			m_view.LayoutSizeChanged += new EventHandler(m_view_LayoutSizeChanged);
			mainControl.Height = m_view.Height;
			Control = mainControl;

			m_commandControl = new SummaryCommandControl(this);
			m_commandControl.Dock = DockStyle.Fill;
			m_commandControl.Visible = XmlUtils.GetOptionalBooleanAttributeValue(caller, "commandVisible", false);
			mainControl.Controls.Add(m_commandControl);
			mainControl.Dock = DockStyle.Fill;
			mainControl.Controls.Add(m_view);
		}
示例#2
0
        public override void FinishInit()
        {
            base.FinishInit();

            string paramType = XmlUtils.GetOptionalAttributeValue(m_configurationNode.ParentNode, "paramType");

            if (paramType == "LiteralString")
            {
                // Instead of the parameter being a layout name, it is literal text which will be
                // the whole contents of the slice, with standard properties.
                string text = XmlUtils.GetManditoryAttributeValue(m_callerNode, "label");
                if (m_stringTable != null)
                {
                    text = m_stringTable.LocalizeAttributeValue(text);
                }
                m_view = new LiteralLabelView(text, this);
            }
            else
            {
                m_layout = XmlUtils.GetOptionalAttributeValue(m_callerNode, "param")
                           ?? XmlUtils.GetManditoryAttributeValue(m_configurationNode, "layout");
                m_collapsedLayout = XmlUtils.GetOptionalAttributeValue(m_callerNode, "collapsedLayout")
                                    ?? XmlUtils.GetOptionalAttributeValue(m_configurationNode, "collapsedLayout");
                m_view          = new SummaryXmlView(m_obj.Hvo, m_layout, m_stringTable, this);
                m_view.Mediator = Mediator;
            }

            var panel = new Panel {
                Dock = DockStyle.Fill
            };

            Control = panel;

            m_view.Dock = DockStyle.Left;
            m_view.LayoutSizeChanged += m_view_LayoutSizeChanged;
            panel.Controls.Add(m_view);

            m_button = new ExpandCollapseButton {
                Dock = DockStyle.Left
            };
            m_button.Click += m_button_Click;
            panel.Controls.Add(m_button);
            panel.MouseDown += OnMouseDownInPanel;

            m_commandControl = new SummaryCommandControl(this)
            {
                Dock    = DockStyle.Fill,
                Visible = XmlUtils.GetOptionalBooleanAttributeValue(m_callerNode, "commandVisible", false)
            };
            panel.Controls.Add(m_commandControl);
        }
示例#3
0
		public override void FinishInit()
		{
			base.FinishInit();

			string paramType = XmlUtils.GetOptionalAttributeValue(m_configurationNode.ParentNode, "paramType");
			if (paramType == "LiteralString")
			{
				// Instead of the parameter being a layout name, it is literal text which will be
				// the whole contents of the slice, with standard properties.
				string text = XmlUtils.GetManditoryAttributeValue(m_callerNode, "label");
				if (m_stringTable != null)
					text = m_stringTable.LocalizeAttributeValue(text);
				m_view = new LiteralLabelView(text, this);
			}
			else
			{
				m_layout = XmlUtils.GetOptionalAttributeValue(m_callerNode, "param")
					?? XmlUtils.GetManditoryAttributeValue(m_configurationNode, "layout");
				m_collapsedLayout = XmlUtils.GetOptionalAttributeValue(m_callerNode, "collapsedLayout")
					?? XmlUtils.GetOptionalAttributeValue(m_configurationNode, "collapsedLayout");
				m_view = new SummaryXmlView(m_obj.Hvo, m_layout, m_stringTable, this);
				m_view.Mediator = Mediator;
			}

			var panel = new Panel { Dock = DockStyle.Fill };
			Control = panel;

			m_view.Dock = DockStyle.Left;
			m_view.LayoutSizeChanged += m_view_LayoutSizeChanged;
			panel.Controls.Add(m_view);

			m_button = new ExpandCollapseButton { Dock = DockStyle.Left };
			m_button.Click += m_button_Click;
			panel.Controls.Add(m_button);
			panel.MouseDown += OnMouseDownInPanel;

			m_commandControl = new SummaryCommandControl(this)
			{
				Dock = DockStyle.Fill,
				Visible = XmlUtils.GetOptionalBooleanAttributeValue(m_callerNode, "commandVisible", false)
			};
			panel.Controls.Add(m_commandControl);
		}
示例#4
0
        /// <summary>
        /// Executes in two distinct scenarios.
        ///
        /// 1. If disposing is true, the method has been called directly
        /// or indirectly by a user's code via the Dispose method.
        /// Both managed and unmanaged resources can be disposed.
        ///
        /// 2. If disposing is false, the method has been called by the
        /// runtime from inside the finalizer and you should not reference (access)
        /// other managed objects, as they already have been garbage collected.
        /// Only unmanaged resources can be disposed.
        /// </summary>
        /// <param name="disposing"></param>
        /// <remarks>
        /// If any exceptions are thrown, that is fine.
        /// If the method is being done in a finalizer, it will be ignored.
        /// If it is thrown by client code calling Dispose,
        /// it needs to be handled by fixing the bug.
        ///
        /// If subclasses override this method, they should call the base implementation.
        /// </remarks>
        protected override void Dispose(bool disposing)
        {
            //Debug.WriteLineIf(!disposing, "****************** " + GetType().Name + " 'disposing' is false. ******************");
            // Must not be run more than once.
            if (IsDisposed)
            {
                return;
            }

            if (disposing)
            {
                // Dispose managed resources here.
            }

            // Dispose unmanaged resources here, whether disposing is true or false.
            m_view           = null;   // Gets disposed elsewhere, since it is in the Controls collection of another active widget.
            m_commandControl = null;   // Gets disposed elsewhere, since it is in the Controls collection of another active widget.

            base.Dispose(disposing);
        }
示例#5
0
        /// <summary>
        /// Construct one, using the "part ref" element (caller) that
        /// invoked the "slice" node that specified this editor.
        /// </summary>
        /// <param name="caller"></param>
        /// <param name="node"></param>
        public SummarySlice(ICmObject obj, XmlNode caller, XmlNode node, StringTable stringTbl)
            : base()
        {
            string paramType = XmlUtils.GetOptionalAttributeValue(node.ParentNode, "paramType");

            if (paramType == "LiteralString")
            {
                // Instead of the parameter being a layout name, it is literal text which will be
                // the whole contents of the slice, with standard properties.
                string text = XmlUtils.GetManditoryAttributeValue(caller, "label");
                if (stringTbl != null)
                {
                    text = stringTbl.LocalizeAttributeValue(text);
                }
                m_view           = new LiteralLabelView(text, this);
                m_fLiteralString = true;
            }
            else
            {
                string layout = XmlUtils.GetOptionalAttributeValue(caller, "param");
                if (layout == null)
                {
                    layout = XmlUtils.GetManditoryAttributeValue(node, "layout");
                }
                m_view = new SummaryXmlView(obj.Hvo, layout, stringTbl, this);
            }
            UserControl mainControl = new UserControl();

            m_view.Dock = DockStyle.Left;
            m_view.LayoutSizeChanged += new EventHandler(m_view_LayoutSizeChanged);
            mainControl.Height        = m_view.Height;
            Control = mainControl;

            m_commandControl         = new SummaryCommandControl(this);
            m_commandControl.Dock    = DockStyle.Fill;
            m_commandControl.Visible = XmlUtils.GetOptionalBooleanAttributeValue(caller, "commandVisible", false);
            mainControl.Controls.Add(m_commandControl);
            mainControl.Dock = DockStyle.Fill;
            mainControl.Controls.Add(m_view);
        }
示例#6
0
		/// <summary>
		/// Executes in two distinct scenarios.
		///
		/// 1. If disposing is true, the method has been called directly
		/// or indirectly by a user's code via the Dispose method.
		/// Both managed and unmanaged resources can be disposed.
		///
		/// 2. If disposing is false, the method has been called by the
		/// runtime from inside the finalizer and you should not reference (access)
		/// other managed objects, as they already have been garbage collected.
		/// Only unmanaged resources can be disposed.
		/// </summary>
		/// <param name="disposing"></param>
		/// <remarks>
		/// If any exceptions are thrown, that is fine.
		/// If the method is being done in a finalizer, it will be ignored.
		/// If it is thrown by client code calling Dispose,
		/// it needs to be handled by fixing the bug.
		///
		/// If subclasses override this method, they should call the base implementation.
		/// </remarks>
		protected override void Dispose(bool disposing)
		{
			//Debug.WriteLineIf(!disposing, "****************** " + GetType().Name + " 'disposing' is false. ******************");
			// Must not be run more than once.
			if (IsDisposed)
				return;

			if (disposing)
			{
				// Dispose managed resources here.
			}

			// Dispose unmanaged resources here, whether disposing is true or false.
			m_view = null; // Gets disposed elsewhere, since it is in the Controls collection of another active widget.
			m_commandControl = null; // Gets disposed elsewhere, since it is in the Controls collection of another active widget.

			base.Dispose(disposing);
		}