public BocAutoCompleteReferenceValueRenderer(
     IResourceUrlFactory resourceUrlFactory,
     IGlobalizationService globalizationService,
     IRenderingFeatures renderingFeatures)
     : this(resourceUrlFactory, globalizationService, renderingFeatures, () => new RenderOnlyTextBox())
 {
 }
 public BocReferenceValueRenderer(
     IResourceUrlFactory resourceUrlFactory,
     IGlobalizationService globalizationService,
     IRenderingFeatures renderingFeatures)
     : this(resourceUrlFactory, globalizationService, renderingFeatures, () => new DropDownList())
 {
 }
Пример #3
0
 /// <summary>
 /// Contructs a renderer bound to a <see cref="Remotion.ObjectBinding.Web.UI.Controls.BocList"/> to render,
 /// an <see cref="HtmlTextWriter"/> to render to, and a <see cref="BocCustomColumnDefinition"/> column for which to render cells.
 /// </summary>
 /// <remarks>
 /// This class should not be instantiated directly by clients. Instead, a <see cref="BocRowRenderer"/> should use a
 /// factory to obtain instances of this class.
 /// </remarks>
 public BocCustomColumnRenderer(
     IResourceUrlFactory resourceUrlFactory,
     IRenderingFeatures renderingFeatures,
     BocListCssClassDefinition cssClasses)
     : base(resourceUrlFactory, renderingFeatures, cssClasses)
 {
 }
 public TestableBocAutoCompleteReferenceValueRenderer(
     IResourceUrlFactory resourceUrlFactory,
     IGlobalizationService globalizationService,
     IRenderingFeatures renderingFeatures)
     : base(resourceUrlFactory, globalizationService, renderingFeatures)
 {
 }
Пример #5
0
 public TestableBocDateTimeValueRenderer(
     IResourceUrlFactory resourceUrlFactory,
     IGlobalizationService globalizationService,
     IRenderingFeatures renderingFeatures)
     : base(resourceUrlFactory, globalizationService, renderingFeatures)
 {
 }
Пример #6
0
 protected BocReferenceValueRendererBase(
     IResourceUrlFactory resourceUrlFactory,
     IGlobalizationService globalizationService,
     IRenderingFeatures renderingFeatures)
     : base(resourceUrlFactory, globalizationService, renderingFeatures)
 {
 }
 public WebTabStripRenderer(
     IResourceUrlFactory resourceUrlFactory,
     IGlobalizationService globalizationService,
     IRenderingFeatures renderingFeatures)
     : base(resourceUrlFactory, globalizationService, renderingFeatures)
 {
 }
Пример #8
0
 public BocDateTimeValueRenderer(
     IResourceUrlFactory resourceUrlFactory,
     IGlobalizationService globalizationService,
     IRenderingFeatures renderingFeatures)
     : this(resourceUrlFactory, globalizationService, renderingFeatures, new RenderOnlyTextBox(), new RenderOnlyTextBox())
 {
 }
Пример #9
0
 public DatePickerButtonRenderer(
     IResourceUrlFactory resourceUrlFactory,
     IGlobalizationService globalizationService,
     IRenderingFeatures renderingFeatures)
     : base(resourceUrlFactory, globalizationService, renderingFeatures)
 {
 }
 public BocTextValueRenderer(
     IResourceUrlFactory resourceUrlFactory,
     IGlobalizationService globalizationService,
     IRenderingFeatures renderingFeatures)
     : base(resourceUrlFactory, globalizationService, renderingFeatures)
 {
 }
Пример #11
0
 public SingleViewRenderer(
     IResourceUrlFactory resourceUrlFactory,
     IGlobalizationService globalizationService,
     IRenderingFeatures renderingFeatures)
     : base(resourceUrlFactory, globalizationService, renderingFeatures)
 {
 }
Пример #12
0
        public void AddAttributesToRender(HtmlTextWriter writer, IRenderingFeatures renderingFeatures)
        {
            ArgumentUtility.CheckNotNull("writer", writer);

            if (!string.IsNullOrEmpty(_href))
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Href, _href);
            }

            if (!string.IsNullOrEmpty(_target))
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Target, _target);
            }

            if (!string.IsNullOrEmpty(_onClick))
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Onclick, _onClick);
            }

            if (!string.IsNullOrEmpty(_accessKey))
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Accesskey, _accessKey);
            }

            if (!string.IsNullOrEmpty(_title))
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Title, _title);
            }

            if (renderingFeatures.EnableDiagnosticMetadata)
            {
                AddDiagnosticMetadataAttributes(writer);
            }
        }
 public BocTreeViewRenderer(
     [NotNull] IResourceUrlFactory resourceUrlFactory,
     [NotNull] IGlobalizationService globalizationService,
     [NotNull] IRenderingFeatures renderingFeatures)
     : base(resourceUrlFactory, globalizationService, renderingFeatures)
 {
 }
Пример #14
0
        /// <summary> Renders the opening tag for the command. </summary>
        /// <param name="writer"> The <see cref="HtmlTextWriter"/> object to use. Must not be <see langword="null"/>. </param>
        /// <param name="renderingFeatures"> The rendering features to use. </param>
        /// <param name="postBackEvent">
        ///   The string executed upon the click on a command of types
        ///   <see cref="CommandType.Event"/> or <see cref="CommandType.WxeFunction"/>.
        ///   This string is usually the call to the <c>__doPostBack</c> script function used by ASP.net
        ///   to force a post back.
        /// </param>
        /// <param name="parameters">
        ///   The strings inserted into the href attribute using <c>string.Format</c>.
        /// </param>
        /// <param name="onClick">
        ///   The string always rendered in the <c>onClick</c> tag of the anchor element.
        /// </param>
        /// <param name="securableObject">
        ///   The <see cref="ISecurableObject"/> for which security is evaluated. Use <see landword="null"/> if security is stateless or not evaluated.
        /// </param>
        /// <param name="additionalUrlParameters">
        ///   The <see cref="NameValueCollection"/> containing additional url parameters.
        ///   Must not be <see langword="null"/>.
        /// </param>
        /// <param name="includeNavigationUrlParameters">
        ///   <see langword="true"/> to include URL parameters provided by <see cref="ISmartNavigablePage"/>.
        /// </param>
        /// <param name="style"> The style applied to the opening tag. </param>
        public virtual void RenderBegin(
            HtmlTextWriter writer,
            IRenderingFeatures renderingFeatures,
            string postBackEvent,
            string[] parameters,
            string onClick,
            ISecurableObject securableObject,
            NameValueCollection additionalUrlParameters,
            bool includeNavigationUrlParameters,
            Style style)
        {
            ArgumentUtility.CheckNotNull("writer", writer);
            ArgumentUtility.CheckNotNull("style", style);

            var commandInfo = GetCommandInfo(postBackEvent, parameters, onClick, securableObject, additionalUrlParameters, includeNavigationUrlParameters);

            if (commandInfo != null)
            {
                commandInfo.AddAttributesToRender(writer, renderingFeatures);
            }

            if (OwnerControl != null && !string.IsNullOrEmpty(OwnerControl.ClientID) && !string.IsNullOrEmpty(ItemID))
            {
                var clientID = OwnerControl.ClientID + "_" + ItemID;
                writer.AddAttribute(HtmlTextWriterAttribute.Id, clientID);
            }

            style.AddAttributesToRender(writer);

            writer.RenderBeginTag(HtmlTextWriterTag.A);
        }
Пример #15
0
        private void SetRenderingFeatures(IRenderingFeatures renderingFeatures)
        {
            var serviceLocator = DefaultServiceLocator.Create();

            serviceLocator.RegisterSingle(() => renderingFeatures);
            ServiceLocator.SetLocatorProvider(() => serviceLocator);
        }
 public TabbedMenuRenderer(
     IResourceUrlFactory resourceUrlFactory,
     IGlobalizationService globalizationService,
     IRenderingFeatures renderingFeatures)
     : base(resourceUrlFactory, globalizationService, renderingFeatures)
 {
 }
 protected BocCommandEnabledColumnRendererBase(
     IResourceUrlFactory resourceUrlFactory,
     IRenderingFeatures renderingFeatures,
     BocListCssClassDefinition cssClasses)
     : base(resourceUrlFactory, renderingFeatures, cssClasses)
 {
 }
Пример #18
0
        public WebTabRenderer(IHotkeyFormatter hotkeyFormatter, IRenderingFeatures renderingFeatures)
        {
            ArgumentUtility.CheckNotNull("hotkeyFormatter", hotkeyFormatter);
            ArgumentUtility.CheckNotNull("renderingFeatures", renderingFeatures);

            _hotkeyFormatter   = hotkeyFormatter;
            _renderingFeatures = renderingFeatures;
        }
 public TestableBocReferenceValueRenderer(
     IResourceUrlFactory resourceUrlFactory,
     IGlobalizationService globalizationService,
     IRenderingFeatures renderingFeatures,
     Func <DropDownList> dropDownListFactoryMethod)
     : base(resourceUrlFactory, globalizationService, renderingFeatures, dropDownListFactoryMethod)
 {
 }
Пример #20
0
        public BocSelectorColumnRenderer(IRenderingFeatures renderingFeatures, BocListCssClassDefinition cssClasses)
        {
            ArgumentUtility.CheckNotNull("renderingFeatures", renderingFeatures);
            ArgumentUtility.CheckNotNull("cssClasses", cssClasses);

            _renderingFeatures = renderingFeatures;
            _cssClasses        = cssClasses;
        }
Пример #21
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Setups the font features.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        private void SetupFontFeatures()
        {
            if (m_fontName == null || m_fontName == "")
            {
                Enabled = false;
                return;
            }
            IRenderEngine renderer;

            if (FontHasGraphiteTables(m_fontName, false, false))
            {
                renderer = FwGrEngineClass.Create();
            }
            else
            {
                renderer = UniscribeEngineClass.Create();
            }
            renderer.WritingSystemFactory = m_wsf;
            HoldDummyGraphics hdg = new HoldDummyGraphics(m_fontName, false, false, CreateGraphics());

            renderer.InitRenderer(hdg.m_vwGraphics, m_fontFeatures);
            m_featureEngine = renderer as IRenderingFeatures;
            if (m_featureEngine == null)
            {
                Enabled = false;
                hdg.Close();
                return;
            }
            int cfid;

            m_featureEngine.GetFeatureIDs(0, null, out cfid);
            if (cfid == 0)
            {
                Enabled = false;
                hdg.Close();
                return;
            }
            if (cfid == 1)
            {
                // What if it's the dummy built-in graphite feature that we ignore?
                // Get the list of features (only 1).
                using (ArrayPtr idsM = MarshalEx.ArrayToNative(cfid, typeof(int)))
                {
                    m_featureEngine.GetFeatureIDs(cfid, idsM, out cfid);
                    int [] ids = (int[])MarshalEx.NativeToArray(idsM, cfid, typeof(int));
                    if (ids[0] == kGrLangFeature)
                    {
                        Enabled = false;
                        hdg.Close();
                        return;
                    }
                }
            }
            Enabled = true;
            hdg.Close();
        }
Пример #22
0
 /// <summary> Renders the opening tag for the command. </summary>
 /// <param name="writer"> The <see cref="HtmlTextWriter"/> object to use. </param>
 /// <param name="renderingFeatures"> The rendering features to use. </param>
 /// <param name="postBackLink">
 ///   The string rendered in the <c>href</c> tag of the anchor element when the command type is <see cref="CommandType.Event"/> or
 ///   <see cref="CommandType.WxeFunction"/>. This string is usually the call to the <c>__doPostBack</c> script function used by ASP.net
 ///   to force a post back.
 /// </param>
 /// <param name="onClick">
 ///   The string rendered in the <c>onClick</c> tag of the anchor element.
 /// </param>
 /// <param name="businessObjectID">
 ///   An identifier for the <see cref="IBusinessObject"/> to which the rendered command is applied.
 /// </param>
 /// <param name="securableObject">
 ///   The <see cref="ISecurableObject"/> for which security is evaluated. Use <see landword="null"/> if security is stateless or not evaluated.
 /// </param>
 public void RenderBegin(
     HtmlTextWriter writer,
     IRenderingFeatures renderingFeatures,
     string postBackLink,
     string onClick,
     string businessObjectID,
     ISecurableObject securableObject)
 {
     RenderBegin(writer, renderingFeatures, postBackLink, new[] { businessObjectID }, onClick, securableObject);
 }
 protected BocReferenceValueRenderer(
     IResourceUrlFactory resourceUrlFactory,
     IGlobalizationService globalizationService,
     IRenderingFeatures renderingFeatures,
     Func <DropDownList> dropDownListFactoryMethod)
     : base(resourceUrlFactory, globalizationService, renderingFeatures)
 {
     ArgumentUtility.CheckNotNull("dropDownListFactoryMethod", dropDownListFactoryMethod);
     _dropDownListFactoryMethod = dropDownListFactoryMethod;
 }
Пример #24
0
        /// <summary>
        /// Initializes the <see cref="Context"/> and the <see cref="Control"/> properties from the arguments.
        /// </summary>
        protected RendererBase(IResourceUrlFactory resourceUrlFactory, IGlobalizationService globalizationService, IRenderingFeatures renderingFeatures)
        {
            ArgumentUtility.CheckNotNull("resourceUrlFactory", resourceUrlFactory);
            ArgumentUtility.CheckNotNull("globalizationService", globalizationService);
            ArgumentUtility.CheckNotNull("renderingFeatures", renderingFeatures);

            _resourceUrlFactory   = resourceUrlFactory;
            _globalizationService = globalizationService;
            _renderingFeatures    = renderingFeatures;
        }
 protected BocAutoCompleteReferenceValueRenderer(
     IResourceUrlFactory resourceUrlFactory,
     IGlobalizationService globalizationService,
     IRenderingFeatures renderingFeatures,
     Func <TextBox> textBoxFactory)
     : base(resourceUrlFactory, globalizationService, renderingFeatures)
 {
     ArgumentUtility.CheckNotNull("textBoxFactory", textBoxFactory);
     _textBoxFactory = textBoxFactory;
 }
Пример #26
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Setups the font features.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        public void SetupFontFeatures()
        {
            CheckDisposed();

            if (string.IsNullOrEmpty(m_fontName))
            {
                Enabled          = false;
                m_isGraphiteFont = false;
                return;
            }

            using (var hdg = new HoldDummyGraphics(m_fontName, false, false, this))
            {
                IRenderEngine renderer = GraphiteEngineClass.Create();
                renderer.InitRenderer(hdg.m_vwGraphics, m_fontFeatures);
                // check if the font is a valid Graphite font
                if (!renderer.FontIsValid)
                {
                    m_isGraphiteFont = false;
                    Enabled          = false;
                    return;
                }
                renderer.WritingSystemFactory = m_wsf;
                m_isGraphiteFont = true;
                m_featureEngine  = renderer as IRenderingFeatures;
                if (m_featureEngine == null)
                {
                    Enabled = false;
                    return;
                }
                int cfid;
                m_featureEngine.GetFeatureIDs(0, null, out cfid);
                if (cfid == 0)
                {
                    Enabled = false;
                    return;
                }
                if (cfid == 1)
                {
                    // What if it's the dummy built-in graphite feature that we ignore?
                    // Get the list of features (only 1).
                    using (ArrayPtr idsM = MarshalEx.ArrayToNative <int>(cfid))
                    {
                        m_featureEngine.GetFeatureIDs(cfid, idsM, out cfid);
                        int [] ids = MarshalEx.NativeToArray <int>(idsM, cfid);
                        if (ids[0] == kGrLangFeature)
                        {
                            Enabled = false;
                            return;
                        }
                    }
                }
                Enabled = true;
            }
        }
 /// <summary> Renders the opening tag for the command. </summary>
 /// <param name="writer"> The <see cref="HtmlTextWriter"/> object to use. </param>
 /// <param name="renderingFeatures"> The rendering features to use. </param>
 /// <param name="postBackLink">
 ///   The string rendered in the <c>href</c> tag of the anchor element when the command type is <see cref="CommandType.Event"/> or
 ///   <see cref="CommandType.WxeFunction"/>. This string is usually the call to the <c>__doPostBack</c> script function used by ASP.net
 ///   to force a post back.
 /// </param>
 /// <param name="onClick">
 ///   The string rendered in the <c>onClick</c> tag of the anchor element.
 /// </param>
 /// <param name="listIndex">
 ///   An index that indentifies the <see cref="IBusinessObject"/> on which the rendered command is applied on.
 /// </param>
 /// <param name="businessObjectID">
 ///   An identifier for the <see cref="IBusinessObject"/> to which the rendered command is applied.
 /// </param>
 /// <param name="securableObject">
 ///   The <see cref="ISecurableObject"/> for which security is evaluated. Use <see landword="null"/> if security is stateless or not evaluated.
 /// </param>
 public void RenderBegin(
     HtmlTextWriter writer,
     IRenderingFeatures renderingFeatures,
     string postBackLink,
     string onClick,
     int listIndex,
     string businessObjectID,
     ISecurableObject securableObject)
 {
     base.RenderBegin(writer, renderingFeatures, postBackLink, new string[] { listIndex.ToString(), businessObjectID }, onClick, securableObject);
 }
        public BocBooleanValueRenderer(
            IResourceUrlFactory resourceUrlFactory,
            IGlobalizationService globalizationService,
            IRenderingFeatures renderingFeatures,
            IBocBooleanValueResourceSetFactory resourceSetFactory)
            : base(resourceUrlFactory, globalizationService, renderingFeatures)
        {
            ArgumentUtility.CheckNotNull("resourceSetFactory", resourceSetFactory);

            _resourceSetFactory = resourceSetFactory;
        }
        /// <summary>
        /// Contructs a renderer bound to a <see cref="BocList"/> to render and an <see cref="HtmlTextWriter"/> to render to.
        /// </summary>
        /// <remarks>
        /// This class should not be instantiated directly by clients. Instead, a <see cref="BocListRenderer"/> should use a
        /// factory to obtain an instance of this class.
        /// </remarks>
        public BocListNavigationBlockRenderer(
            IResourceUrlFactory resourceUrlFactory,
            IGlobalizationService globalizationService,
            IRenderingFeatures renderingFeatures,
            BocListCssClassDefinition cssClasses)
            : base(resourceUrlFactory, globalizationService, renderingFeatures)
        {
            ArgumentUtility.CheckNotNull("cssClasses", cssClasses);

            _cssClasses = cssClasses;
        }
Пример #30
0
        public BocRowRenderer(
            BocListCssClassDefinition cssClasses,
            IBocIndexColumnRenderer indexColumnRenderer,
            IBocSelectorColumnRenderer selectorColumnRenderer,
            IRenderingFeatures renderingFeatures)
        {
            ArgumentUtility.CheckNotNull("cssClasses", cssClasses);

            _cssClasses             = cssClasses;
            _indexColumnRenderer    = indexColumnRenderer;
            _selectorColumnRenderer = selectorColumnRenderer;
            _renderingFeatures      = renderingFeatures;
        }
Пример #31
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Setups the font features.
		/// </summary>
		/// ------------------------------------------------------------------------------------
		public void SetupFontFeatures()
		{
			CheckDisposed();

#if __MonoCS__
			// TODO-Linux: Neither Graphite or UniscribeEngine Avaliable
			m_featureEngine = null;
			return;
#else
			if (m_fontName == null || m_fontName == "")
			{
				Enabled = false;
				m_isGraphiteFont = false;
				return;
			}
			IRenderEngine renderer;
			if (FontHasGraphiteTables(m_fontName, false, false))
			{
				renderer = FwGrEngineClass.Create();
				m_isGraphiteFont = true;
			}
			else
			{
				renderer = UniscribeEngineClass.Create();
				m_isGraphiteFont = false;
			}
			renderer.WritingSystemFactory = m_wsf;
			using (HoldDummyGraphics hdg = new HoldDummyGraphics(m_fontName, false, false, this))
			{
			renderer.InitRenderer(hdg.m_vwGraphics, m_fontFeatures);
			m_featureEngine = renderer as IRenderingFeatures;
			if (m_featureEngine == null)
			{
				Enabled = false;
				return;
			}
			int cfid;
			m_featureEngine.GetFeatureIDs(0, null, out cfid);
			if (cfid == 0)
			{
				Enabled = false;
				return;
			}
			if (cfid == 1)
			{
				// What if it's the dummy built-in graphite feature that we ignore?
				// Get the list of features (only 1).
				using (ArrayPtr idsM = MarshalEx.ArrayToNative<int>(cfid))
				{
					m_featureEngine.GetFeatureIDs(cfid, idsM, out cfid);
					int [] ids = MarshalEx.NativeToArray<int>(idsM, cfid);
					if (ids[0] == kGrLangFeature)
					{
						Enabled = false;
						return;
					}
				}
			}
			Enabled = true;
			}
#endif
		}
Пример #32
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Setups the font features.
		/// </summary>
		/// ------------------------------------------------------------------------------------
		private void SetupFontFeatures()
		{
			if (m_fontName == null || m_fontName == "")
			{
				Enabled = false;
				return;
			}
			IRenderEngine renderer;
			if (FontHasGraphiteTables(m_fontName, false, false))
				renderer = FwGrEngineClass.Create();
			else
				renderer = UniscribeEngineClass.Create();
			renderer.WritingSystemFactory = m_wsf;
			HoldDummyGraphics hdg = new HoldDummyGraphics(m_fontName, false, false, CreateGraphics());
			renderer.InitRenderer(hdg.m_vwGraphics, m_fontFeatures);
			m_featureEngine = renderer as IRenderingFeatures;
			if (m_featureEngine == null)
			{
				Enabled = false;
				hdg.Close();
				return;
			}
			int cfid;
			m_featureEngine.GetFeatureIDs(0, null, out cfid);
			if (cfid == 0)
			{
				Enabled = false;
				hdg.Close();
				return;
			}
			if (cfid == 1)
			{
				// What if it's the dummy built-in graphite feature that we ignore?
				// Get the list of features (only 1).
				using (ArrayPtr idsM = MarshalEx.ArrayToNative(cfid, typeof(int)))
				{
					m_featureEngine.GetFeatureIDs(cfid, idsM, out cfid);
					int [] ids = (int[])MarshalEx.NativeToArray(idsM, cfid, typeof(int));
					if (ids[0] == kGrLangFeature)
					{
						Enabled = false;
						hdg.Close();
						return;
					}
				}
			}
			Enabled = true;
			hdg.Close();
		}
Пример #33
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Setups the font features.
		/// </summary>
		/// ------------------------------------------------------------------------------------
		public void SetupFontFeatures()
		{
			CheckDisposed();

			if (string.IsNullOrEmpty(m_fontName))
			{
				Enabled = false;
				m_isGraphiteFont = false;
				return;
			}

			using (var hdg = new HoldDummyGraphics(m_fontName, false, false, this))
			{
				IRenderEngine renderer = GraphiteEngineClass.Create();
				renderer.InitRenderer(hdg.m_vwGraphics, m_fontFeatures);
				// check if the font is a valid Graphite font
				if (!renderer.FontIsValid)
				{
					m_isGraphiteFont = false;
					Enabled = false;
					return;
				}
				renderer.WritingSystemFactory = m_wsf;
				m_isGraphiteFont = true;
				m_featureEngine = renderer as IRenderingFeatures;
				if (m_featureEngine == null)
				{
					Enabled = false;
					return;
				}
				int cfid;
				m_featureEngine.GetFeatureIDs(0, null, out cfid);
				if (cfid == 0)
				{
					Enabled = false;
					return;
				}
				if (cfid == 1)
				{
					// What if it's the dummy built-in graphite feature that we ignore?
					// Get the list of features (only 1).
					using (ArrayPtr idsM = MarshalEx.ArrayToNative<int>(cfid))
					{
						m_featureEngine.GetFeatureIDs(cfid, idsM, out cfid);
						int [] ids = MarshalEx.NativeToArray<int>(idsM, cfid);
						if (ids[0] == kGrLangFeature)
						{
							Enabled = false;
							return;
						}
					}
				}
				Enabled = true;
			}
		}