Пример #1
0
 public ExcelWriter(
     IPredictionMatrixWriter predictionMatrixWriter,
     IAttributeWriter attributeWriter,
     IDataObjectsConverter dataObjectsConverter)
 {
     _predictionMatrixWriter = predictionMatrixWriter;
     _attributeWriter        = attributeWriter;
     _dataObjectsConverter   = dataObjectsConverter;
 }
Пример #2
0
        protected override void RenderAttributes(IContext context, IAttributeWriter writer)
        {
            base.RenderAttributes(context, writer);

            //writer.WriteAttributeString(WGAttributes.Text, Text);
            String url = (new SkinResourceHandle(typeof(Skins.XonomyBoxSkin), "Xonomy.html")).ToString();

            writer.WriteAttributeString("sUrl", url);   // 冇用嘅,攞嚟試下 Data_GetAttribute work 唔 work
        }
Пример #3
0
 public ExcelWriter(
     IPredictionMatrixWriter predictionMatrixWriter,
     IAttributeWriter attributeWriter,
     ISaveFileDialog sfd,
     IDataObjectsConverter dataObjectsConverter)
 {
     _predictionMatrixWriter = predictionMatrixWriter;
     _attributeWriter        = attributeWriter;
     _newSFD = sfd;
     _dataObjectsConverter = dataObjectsConverter;
 }
Пример #4
0
        /// <summary>
        /// Render attributes for UploadBox
        /// </summary>
        /// <param name="context"></param>
        /// <param name="writer"></param>
        protected override void RenderAttributes(IContext context, IAttributeWriter writer)
        {
            //! 2020.10.22 paulus: WGAttributes 屬於 WebGUI Core,唔識增加 WGAttributes.UploadBox???,借用現有嘅 WGAttributes.UploadControl???
            writer.WriteAttributeString(WGAttributes.UploadControlMaxNumberOfFiles, this.UploadMaxNumberOfFiles.ToString(CultureInfo.InvariantCulture));
            writer.WriteAttributeString(WGAttributes.UploadControlMaxFileSize, this.UploadMaxFileSize.ToString(CultureInfo.InvariantCulture));
            writer.WriteAttributeString(WGAttributes.UploadControlMinFileSize, this.UploadMinFileSize.ToString(CultureInfo.InvariantCulture));
            writer.WriteAttributeString(WGAttributes.UploadControlFileTypes, this.UploadFileTypes);
            writer.WriteAttributeString(WGAttributes.UploadControlPost, (new GatewayReference(this, WGAttributes.UploadControlPost)).ToString());
            writer.WriteAttributeString(WGAttributes.UploadControlText, this.UploadText);
            writer.WriteAttributeString(WGAttributes.UploadControlClientChunkSize, this.UploadClientChunkSize.ToString(CultureInfo.InvariantCulture));
            writer.WriteAttributeString(WGAttributes.UploadControlShowFilenameOnBar, (this.UploadShowFilenameOnBar ? "1" : "0"));
            writer.WriteAttributeString(WGAttributes.UploadControlShowSpeedOnBar, (this.UploadShowSpeedOnBar ? "1" : "0"));
            writer.WriteAttributeString(WGAttributes.UploadControlEnabled, (this.Enabled ? "1" : "0"));

            base.RenderAttributes(context, writer);
        }
Пример #5
0
        protected override void RenderAttributes(IContext context, IAttributeWriter writer)
        {
            base.RenderAttributes(context, writer);

            #region Custom Attributes

            writer.WriteAttributeString("SEL", "SELECTABLE");
            writer.WriteAttributeString("ANYTHING", "ANYTHING WILL DO");

            //writer.WriteAttributeString(WGAttributes.Text, Text);
            String url = (new SkinResourceHandle(typeof(TreantBoxSkin), "TreantBox.html")).ToString();
            writer.WriteAttributeString("sUrl", url);   // 冇用嘅,攞嚟試下 Data_GetAttribute work 唔 work

            writer.WriteAttributeString(WGAttributes.HTML5, TreantBoxDataJson);

            #endregion
        }
Пример #6
0
        protected override void RenderAttributes(IContext context, IAttributeWriter writer)
        {
            base.RenderAttributes(context, writer);

            #region Custom Attributes
            //writer.WriteAttributeString("SEL", "SELECTABLE");
            //writer.WriteAttributeString("ANYTHING", "ANYTHING WILL DO");

            #region ECharts with simple option
            var pattern       = @"(""(?:[^""\\]|\\.)*"")|\s+";
            var echartsOption = Regex.Replace(@"{
    ""title"": {
        ""text"": ""第一个 ECharts 实例""
    },
    ""tooltip"": {},
    ""legend"": {
        ""data"":[""销量""]
    },
    ""xAxis"": {
        ""data"": [""衬衫"",""羊毛衫"",""雪纺衫"",""裤子"",""高跟鞋"",""袜子""]
    },
    ""yAxis"": {},
    ""series"": [{
        ""name"": ""销量"",
        ""type"": ""bar"",
        ""data"": [5, 20, 36, 10, 10, 20]
    }]
}", pattern, "$1");   // Use RegEx to remove spaces CRLF
            #endregion

            writer.WriteAttributeString("EChartsOption", this.EChartsOption == string.Empty ? echartsOption : this.EChartsOption);

            //writer.WriteAttributeString(WGAttributes.Text, Text);
            String url = (new SkinResourceHandle(typeof(EChartsBoxSkin), "EChartsBox.html")).ToString();
            writer.WriteAttributeString("sUrl", url);   // 冇用嘅,攞嚟試下 Data_GetAttribute work 唔 work

            writer.WriteAttributeString(WGAttributes.HTML5, "EChartsBoxOption");

            #endregion
        }
Пример #7
0
 protected override void RenderAttributes(IContext context, IAttributeWriter writer)
 {
     base.RenderAttributes(context, writer);
     writer.WriteAttributeString("SEL", this.Selectable ? "1" : "0");
 }
Пример #8
0
        protected override void RenderAttributes(IContext context, IAttributeWriter objWriter)
        {
            base.RenderAttributes(context, objWriter);
            string json = "";
            json = Newtonsoft.Json.JsonConvert.SerializeObject(this.Items);
            objWriter.WriteAttributeString(WGAttributes.Code, json);
            if (!string.IsNullOrWhiteSpace(DisplayFormat))
            {
                objWriter.WriteAttributeString(WGAttributes.Format, DisplayFormat);
            }
            if (!string.IsNullOrWhiteSpace(ClientInputDisplayFormat))
            {
                objWriter.WriteAttributeString("ClientInputDisplayFormat", ClientInputDisplayFormat);
            }
            if (!string.IsNullOrWhiteSpace(this.VaildExpression))
            {
                objWriter.WriteAttributeString(WGAttributes.ValueValidationExpression, VaildExpression);
            }
            if (!string.IsNullOrWhiteSpace(this.VaildExpressionMsg))
            {
                objWriter.WriteAttributeString(WGAttributes.InValidateMessage, VaildExpressionMsg);
            }
            objWriter.WriteAttributeString(WGAttributes.LabelEdit, this.Editable ? "1" : "0");
            if (!string.IsNullOrEmpty(SplitString))
            {
                objWriter.WriteAttributeString("SplitStr", this.SplitString);
            }

            if (!string.IsNullOrWhiteSpace(OnClientRemoveScript))
            {
                objWriter.WriteAttributeString("OnRemove", this.OnClientRemoveScript);
            }
        }
Пример #9
0
        protected override void RenderAttributes(IContext context, IAttributeWriter writer)
        {
            base.RenderAttributes(context, writer);
            if (Radius != CornerRadius.Empty)
            {
                CornerRadiusValue rd = this.Radius;
                string style = rd.GetStyle();
                writer.WriteAttributeString("Radius", style);
            }

            if (this.BoxShadow != this.DefaultBoxShadow)
            {
                BoxShadowValue bs = this.BoxShadow;
                string style = bs.GetStyle();
                writer.WriteAttributeString("BoxShadow", style);
            }
        }
        protected override void RenderAttributes(IContext context, IAttributeWriter writer)
        {
            base.RenderAttributes(context, writer);

            writer.WriteAttributeString(WGAttributes.Text, Text);
        }
Пример #11
0
        protected override void RenderAttributes(IContext context, IAttributeWriter writer)
        {
            base.RenderAttributes(context, writer);

            writer.WriteAttributeString(WGAttributes.Text, Text);
        }
Пример #12
0
        /// <summary>
        /// Renders the attributes.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="writer">The writer.</param>
        protected override void RenderAttributes(IContext context, IAttributeWriter writer)
        {
            base.RenderAttributes(context, writer);

            if (mobjImage != null)
            {
                writer.WriteAttributeString(WGAttributes.Image, mobjImage.ToString());
                if (mobjSelection != null)
                {
                    string size = string.Format("{{ x: {0}, y:{1}, w:{2}, h:{3} }}",
                        mobjSelection.X, mobjSelection.Y, mobjSelection.Width, mobjSelection.Height
                        );
                    writer.WriteAttributeString(WGAttributes.SelectedImage, size);
                }
                writer.WriteAttributeString("bgOpacity", this.BgOpacity);
                writer.WriteAttributeString("bgColor", ColorTranslator.ToHtml(this.BgColor));
                if (AspectRatio > 0)
                {
                    writer.WriteAttributeString("aspectRatio", AspectRatio);
                }
            }
        }
Пример #13
0
 protected override void RenderAttributes(IContext context, IAttributeWriter objWriter)
 {
     base.RenderAttributes(context, objWriter);
     objWriter.WriteAttributeString(WGAttributes.ItemHeight, NodeHeight);
     objWriter.WriteAttributeString("showHtml", this.AllowNodeTextAsHtml ? "1" : "0");
     objWriter.WriteAttributeString("selectFullLine", this.AllowSelectFullLine ? "1" : "0");
 }