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


C# StructuredText.FindChild方法代码示例

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


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

示例1: Deserialize

        public object Deserialize(StructuredText node) {
            TerminalSettings ts = new TerminalSettings();
            ts.BeginUpdate();

            ts.Encoding = ParseEncodingType(node.Get("encoding", ""), EncodingType.ISO8859_1);
            ts.TerminalType = ParseUtil.ParseEnum<TerminalType>(node.Get("terminal-type"), TerminalType.XTerm);
            ts.LocalEcho = ParseUtil.ParseBool(node.Get("localecho"), false);
            ts.LineFeedRule = ParseUtil.ParseEnum<LineFeedRule>(node.Get("linefeedrule"), LineFeedRule.Normal);
            ts.TransmitNL = ParseUtil.ParseEnum<NewLine>(node.Get("transmit-nl"), NewLine.CR);
            ts.EnabledCharTriggerIntelliSense = ParseUtil.ParseBool(node.Get("char-trigger-intellisense"), false);
            string shellscheme = node.Get("shellscheme", ShellSchemeCollection.DEFAULT_SCHEME_NAME);
            if (shellscheme.Length > 0)
                ts.SetShellSchemeName(shellscheme);
            ts.Caption = node.Get("caption", "");
#if !UNITTEST
            //現在テストではRenderProfileは対象外
            StructuredText rp = node.FindChild(typeof(RenderProfile).FullName);
            if (rp != null)
                ts.RenderProfile = _serializeService.Deserialize(rp) as RenderProfile;
#endif
            ts.EndUpdate();
            return ts;
        }
开发者ID:Ricordanza,项目名称:poderosa,代码行数:23,代码来源:TerminalSettingsSerialize.cs

示例2: Deserialize

        public void Deserialize(SSHLoginParameter tp, StructuredText node)
        {
            base.Deserialize(tp, node);
            tp.Method = "SSH1".Equals(node.Get("method")) ? SSHProtocol.SSH1 : SSHProtocol.SSH2;
            tp.AuthenticationType = ParseUtil.ParseEnum<AuthenticationType>(node.Get("authentication", ""), AuthenticationType.Password);
            tp.Account = node.Get("account", "");
            tp.IdentityFileName = node.Get("identityFileName", "");
            if (ProtocolsPlugin.Instance.ProtocolOptions.ReadSerializedPassword) {
                string pw = node.Get("passphrase", null);
                if (pw != null) {
                    tp.PasswordOrPassphrase = pw;
                    tp.LetUserInputPassword = false;
                }
                else {
                    pw = node.Get("password", null);
                    if (pw != null) {
                        pw = new SimpleStringEncrypt().DecryptString(pw);
                        if (pw != null) {
                            tp.PasswordOrPassphrase = pw;
                            tp.LetUserInputPassword = false;
                        }
                    }
                }
            }

            tp.EnableAgentForwarding = GetBoolValue(node, "enableAgentForwarding", false);

            tp.EnableX11Forwarding = GetBoolValue(node, "enableX11Forwarding", false);

            StructuredText x11Node = node.FindChild("x11Forwarding");
            if (x11Node != null) {
                int display = GetIntValue(x11Node, "display", 0);
                X11ForwardingParams x11params = new X11ForwardingParams(display);
                x11params.Screen = GetIntValue(x11Node, "screen", 0);
                x11params.NeedAuth = GetBoolValue(x11Node, "needAuth", false);
                x11params.XauthorityFile = x11Node.Get("xauthorityFile", null);
                x11params.UseCygwinUnixDomainSocket = GetBoolValue(x11Node, "useCygwinUnixDomainSocket", false);
                x11params.X11UnixFolder = x11Node.Get("x11UnixFolder", null);
                tp.X11Forwarding = x11params;
            }
        }
开发者ID:poderosaproject,项目名称:poderosa,代码行数:41,代码来源:TerminalParameterSerialize.cs

示例3: Deserialize

        public object Deserialize(StructuredText node) {
            SerialTerminalSettings ts = SerialPortUtil.CreateDefaultSerialTerminalSettings("COM1");

            //TODO Deserializeの別バージョンを作ってimportさせるべきだろう。もしくはService側の実装から変える。要素側には空引数コンストラクタを強制すればいいか
            StructuredText basenode = node.FindChild(typeof(TerminalSettings).FullName);
            if (basenode != null)
                ts.BaseImport((ITerminalSettings)SerialPortPlugin.Instance.SerializeService.Deserialize(basenode));

            ts.BaudRate = ParseUtil.ParseInt(node.Get("baud-rate"), 9600);
            ts.ByteSize = (byte)ParseUtil.ParseInt(node.Get("byte-size"), 8);
            ts.Parity = ParseUtil.ParseEnum<Parity>(node.Get("parity"), Parity.NOPARITY);
            ts.StopBits = ParseUtil.ParseEnum<StopBits>(node.Get("stop-bits"), StopBits.ONESTOPBIT);
            ts.FlowControl = ParseUtil.ParseEnum<FlowControl>(node.Get("flow-control"), FlowControl.None);
            ts.TransmitDelayPerChar = ParseUtil.ParseInt(node.Get("delay-per-char"), 0);
            ts.TransmitDelayPerLine = ParseUtil.ParseInt(node.Get("delay-per-line"), 0);

            return ts;
        }
开发者ID:Ricordanza,项目名称:poderosa,代码行数:18,代码来源:SerialSettings.cs

示例4: Deserialize

        public object Deserialize(StructuredText node)
        {
            SerialTerminalSettings ts = SerialPortUtil.CreateDefaultSerialTerminalSettings(1);

            //TODO Deserialize�̕ʃo�[�W����������import������ׂ����낤�B�������Service���̎�������ς���B�v�f���ɂ͋�����R���X�g���N�^���������΂�����
            StructuredText basenode = node.FindChild(typeof(TerminalSettings).FullName);
            if (basenode != null)
                ts.BaseImport((ITerminalSettings)SerialPortPlugin.Instance.SerializeService.Deserialize(basenode));

            ts.BaudRate = ParseUtil.ParseInt(node.Get("baud-rate"), 9600);
            ts.ByteSize = (byte)ParseUtil.ParseInt(node.Get("byte-size"), 8);
            ts.Parity = ParseUtil.ParseEnum<Parity>(node.Get("parity"), Parity.NOPARITY);
            ts.StopBits = ParseUtil.ParseEnum<StopBits>(node.Get("stop-bits"), StopBits.ONESTOPBIT);
            ts.FlowControl = ParseUtil.ParseEnum<FlowControl>(node.Get("flow-control"), FlowControl.None);
            ts.TransmitDelayPerChar = ParseUtil.ParseInt(node.Get("delay-per-char"), 0);
            ts.TransmitDelayPerLine = ParseUtil.ParseInt(node.Get("delay-per-line"), 0);

            return ts;
        }
开发者ID:VirusFree,项目名称:Poderosa,代码行数:19,代码来源:SerialSettings.cs


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