Пример #1
0
        /// <summary>
        /// 获取显示确认对话框的客户端脚本
        /// </summary>
        /// <param name="message">对话框消息</param>
        /// <param name="title">对话框标题</param>
        /// <param name="icon">对话框图标</param>
        /// <param name="okScriptstring">点击确定按钮执行的客户端脚本</param>
        /// <param name="cancelScript">点击取消按钮执行的客户端脚本</param>
        /// <param name="target">弹出对话框的目标页面</param>
        /// <returns>客户端脚本</returns>
        public static string GetShowReference(string message, string title, MessageBoxIcon icon, string okScriptstring, string cancelScript, Target target)
        {
            //string msgBoxScript = "var msgBox=Ext.MessageBox;";
            //msgBoxScript += "if(parent!=window){msgBox=parent.window.Ext.MessageBox;}";
            if (String.IsNullOrEmpty(title))
            {
                title = "X.util.confirmTitle";
            }
            else
            {
                title = JsHelper.GetJsString(title.Replace("\r\n", "\n").Replace("\n", "<br/>"));
            }
            message = message.Replace("\r\n", "\n").Replace("\n", "<br/>");


            JsObjectBuilder ob = new JsObjectBuilder();

            ob.AddProperty("title", title, true);
            ob.AddProperty("msg", JsHelper.GetJsStringWithScriptTag(message), true);
            ob.AddProperty("buttons", "Ext.MessageBox.OKCANCEL", true);
            ob.AddProperty("icon", String.Format("{0}", MessageBoxIconHelper.GetName(icon)), true);
            ob.AddProperty("fn", String.Format("function(btn){{if(btn=='cancel'){{{0}}}else{{{1}}}}}", cancelScript, okScriptstring), true);

            string targetName = "window";

            if (target != Target.Self)
            {
                targetName = TargetHelper.GetScriptName(target);
            }
            return(String.Format("{0}.Ext.MessageBox.show({1});", targetName, ob.ToString()));
        }
Пример #2
0
        /// <summary>
        /// 获取显示对话框的客户端脚本
        /// </summary>
        /// <returns>客户端脚本</returns>
        public string GetShowReference()
        {
            string message = "";
            string title   = "";

            if (!String.IsNullOrEmpty(Message))
            {
                message = Message;
            }
            if (!String.IsNullOrEmpty(Title))
            {
                title = Title;
            }


            JsObjectBuilder jsOB = new JsObjectBuilder();

            if (!String.IsNullOrEmpty(CancelScript))
            {
                jsOB.AddProperty("cancel", CancelScript);
            }

            if (!String.IsNullOrEmpty(OkScript))
            {
                jsOB.AddProperty("ok", OkScript);
            }

            if (Target != Target.Self)
            {
                jsOB.AddProperty("target", TargetHelper.GetName(Target));
            }

            if (MessageBoxIcon != MessageBoxIcon.Warning)
            {
                jsOB.AddProperty("messageIcon", MessageBoxIconHelper.GetShortName(MessageBoxIcon));
            }

            if (!String.IsNullOrEmpty(title))
            {
                jsOB.AddProperty("title", title.Replace("\r\n", "\n").Replace("\n", "<br/>"));
            }

            if (!String.IsNullOrEmpty(message))
            {
                jsOB.AddProperty("message", JsHelper.EnquoteWithScriptTag(message.Replace("\r\n", "\n").Replace("\n", "<br/>")), true);
            }

            return(String.Format("F.confirm({0});", jsOB.ToString()));
        }
Пример #3
0
        /// <summary>
        /// 返回对象的Json字符串表示
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            if (Listeners.Count > 0)
            {
                //// 如果在 Listeners 中没有添加上下文,则添加默认的 this
                //if (!Listeners.ContainsProperty(OptionName.Scope))
                //{
                //    Listeners.AddProperty(OptionName.Scope, "box", true);
                //}

                AddProperty("listeners", Listeners.ToString(), true);
            }

            return(_defaultBuilder.ToString());
        }
Пример #4
0
        /// <summary>
        /// 获取显示对话框的客户端脚本
        /// </summary>
        /// <returns>客户端脚本</returns>
        public string GetShowReference()
        {
            string message = "";
            string title   = "";

            if (!String.IsNullOrEmpty(Message))
            {
                message = Message;
            }
            if (!String.IsNullOrEmpty(Title))
            {
                title = Title;
            }

            JsObjectBuilder jsOB = new JsObjectBuilder();

            if (Target != Target.Self)
            {
                jsOB.AddProperty("target", TargetHelper.GetName(Target));
            }

            if (NotifyIcon != NotifyIcon.Info)
            {
                jsOB.AddProperty("notifyIcon", NotifyIconHelper.GetName(NotifyIcon));
            }

            if (!String.IsNullOrEmpty(title))
            {
                jsOB.AddProperty("title", title.Replace("\r\n", "\n").Replace("\n", "<br/>"));
            }

            if (!String.IsNullOrEmpty(message))
            {
                jsOB.AddProperty("message", JsHelper.EnquoteWithScriptTag(message.Replace("\r\n", "\n").Replace("\n", "<br/>")), true);
            }

            return(String.Format("F.notify({0});", jsOB.ToString()));
        }
Пример #5
0
        /// <summary>
        /// 获取显示对话框的客户端脚本
        /// </summary>
        /// <returns>客户端脚本</returns>
        public string GetShowReference()
        {
            string message = "";
            string title = "";
            if (!String.IsNullOrEmpty(Message))
            {
                message = Message;
            }
            if (!String.IsNullOrEmpty(Title))
            {
                title = Title;
            }


            JsObjectBuilder jsOB = new JsObjectBuilder();

            if (!String.IsNullOrEmpty(CancelScript))
            {
                jsOB.AddProperty("cancel", CancelScript);
            }

            if (!String.IsNullOrEmpty(OkScript))
            {
                jsOB.AddProperty("ok", OkScript);
            }

            if (Target != Target.Self)
            {
                jsOB.AddProperty("target", TargetHelper.GetName(Target));
            }

            if (MessageBoxIcon != MessageBoxIcon.Warning)
            {
                jsOB.AddProperty("messageIcon", MessageBoxIconHelper.GetShortName(MessageBoxIcon));
            }

            if (!String.IsNullOrEmpty(title))
            {
                jsOB.AddProperty("title", title.Replace("\r\n", "\n").Replace("\n", "<br/>"));
            }

            if (!String.IsNullOrEmpty(message))
            {
                jsOB.AddProperty("message", JsHelper.EnquoteWithScriptTag(message.Replace("\r\n", "\n").Replace("\n", "<br/>")), true);
            }

            return String.Format("F.confirm({0});", jsOB.ToString());
        }
Пример #6
0
        /// <summary>
        /// 获取显示确认对话框的客户端脚本
        /// </summary>
        /// <param name="message">对话框消息</param>
        /// <param name="title">对话框标题</param>
        /// <param name="icon">对话框图标</param>
        /// <param name="okScriptstring">点击确定按钮执行的客户端脚本</param>
        /// <param name="cancelScript">点击取消按钮执行的客户端脚本</param>
        /// <param name="target">弹出对话框的目标页面</param>
        /// <returns>客户端脚本</returns>
        public static string GetShowReference(string message, string title, MessageBoxIcon icon, string okScriptstring, string cancelScript, Target target)
        {
            //string msgBoxScript = "var msgBox=Ext.MessageBox;";
            //msgBoxScript += "if(parent!=window){msgBox=parent.window.Ext.MessageBox;}";
            if (String.IsNullOrEmpty(title))
            {
                title = "X.util.confirmTitle";
            }
            else
            {
                title = JsHelper.GetJsString(title.Replace("\r\n", "\n").Replace("\n", "<br/>"));
            }
            message = message.Replace("\r\n", "\n").Replace("\n", "<br/>");

            JsObjectBuilder ob = new JsObjectBuilder();
            ob.AddProperty("title", title, true);
            ob.AddProperty("msg", JsHelper.GetJsStringWithScriptTag(message), true);
            ob.AddProperty("buttons", "Ext.MessageBox.OKCANCEL", true);
            ob.AddProperty("icon", String.Format("{0}", MessageBoxIconHelper.GetName(icon)), true);
            ob.AddProperty("fn", String.Format("function(btn){{if(btn=='cancel'){{{0}}}else{{{1}}}}}", cancelScript, okScriptstring), true);

            string targetName = "window";
            if (target != Target.Self)
            {
                targetName = TargetHelper.GetScriptName(target);
            }
            return String.Format("{0}.Ext.MessageBox.show({1});", targetName, ob.ToString());
        }
Пример #7
0
        /// <summary>
        /// 添加列
        /// </summary>
        /// <param name="rowIdsBuilder">行ID集合</param>
        /// <param name="startLineIndex">开始行的索引(包含)</param>
        /// <param name="endLineIndex">结束行的索引(包含)</param>
        /// <param name="columnCount">行的列数</param>
        private string AddColumnScript(JsArrayBuilder rowIdsBuilder, int startLineIndex, int endLineIndex, int columnCount)
        {
            // 注意,注册脚本的控件应该是最后一个 Row
            // 假如有从上之下这些控件: Row1(Field1,Field2), Row2(Field3,Field4),Row3(Field5)
            // 则渲染时,JS脚本的执行顺序为:Field1,Field2,Row1,Field3,Field4,Row2,Field5,Row3
            // 所以,如果column Panel的脚本注册为控件 Row3,则能保证所有的子控件已经初始化
            // 需要注意的是:在此设置脚本内容到 Row3 控件
            // 现在已经不是这样的了!!!,Row不在是一个控件

            #region examples


            //            {
            //                    layout: 'column',
            //                    border:false,
            //                    items:[{
            //                        columnWidth: .5,
            //                        layout: 'form',
            //                        border:false,
            //                        items:[{
            //                            xtype:'combo',
            //                            store: nextStepStore,
            //                            displayField:'text',
            //                            valueField:'value',
            //                            typeAhead: true,
            //                            mode: 'local',
            //                            triggerAction: 'all',
            //                            value:'1',
            //                            emptyText:'请选择下一步',
            //                            selectOnFocus:true,
            //                            allowBlank:false,
            //                            fieldLabel: '下一步',
            //                            labelSeparator:'&nbsp;<span style="color:red;vertical-align:text-bottom;">*</span>',
            //                            name: 'nextStep',
            //                            anchor:'95%'
            //                        }]
            //                    },{
            //                        columnWidth: .5,
            //                        layout: 'form',
            //                        border:false,
            //                        items:[{
            //                            xtype:'combo',
            //                            store: executePersonStore,
            //                            displayField:'text',
            //                            valueField:'value',
            //                            typeAhead: true,
            //                            mode: 'local',
            //                            triggerAction: 'all',
            //                            value:'1',
            //                            emptyText:'请选择执行人',
            //                            selectOnFocus:true,
            //                            allowBlank:false,
            //                            fieldLabel: '执行人',
            //                            labelSeparator:'&nbsp;<span style="color:red;vertical-align:text-bottom;">*</span>',
            //                            name: 'executePerson',
            //                            anchor:'95%'
            //                        }]
            //                    }]
            //          }


            #endregion


            // 最后一行
            FormRow endLineRow = Rows[endLineIndex];
            string  rowId      = String.Format("{0}_row{1}", XID, endLineIndex);



            #region bodyStyleStr


            //string bodyStyleStr = String.Empty;
            //if (EnableBackgroundColor)
            //{
            //    bodyStyleStr = GlobalConfig.GetDefaultBackgroundColor();
            //}

            //if (!String.IsNullOrEmpty(bodyStyleStr))
            //{
            //    bodyStyleStr = String.Format("background-color:{0};", bodyStyleStr);
            //}

            #endregion


            string   defaultColumnWidthStr = (1.0 / columnCount).ToString("F2", System.Globalization.CultureInfo.InvariantCulture);
            string[] columnWidths          = ResolveColumnWidths(columnCount, Rows[startLineIndex].ColumnWidths, defaultColumnWidthStr);

            // row_column
            JsArrayBuilder rowColumnScriptsBuilder = new JsArrayBuilder();
            for (int columnIndex = 0; columnIndex < columnCount; columnIndex++)
            {
                #region 计算每一列的值

                // 循环每一列
                JsArrayBuilder fieldsAB = new JsArrayBuilder();
                for (int rowIndex = startLineIndex; rowIndex <= endLineIndex; rowIndex++)
                {
                    FormRow currentRow = Rows[rowIndex];

                    if (columnIndex <= GetRowColumnCount(currentRow) - 1)
                    {
                        ControlBase component = GetRowColumnControl(currentRow, columnIndex);
                        if (component != null)
                        {
                            fieldsAB.AddProperty(String.Format("{0}", component.XID), true);
                        }
                    }
                }

                // 当前列的创建JS
                JsObjectBuilder columnOB    = new JsObjectBuilder();
                string          columnWidth = columnWidths[columnIndex];
                if (Convert.ToDouble(columnWidth) <= 1.0)
                {
                    columnOB.AddProperty("columnWidth", columnWidths[columnIndex], true);
                }
                else
                {
                    columnOB.AddProperty("width", columnWidths[columnIndex], true);
                }

                columnOB.AddProperty("layout", "anchor");
                columnOB.AddProperty("border", false);
                //columnOB.AddProperty("bodyStyle", bodyStyleStr);
                //columnOB.AddProperty("labelWidth", LabelWidth.Value);
                columnOB.AddProperty("id", rowId + "_column" + columnIndex.ToString());

                // 有可能为空
                if (fieldsAB.Count > 0)
                {
                    columnOB.AddProperty("items", fieldsAB.ToString(), true);
                }


                rowColumnScriptsBuilder.AddProperty(columnOB.ToString(), true);

                // 现在采取的是安全的ajax,不会出现下面的情况
                //// 所有Layout=form的地方必须用Ext.FormPanel,否则删除时不会把FieldLabek删除掉
                //rowColumnScriptsBuilder.AddProperty(String.Format("new Ext.FormPanel({0})", columnOB.ToString()), true);

                #endregion
            }

            // 外面的JS(X.__Panel1_UpdatePanelConnector1_Panel7_Form5_row0)
            JsObjectBuilder rowBuilder = new JsObjectBuilder();
            rowBuilder.AddProperty("layout", "column");
            rowBuilder.AddProperty("border", false);
            //rowBuilder.AddProperty("bodyStyle", bodyStyleStr);

            // 有可能为空
            if (rowColumnScriptsBuilder.Count > 0)
            {
                rowBuilder.AddProperty("items", rowColumnScriptsBuilder.ToString(), true);
            }


            // 把当前节点添加到结果集合中
            rowIdsBuilder.AddProperty(String.Format("{0}", rowId), true);
            rowBuilder.AddProperty("id", rowId);

            // 注意要注册 最后 一个 Row的脚本
            return(String.Format("var {0}=Ext.create('Ext.panel.Panel',{1});", rowId, rowBuilder.ToString()));
        }
Пример #8
0
        private string GetGridColumnScript()
        {
            string selectModelID = Render_SelectModelID;
            string gridColumnID = Render_GridColumnModelID;
            // columns
            JsArrayBuilder columnsBuilder = new JsArrayBuilder();

            //string expanderScript = String.Empty;
            //if (!String.IsNullOrEmpty(RowExpander.DataFormatString))
            //{
            //    string tplStr = String.Format(RowExpander.DataFormatString.Replace("{", "{{{").Replace("}", "}}}"), RowExpander.DataFields);
            //    expanderScript = String.Format("var {0}=new Ext.ux.grid.RowExpander({{tpl:new Ext.Template({1})}});", Render_GridRowExpanderID, JsHelper.Enquote(tplStr));
            //    columnsBuilder.AddProperty(Render_GridRowExpanderID, true);
            //}

            // 如果启用行序号,则放在第一列
            if (EnableRowNumber)
            {
                JsObjectBuilder rowNumberBuilder = new JsObjectBuilder();
                if (RowNumberWidth != Unit.Empty)
                {
                    rowNumberBuilder.AddProperty("width", RowNumberWidth.Value);
                }
                if (AllowPaging)
                {
                    rowNumberBuilder.AddProperty("x_paging", Render_PagingID, true);
                }
                if (EnableRowNumberPaging)
                {
                    rowNumberBuilder.AddProperty("x_paging_enabled", EnableRowNumberPaging);
                }

                columnsBuilder.AddProperty(String.Format("new Ext.grid.RowNumberer({0})", rowNumberBuilder.ToString()), true);
            }
            // 如果启用CheckBox,则放在第二列
            // 如果启用单元格编辑,则EnableCheckBoxSelect属性失效
            if (EnableCheckBoxSelect && !AllowCellEditing)
            {
                columnsBuilder.AddProperty(selectModelID, true);
            }

            string groupColumnScript = GetGroupColumnScript();

            string expanderXID = String.Empty;
            foreach (GridColumn column in AllColumns)
            {
                if (column is TemplateField && (column as TemplateField).RenderAsRowExpander)
                {
                    expanderXID = column.XID;
                }

                columnsBuilder.AddProperty(column.XID, true);

            }

            // 为Grid添加plugin属性
            JsArrayBuilder pluginBuilder = new JsArrayBuilder();

            if (!String.IsNullOrEmpty(expanderXID))
            {
                pluginBuilder.AddProperty(expanderXID, true);
            }

            if (!String.IsNullOrEmpty(groupColumnScript))
            {
                pluginBuilder.AddProperty(Render_GridGroupColumnID, true);
            }

            if (pluginBuilder.Count > 0)
            {
                OB.AddProperty("plugins", pluginBuilder.ToString(), true);
            }

            JsObjectBuilder defaultsBuilder = new JsObjectBuilder();
            // 这是Extjs默认的客户端排序
            //defaultsBuilder.AddProperty("sortable", false);
            //defaultsBuilder.AddProperty("menuDisabled", true);
            defaultsBuilder.AddProperty("width", 100);

            string columnModelScript = String.Format("var {0}=new Ext.grid.ColumnModel({{columns:{1},defaults:{2}}});", gridColumnID, columnsBuilder, defaultsBuilder);

            return groupColumnScript + columnModelScript;
        }
Пример #9
0
        /// <summary>
        /// 添加列
        /// </summary>
        /// <param name="rowIdsBuilder">行ID集合</param>
        /// <param name="startLineIndex">开始行的索引(包含)</param>
        /// <param name="endLineIndex">结束行的索引(包含)</param>
        /// <param name="columnCount">行的列数</param>
        private string AddColumnScript(JsArrayBuilder rowIdsBuilder, int startLineIndex, int endLineIndex, int columnCount)
        {
            // 注意,注册脚本的控件应该是最后一个 Row
            // 假如有从上之下这些控件: Row1(Field1,Field2), Row2(Field3,Field4),Row3(Field5)
            // 则渲染时,JS脚本的执行顺序为:Field1,Field2,Row1,Field3,Field4,Row2,Field5,Row3
            // 所以,如果column Panel的脚本注册为控件 Row3,则能保证所有的子控件已经初始化
            // 需要注意的是:在此设置脚本内容到 Row3 控件
            // 现在已经不是这样的了!!!,Row不在是一个控件

            #region examples

            //            {
            //                    layout: 'column',
            //                    border:false,
            //                    items:[{
            //                        columnWidth: .5,
            //                        layout: 'form',
            //                        border:false,
            //                        items:[{
            //                            xtype:'combo',
            //                            store: nextStepStore,
            //                            displayField:'text',
            //                            valueField:'value',
            //                            typeAhead: true,
            //                            mode: 'local',
            //                            triggerAction: 'all',
            //                            value:'1',
            //                            emptyText:'请选择下一步',
            //                            selectOnFocus:true,
            //                            allowBlank:false,
            //                            fieldLabel: '下一步',
            //                            labelSeparator:'&nbsp;<span style="color:red;vertical-align:text-bottom;">*</span>',
            //                            name: 'nextStep',
            //                            anchor:'95%'
            //                        }]
            //                    },{
            //                        columnWidth: .5,
            //                        layout: 'form',
            //                        border:false,
            //                        items:[{
            //                            xtype:'combo',
            //                            store: executePersonStore,
            //                            displayField:'text',
            //                            valueField:'value',
            //                            typeAhead: true,
            //                            mode: 'local',
            //                            triggerAction: 'all',
            //                            value:'1',
            //                            emptyText:'请选择执行人',
            //                            selectOnFocus:true,
            //                            allowBlank:false,
            //                            fieldLabel: '执行人',
            //                            labelSeparator:'&nbsp;<span style="color:red;vertical-align:text-bottom;">*</span>',
            //                            name: 'executePerson',
            //                            anchor:'95%'
            //                        }]
            //                    }]
            //          }

            #endregion

            // 最后一行
            FormRow endLineRow = Rows[endLineIndex];
            string rowId = String.Format("{0}_row{1}", XID, endLineIndex);

            #region bodyStyleStr

            //string bodyStyleStr = String.Empty;
            //if (EnableBackgroundColor)
            //{
            //    bodyStyleStr = GlobalConfig.GetDefaultBackgroundColor();
            //}

            //if (!String.IsNullOrEmpty(bodyStyleStr))
            //{
            //    bodyStyleStr = String.Format("background-color:{0};", bodyStyleStr);
            //}

            #endregion

            string defaultColumnWidthStr = (1.0 / columnCount).ToString("F2", System.Globalization.CultureInfo.InvariantCulture);
            string[] columnWidths = ResolveColumnWidths(columnCount, Rows[startLineIndex].ColumnWidths, defaultColumnWidthStr);

            // row_column
            JsArrayBuilder rowColumnScriptsBuilder = new JsArrayBuilder();
            for (int columnIndex = 0; columnIndex < columnCount; columnIndex++)
            {
                #region 计算每一列的值

                // 循环每一列
                JsArrayBuilder fieldsAB = new JsArrayBuilder();
                for (int rowIndex = startLineIndex; rowIndex <= endLineIndex; rowIndex++)
                {
                    FormRow currentRow = Rows[rowIndex];

                    if (columnIndex <= GetRowColumnCount(currentRow) - 1)
                    {
                        ControlBase component = GetRowColumnControl(currentRow, columnIndex);
                        if (component != null)
                        {
                            fieldsAB.AddProperty(String.Format("{0}", component.XID), true);
                        }
                    }
                }

                // 当前列的创建JS
                JsObjectBuilder columnOB = new JsObjectBuilder();
                string columnWidth = columnWidths[columnIndex];
                if (Convert.ToDouble(columnWidth) <= 1.0)
                {
                    columnOB.AddProperty("columnWidth", columnWidths[columnIndex], true);
                }
                else
                {
                    columnOB.AddProperty("width", columnWidths[columnIndex], true);
                }

                columnOB.AddProperty("layout", "anchor");
                columnOB.AddProperty("border", false);
                //columnOB.AddProperty("bodyStyle", bodyStyleStr);
                //columnOB.AddProperty("labelWidth", LabelWidth.Value);
                columnOB.AddProperty("id", rowId + "_column" + columnIndex.ToString());

                // 有可能为空
                if (fieldsAB.Count > 0)
                {
                    columnOB.AddProperty("items", fieldsAB.ToString(), true);
                }

                rowColumnScriptsBuilder.AddProperty(columnOB.ToString(), true);

                // 现在采取的是安全的ajax,不会出现下面的情况
                //// 所有Layout=form的地方必须用Ext.FormPanel,否则删除时不会把FieldLabek删除掉
                //rowColumnScriptsBuilder.AddProperty(String.Format("new Ext.FormPanel({0})", columnOB.ToString()), true);

                #endregion
            }

            // 外面的JS(X.__Panel1_UpdatePanelConnector1_Panel7_Form5_row0)
            JsObjectBuilder rowBuilder = new JsObjectBuilder();
            rowBuilder.AddProperty("layout", "column");
            rowBuilder.AddProperty("border", false);
            //rowBuilder.AddProperty("bodyStyle", bodyStyleStr);

            // 有可能为空
            if (rowColumnScriptsBuilder.Count > 0)
            {
                rowBuilder.AddProperty("items", rowColumnScriptsBuilder.ToString(), true);
            }

            // 把当前节点添加到结果集合中
            rowIdsBuilder.AddProperty(String.Format("{0}", rowId), true);
            rowBuilder.AddProperty("id", rowId);

            // 注意要注册 最后 一个 Row的脚本
            return String.Format("var {0}=Ext.create('Ext.panel.Panel',{1});", rowId, rowBuilder.ToString());
        }
Пример #10
0
        /// <summary>
        /// 获取显示对话框的客户端脚本
        /// </summary>
        /// <returns>客户端脚本</returns>
        public string GetShowReference()
        {
            string message = "";
            string title = "";
            if (!String.IsNullOrEmpty(Message))
            {
                message = Message;
            }
            if (!String.IsNullOrEmpty(Title))
            {
                title = Title;
            }

            JsObjectBuilder jsOB = new JsObjectBuilder();

            if (Target != Target.Self)
            {
                jsOB.AddProperty("target", TargetHelper.GetName(Target));
            }

            if (NotifyIcon != NotifyIcon.Info)
            {
                jsOB.AddProperty("notifyIcon", NotifyIconHelper.GetName(NotifyIcon));
            }

            if (!String.IsNullOrEmpty(title))
            {
                jsOB.AddProperty("title", title.Replace("\r\n", "\n").Replace("\n", "<br/>"));
            }

            if (!String.IsNullOrEmpty(message))
            {
                jsOB.AddProperty("message", JsHelper.EnquoteWithScriptTag(message.Replace("\r\n", "\n").Replace("\n", "<br/>")), true);
            }

            return String.Format("F.notify({0});", jsOB.ToString());
        }