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


C# Dialog.GenerateOutput方法代码示例

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


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

示例1: ReadDialogFromRCFile

        /// <summary>
        /// Reads a dialog from a .rc file.
        /// </summary>
        /// <param name="reader">StreamReader to read dialog from.</param>
        /// <param name="writer">XmlWriter to write output to.</param>
        /// <param name="dialog">Dialog being read.</param>
        /// <returns>Error or ErrorCode.None.</returns>
        private static ErrorCode ReadDialogFromRCFile(StreamReader reader, XmlWriter writer, Dialog dialog)
        {
            string curLine;
            string curToken;
            string dlgCaption;

            // Skip the next line (STYLE)
            if (null == (curLine = ReadLineFromFile(reader)))
            {
                return ErrorCode.ReadLine;
            }

            /*
            if (null == (curLine = ReadLineFromFile(reader)))
            {
                return ErrorCode.ReadLine;
            }
            */

            // Look for the "CAPTION" line
            if (null == (curLine = ReadLineFromFile(reader)))
            {
                return ErrorCode.ReadLine;
            }

            GetTokenFromLine(curLine, out curToken, 1);
            if (0 == String.Compare(curToken, "CAPTION"))
            {
                // Found the dialog's caption

                // Get the dialog caption
                GetTokenFromLine(curLine, out dlgCaption, 2);

                int firstQuote = dlgCaption.IndexOf('\"');
                int lastQuote = dlgCaption.LastIndexOf('\"');
                if (-1 != firstQuote && -1 != lastQuote)
                {
                    dialog.Title = dlgCaption.Substring(firstQuote, (lastQuote - firstQuote) - 1);
                }
            }

            // Write the entire dialog if it was properly formatted in the RC file
            if (null != dialog)
            {
                dialog.GenerateOutput(writer);
            }

            // Skip the next line (FONT)
            if (null == (curLine = ReadLineFromFile(reader)))
            {
                return ErrorCode.ReadLine;
            }

            // Look for the "BEGIN" line
            if (null == (curLine = ReadLineFromFile(reader)))
            {
                return ErrorCode.ReadLine;
            }

            GetTokenFromLine(curLine, out curToken, 1);
            if (0 == String.Compare(curToken, "BEGIN"))
            {
                bool foundDialogEnd = false;
                while (!foundDialogEnd)
                {
                    // Look for the "END" line
                    if (null == (curLine = ReadLineFromFile(reader)))
                    {
                        return ErrorCode.ReadLine;
                    }

                    GetTokenFromLine(curLine, out curToken, 1);
                    if (0 == String.Compare(curToken, "END"))
                    {
                        foundDialogEnd = true;
                    }
                    else
                    {
                        Control newControl = new Control(null, ControlType.Initialize, 0, 0, 0, 0);

                        // Determine the type of control we have
                        GetTokenFromLine(curLine, out curToken, 1);
                        if (0 == String.Compare(curToken, "DEFPUSHBUTTON"))
                        {
                            SetupPushButton(newControl, curLine, true);
                        }
                        else if (0 == String.Compare(curToken, "PUSHBUTTON"))
                        {
                            SetupPushButton(newControl, curLine, false);
                        }
                        else if (0 == String.Compare(curToken, "EDITTEXT"))
                        {
                            SetupEditBox(newControl, curLine);
//.........这里部分代码省略.........
开发者ID:sillsdev,项目名称:FwSupportTools,代码行数:101,代码来源:tallowrc.cs


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