本文整理汇总了C#中StructuredText.Set方法的典型用法代码示例。如果您正苦于以下问题:C# StructuredText.Set方法的具体用法?C# StructuredText.Set怎么用?C# StructuredText.Set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StructuredText
的用法示例。
在下文中一共展示了StructuredText.Set方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Serialize
public StructuredText Serialize(object obj) {
PipeTerminalParameter tp = obj as PipeTerminalParameter;
Debug.Assert(tp != null);
StructuredText node = new StructuredText(ConcreteType.FullName);
if (tp.ExeFilePath != null)
node.Set("exeFilePath", tp.ExeFilePath);
if (!String.IsNullOrEmpty(tp.CommandLineOptions))
node.Set("commandLineOptions", tp.CommandLineOptions);
if (tp.EnvironmentVariables != null && tp.EnvironmentVariables.Length > 0) {
foreach (PipeTerminalParameter.EnvironmentVariable e in tp.EnvironmentVariables) {
StructuredText envNode = new StructuredText("environmentVariable");
envNode.Set("name", e.Name);
envNode.Set("value", e.Value);
node.AddChild(envNode);
}
}
if (tp.InputPipePath != null)
node.Set("inputPipePath", tp.InputPipePath);
if (tp.OutputPipePath != null)
node.Set("outputPipePath", tp.OutputPipePath);
if (tp.TerminalType != null)
node.Set("terminal-type", tp.TerminalType);
if (tp.AutoExecMacroPath != null)
node.Set("autoexec-macro", tp.AutoExecMacroPath);
return node;
}
示例2: Serialize
public void Serialize(LocalShellParameter tp, StructuredText node)
{
base.Serialize(tp, node);
if (CygwinUtil.DefaultHome != tp.Home)
node.Set("home", tp.Home);
if (CygwinUtil.DefaultShell != tp.ShellName)
node.Set("shellName", tp.ShellName);
if (CygwinUtil.DefaultCygwinDir != tp.CygwinDir)
node.Set("cygwin-directory", tp.CygwinDir);
}
示例3: Serialize
public StructuredText Serialize(object obj) {
StructuredText storage = new StructuredText(this.ConcreteType.FullName);
TerminalSettings ts = (TerminalSettings)obj;
storage.Set("encoding", ts.Encoding.ToString());
if (ts.TerminalType != TerminalType.XTerm)
storage.Set("terminal-type", ts.TerminalType.ToString());
if (ts.LocalEcho)
storage.Set("localecho", "true");
if (ts.LineFeedRule != LineFeedRule.Normal)
storage.Set("linefeedrule", ts.LineFeedRule.ToString());
if (ts.TransmitNL != NewLine.CR)
storage.Set("transmit-nl", ts.TransmitNL.ToString());
if (ts.EnabledCharTriggerIntelliSense)
storage.Set("char-trigger-intellisense", "true");
if (!ts.ShellScheme.IsGeneric)
storage.Set("shellscheme", ts.ShellScheme.Name);
storage.Set("caption", ts.Caption);
#if !UNITTEST
//現在テストではRenderProfileは対象外
if (!ts.UsingDefaultRenderProfile)
storage.AddChild(_serializeService.Serialize(ts.RenderProfile));
#endif
//アイコンはシリアライズしない
return storage;
}
示例4: Serialize
public StructuredText Serialize(object obj)
{
StructuredText storage = new StructuredText(typeof(RenderProfile).FullName);
RenderProfile prof = (RenderProfile)obj;
storage.Set("font-name", prof.FontName);
storage.Set("cjk-font-name", prof.CJKFontName);
storage.Set("font-size", prof.FontSize.ToString());
storage.Set("line-spacing", prof.LineSpacing.ToString());
if (prof.UseClearType)
storage.Set("clear-type", "true");
if (!prof.EnableBoldStyle)
storage.Set("enable-bold-style", "false");
if (prof.ForceBoldStyle)
storage.Set("force-bold-style", "true");
storage.Set("text-color", prof.ForeColor.Name);
storage.Set("back-color", prof.BackColor.Name);
if (prof.BackgroundImageFileName.Length > 0) {
storage.Set("back-image", prof.BackgroundImageFileName);
storage.Set("back-style", prof.ImageStyle.ToString());
}
if (!prof.ESColorSet.IsDefault)
storage.Set("escape-sequence-color", prof.ESColorSet.Format());
storage.Set("darken-escolor-for-background", prof.DarkenEsColorForBackground.ToString());
return storage;
}
示例5: SaveToXML
public void SaveToXML(string filename) {
ISerializeService ss = TerminalSessionsPlugin.Instance.SerializeService;
StructuredText settings_text = ss.Serialize(_settings);
StructuredText parameter_text = ss.Serialize(_param);
//新形式で
StructuredText root = new StructuredText("poderosa-shortcut");
root.Set("version", "4.0");
root.AddChild(settings_text);
root.AddChild(parameter_text);
XmlWriter wr = CreateDefaultWriter(filename);
new XmlStructuredTextWriter(wr).Write(root);
wr.WriteEndDocument();
wr.Close();
}
示例6: Serialize
public StructuredText Serialize(object obj) {
SerialTerminalSettings ts = obj as SerialTerminalSettings;
Debug.Assert(ts != null);
StructuredText node = new StructuredText(this.ConcreteType.FullName);
node.AddChild(SerialPortPlugin.Instance.SerializeService.Serialize(typeof(TerminalSettings), ts));
node.Set("baud-rate", ts.BaudRate.ToString());
if (ts.ByteSize != 8)
node.Set("byte-size", ts.ByteSize.ToString());
if (ts.Parity != Parity.NOPARITY)
node.Set("parity", ts.Parity.ToString());
if (ts.StopBits != StopBits.ONESTOPBIT)
node.Set("stop-bits", ts.StopBits.ToString());
if (ts.FlowControl != FlowControl.None)
node.Set("flow-control", ts.FlowControl.ToString());
if (ts.TransmitDelayPerChar != 0)
node.Set("delay-per-char", ts.TransmitDelayPerChar.ToString());
if (ts.TransmitDelayPerLine != 0)
node.Set("delay-per-line", ts.TransmitDelayPerLine.ToString());
return node;
}
示例7: Serialize
public void Serialize(SSHSubsystemParameter tp, StructuredText node)
{
base.Serialize(tp, node);
node.Set("subsystemName", tp.SubsystemName);
}
示例8: SaveTo
public void SaveTo(StructuredText node) {
node.Clear();
foreach (Tag tag in _data) {
if (tag.Key != tag.Command.DefaultShortcutKey)
node.Set(tag.Command.CommandID, WinFormsUtil.FormatShortcut(tag.Key, '+'));
}
}