예제 #1
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            StyleEnum style = (StyleEnum)value;

            switch (style)
            {
            case StyleEnum.Default:
                return(Brushes.White);

                break;

            case StyleEnum.Entity:
                return(Brushes.Black);

                break;

            case StyleEnum.Object:
                return(Brushes.Red);

                break;

            case StyleEnum.Obstacle:
                return(Brushes.Brown);

                break;

            default:
                return(Brushes.White);
            }
        }
 public FontRegistryEntry(int HorizontalSize, int VerticalSize, int HorizontalResolution,
                          int VerticalResolution, int ExtraAttributes, int Weight,
                          FamilyEnum Family, StyleEnum StyleStyle, ushort StyleSub, LanguageEnum Language,
                          ushort Region, ushort Country, string FileName,
                          string Name, uint Expire, int ShadowOption)
 {
     this.ExtraAttributes = ExtraAttributes;
     this.ShadowOption    = ShadowOption;
     this.FontStyle       = new FontStyle()
     {
         Size = new HorizontalVerticalFloat()
         {
             Horizontal = HorizontalSize, Vertical = VerticalSize,
         },
         Resolution =
             new HorizontalVerticalFloat()
         {
             Horizontal = HorizontalResolution,
             Vertical   = VerticalResolution,
         },
         Weight     = Weight,
         Family     = Family,
         StyleStyle = StyleStyle,
         StyleSub   = StyleSub,
         Language   = Language,
         Region     = Region,
         Country    = Country,
         FileName   = FileName,
         Name       = Name,
         Expire     = Expire,
     };
 }
예제 #3
0
        public static VisualElement[,] CreateGrid(this VisualElement parent, int width, int height, Func <int, int, VisualElement> elementCreator)
        {
            var gridElements = new VisualElement[width, height];

            if (width <= 0 || height <= 0)
            {
                return(gridElements);
            }

            var rowFlex = new StyleEnum <FlexDirection>();

            rowFlex.value = FlexDirection.Row;

            for (int y = 0; y < height; y++)
            {
                var widthPanel = new VisualElement();

                widthPanel.style.flexDirection = rowFlex;

                for (int x = 0; x < width; x++)
                {
                    var element = elementCreator(x, y);
                    gridElements[x, y] = element;
                    widthPanel.Add(element);
                }

                parent.Add(widthPanel);
            }

            return(gridElements);
        }
예제 #4
0
 private Border(Document context, double width, StyleEnum style, LineDash pattern)
     : base(context, new PdfDictionary(new PdfName[] { PdfName.Type }, new PdfDirectObject[] { PdfName.Border }))
 {
     Width   = width;
     Style   = style;
     Pattern = pattern;
 }
예제 #5
0
 /**
  * <summary>Creates a reusable instance.</summary>
  */
 public Border(
     Document context,
     double width,
     StyleEnum style
     ) : this(context, width, style, null)
 {
 }
        void UpdateInfoOverlayUI()
        {
            if (m_DataInfoOverlay == null)
            {
                m_DataInfoOverlay = new DataInfoOverlay();
            }

            var uiDisplayStyle = new StyleEnum <DisplayStyle>(m_ToolIsActive ? DisplayStyle.Flex : DisplayStyle.None);

            m_DataInfoOverlay.style.display = uiDisplayStyle;
            SimulationView.AddElementToLastHoveredWindow(m_DataInfoOverlay);

            var showOverlay = false;

            if (m_InteractionModule != null && m_InteractionModule.CurrentHoverTarget != null)
            {
                var proxy = m_InteractionModule.CurrentHoverTarget.GetComponentInParent <Proxy>();
                if (proxy != null && proxy.currentData != null)
                {
                    showOverlay = true;
                    m_DataInfoOverlay.UpdateInfo(proxy.currentData);
                }
            }

            m_DataInfoOverlay.visible = showOverlay;
        }
예제 #7
0
        /// <summary>
        /// 通过StyleEnum获取对应的明细数据
        /// </summary>
        /// <param name="style">StyleEnum对象</param>
        /// <returns>NFMT.Data.Model.BdStyleDetail集合</returns>
        public static DetailCollection Details(StyleEnum style)
        {
            if (detailDic.ContainsKey(style))
                return detailDic[style];

            RegisterDetails(style);

            return detailDic[style];
        }
예제 #8
0
 public Transition(Document context, StyleEnum style, double duration, OrientationEnum orientation, PageDirectionEnum pageDirection, DirectionEnum direction, double scale)
     : this(context)
 {
     Style         = style;
     Duration      = duration;
     Orientation   = orientation;
     PageDirection = pageDirection;
     Direction     = direction;
     Scale         = scale;
 }
예제 #9
0
        private static void updateView(View v, StyleEnum style)
        {
            if (testDocNeedsInitializing(v.Document))
            {
                createAllStyles(v.Document);
            }


            //does the current view have an analysis style?
            Parameter avf = v.get_Parameter(BuiltInParameter.VIEW_ANALYSIS_DISPLAY_STYLE);
            Document  doc = v.Document;

            if (avf != null)
            {
                ElementId eid = avf.AsElementId();

                string name = "";
                switch (style)
                {
                case StyleEnum.Faces:
                    name = "SolidView";
                    break;

                case StyleEnum.Vectors:
                    name = "VectorView";
                    break;

                default:
                    throw new ApplicationException("Unexpected Display Style: " + style);
                }

                ElementId pc = AnalysisDisplayStyle.FindByName(doc, name);



                if (pc.IntegerValue > 0)
                {
                    if (avf.AsElementId() != pc)
                    {
                        Transaction t = null;
                        if (v.Document.IsModifiable == false)
                        {
                            t = new Transaction(v.Document, "Set AVF view style");
                            t.Start();
                        }
                        bool success = avf.Set(pc);
                        if (t != null)
                        {
                            t.Commit();
                        }
                    }
                }
            }
        }
예제 #10
0
 public Border(
     Document context,
     float width,
     StyleEnum style,
     LineDash pattern
     ) : this(context)
 {
     Width   = width;
     Style   = style;
     Pattern = pattern;
 }
        private void UpdateSettingsField()
        {
            _settingsObjectField.value = ModelColourEditorSettings.Instance;

            StyleEnum <DisplayStyle> empty = new StyleEnum <DisplayStyle>();

            _settingsObjectField.style.display = !ModelColourEditorSettings.HasAsset ? DisplayStyle.None : empty;
            _button.style.display = ModelColourEditorSettings.HasAsset ? DisplayStyle.None : empty;

            _hasMultipleEditors       = AssetDatabase.FindAssets("t:ModelColourEditorSettings").Length > 1;
            _warningBox.style.display = _hasMultipleEditors ? empty : DisplayStyle.None;
        }
        private void SetPropertyValue(object newValue)
        {
            object val  = StyleDebug.GetComputedStyleValue(m_SelectedElement.computedStyle, m_PropertyInfo.id);
            Type   type = m_PropertyInfo.type;

            if (newValue == null)
            {
                if (type == typeof(StyleBackground))
                {
                    val = new StyleBackground();
                }

                if (type == typeof(StyleFont))
                {
                    val = new StyleFont();
                }
            }
            else if (type == newValue.GetType())
            {
                val = newValue;
            }
            else
            {
                if (type == typeof(StyleBackground))
                {
                    val = new StyleBackground(newValue as Texture2D);
                }
                else if (type == typeof(StyleEnum <Overflow>) && newValue is OverflowInternal)
                {
                    OverflowInternal newV = (OverflowInternal)newValue;
                    Overflow         v    = newV == OverflowInternal.Hidden ? Overflow.Hidden : Overflow.Visible;
                    val = new StyleEnum <Overflow>(v);
                }
                else
                {
                    var valueInfo = type.GetProperty("value");
                    try
                    {
                        valueInfo.SetValue(val, newValue, null);
                    }
                    catch (Exception)
                    {
                        Debug.LogError($"Invalid value for property '{m_PropertyName}'");
                        return;
                    }
                }
            }

            StyleDebug.SetInlineStyleValue(m_SelectedElement.style, m_PropertyInfo.id, val);
            SetSpecificity(StyleDebug.InlineSpecificity);
        }
예제 #13
0
        int CountStyles(StyleEnum <FontStyle> style)
        {
            var root        = m_Window.rootVisualElement;
            int styledWords = 0;

            for (int i = 0; i < root.childCount; i++)
            {
                if (root.ElementAt(i).style.unityFontStyleAndWeight == style)
                {
                    styledWords++;
                }
            }
            return(styledWords);
        }
예제 #14
0
 public Transition(
     Document context,
     StyleEnum style
     ) : this(
         context,
         style,
         DefaultDuration,
         DefaultOrientation,
         DefaultPageDirection,
         DefaultDirection,
         DefaultScale
         )
 {
 }
예제 #15
0
        /// <summary>
        /// This is the FillPatern mapping, it is used to convert the binary fillpatern to the open xml string
        /// </summary>
        /// <param name="fp"></param>
        /// <returns></returns>
        public static string getStringFromFillPatern(StyleEnum fp)
        {
            switch (fp)
            {
            case StyleEnum.FLSNULL: return("none");

            case StyleEnum.FLSSOLID: return("solid");

            case StyleEnum.FLSMEDGRAY: return("mediumGray");

            case StyleEnum.FLSDKGRAY: return("darkGray");

            case StyleEnum.FLSLTGRAY: return("lightGray");

            case StyleEnum.FLSDKHOR: return("darkHorizontal");

            case StyleEnum.FLSDKVER: return("darkVertical");

            case StyleEnum.FLSDKDOWN: return("darkDown");

            case StyleEnum.FLSDKUP: return("darkUp");

            case StyleEnum.FLSDKGRID: return("darkGrid");

            case StyleEnum.FLSDKTRELLIS: return("darkTrellis");

            case StyleEnum.FLSLTHOR: return("lightHorizontal");

            case StyleEnum.FLSLTVER: return("lightVertical");

            case StyleEnum.FLSLTDOWN: return("lightDown");

            case StyleEnum.FLSLTUP: return("lightUp");

            case StyleEnum.FLSLTGRID: return("lightGrid");

            case StyleEnum.FLSLTTRELLIS: return("lightTrellis");

            case StyleEnum.FLSGRAY125: return("gray125");

            case StyleEnum.FLSGRAY0625: return("gray0625");

            default: return("none");
            }
        }
예제 #16
0
        private static void RegisterDetails(StyleEnum style)
        {
            BLL.BDStyleBLL bll = new BLL.BDStyleBLL();

            NFMT.Common.ResultModel result = bll.Load(style);
            if (result.ResultStatus != 0)
                throw new Exception("加载类型明细失败");

            DetailCollection details = result.ReturnValue as DetailCollection;

            if (details == null)
                throw new Exception("加载类型明细失败");

            lock (detailDic)
            {
                if (!detailDic.ContainsKey(style))
                    detailDic.Add(style, details);
            }
        }
예제 #17
0
파일: BDStyleBLL.cs 프로젝트: weiliji/NFMT
        /// <summary>
        /// 获取BDStyleDetail集合,返回DetailCollection
        /// </summary>
        /// <param name="style">类型</param>
        /// <returns></returns>
        public ResultModel Load(StyleEnum style)
        {
            ResultModel result = new ResultModel();

            try
            {
                result = bDStyleDAL.Load(style);
            }
            catch (Exception ex)
            {
                result.Message = ex.Message;
            }
            finally
            {
                if (result.ResultStatus != 0)
                    log.ErrorFormat("加载类型失败,失败原因:{0}", result.Message);
                else if (log.IsInfoEnabled)
                    log.InfoFormat("加载基础类型,执行结果:{0}", result.Message);
            }
            return result;
        }
예제 #18
0
파일: Styling.cs 프로젝트: kpocza/docx2tex
        public string Enum2TextStart(StyleEnum styleEnum)
        {
            switch (styleEnum)
            {
            case StyleEnum.TextIt:
                return(Config.Instance.LaTeXTags.StylePair.Begin.TextIt);

            case StyleEnum.TextBf:
                return(Config.Instance.LaTeXTags.StylePair.Begin.TextBf);

            case StyleEnum.Underline:
                return(Config.Instance.LaTeXTags.StylePair.Begin.Underline);

            case StyleEnum.Sout:
                return(Config.Instance.LaTeXTags.StylePair.Begin.Sout);

            case StyleEnum.Xout:
                return(Config.Instance.LaTeXTags.StylePair.Begin.Xout);

            case StyleEnum.TextSc:
                return(Config.Instance.LaTeXTags.StylePair.Begin.TextSc);

            case StyleEnum.TextC:
                return(Config.Instance.LaTeXTags.StylePair.Begin.TextC);

            case StyleEnum.SuperScript:
                return(Config.Instance.LaTeXTags.StylePair.Begin.SuperScript);

            case StyleEnum.SubScript:
                return(Config.Instance.LaTeXTags.StylePair.Begin.SubScript);

            case StyleEnum.ParaFlushRight:
                return(Config.Instance.LaTeXTags.StylePair.Begin.ParaFlushRight);

            case StyleEnum.ParaCenter:
                return(Config.Instance.LaTeXTags.StylePair.Begin.ParaCenter);
            }
            return(string.Empty);
        }
예제 #19
0
        void UpdateOverlayUI()
        {
            if (m_InfoOverlay == null)
            {
                m_InfoOverlay = new CompareInfoOverlay();
            }

            var uiDisplayStyle = new StyleEnum <DisplayStyle>(m_ToolIsActive ? DisplayStyle.Flex : DisplayStyle.None);

            m_InfoOverlay.style.display = uiDisplayStyle;

            SimulationView.AddElementToLastHoveredWindow(m_InfoOverlay);

            var compareObjName = "...";
            var dataName       = "...";

            k_ConditionRatings.Clear();

            if (m_CompareDataModule != null)
            {
                m_CompareDataModule.GetConditionRatings(k_ConditionRatings);

                var proxyToCompare = m_CompareDataModule.ProxyToCompare;
                if (proxyToCompare != null)
                {
                    compareObjName = proxyToCompare.gameObject.name;
                }

                var comparisonData = m_CompareDataModule.GetComparisonData();
                if (comparisonData != null)
                {
                    dataName = $"Data #{comparisonData.DataID}";
                }
            }

            m_InfoOverlay.HeaderLabel.text = $"Comparing {compareObjName} to {dataName}";

            m_InfoOverlay.SetConditionRatings(k_ConditionRatings);
        }
예제 #20
0
        internal void BindData(CreateProxyFromData createData)
        {
            BindPotentialConditions(createData.PotentialConditions);
            GetDefaultName += createData.GenerateProxyName;
            NameChanged    += createData.SetProxyName;
            Create         += () =>
            {
                if (createData.CreatedGameObject != null && !createData.EditMode)
                {
                    Undo.RegisterCreatedObjectUndo(createData.CreatedGameObject, "Create Proxy");
                    EditorGUIUtility.PingObject(createData.CreatedGameObject);
                }

                createData.ConfirmCreate();
            };
            Cancel += createData.CancelCreate;
            var countFieldDisplayStyle = new StyleEnum <DisplayStyle>(createData.EditMode ? DisplayStyle.None : DisplayStyle.Flex);

            m_CountField.value = createData.MaxCount;
            m_CountField.parent.style.display = countFieldDisplayStyle; // Hide parent of the count field to hide the entire row including checkbox
            RefreshName();
        }
        void UpdateCreateUI()
        {
            if (m_CreateOverlay == null)
            {
                m_CreateOverlay = new CreateButtonsOverlay();
                m_CreateOverlay.CreateButton.clickable.clicked += OnCreateButtonClicked;
            }

            var uiDisplayStyle = new StyleEnum <DisplayStyle>(m_ToolIsActive ? DisplayStyle.Flex : DisplayStyle.None);

            m_CreateOverlay.style.display = uiDisplayStyle;

            var visible = false;

            if (m_InteractionModule != null)
            {
                // Set button visibility and text based on current selection
                var currentSelection = m_InteractionModule.CurrentSelection;
                var selectionCount   = currentSelection.Count;
                if (selectionCount > 0)
                {
                    visible = true;
                    m_CreateOverlay.CreateButton.text = selectionCount > 1 ? "Create Proxy Group" : "Create Proxy";
                }

                // Set button position
                SimulationView.AddElementToLastHoveredWindow(m_CreateOverlay);
                var clickPosition = m_InteractionModule.LastSimViewClickPosition;
                var view          = SimulationView.LastHoveredSimulationOrDeviceView;
                if (view != null && view.camera != null)
                {
                    var buttonPosition = view.camera.WorldToViewportPoint(clickPosition);
                    m_CreateOverlay.SetButtonsPosition(buttonPosition);
                }
            }

            m_CreateOverlay.SetButtonsVisible(visible);
        }
예제 #22
0
			public FontRegistryEntry(int HorizontalSize, int VerticalSize, int HorizontalResolution,
				int VerticalResolution, int ExtraAttributes, int Weight,
				FamilyEnum Family, StyleEnum StyleStyle, ushort StyleSub, LanguageEnum Language,
				ushort Region, ushort Country, String FileName,
				String Name, uint Expire, int ShadowOption)
			{
				this.ExtraAttributes = ExtraAttributes;
				this.ShadowOption = ShadowOption;
				this.FontStyle = new FontStyle()
				{
					Size = new HorizontalVerticalFloat() { Horizontal = HorizontalSize, Vertical = VerticalSize, },
					Resolution = new HorizontalVerticalFloat() { Horizontal = HorizontalResolution, Vertical = VerticalResolution, },
					Weight = Weight,
					Family = Family,
					StyleStyle = StyleStyle,
					StyleSub = StyleSub,
					Language = Language,
					Region = Region,
					Country = Country,
					FileName = FileName,
					Name = Name,
					Expire = Expire,
				};
			}
예제 #23
0
 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="fillpat">Fill Patern</param>
 /// <param name="icvFore">Foreground Color</param>
 /// <param name="icvBack">Background Color</param>
 public FillData(StyleEnum fillpat, int icvFore, int icvBack)
 {
     this.fillPatern = fillpat;
     this.icvFore    = icvFore;
     this.icvBack    = icvBack;
 }
        public static StyleInt ToStyleInt <T>(this T str) where T : struct, IConvertible
        {
            StyleEnum <T> newOne = str;

            return(new StyleInt(newOne.value.ToInt32(CultureInfo.CurrentCulture)));
        }
예제 #25
0
 public FramedPhoto(double width, double height, MaterialEnum material, StyleEnum style) : base(width, height)
 {
     _theMaterial = material;
     _theStyle    = style;
 }
예제 #26
0
        //public static Border Wrap(PdfDirectObject baseObject)
        //{
        //    return baseObject?.Wrapper as Border ?? new Border(baseObject);
        //}
        #endregion

        #region interface
        #region private

        /**
         * <summary>Gets the code corresponding to the given value.</summary>
         */
        private static PdfName ToCode(StyleEnum value)
        {
            return(StyleEnumCodes[value]);
        }
예제 #27
0
파일: Store.cs 프로젝트: kpocza/docx2tex
 public StyleRun(StyleEnum style, Styling stylingFn)
 {
     this.Style      = style;
     this._stylingFn = stylingFn;
 }
        private void SetPropertyValue(object newValue)
        {
            object val  = StyleDebug.GetComputedStyleActualValue(m_SelectedElement.computedStyle, m_PropertyInfo.id);
            Type   type = m_PropertyInfo.type;

            if (newValue == null)
            {
                if (type == typeof(StyleBackground))
                {
                    val = new StyleBackground();
                }

                if (type == typeof(StyleFont))
                {
                    val = new StyleFont();
                }
            }
            else if (type == newValue.GetType())
            {
                // For StyleLengthField
                val = newValue;
            }
            else
            {
                if (type == typeof(StyleBackground))
                {
                    val = new StyleBackground(newValue as Texture2D);
                }
                else if (type == typeof(StyleFontDefinition))
                {
                    val = new StyleFontDefinition(newValue);
                }
                else if (val is TextShadow textShadow)
                {
                    if (newValue is Color newColor)
                    {
                        textShadow.color = newColor;
                    }
                    if (newValue is Vector2 newOffset)
                    {
                        textShadow.offset = newOffset;
                    }
                    if (newValue is float newBlur)
                    {
                        textShadow.blurRadius = newBlur;
                    }

                    val = new StyleTextShadow(textShadow);
                }
                else if (type == typeof(StyleEnum <Overflow>) && newValue is OverflowInternal)
                {
                    OverflowInternal newV = (OverflowInternal)newValue;
                    Overflow         v    = newV == OverflowInternal.Hidden ? Overflow.Hidden : Overflow.Visible;
                    val = new StyleEnum <Overflow>(v);
                }
                else
                {
                    var underlyingType = type.GetProperty("value").PropertyType;
                    var ctor           = type.GetConstructor(new[] { underlyingType });
                    try
                    {
                        val = ctor.Invoke(new[] { newValue });
                    }
                    catch (Exception)
                    {
                        Debug.LogError($"Invalid value for property '{m_PropertyName}'");
                        return;
                    }
                }
            }

            StyleDebug.SetInlineStyleValue(m_SelectedElement.style, m_PropertyInfo.id, val);
            SetSpecificity(StyleDebug.InlineSpecificity);
        }
예제 #29
0
파일: BDStyleDAL.cs 프로젝트: weiliji/NFMT
        public ResultModel Load(StyleEnum style)
        {
            ResultModel result = new ResultModel();

            SqlDataReader dr = null;

            try
            {
                string sql = string.Format("select * from dbo.BDStyleDetail where BDStyleId = {0}", (int)style);

                dr = SqlHelper.ExecuteReader(this.ConnectString, CommandType.Text, sql, null);

                DetailCollection detailCollection = new DetailCollection();

                while (dr.Read())
                {
                    Model.BDStyleDetail detail = new BDStyleDetail();

                    if (dr["StyleDetailId"] != DBNull.Value)
                    {
                        detail.StyleDetailId = Convert.ToInt32(dr["StyleDetailId"]);
                    }

                    if (dr["BDStyleId"] != DBNull.Value)
                    {
                        detail.BDStyleId = Convert.ToInt32(dr["BDStyleId"]);
                    }

                    if (dr["DetailCode"] != DBNull.Value)
                    {
                        detail.DetailCode = dr["DetailCode"].ToString();
                    }

                    if (dr["DetailName"] != DBNull.Value)
                    {
                        detail.DetailName = dr["DetailName"].ToString();
                    }

                    if (dr["DetailStatus"] != DBNull.Value)
                    {
                        detail.DetailStatus = (NFMT.Common.StatusEnum)Convert.ToInt32(dr["DetailStatus"]);
                    }

                    if (dr["CreatorId"] != DBNull.Value)
                    {
                        detail.CreatorId = Convert.ToInt32(dr["CreatorId"]);
                    }

                    if (dr["LastModifyId"] != DBNull.Value)
                    {
                        detail.LastModifyId = Convert.ToInt32(dr["LastModifyId"]);
                    }

                    if (dr["CreateTime"] != DBNull.Value)
                    {
                        detail.CreateTime = Convert.ToDateTime(dr["CreateTime"]);
                    }

                    if (dr["LastModifyTime"] != DBNull.Value)
                    {
                        detail.LastModifyTime = Convert.ToDateTime(dr["LastModifyTime"]);
                    }

                    detailCollection.Add(detail);
                }

                result.AffectCount = detailCollection.Count;
                result.Message = "获取列表成功";
                result.ResultStatus = 0;
                result.ReturnValue = detailCollection;
            }
            catch (Exception ex)
            {
                result.Message = ex.Message;
            }
            finally
            {
                if (dr != null)
                    dr.Dispose();
            }

            return result;
        }
예제 #30
0
        /// <summary>
        /// Method to maintain the styles and to create singleton instances
        /// </summary>
        /// <param name="value">Enum value to maintain</param>
        /// <returns>The style according to the passed enum value</returns>
        private static Style GetStyle(StyleEnum value)
        {
            Style s = null;

            switch (value)
            {
            case StyleEnum.bold:
                if (bold == null)
                {
                    bold = new Style();
                    bold.CurrentFont.Bold = true;
                }
                s = bold;
                break;

            case StyleEnum.italic:
                if (italic == null)
                {
                    italic = new Style();
                    italic.CurrentFont.Italic = true;
                }
                s = italic;
                break;

            case StyleEnum.boldItalic:
                if (boldItalic == null)
                {
                    boldItalic = new Style();
                    boldItalic.CurrentFont.Italic = true;
                    boldItalic.CurrentFont.Bold   = true;
                }
                s = boldItalic;
                break;

            case StyleEnum.underline:
                if (underline == null)
                {
                    underline = new Style();
                    underline.CurrentFont.Underline = true;
                }
                s = underline;
                break;

            case StyleEnum.doubleUnderline:
                if (doubleUnderline == null)
                {
                    doubleUnderline = new Style();
                    doubleUnderline.CurrentFont.DoubleUnderline = true;
                }
                s = doubleUnderline;
                break;

            case StyleEnum.strike:
                if (strike == null)
                {
                    strike = new Style();
                    strike.CurrentFont.Strike = true;
                }
                s = strike;
                break;

            case StyleEnum.dateFormat:
                if (dateFormat == null)
                {
                    dateFormat = new Style();
                    dateFormat.CurrentNumberFormat.Number = NumberFormat.FormatNumber.format_14;
                }
                s = dateFormat;
                break;

            case StyleEnum.roundFormat:
                if (roundFormat == null)
                {
                    roundFormat = new Style();
                    roundFormat.CurrentNumberFormat.Number = NumberFormat.FormatNumber.format_1;
                }
                s = roundFormat;
                break;

            case StyleEnum.borderFrame:
                if (borderFrame == null)
                {
                    borderFrame = new Style();
                    borderFrame.CurrentBorder.TopStyle    = Border.StyleValue.thin;
                    borderFrame.CurrentBorder.BottomStyle = Border.StyleValue.thin;
                    borderFrame.CurrentBorder.LeftStyle   = Border.StyleValue.thin;
                    borderFrame.CurrentBorder.RightStyle  = Border.StyleValue.thin;
                }
                s = borderFrame;
                break;

            case StyleEnum.borderFrameHeader:
                if (borderFrameHeader == null)
                {
                    borderFrameHeader = new Style();
                    borderFrameHeader.CurrentBorder.TopStyle    = Border.StyleValue.thin;
                    borderFrameHeader.CurrentBorder.BottomStyle = Border.StyleValue.medium;
                    borderFrameHeader.CurrentBorder.LeftStyle   = Border.StyleValue.thin;
                    borderFrameHeader.CurrentBorder.RightStyle  = Border.StyleValue.thin;
                    borderFrameHeader.CurrentFont.Bold          = true;
                }
                s = borderFrameHeader;
                break;

            case StyleEnum.dottedFill_0_125:
                if (dottedFill_0_125 == null)
                {
                    dottedFill_0_125 = new Style();
                    dottedFill_0_125.CurrentFill.PatternFill = Fill.PatternValue.gray125;
                }
                s = dottedFill_0_125;
                break;

            case StyleEnum.mergeCellStyle:
                if (mergeCellStyle == null)
                {
                    mergeCellStyle = new Style();
                    mergeCellStyle.CurrentCellXf.ForceApplyAlignment = true;
                }
                s = mergeCellStyle;
                break;

            default:
                break;
            }
            return(s.CopyStyle()); // Copy makes basic styles immutable
        }
예제 #31
0
파일: Store.cs 프로젝트: kpocza/docx2tex
 public StyleEndRun(StyleEnum style, Styling stylingFn)
     : base(style, stylingFn)
 {
 }
예제 #32
0
 /**
  * <summary>Creates a non-reusable instance.</summary>
  */
 public Border(double width, StyleEnum style) : this(null, width, style)
 {
 }
예제 #33
0
파일: Store.cs 프로젝트: kpocza/docx2tex
 public void AddStartStyle(StyleEnum styleEnum)
 {
     _runs.Add(new StyleStartRun(styleEnum, _stylingFn));
 }
예제 #34
0
        private void SetPropertyValue(object newValue)
        {
            object val  = StyleDebug.GetComputedStyleValue(m_SelectedElement.computedStyle, m_PropertyInfo.id);
            Type   type = m_PropertyInfo.type;

            if (newValue == null)
            {
                if (type == typeof(StyleBackground))
                {
                    val = new StyleBackground();
                }

                if (type == typeof(StyleFont))
                {
                    val = new StyleFont();
                }

                if (type == typeof(StyleFontDefinition))
                {
                    val = new StyleFontDefinition();
                }
            }
            else if (type == newValue.GetType())
            {
                // For StyleLengthField
                val = newValue;
            }
            else
            {
                if (type == typeof(StyleBackground))
                {
                    val = new StyleBackground(newValue as Texture2D);
                }
                else if (type == typeof(StyleFontDefinition))
                {
                    val = new StyleFontDefinition(newValue);
                }
                else if (val is TextShadow textShadow)
                {
                    if (newValue is Color newColor)
                    {
                        textShadow.color = newColor;
                    }
                    if (newValue is Vector2 newOffset)
                    {
                        textShadow.offset = newOffset;
                    }
                    if (newValue is float newBlur)
                    {
                        textShadow.blurRadius = newBlur;
                    }

                    val = new StyleTextShadow(textShadow);
                }
                else if (type == typeof(StyleEnum <Overflow>) && newValue is OverflowInternal)
                {
                    OverflowInternal newV = (OverflowInternal)newValue;
                    Overflow         v    = newV == OverflowInternal.Hidden ? Overflow.Hidden : Overflow.Visible;
                    val = new StyleEnum <Overflow>(v);
                }
                else if (val is Scale scale && newValue is Vector3 newScale)
                {
                    val = new StyleScale(new Scale(newScale));
                }
예제 #35
0
파일: Store.cs 프로젝트: kpocza/docx2tex
 public void AddEndStyle(StyleEnum styleEnum)
 {
     _runs.Add(new StyleEndRun(styleEnum, _stylingFn));
 }