Ejemplo n.º 1
0
        /// <summary>
        /// Extends the base WriteXml with additional properties managed by this class.
        /// </summary>
        /// <param name="writer">The XmlWriter used by the serializer.</param>
        public override void WriteXml(XmlWriter writer)
        {
            base.WriteXml(writer);

            writer.WriteAttributeString("applyColors", ApplyColors.ToString().ToLower());
            writer.WriteAttributeString("styleType", StyleType.ToString());
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Returns the css class for the given style type.
        /// </summary>
        /// <param name="styleType">Type of the style.</param>
        /// <returns></returns>
        public static string CssClass(this StyleType styleType)
        {
            var memInfo    = typeof(StyleType).GetMember(styleType.ToString());
            var attributes = memInfo[0].GetCustomAttributes(typeof(StyleTypeCssClassAttribute), false);

            return(((StyleTypeCssClassAttribute)attributes[0]).CssClass);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Преобразования объекта типв <see cref="StyleType"/> в html
 /// </summary>
 /// <param name="item"></param>
 /// <returns></returns>
 public static string ToHtml(this StyleType item)
 {
     return(item switch {
         SimpleText text => text.ToHtml(),
         InternalLinkItem link => link.ToHtml(),
         InlineImageItem image => image.ToHtml(),
         _ => item.ToString()
     });
Ejemplo n.º 4
0
        /// <summary>
        /// Print the object's XML to the XmlWriter.
        /// </summary>
        /// <param name="objWriter">XmlTextWriter to write with.</param>
        /// <param name="objCulture">Culture in which to print.</param>
        /// <param name="strLanguageToPrint">Language in which to print</param>
        public void Print(XmlTextWriter objWriter, CultureInfo objCulture, string strLanguageToPrint)
        {
            objWriter.WriteStartElement("lifestyle");
            objWriter.WriteElementString("name", CustomName);
            objWriter.WriteElementString("cost", Cost.ToString(_objCharacter.Options.NuyenFormat, objCulture));
            objWriter.WriteElementString("totalmonthlycost", TotalMonthlyCost.ToString(_objCharacter.Options.NuyenFormat, objCulture));
            objWriter.WriteElementString("totalcost", TotalCost.ToString(_objCharacter.Options.NuyenFormat, objCulture));
            objWriter.WriteElementString("dice", Dice.ToString(objCulture));
            objWriter.WriteElementString("multiplier", Multiplier.ToString(_objCharacter.Options.NuyenFormat, objCulture));
            objWriter.WriteElementString("months", Increments.ToString(objCulture));
            objWriter.WriteElementString("purchased", Purchased.ToString());
            objWriter.WriteElementString("type", StyleType.ToString());
            objWriter.WriteElementString("increment", IncrementType.ToString());
            objWriter.WriteElementString("sourceid", SourceID.ToString("D"));
            objWriter.WriteElementString("bonuslp", BonusLP.ToString(objCulture));
            string strBaseLifestyle = string.Empty;

            // Retrieve the Advanced Lifestyle information if applicable.
            if (!string.IsNullOrEmpty(BaseLifestyle))
            {
                XmlNode objXmlAspect = GetNode();
                if (objXmlAspect != null)
                {
                    strBaseLifestyle = objXmlAspect["translate"]?.InnerText ?? objXmlAspect["name"]?.InnerText ?? strBaseLifestyle;
                }
            }

            objWriter.WriteElementString("baselifestyle", strBaseLifestyle);
            objWriter.WriteElementString("trustfund", TrustFund.ToString());
            objWriter.WriteElementString("source", CommonFunctions.LanguageBookShort(Source, strLanguageToPrint));
            objWriter.WriteElementString("page", DisplayPage(strLanguageToPrint));
            objWriter.WriteStartElement("qualities");

            // Retrieve the Qualities for the Advanced Lifestyle if applicable.
            foreach (LifestyleQuality objQuality in LifestyleQualities)
            {
                objQuality.Print(objWriter, objCulture, strLanguageToPrint);
            }
            // Retrieve the free Grids for the Advanced Lifestyle if applicable.
            foreach (LifestyleQuality objQuality in FreeGrids)
            {
                objQuality.Print(objWriter, objCulture, strLanguageToPrint);
            }
            objWriter.WriteEndElement();
            if (_objCharacter.Options.PrintNotes)
            {
                objWriter.WriteElementString("notes", Notes);
            }
            objWriter.WriteEndElement();
        }
Ejemplo n.º 5
0
 private void OnPressStyle(StyleType type)
 {
     if (_Status == CameraStatus.Playing)
     {
         _CurrentStyle     = type;
         BackImage.texture = _Images[type.ToString().ToLower()];
     }
     if (_Status == CameraStatus.Responsed)
     {
         _TransferedUrl = null;
         _CurrentStyle  = type;
         _WebCamTexture.Play();
         RawImage.texture            = _WebCamTexture;
         _Status                     = CameraStatus.Playing;
         RawImage.transform.rotation = _CameraRotation;
     }
 }
Ejemplo n.º 6
0
        public override IEnumerable <Argument> GetArguments()
        {
            List <Argument> args = new List <Argument>();

            args.Add(ArgumentHelper.ArgumentFactory(nameof(Response), Response));
            args.Add(ArgumentHelper.ArgumentFactory(nameof(ResponseTransformation), ResponseTransformation));
            args.Add(ArgumentHelper.ArgumentFactory(nameof(XAxis), XAxis));
            args.Add(ArgumentHelper.ArgumentFactory(nameof(XAxisTransformation), XAxisTransformation));
            args.Add(ArgumentHelper.ArgumentFactory(nameof(FirstCatFactor), FirstCatFactor));
            args.Add(ArgumentHelper.ArgumentFactory(nameof(SecondCatFactor), SecondCatFactor));
            args.Add(ArgumentHelper.ArgumentFactory(nameof(StyleType), StyleType.ToString()));
            args.Add(ArgumentHelper.ArgumentFactory(nameof(DisplayLegend), DisplayLegend));

            args.Add(ArgumentHelper.ArgumentFactory(nameof(XAxisMin), XAxisMin));
            args.Add(ArgumentHelper.ArgumentFactory(nameof(XAxisMax), XAxisMax));
            args.Add(ArgumentHelper.ArgumentFactory(nameof(YAxisMin), YAxisMin));
            args.Add(ArgumentHelper.ArgumentFactory(nameof(YAxisMax), YAxisMax));


            args.Add(ArgumentHelper.ArgumentFactory(nameof(SEMPlotIncludeData), SEMPlotIncludeData));
            args.Add(ArgumentHelper.ArgumentFactory(nameof(MainTitle), MainTitle));
            args.Add(ArgumentHelper.ArgumentFactory(nameof(XAxisTitle), XAxisTitle));
            args.Add(ArgumentHelper.ArgumentFactory(nameof(YAxisTitle), YAxisTitle));

            args.Add(ArgumentHelper.ArgumentFactory(nameof(XAxisLevelsOrder), FixFactorOrdering(XAxisLevelsOrder)));
            args.Add(ArgumentHelper.ArgumentFactory(nameof(FirstCatFactorLevelsOrder), FixFactorOrdering(FirstCatFactorLevelsOrder)));
            args.Add(ArgumentHelper.ArgumentFactory(nameof(SecondCatFactorLevelsOrder), FixFactorOrdering(SecondCatFactorLevelsOrder)));

            args.Add(ArgumentHelper.ArgumentFactory(nameof(ScatterplotSelected), ScatterplotSelected));
            args.Add(ArgumentHelper.ArgumentFactory(nameof(LinearFitSelected), LinearFitSelected));
            args.Add(ArgumentHelper.ArgumentFactory(nameof(JitterSelected), JitterSelected));
            args.Add(ArgumentHelper.ArgumentFactory(nameof(BoxplotSelected), BoxplotSelected));
            args.Add(ArgumentHelper.ArgumentFactory(nameof(BoxplotOptions), BoxplotOptions));
            args.Add(ArgumentHelper.ArgumentFactory(nameof(ErrorBarPlotSelected), ErrorBarPlotSelected));
            args.Add(ArgumentHelper.ArgumentFactory(nameof(SEMType), SEMType.ToString()));
            args.Add(ArgumentHelper.ArgumentFactory(nameof(ErrorBarType), ErrorBarType.ToString()));
            args.Add(ArgumentHelper.ArgumentFactory(nameof(HistogramSelected), HistogramSelected));
            args.Add(ArgumentHelper.ArgumentFactory(nameof(NormalDistSelected), NormalDistSelected));
            args.Add(ArgumentHelper.ArgumentFactory(nameof(CaseProfilesPlotSelected), CaseProfilesPlotSelected));
            args.Add(ArgumentHelper.ArgumentFactory(nameof(CaseIDFactor), CaseIDFactor));
            args.Add(ArgumentHelper.ArgumentFactory(nameof(ShowCaseIDsInLegend), ShowCaseIDsInLegend));
            args.Add(ArgumentHelper.ArgumentFactory(nameof(ReferenceLine), ReferenceLine));

            return(args);
        }
Ejemplo n.º 7
0
        public static void FormatStyle(this Scintilla scintilla, StyleType styleType)
        {
            ILexerStyle style = null;

            switch (styleType)
            {
            case StyleType.Xml:
                style = new XmlLexerStyle();
                break;

            case StyleType.Json:
                style = new JsonLexerStyle();
                break;

            case StyleType.CSharp:
            default:
                throw new NotImplementedException(styleType.ToString());
            }

            style.LexerStyle(scintilla);
        }
Ejemplo n.º 8
0
        public override string GetCommandLineArguments()
        {
            ArgumentFormatter argFormatter = new ArgumentFormatter();
            StringBuilder     arguments    = new StringBuilder();

            //X-Axis variable
            arguments.Append(" " + argFormatter.GetFormattedArgument(XAxis, true)); //4

            //X-Axis transformation
            arguments.Append(" " + argFormatter.GetFormattedArgument(XAxisTransformation, false)); //5

            //Response variable
            arguments.Append(" " + argFormatter.GetFormattedArgument(Response, true)); //6

            //Response transformation
            arguments.Append(" " + argFormatter.GetFormattedArgument(ResponseTransformation, false)); //7

            //1st cat factor
            arguments.Append(" " + argFormatter.GetFormattedArgument(FirstCatFactor, true)); //8

            //2nd cat factor
            arguments.Append(" " + argFormatter.GetFormattedArgument(SecondCatFactor, true)); //9

            //Graph type
            arguments.Append(" " + argFormatter.GetFormattedArgument(StyleType.ToString(), false)); //10

            //Main title
            arguments.Append(" " + argFormatter.GetFormattedArgument(MainTitle, false)); //11

            //X-Axis title
            arguments.Append(" " + argFormatter.GetFormattedArgument(XAxisTitle, false)); //12

            //Y Axis title
            arguments.Append(" " + argFormatter.GetFormattedArgument(YAxisTitle, false)); //13


            //XAxisLevelsOrder
            arguments.Append(" " + argFormatter.GetFormattedArgument(FixFactorOrdering(XAxisLevelsOrder), false)); //14

            //FirstCatFactorLevelsOrder
            arguments.Append(" " + argFormatter.GetFormattedArgument(FixFactorOrdering(FirstCatFactorLevelsOrder), false)); //15

            //SecondCatFactorLevelsOrder
            arguments.Append(" " + argFormatter.GetFormattedArgument(FixFactorOrdering(SecondCatFactorLevelsOrder), false)); //16


            //Scatterplot
            arguments.Append(" " + argFormatter.GetFormattedArgument(ScatterplotSelected)); //17

            //Linear plot
            arguments.Append(" " + argFormatter.GetFormattedArgument(LinearFitSelected)); //18

            //Jitter
            arguments.Append(" " + argFormatter.GetFormattedArgument(JitterSelected)); //19

            //Boxplot
            arguments.Append(" " + argFormatter.GetFormattedArgument(BoxplotSelected)); //20

            //Outliers
            arguments.Append(" " + argFormatter.GetFormattedArgument(BoxplotOptions)); //21

            //SEM Plot
            arguments.Append(" " + argFormatter.GetFormattedArgument(ErrorBarPlotSelected)); //22

            //Column plot type
            arguments.Append(" " + argFormatter.GetFormattedArgument(SEMType.ToString(), false));      //23

            arguments.Append(" " + argFormatter.GetFormattedArgument(ErrorBarType.ToString(), false)); //24

            //Histogram plot
            arguments.Append(" " + argFormatter.GetFormattedArgument(HistogramSelected)); //25

            //Normal distribution fit
            arguments.Append(" " + argFormatter.GetFormattedArgument(NormalDistSelected)); //26

            //Case profiles plot
            arguments.Append(" " + argFormatter.GetFormattedArgument(CaseProfilesPlotSelected)); //27

            //Case ID Factor
            arguments.Append(" " + argFormatter.GetFormattedArgument(CaseIDFactor, true)); //28

            //Case ID Factor
            arguments.Append(" " + argFormatter.GetFormattedArgument(ShowCaseIDsInLegend)); //29

            //Reference Line
            arguments.Append(" " + argFormatter.GetFormattedArgument(ReferenceLine.ToString(), false)); //30

            //Legend
            arguments.Append(" " + argFormatter.GetFormattedArgument(DisplayLegend)); //31

            //SEM Plot include data
            arguments.Append(" " + argFormatter.GetFormattedArgument(SEMPlotIncludeData)); //32


            //XAxisMin
            arguments.Append(" " + argFormatter.GetFormattedArgument(XAxisMin)); //33

            //XAxisMax
            arguments.Append(" " + argFormatter.GetFormattedArgument(XAxisMax)); //34

            //YAxisMin
            arguments.Append(" " + argFormatter.GetFormattedArgument(YAxisMin)); //35

            //YAxisMax
            arguments.Append(" " + argFormatter.GetFormattedArgument(YAxisMax)); //36

            return(arguments.ToString().Trim());
        }
Ejemplo n.º 9
0
 /// <summary>
 /// Grid 내부에 등록 된 스타일 반환
 /// </summary>
 /// <param name="styleType"></param>
 /// <param name="styleName"></param>
 /// <returns></returns>
 public static CellStyle x_GetStyle(this C1FlexGrid flexGrid, StyleType styleType, string styleName)
 {
     return(flexGrid.Styles.Add(styleName, styleType.ToString()));
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Grid 내부에 등록 된 스타일 반환
 /// </summary>
 /// <param name="styleType"></param>
 /// <param name="styleName"></param>
 /// <returns></returns>
 public static CellStyle x_GetStyle(this C1FlexGrid flexGrid, StyleType styleType, string styleName)
 {
     return flexGrid.Styles.Add(styleName, styleType.ToString());
 }
Ejemplo n.º 11
0
        private IEnumerator Uploading(StyleType type)
        {
            // 画像を正方形に
            int x, y, block;

            if (_WebCamTexture.width > _WebCamTexture.height)
            {
                x     = (_WebCamTexture.width - _WebCamTexture.height) / 2;
                y     = 0;
                block = _WebCamTexture.height;
            }
            else
            {
                x     = 0;
                y     = (_WebCamTexture.height - _WebCamTexture.width) / 2;
                block = _WebCamTexture.width;
            }
            Texture2D takenPhoto = new Texture2D(block, block, TextureFormat.RGB24, false);
            var       colors     = _WebCamTexture.GetPixels(x, y, block, block);

            if (_ModifyTexture != null)
            {
                colors = _ModifyTexture(colors, block);
            }
            takenPhoto.SetPixels(colors);
            takenPhoto.Apply();

            Texture2D loadingPhoto = new Texture2D(_WebCamTexture.width, _WebCamTexture.height, TextureFormat.RGB24, false);

            loadingPhoto.SetPixels(_WebCamTexture.GetPixels());
            loadingPhoto.Apply();

            // アップロード開始
            _WebCamTexture.Stop();
            _Status          = CameraStatus.Uploading;
            RawImage.texture = loadingPhoto;
            StartCoroutine(GettingUploadingRaw());

            WWWForm form = new WWWForm();

            form.AddBinaryData("target", takenPhoto.EncodeToJPG());
            form.AddField("mode", type.ToString().ToLower());
            Destroy(takenPhoto);
            using (UnityWebRequest www = UnityWebRequest.Post(URL_TRANSFER, form))
            {
                yield return(www.SendWebRequest());

                if (www.isNetworkError || www.isHttpError)
                {
                    Debug.Log(www.error);
                }
                else
                {
                    Debug.Log("Transfered ! " + www.url);
                    RawImage.transform.rotation = Quaternion.Euler(0, 0, 0);
                    byte[]    bytes   = www.downloadHandler.data;
                    Texture2D texture = new Texture2D(256, 256);
                    texture.LoadImage(bytes);
                    RawImage.texture = texture;
                    RawImage.color   = Color.white;
                    _TransferedUrl   = www.url;
                }
                _Status = CameraStatus.Responsed;
            }
        }