프로젝트

일반

사용자정보

개정판 661b7416

ID661b7416598de29c8ba957a702c8b0b2135eda3f
상위 8c66babd
하위 5529d2a2

백흠경이(가) 5년 이상 전에 추가함

issue #999: Add FromString to all of controls

Change-Id: I64093e34a5f9e8d367cbed769ff4db8d7472cb7a

차이점 보기:

MarkupToPDF/Controls/Text/TextControl.cs
1193 1193
                return "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1194 1194
            }
1195 1195
        }
1196

  
1197
        /// <summary>
1198
        /// create a textcontrol from given string
1199
        /// </summary>
1200
        /// <param name="str"></param>
1201
        /// <returns></returns>
1202
        public static TextControl FromString(string str, SolidColorBrush brush, string sProjectNo)
1203
        {
1204
            using (S_TextControl s = JsonSerializerHelper.JsonDeserialize<S_TextControl>(str))
1205
            {
1206
                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1207
                TextControl instance = new TextControl()
1208
                {
1209
                    Text = s.Text,
1210
                    StartPoint = s.StartPoint,
1211
                    EndPoint = s.EndPoint,
1212
                    CanvasX = s.StartPoint.X,
1213
                    CanvasY = s.StartPoint.Y,
1214
                    BoxWidth = s.BoxW,
1215
                    BoxHeight = s.BoxH,
1216
                    ControlType_No = s.paintMethod,
1217
                    LineSize = new Thickness(Convert.ToDouble(data2.First())),
1218
                    TextSize = Convert.ToDouble(data2[1]),
1219
                    FontColor = brush,
1220
                    FontSize = 10,
1221
                    UserID = s.UserID,
1222
                    IsHighLight = s.isHighLight,
1223
                    Angle = s.Angle,
1224
                    PointSet = s.PointSet,
1225
                    Opacity = s.Opac,
1226
                    TextFamily = new FontFamily(s.fontConfig[0]),
1227
                    //인구 추가(2018.04.17)
1228
                    TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]),
1229
                    TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]),
1230
                };
1231

  
1232
                if (s.fontConfig.Count() == 4)
1233
                {
1234
                    instance.UnderLine = TextDecorations.Underline;
1235
                }
1236

  
1237
                return instance;
1238
            }
1239
        }
1196 1240
    }
1197 1241
}

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)