示例#1
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="xnSpec"></param>
        /// <param name="fakeFlid"></param>
        /// <param name="xbv"></param>
        public XmlRDEBrowseViewVc(XmlNode xnSpec, int fakeFlid, XmlBrowseViewBase xbv)
            : base(xnSpec, fakeFlid, xbv)
        {
            // set the border color
            BorderColor = SystemColors.ControlDark;

            // Check for the special editable row attributes.
            // this one is independently optional so we can handle it separately.
            m_sEditRowMergeMethod = XmlUtils.GetAttributeValue(xnSpec, "editRowMergeMethod", null);
            XmlAttribute xa = xnSpec.Attributes["editRowModelClass"];

            if (xa != null && xa.Value.Length != 0)
            {
                m_sEditRowModelClass = xa.Value;
                xa = xnSpec.Attributes["editRowSaveMethod"];
                if (xa != null && xa.Value.Length != 0)
                {
                    m_sEditRowSaveMethod = xa.Value;
                    xa = xnSpec.Attributes["editRowAssembly"];
                    if (xa != null && xa.Value.Length != 0)
                    {
                        m_sEditRowAssembly = xa.Value;
                        xa = xnSpec.Attributes["editRowClass"];
                        if (xa != null && xa.Value.Length != 0)
                        {
                            m_sEditRowClass = xa.Value;
                        }
                        else
                        {
                            // Should we complain to the user?  Die horribly? ...
                            m_sEditRowModelClass = null;
                            m_sEditRowSaveMethod = null;
                            m_sEditRowAssembly   = null;
                            Debug.WriteLine("editRowModelClass, editRowSaveMethod, and " +
                                            "editRowAssembly are set, but editRowClass is not!?");
                        }
                    }
                    else
                    {
                        // Should we complain to the user?  Die horribly? ...
                        m_sEditRowModelClass = null;
                        m_sEditRowSaveMethod = null;
                        Debug.WriteLine("editRowModelClass and editRowSaveMethod are set, " +
                                        "but editRowAssembly is not!?");
                    }
                }
                else
                {
                    // Should we complain to the user?  Die horribly? ...
                    m_sEditRowModelClass = null;
                    Debug.WriteLine("editRowModelClass is set, but editRowSaveMethod is not!?");
                }
            }

            // For RDE use, we want total RTL user experience (see LT-5127).
            Cache             = m_xbv.Cache;
            m_fShowColumnsRTL = IsWsRTL(m_cache.ServiceLocator.WritingSystems.DefaultVernacularWritingSystem.Handle);
        }
        public void HasEnoughScrollHeight()
        {
            FakeKeyboardController.Install();

            using (var area = new XmlBrowseViewBase())
            {
                var doc = new XmlDocument();
                doc.LoadXml(@"<parameters/>");

                using (var mediator = new Mediator())
                {
                    area.Init(mediator, doc.DocumentElement);
                    var rootbox = VwRootBoxClass.Create();
                    rootbox.SetSite(area);
                    ReflectionHelper.SetField(area, "m_rootb", rootbox);

                    var scrollRange = (Size)ReflectionHelper.GetProperty(area, "AdjustedScrollRange");

                    int reasonablyEnoughSpace = Convert.ToInt32(2.5 * SystemInformation.HorizontalScrollBarHeight);

                    Assert.That(scrollRange.Height, Is.GreaterThanOrEqualTo(reasonablyEnoughSpace));
                }
            }
        }
 /// ------------------------------------------------------------------------------------
 /// <summary>
 /// Initializes a new instance of the <see cref="XmlBrowseViewSelectionRestorer"/> class.
 /// </summary>
 /// ------------------------------------------------------------------------------------
 public XmlBrowseViewSelectionRestorer(XmlBrowseViewBase browseView) : base(browseView)
 {
 }
示例#4
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="xnSpec"></param>
 /// <param name="fakeFlid"></param>
 /// <param name="stringTable"></param>
 /// <param name="xbv"></param>
 public XmlBrowseViewVc(XmlNode xnSpec, int fakeFlid, StringTable stringTable, XmlBrowseViewBase xbv)
     : base(xnSpec, fakeFlid, stringTable, xbv)
 {
 }
示例#5
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="xnSpec"></param>
 /// <param name="fakeFlid"></param>
 /// <param name="xbv"></param>
 public XmlBrowseViewVc(XmlNode xnSpec, int fakeFlid, XmlBrowseViewBase xbv)
     : base(xnSpec, fakeFlid, xbv)
 {
 }