本文整理汇总了C#中TextType类的典型用法代码示例。如果您正苦于以下问题:C# TextType类的具体用法?C# TextType怎么用?C# TextType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TextType类属于命名空间,在下文中一共展示了TextType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DataSetTargetCore
///////////////////////////////////////////////////////////////////////////////////////////////////
////////////BUILD FROM MUTABLE OBJECTS //////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
#region Constructors and Destructors
/// <summary>
/// Initializes a new instance of the <see cref="DataSetTargetCore"/> class.
/// </summary>
/// <param name="itemMutableObject">
/// The agencyScheme.
/// </param>
/// <param name="parent">
/// The parent.
/// </param>
/// <exception cref="SdmxSemmanticException"> Throws SdmxSemmanticException.
/// </exception>
/// <exception cref="SdmxSemmanticException">
/// Throws Validate exception.
/// </exception>
public DataSetTargetCore(IDataSetTargetMutableObject itemMutableObject, IMetadataTarget parent)
: base(itemMutableObject, parent)
{
this.textType = TextType.GetFromEnum(TextEnumType.DataSetReference);
try
{
this.textType = itemMutableObject.TextType;
}
catch (SdmxSemmanticException ex)
{
throw new SdmxSemmanticException(ex, ExceptionCode.ObjectStructureConstructionError, this.Urn);
}
catch (Exception th)
{
throw new SdmxException(th, ExceptionCode.ObjectStructureConstructionError, this.Urn);
}
try
{
this.Validate();
}
catch (SdmxSemmanticException ex1)
{
throw new SdmxSemmanticException(ex1, ExceptionCode.ObjectStructureConstructionError, this.Urn);
}
catch (Exception th1)
{
throw new SdmxException(th1, ExceptionCode.ObjectStructureConstructionError, this.Urn);
}
}
示例2: AddLine
public void AddLine(TextType txtType, String text)
{
string indent = "";
switch ((int)txtType)
{
// HeaderOpenBlock
case 0:
indent = " ";
break;
// Header
case 1:
indent = " ";
break;
// Indent1
case 2:
indent = " ";
break;
// CloseBlock
case 3:
indent = " )";
break;
// EmptyLine
case 4:
indent = "";
break;
}
_text = _text.AddLast(indent + text);
_type = _type.AddLast(txtType);
}
示例3: AddKeyWordProperty
private TextType AddKeyWordProperty(TextType propType, string name, string value, ContentType property)
{
if (propType == null)
{
propType = new TextType(property);
m_docText.AddTextType(propType);
}
TextNode newNode = new TextNode();
newNode.AddParent(propType);
propType.AddChild(newNode);
newNode.AddInfo(new NodeInfo()
{
name = "Name",
type = DataType.String,
value = name
});
newNode.AddInfo(new NodeInfo()
{
name = "Value",
type = DataType.String,
value = value
});
return propType;
}
示例4: ReportPeriodTargetCore
///////////////////////////////////////////////////////////////////////////////////////////////////
////////////BUILD FROM MUTABLE OBJECT //////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
#region Constructors and Destructors
/// <summary>
/// Initializes a new instance of the <see cref="ReportPeriodTargetCore"/> class.
/// </summary>
/// <param name="parent">
/// The parent.
/// </param>
/// <param name="itemMutableObject">
/// The sdmxObject.
/// </param>
/// <exception cref="SdmxSemmanticException">
/// Throws Validate exception.
/// </exception>
public ReportPeriodTargetCore(IIdentifiableObject parent, IReportPeriodTargetMutableObject itemMutableObject)
: base(itemMutableObject, parent)
{
this.textType = TextType.GetFromEnum(TextEnumType.ObservationalTimePeriod);
if (itemMutableObject.StartTime != null)
{
this.startTime = new SdmxDateCore(itemMutableObject.StartTime, TimeFormatEnumType.DateTime);
}
if (itemMutableObject.EndTime != null)
{
this.endTime = new SdmxDateCore(itemMutableObject.EndTime, TimeFormatEnumType.DateTime);
}
if (itemMutableObject.TextType != null)
{
this.textType = itemMutableObject.TextType;
}
try
{
this.Validate();
}
catch (SdmxSemmanticException e)
{
throw new SdmxSemmanticException(e, ExceptionCode.FailValidation, this);
}
}
示例5: FontCGSizeorTextType
private float FontCGSizeorTextType (TextType type, int level)
{
float fontSize = 0;
switch (type) {
case TextType.Title:
fontSize = 88;
break;
case TextType.Chapter:
fontSize = 94;
break;
case TextType.Code:
fontSize = 36;
break;
case TextType.Subtitle:
fontSize = 64;
break;
case TextType.Body:
fontSize = level == 0 ? 50 : 40;
break;
default:
fontSize = 56;
break;
}
return fontSize;
}
示例6: GetText
/// <summary>
/// Get Global String
/// </summary>
/// <param name="tag"></param>
/// <returns></returns>
public String GetText(TextType tag)
{
String strText = String.Empty;
_stringDic.TryGetValue(tag.ToString(), out strText);
strText = String.IsNullOrEmpty(strText) ? tag.ToString() : strText.Replace("&", "&");
return strText;
}
示例7: TextDescriptor
internal TextDescriptor(TextType typeText, int start, int len, bool bold)
{
StartPos = start;
Length = len;
TypeText = typeText;
Bold = bold;
}
示例8: HandleOleLinks
private void HandleOleLinks(TextType links)
{
for (int i = 0; i < links.GetChildCount(); i++)
{
IAbstractTextNode iChild = links.GetChild(i);
ProcessChildNode(iChild);
}
}
示例9: Task1
public Task1()
{
InitializeComponent();
new Task2().Show();
_current = TextType.In;
}
示例10: GetText
/// <summary>
/// 获得文字
/// </summary>
/// <param name="defaultText"></param>
/// <param name="tag"></param>
/// <returns></returns>
public static string GetText(string defaultText, TextType tag)
{
if (IsUseDefaultLanguage || tag == TextType.UseDefaultLanguage) return defaultText;
string strText;
StringResource.StringDic.TryGetValue(tag.ToString(), out strText);
strText = string.IsNullOrEmpty(strText) ? tag.ToString() : strText.Replace("&", "&");
return strText;
}
示例11: RaiseClassificationChanged
public void RaiseClassificationChanged(SnapshotSpan span, TextType type)
{
_isRobotsTxt = true;
_textType = type;
var handler = this.ClassificationChanged;
if (handler != null)
handler(this, new ClassificationChangedEventArgs(span));
}
示例12: ProcessSchemaValidationError
private void ProcessSchemaValidationError(CodedStatusMessageType errorMessage, SchemaValidationException e)
{
foreach (string error in e.GetValidationErrors())
{
TextType text = new TextType();
errorMessage.Text.Add(text);
text.TypedValue = error;
}
}
示例13: OnClassificationChanged
public void OnClassificationChanged(SnapshotSpan span, TextType type)
{
_isDockerfile = true;
_textType = type;
var handler = this.ClassificationChanged;
if (handler != null)
handler(this, new ClassificationChangedEventArgs(span));
}
示例14: handleNumberkeyDown
public static void handleNumberkeyDown(TextType _texttype, ref KeyEventArgs e, NumberType _NumberType, NumberPower __NumberPower)
{
bool result = true;
bool numericKeys = (
((e.KeyCode >= Keys.D0 && e.KeyCode <= Keys.D9) ||
(e.KeyCode >= Keys.NumPad0 && e.KeyCode <= Keys.NumPad9))
&& e.Modifiers != Keys.Shift);
bool ctrlA = e.KeyCode == Keys.A && e.Modifiers == Keys.Control;
bool mark = (e.KeyCode == Keys.OemMinus && __NumberPower != NumberPower.positiveOnly) || (e.KeyCode == Keys.Oemplus && __NumberPower != NumberPower.NegativeOnly);
bool comma = (_NumberType != NumberType.Integer && (e.KeyData == Keys.Decimal || e.KeyCode == Keys.Oemcomma || e.KeyCode == Keys.OemPeriod));
bool editKeys = (
(e.KeyCode == Keys.Z && e.Modifiers == Keys.Control) ||
(e.KeyCode == Keys.X && e.Modifiers == Keys.Control) ||
(e.KeyCode == Keys.C && e.Modifiers == Keys.Control) ||
(e.KeyCode == Keys.V && e.Modifiers == Keys.Control) ||
e.KeyCode == Keys.Delete ||
e.KeyCode == Keys.Back);
bool navigationKeys = (
e.KeyCode == Keys.Up ||
e.KeyCode == Keys.Right ||
e.KeyCode == Keys.Down ||
e.KeyCode == Keys.Left ||
e.KeyCode == Keys.Home ||
e.KeyCode == Keys.End);
switch (_texttype)
{
case TextType.IsNumber:
{
if (!(numericKeys || editKeys || navigationKeys || mark || comma))
{
if (ctrlA) // Do select all as OS/Framework does not always seem to implement this.
// SelectAll();
result = false;
}
if (!result) // If not valid key then suppress and handle.
{
e.SuppressKeyPress = true;
e.Handled = true;
if (ctrlA) { } // Do Nothing!
}
break;
}
case TextType.IsdateTime: break;
case TextType.IsMail: break;
case TextType.IsString: break;
case TextType.IsTel: break;
}
}
示例15: DummyTextToken
/// ------------------------------------------------------------------------------------
/// <summary>
/// Initializes a new instance of the <see cref="DummyTextToken"/> class.
/// </summary>
/// <param name="text">The text.</param>
/// <param name="textType">Type of the text.</param>
/// <param name="isParagraphStart">if set to <c>true</c> text token starts a paragraph.
/// </param>
/// <param name="isNoteStart">if set to <c>true</c> text token starts a note.</param>
/// <param name="paraStyleName">Name of the paragraph style.</param>
/// <param name="charStyleName">Name of the character style.</param>
/// <param name="icuLocale">The icu locale.</param>
/// ------------------------------------------------------------------------------------
public DummyTextToken(string text, TextType textType, bool isParagraphStart,
bool isNoteStart, string paraStyleName, string charStyleName, string icuLocale)
{
m_text = text;
m_textType = textType;
m_isParagraphStart = isParagraphStart;
m_isNoteStart = isNoteStart;
m_paraStyleName = paraStyleName;
m_charStyleName = charStyleName;
m_iculocale = icuLocale;
}