当前位置: 首页>>代码示例>>C#>>正文


C# StructuredText.AddChild方法代码示例

本文整理汇总了C#中StructuredText.AddChild方法的典型用法代码示例。如果您正苦于以下问题:C# StructuredText.AddChild方法的具体用法?C# StructuredText.AddChild怎么用?C# StructuredText.AddChild使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在StructuredText的用法示例。


在下文中一共展示了StructuredText.AddChild方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: 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;
        }
开发者ID:Ricordanza,项目名称:poderosa,代码行数:26,代码来源:TerminalSettingsSerialize.cs

示例2: 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();

        }
开发者ID:Ricordanza,项目名称:poderosa,代码行数:16,代码来源:ShortcutFile.cs

示例3: 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;
        }
开发者ID:Ricordanza,项目名称:poderosa,代码行数:35,代码来源:PipeTerminalParameterSerializer.cs

示例4: Serialize

        public StructuredText Serialize(object obj) {
            PipeTerminalSettings ts = obj as PipeTerminalSettings;
            Debug.Assert(ts != null);

            StructuredText node = new StructuredText(this.ConcreteType.FullName);
            node.AddChild(PipePlugin.Instance.SerializeService.Serialize(typeof(TerminalSettings), obj));

            return node;
        }
开发者ID:Ricordanza,项目名称:poderosa,代码行数:9,代码来源:PipeTerminalSettingsSerializer.cs

示例5: 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;
        }
开发者ID:Ricordanza,项目名称:poderosa,代码行数:23,代码来源:SerialSettings.cs

示例6: Serialize

        public void Serialize(SSHLoginParameter tp, StructuredText node)
        {
            base.Serialize(tp, node);
            if (tp.Method != SSHProtocol.SSH2)
                node.Set("method", tp.Method.ToString());
            if (tp.AuthenticationType != AuthenticationType.Password)
                node.Set("authentication", tp.AuthenticationType.ToString());
            node.Set("account", tp.Account);
            if (tp.IdentityFileName.Length > 0)
                node.Set("identityFileName", tp.IdentityFileName);
            if (tp.PasswordOrPassphrase != null) {
                if (ProtocolsPlugin.Instance.ProtocolOptions.SavePlainTextPassword) {
                    node.Set("passphrase", tp.PasswordOrPassphrase);
                }
                else if (ProtocolsPlugin.Instance.ProtocolOptions.SavePassword) {
                    string pw = new SimpleStringEncrypt().EncryptString(tp.PasswordOrPassphrase);
                    if (pw != null) {
                        node.Set("password", pw);
                    }
                }
            }

            node.Set("enableAgentForwarding", tp.EnableAgentForwarding.ToString());

            node.Set("enableX11Forwarding", tp.EnableX11Forwarding.ToString());

            if (tp.X11Forwarding != null) {
                StructuredText x11Node = node.AddChild("x11Forwarding");
                x11Node.Set("display", tp.X11Forwarding.Display.ToString(NumberFormatInfo.InvariantInfo));
                x11Node.Set("screen", tp.X11Forwarding.Screen.ToString(NumberFormatInfo.InvariantInfo));
                x11Node.Set("needAuth", tp.X11Forwarding.NeedAuth.ToString());
                if (tp.X11Forwarding.XauthorityFile != null) {
                    x11Node.Set("xauthorityFile", tp.X11Forwarding.XauthorityFile);
                }
                x11Node.Set("useCygwinUnixDomainSocket", tp.X11Forwarding.UseCygwinUnixDomainSocket.ToString());
                if (tp.X11Forwarding.X11UnixFolder != null) {
                    x11Node.Set("x11UnixFolder", tp.X11Forwarding.X11UnixFolder);
                }
            }
        }
开发者ID:poderosaproject,项目名称:poderosa,代码行数:40,代码来源:TerminalParameterSerialize.cs

示例7: SaveTo

 public void SaveTo(StructuredText node) {
     foreach (MRUItem tp in _data) {
         try {
             node.AddChild(_serializer.Serialize(tp));
         }
         catch (Exception ex) {
             RuntimeUtil.ReportException(ex);
         }
     }
 }
开发者ID:Ricordanza,项目名称:poderosa,代码行数:10,代码来源:MRUPlugin.cs

示例8: Serialize

 public StructuredText Serialize(object obj) {
     MRUItem item = (MRUItem)obj;
     StructuredText t = new StructuredText(this.ConcreteType.FullName);
     t.AddChild(_serializeService.Serialize(item.TerminalParameter));
     t.AddChild(_serializeService.Serialize(item.TerminalSettings));
     return t;
 }
开发者ID:Ricordanza,项目名称:poderosa,代码行数:7,代码来源:MRUPlugin.cs


注:本文中的StructuredText.AddChild方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。