123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743 |
- using ComPDFKitViewer;
- using ComPDFKitViewer.AnnotEvent;
- using PDF_Office.CustomControl.CompositeControl;
- using PDF_Office.Model;
- using PDF_Office.Model.AnnotPanel;
- using PDF_Office.Model.PropertyPanel.AnnotPanel;
- using PDF_Office.ViewModels.Tools;
- using PDF_Office.ViewModels.Tools.AnnotManager;
- using PDFSettings;
- using Prism.Commands;
- using Prism.Mvvm;
- using Prism.Regions;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Media;
- namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
- {
- public class FreetextAnnotPropertyViewModel : BindableBase, INavigationAware
- {
- #region 文案
- private string T_title;
- public string T_Title
- {
- get { return T_title; }
- set
- {
- SetProperty(ref T_title, value);
- }
- }
- private string T_font;
- public string T_Font
- {
- get { return T_font; }
- set
- {
- SetProperty(ref T_font, value);
- }
- }
-
- private string T_fill;
- public string T_Fill
- {
- get { return T_fill; }
- set
- {
- SetProperty(ref T_fill, value);
- }
- }
- private void InitString()
- {
- T_Title = App.MainPageLoader.GetString("FreeText_Title");
- T_Font = App.MainPageLoader.GetString("FreeText_Font");
- T_Fill = App.MainPageLoader.GetString("FreeText_Fill");
- }
- #endregion
- private FontBoardVm _fontVm = new FontBoardVm(true);
- public FontBoardVm FontVm
- {
- get { return _fontVm; }
- set { SetProperty(ref _fontVm, value); }
- }
- private AnnotCommon _basicVm = new AnnotCommon();
- public AnnotCommon BasicVm
- {
- get { return _basicVm; }
- set => SetProperty(ref _basicVm, value);
- }
- private bool _isFillFreeText = false;
- public bool IsFillFreeTextAnnot
- {
- get { return _isFillFreeText; }
- set => SetProperty(ref _isFillFreeText, value);
- }
- private bool _isCheckedTime = false;
- public bool IsCheckedTime
- {
- get { return _isCheckedTime; }
- set => SetProperty(ref _isCheckedTime, value);
- }
- private ComboDataItem _currrentDateFormat = new ComboDataItem("M/d", "format");
- public ComboDataItem CurrrentDateFormat
- {
- get { return _currrentDateFormat; }
- set => SetProperty(ref _currrentDateFormat, value);
- }
- public List<ComboDataItem> DateFormatItems { get; private set; }
- public AnnotAttribEvent AnnotEvent { get; set; }
- private FreeTextAnnotArgs Annot;
- private AnnotTransfer PropertyPanel;
- public DelegateCommand SelectedPresetFontCommand { get; set; }
- public DelegateCommand FontFamilyChangedCommand { get; set; }
- public DelegateCommand FontStyleWeightChangedCommand { get; set; }
- public DelegateCommand<object> SelectedFillOpacityCommand { get; set; }
-
- public DelegateCommand<object> SelectedColorCommand { get; set; }
- public DelegateCommand<object> SelectedFillColorCommand { get; set; }
-
- public DelegateCommand FontSizeChangedCommand { get; set; }
- public DelegateCommand<object> TextAlignCheckedCommand { get; set; }
- public DelegateCommand<object> LineModeCheckedCommand { get; set; }
- public DelegateCommand<object> SelectedOpacityValueCommand { get; set; }
- public DelegateCommand CustomFontStyleCommand { get; set; }
- public DelegateCommand ReDefineFontStyleCommand { get; set; }
- public DelegateCommand RestoreDefaultStyleCommand { get; set; }
- public DelegateCommand DateFormatChangedCommand { get; set; }
- public DelegateCommand ShowTimeCheckedChnagedCommand { get; set; }
- public event EventHandler<object> LoadPropertyHandler;
- public FreetextAnnotPropertyViewModel()
- {
- InitString();
- //文本设置
- //预设文本样式
- SelectedPresetFontCommand = new DelegateCommand(SelectedPresetFont);
- //文本字重、字体
- FontStyleWeightChangedCommand = new DelegateCommand(FontStyleWeightChanged);
- //字体
- FontFamilyChangedCommand = new DelegateCommand(FontFamilyChanged);
- //自定义
- CustomFontStyleCommand = new DelegateCommand(CustomFontStyle);
- //重新定义
- ReDefineFontStyleCommand = new DelegateCommand(ReDefineFontStyle);
- //恢复默认
- RestoreDefaultStyleCommand = new DelegateCommand(RestoreDefaultStyle);
- //颜色
- SelectedColorCommand = new DelegateCommand<object>(SelectedColor_Command);
- //填充颜色
- SelectedFillColorCommand = new DelegateCommand<object>(SelectedFillColorChange);
- //填充颜色不透明度
- SelectedFillOpacityCommand = new DelegateCommand<object>(SelectedFillOpacity);
- //大小
- FontSizeChangedCommand = new DelegateCommand(FontSizeChanged);
- //内容对齐
- TextAlignCheckedCommand = new DelegateCommand<object>(TextAlignChecked);
- //填写与签名:日期
- DateFormatChangedCommand = new DelegateCommand(DateFormatChanged);
- ShowTimeCheckedChnagedCommand = new DelegateCommand(ShowTimeCheckedChnaged);
- //MVP不上
- LineModeCheckedCommand = new DelegateCommand<object>(LineMode_Checked);
- SelectedOpacityValueCommand = new DelegateCommand<object>(SelectedOpacityValue);
- InitVariable();
- }
-
- private void InitVariable()
- {
- DateFormatItems = new List<ComboDataItem>();
- DateFormatItems = TextFont.GetDateFormats();
- UpdateDateFormatLists();
- InitFillColorItems();
- }
- private void InitFillColorItems()
- {
- BasicVm.FillColorItems = AnnotColorList.GetColorList(ColorSelectorType.Fill);
- }
- private void UpdateDateFormatLists()
- {
- string strTime = " HH:mm:ss";
- foreach (var item in DateFormatItems)
- {
- if (IsCheckedTime)
- strTime = item.ValueStr + " HH:mm:ss";
- else
- strTime = item.ValueStr;
- string stadate = System.DateTime.Now.ToString(strTime);
- item.SetContent(stadate);
- if (CurrrentDateFormat != null && item.ValueStr == CurrrentDateFormat.ValueStr)
- CurrrentDateFormat.SetContent(stadate);
- }
- CurrrentDateFormat = new ComboDataItem(CurrrentDateFormat.ValueStr, CurrrentDateFormat.Content);
- }
-
- private void TextAlignChecked(object obj)
- {
- if ((string)obj != null)
- {
- switch ((string)obj)
- {
- case "AlignLeft":
- GetAnnotAlign(TextAlignment.Left);
- PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.TextAlign, TextAlignment.Left);
- break;
- case "AlignCenter":
- GetAnnotAlign(TextAlignment.Center);
- PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.TextAlign, TextAlignment.Center);
- break;
- case "AlignRight":
- GetAnnotAlign(TextAlignment.Right);
- PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.TextAlign, TextAlignment.Right);
- break;
- case "Justify":
- GetAnnotAlign(TextAlignment.Justify);
- PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.TextAlign, TextAlignment.Justify);
- break;
- }
-
- }
- }
- private void LineMode_Checked(object obj)
- {
- if(obj != null)
- {
- var tag = ((string)obj);
- switch (tag)
- {
- case "Dashed":
- AnnotEvent?.UpdateAttrib(AnnotAttrib.LineStyle, DashStyles.Dash);
- break;
- case "Solid":
- AnnotEvent?.UpdateAttrib(AnnotAttrib.LineStyle, DashStyles.Solid);
- break;
- }
- AnnotEvent?.UpdateAnnot();
- }
- }
-
- //从预设样式设置文本
- private void SelectedPresetFont()
- {
- if (FontVm.CurrentPresetFont != null)
- {
- var itemComboxItem = FontVm.CurrentPresetFont;
- var item = FontVm.PresetFontList.FirstOrDefault(temp => temp.mTag == itemComboxItem.ValueStr);
- if (item != null)
- {
- FontVm.GetCurrentFontSize(item.mFontSize);
- if (item.mFontFamily != null)
- FontVm.GetCurrentFontFamily(item.mFontFamily.ToString(), item.mFontFamily.ToString());
- FontVm.GetFontWeights_Style(item.mFontStyle, item.mFontWeight);
- Dictionary<AnnotAttrib, object> AnnotAttribDir = new Dictionary<AnnotAttrib, object>();
- AnnotAttribDir.Add(AnnotAttrib.FontSize, item.mFontSize);
- AnnotAttribDir.Add(AnnotAttrib.FontFamily, item.mFontFamily);
- AnnotAttribDir.Add(AnnotAttrib.FontStyle, item.mFontStyle);
- AnnotAttribDir.Add(AnnotAttrib.FontWeight, item.mFontWeight);
- PropertyPanel.UpdateAnnotAllAttribs(AnnotAttribDir);
- }
- }
- }
- //设置文本字重、样式
- private void FontStyleWeightChanged()
- {
- if(FontVm.CurrrentFontWeightStyle != null)
- {
- FontVm.UpdateFontWeight_Style();
- Dictionary<AnnotAttrib, object> AnnotAttribDir = new Dictionary<AnnotAttrib, object>();
- AnnotAttribDir.Add(AnnotAttrib.FontStyle, FontVm.FontStyleItem);
- AnnotAttribDir.Add(AnnotAttrib.FontWeight, FontVm.FontWeightItem);
- PropertyPanel.UpdateAnnotAllAttribs(AnnotAttribDir);
- }
- }
-
- private void SelectedFillOpacity(object obj)
- {
- if (obj != null)
- {
- BasicVm.FillOpacity = (double)obj;
- BasicVm.FillColor.Opacity = BasicVm.FillOpacity;
- PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Transparency, BasicVm.FillOpacity);
- }
- }
- private void SelectedOpacityValue(object obj)
- {
- if (obj != null && obj is double)
- {
- BasicVm.FillOpacity = (double)obj;
- BasicVm.FillColor.Opacity = BasicVm.FillOpacity;
- PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Transparency, BasicVm.FillOpacity);
- }
- }
-
- //设置字体大小
- private void FontSizeChanged()
- {
- if (FontVm.CurrentFontSize != null)
- {
- PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.FontSize, FontVm.CurrentFontSize.Value);
- if (BasicVm.IsMultiSelected == false)
- PropertyPanel.InvokeToMyTools(BasicVm.AnnotType, Annot);
- }
- }
- //设置字体样式
- private void FontFamilyChanged()
- {
- if (string.IsNullOrEmpty(FontVm.CurrentFontFamily.ValueStr) == false)
- {
- PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.FontFamily, new FontFamily(FontVm.CurrentFontFamily.ValueStr));
- }
- }
- private void SelectedFillColorChange(object obj)
- {
- if (obj != null)
- {
- var colorValue = (Color)obj;
- if (colorValue != null)
- {
- BasicVm.FillColor = new SolidColorBrush(colorValue);
- PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.FillColor, colorValue);
- // BasicVm.FillColor.Opacity = BasicVmFillOpacity;
- }
- }
- }
- private void SelectedColor_Command(object obj)
- {
- if (obj != null)
- {
- var colorValue = (Color)obj;
- if (colorValue != null)
- {
- FontVm.FontColor = new SolidColorBrush(colorValue);
- PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.FontColor, colorValue);
- }
- }
- }
- private void CustomFontStyle()
- {
- if (FontVm.CurrentPresetFont != null)
- {
- ContextMenu menu;
- if (FontVm.CurrentPresetFont.ValueStr == "custom")
- {
- menu = SelectAnnotContextMenu(false);
- }
- else
- {
- menu = SelectAnnotContextMenu(true);
- }
- if (menu != null)
- {
- menu.IsOpen = true;
- }
- }
- }
- private ContextMenu SelectAnnotContextMenu(bool isEnable)
- {
- var popMenu = App.Current.FindResource("CustomFontStyleFlyoutMenu") as ContextMenu;
- if (popMenu != null && popMenu.Items.Count == 2)
- {
- //用所选部分重新定义
- MenuItem menuItem = popMenu.Items[0] as MenuItem;
- menuItem.IsEnabled = isEnable;
- menuItem.Command = ReDefineFontStyleCommand;
- //恢复默认预设样式
- menuItem = popMenu.Items[1] as MenuItem;
- menuItem.IsEnabled = isEnable;
- menuItem.Command = RestoreDefaultStyleCommand;
- }
- return popMenu;
- }
- public List<PresetFontItem> FontStyleList = new List<PresetFontItem>();
- private void ReDefineFontStyle()
- {
-
- var item = FontVm.PresetFontList.FirstOrDefault(temp => temp.mTag == FontVm.CurrentPresetFont.ValueStr);
- if (item == null) return;
- item.mFontFamily = new FontFamily(FontVm.CurrentFontFamily.ValueStr);
- if (FontVm.CurrrentFontWeightStyle.ValueStr == "Bold")
- {
- item.mFontStyle = FontStyles.Normal;
- item.mFontWeight = FontWeights.Bold;
- }
- else if (FontVm.CurrrentFontWeightStyle.ValueStr == "Regular")
- {
- item.mFontStyle = FontStyles.Normal;
- item.mFontWeight = FontWeights.Normal;
- }
- else
- {
- item.mFontStyle = FontStyles.Italic;
- item.mFontWeight = FontWeights.Bold;
- }
- item.mFontSize = (int)FontVm.CurrentFontSize.Value;
- }
- private void RestoreDefaultStyle()
- {
- var defaultlists = TextFont.GetPresetFontStyle();
- if(FontVm.CurrentPresetFont.ValueStr != "custom")
- {
- var defaulItem = defaultlists.FirstOrDefault(temp => temp.mTag == FontVm.CurrentPresetFont.ValueStr);
- if (defaulItem != null)
- {
- var currentItem = FontVm.PresetFontList.FirstOrDefault(temp => temp.mTag == FontVm.CurrentPresetFont.ValueStr);
- if (currentItem != null)
- {
- currentItem.mTagContent = defaulItem.mTagContent;
- currentItem.mFontStyle = defaulItem.mFontStyle;
- currentItem.mFontWeight = defaulItem.mFontWeight;
- currentItem.mFontFamily = defaulItem.mFontFamily;
- currentItem.mFontSize = defaulItem.mFontSize;
- FontVm.GetCurrentFontFamily(currentItem.mFontFamily.ToString(), currentItem.mFontFamily.ToString());
- FontVm.GetCurrentFontSize(currentItem.mFontSize);
- FontVm.GetFontWeights_Style(currentItem.mFontStyle, currentItem.mFontWeight);
- }
- }
- }
-
- }
- private void DateFormatChanged()
- {
- if(CurrrentDateFormat != null)
- {
- if (IsCheckedTime)
- UpdateDateFormatLists();
- PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.NoteText, CurrrentDateFormat.Content);
- }
- }
- private void ShowTimeCheckedChnaged()
- {
- if (CurrrentDateFormat != null)
- {
- UpdateDateFormatLists();
- PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.NoteText, CurrrentDateFormat.Content);
- }
- }
- public bool IsNavigationTarget(NavigationContext navigationContext)
- {
- return true;
- }
- public void OnNavigatedFrom(NavigationContext navigationContext)
- {
- BasicVm.IsMultiSelected = false;
- // IsCheckedTime = false;
- }
- public void OnNavigatedTo(NavigationContext navigationContext)
- {
- navigationContext.Parameters.TryGetValue<AnnotTransfer>(ParameterNames.PropertyPanelContentViewModel, out PropertyPanel);
- if (PropertyPanel != null)
- {
-
- AnnotEvent = PropertyPanel.AnnotEvent;
- Annot = PropertyPanel.annot as FreeTextAnnotArgs;
- LoadPropertyHandler?.Invoke(this, Annot);
- BasicVm.AnnotTypeTitle = "文字";
- BasicVm.IsMultiSelected = PropertyPanel.IsMultiSelected;
- IsFillFreeTextAnnot = PropertyPanel.IsTextFill;
- if (BasicVm.IsMultiSelected)
- {
- IsAttributeEquals();
- BasicVm.IsSolidLine = BasicVm.IsDashLine = false;
- }
- else
- {
- GetAnnotProperty();
- }
- IsFillFreeTextAnnot = PropertyPanel.IsTextFill;
- }
- }
- /// <summary>
- /// 多选的注释
- /// </summary>
- private List<FreeTextAnnotArgs> ConvertLists()
- {
- List<FreeTextAnnotArgs> FreeTextLists = new List<FreeTextAnnotArgs>();
- foreach (var item in PropertyPanel.annotlists)
- {
- var itemFreeText = item as FreeTextAnnotArgs;
- if (itemFreeText != null)
- {
- FreeTextLists.Add(itemFreeText);
- }
- }
- if (FreeTextLists.Count != PropertyPanel.annotlists.Count)
- return null;
- else
- return FreeTextLists;
- }
- private void IsAttributeEquals()
- {
- var list = ConvertLists();
- if (list != null)
- {
- var temp = list[0];
- Dictionary<string, bool> isNoEqualsDir = new Dictionary<string, bool>();
- isNoEqualsDir.Add("FontFamily", false);
- isNoEqualsDir.Add("FontSize", false);
- isNoEqualsDir.Add("FontStyleFontWeight", false);
- isNoEqualsDir.Add("FontColor", false);
- isNoEqualsDir.Add("FillColor", false);
- isNoEqualsDir.Add("TextAglin", false);
- foreach (var item in list)
- {
- if (item == list[0])
- continue;
- if (temp.Align != item.Align)
- {
- isNoEqualsDir["TextAglin"] = true;
- FontVm.StrTextAlign = "None";
- }
- if (temp.FontFamily != item.FontFamily)
- {
- isNoEqualsDir["FontFamily"] = true;
- FontVm.CurrentFontFamily = null;
- }
- if (temp.FontSize != item.FontSize)
- {
- isNoEqualsDir["FontSize"] = true;
- FontVm.CurrentFontSize = null;
- }
- if (temp.FontStyle != item.FontStyle || temp.FontWeight != item.FontWeight)
- {
- isNoEqualsDir["FontStyleFontWeight"] = true;
- FontVm.CurrrentFontWeightStyle = null;
- }
- if (isNoEqualsDir["FontFamily"] == true || isNoEqualsDir["FontSize"] == true || isNoEqualsDir["FontStyleFontWeight"] == true)
- {
- FontVm.CurrentPresetFont = null;
- }
- if (isNoEqualsDir["FontColor"] == false)
- {
- if (temp.FontColor.A != item.FontColor.A || temp.FontColor.R != item.FontColor.R || temp.FontColor.G != item.FontColor.G || temp.FontColor.B != item.FontColor.B)
- {
- FontVm.FontColor = new SolidColorBrush(Color.FromArgb(0x01, 0xff, 0xff, 0xff));
- isNoEqualsDir["FontColor"] = true;
- }
- }
- if (isNoEqualsDir["FillColor"] == false)
- {
- if (temp.BgColor.A != item.BgColor.A || temp.BgColor.R != item.BgColor.R || temp.BgColor.G != item.BgColor.G || temp.BgColor.B != item.BgColor.B)
- {
- BasicVm.FillColor = new SolidColorBrush(Color.FromArgb(0x01, 0xff, 0xff, 0xff));
- isNoEqualsDir["FillColor"] = true;
- }
- }
- }
- ////以下是多选注释的属性相等时
- if (isNoEqualsDir["TextAglin"] == false)
- {
- GetAnnotAlign(temp.Align);
- }
- if (isNoEqualsDir["FontFamily"] == false)
- {
- FontVm.GetCurrentFontFamily(temp.FontFamily.ToString(), temp.FontFamily.ToString());
- }
- if (isNoEqualsDir["FontSize"] == false)
- {
- FontVm.GetCurrentFontSize((int)temp.FontSize);
- }
- if (isNoEqualsDir["FontStyleFontWeight"] == false)
- {
- FontVm.GetFontWeights_Style(temp.FontStyle, temp.FontWeight);
- }
-
- if (isNoEqualsDir["FontColor"] == false)
- {
- FontVm.FontColor = new SolidColorBrush(temp.FontColor);
- }
- if (isNoEqualsDir["FillColor"] == false)
- {
- FontVm.FontColor = new SolidColorBrush(temp.BgColor);
- }
- }
- }
- private void GetAnnotProperty()
- {
- BasicVm.FillColor = new SolidColorBrush(Annot.BgColor);
- BasicVm.FillOpacity = Annot.Transparency;
- FontVm.FontColor = new SolidColorBrush(Annot.FontColor);
- FontVm.GetCurrentFontSize((int)Annot.FontSize);
- FontVm.GetCurrentFontFamily(Annot.FontFamily.ToString(), Annot.FontFamily.ToString());
- FontVm.GetFontWeights_Style(Annot.FontStyle, Annot.FontWeight);
- GetTimeFormat();
- GetAnnotAlign(Annot.Align);
- }
- //填写与签名
- private void GetTimeFormat()
- {
- if (IsFillFreeTextAnnot == false)
- return;
- if(string.IsNullOrEmpty(Annot.TextContent))
- {
- if (CurrrentDateFormat != null)
- {
- if (IsCheckedTime)
- UpdateDateFormatLists();
- PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.NoteText, CurrrentDateFormat.Content);
- }
- return;
- }
- DateTime dtDate;
- bool isTime = false;
- foreach (var item in DateFormatItems)
- {
- var strFormat = "";
- var strArr = Annot.TextContent.Split(' ');
- if (strArr != null && strArr.Count() == 2)
- {
- strFormat = item.ValueStr + " HH:mm:ss";
- }
- else
- {
- strFormat = item.ValueStr;
- }
- if (DateTime.TryParseExact(Annot.TextContent, strFormat, System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.AdjustToUniversal, out dtDate))
- {
- if (strArr != null && strArr.Count() == 2)
- {
- isTime = true;
- }
- foreach (var item2 in DateFormatItems)
- {
- string stadate = System.DateTime.Now.ToString(strFormat);
- item.SetContent(stadate);
- }
- CurrrentDateFormat = new ComboDataItem(item.ValueStr, item.Content);
- break;
- }
- }
- IsCheckedTime = isTime;
- }
- //文本内容对齐
- private void GetAnnotAlign(TextAlignment align)
- {
- switch (align)
- {
- case TextAlignment.Left:
- FontVm.StrTextAlign = "Left";
- break;
- case TextAlignment.Center:
- FontVm.StrTextAlign = "Center";
- break;
- case TextAlignment.Right:
- FontVm.StrTextAlign = "Right";
- break;
- case TextAlignment.Justify:
- FontVm.StrTextAlign = "Justify";
- break;
- default:
- FontVm.StrTextAlign = "None";
- break;
- }
- }
- }
- }
|