当前位置: 首页>>代码示例>>C#>>正文


C# HtmlTableRow.RenderControl方法代码示例

本文整理汇总了C#中HtmlTableRow.RenderControl方法的典型用法代码示例。如果您正苦于以下问题:C# HtmlTableRow.RenderControl方法的具体用法?C# HtmlTableRow.RenderControl怎么用?C# HtmlTableRow.RenderControl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HtmlTableRow的用法示例。


在下文中一共展示了HtmlTableRow.RenderControl方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RenderComponentRow


//.........这里部分代码省略.........

        BXComponentParameterViewComboExpressionEditor parameterComboExpEd = parameterControl as BXComponentParameterViewComboExpressionEditor;
        if (parameterComboExpEd != null)
        {
            string switchModeImgID = string.Concat(parameterComboExpEd.ClientID, ClientIDSeparator, "imgSwitchModificationMode"),
            //string switchModeImgID = "imgSwitchModificationMode",
                urlToModificationModeTextImg = BXThemeHelper.AddAbsoluteThemePath("images/components/exp_off.gif"),
                urlToModificationModeExprImg = BXThemeHelper.AddAbsoluteThemePath("images/components/exp_on.gif");
            HtmlImage switchModeImg = new HtmlImage();
            switchModeImg.ID = switchModeImgID;
            switchModeImg.Attributes.Add("class", "parameter-button mode");

            string switchModeImgAlt2Expr = GetMessage("IMG_TITLE_SWITCH_TO_DYN_EXP_ED"),
                switchModeImgAlt2Text = GetMessage("IMG_TITLE_SWITCH_TO_STD_ED");

            
            if (parameterComboExpEd.GetModificationMode() == BXComponentParameterModificationMode.Standard)
            {
                switchModeImg.Alt = switchModeImgAlt2Expr;
                switchModeImg.Attributes.Add("title", switchModeImgAlt2Expr);
                switchModeImg.Src = urlToModificationModeTextImg;
                switchModeButtonContainer.Attributes.CssStyle[HtmlTextWriterStyle.Visibility] = "hidden";
            }
            else 
            {
                switchModeImg.Alt = switchModeImgAlt2Text;
                switchModeImg.Attributes.Add("title", switchModeImgAlt2Text);
                switchModeImg.Src = urlToModificationModeExprImg;
                switchModeButtonContainer.Attributes.CssStyle[HtmlTextWriterStyle.Visibility] = "visible";
            }

            switchModeImg.Attributes.Add("onclick", string.Format("var view = Bitrix.ComponentParametersEditor.getInstance().getView('{0}'); view.switchModificationMode(); if(view.getModificationMode().getCurrentID() == {1}){{ this.src = '{3}'; this.alt = '{4}'; this.title = '{4}'; }}else {{ this.src = '{2}'; this.alt = '{5}'; this.title = '{5}'; }}",
                parameterComboExpEd.ClientID,
                Convert.ToInt32(BXComponentParameterModificationMode.Standard),
				urlToModificationModeExprImg,
				urlToModificationModeTextImg,
                switchModeImgAlt2Expr,
                switchModeImgAlt2Text));

            parameterComboExpEd.ShowModificationModeSwitchButton = false;
            parameterComboExpEd.DisplayExpressionTags = false;
        
            //dataCell.Controls.Add(switchModeImg);
            switchModeButtonContainer.Controls.Add(switchModeImg);
        }

        if (!parameter.RefreshOnDirty)
            dataCell.Controls.Remove(refreshButtonContainer);
        else
        {
            BXComponentParameterView parameterView = (BXComponentParameterView)parameterControl;
            HtmlImage refreshImg = new HtmlImage();
            string refreshImgID = string.Concat(parameterView.ClientID, ClientIDSeparator, "imgRefreshComponentParameters");
            refreshImg.ID = refreshImgID;
            refreshImg.Attributes.Add("class", "parameter-button refresh");
            
            refreshImg.Src = BXThemeHelper.AddAbsoluteThemePath("images/refresh_blue.gif");

            string refreshImgAlt = GetMessage("IMG_TITLE_REFRESH");

            refreshImg.Alt = refreshImgAlt;
            refreshImg.Attributes.Add("title", refreshImgAlt);

            refreshImg.Attributes.Add("onclick", string.Format("this.src='{0}'; window.setTimeout(function(){{ {1}; }}, 300);", 
                BXThemeHelper.AddAbsoluteThemePath("images/refresh_blue_anim.gif"),
                parameterView.GetPostBackEventReference(BXComponentParameterViewPostBackEventType.RefreshComponentParameters)));
            //dataCell.Controls.Add(refreshImg);
            refreshButtonContainer.Controls.Add(refreshImg);

            parameterView.SetPostBackEventTrigger(
                BXComponentParameterViewPostBackEventType.RefreshComponentParameters,
                string.Format("window.document.getElementById('{0}').onclick();", refreshImg.ClientID));
        }

		ParamClientSideAction action = parameter.ClientSideAction;
		if (action != null)
		{
			action.AdjustControls(new Control[] { row }, this);
			action.RegisterClientScripts(this);
			ParamClientSideActionGroupView groupViewAction = action as ParamClientSideActionGroupView;
			if (groupViewAction != null)
			{
				ScriptManager.RegisterStartupScript(this,
					GetType(),
					"ParamClientSideActionGroupViewVisibilityBinding",
                    string.Format("if(typeof(Bitrix) != 'undefined' && typeof(Bitrix.ParamClientSideActionGroupView) != 'undefined'){{ Bitrix.ParamClientSideActionGroupView.ensureEntryCreated('{0}'); }}", groupViewAction.ViewID), 
					true);

				if (groupViewAction is ParamClientSideActionGroupViewMember)
					row.Attributes.CssStyle[HtmlTextWriterStyle.Display] = "none";
			}

		}
        using (StringWriter sw = new StringWriter())
        {
            using (HtmlTextWriter htmlw = new HtmlTextWriter(sw))
                row.RenderControl(htmlw);
            return sw.ToString();
        }
    }
开发者ID:mrscylla,项目名称:volotour.ru,代码行数:101,代码来源:EditComponentParameters.aspx.cs


注:本文中的HtmlTableRow.RenderControl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。