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


C# Rhino.ReadString方法代码示例

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


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

示例1: ReadDocument

            //Called whenever a Rhino document is being loaded and plug-in user data was 
            //encountered written by a plug-in with this plug-in's GUID. 
            // 
            //If any ON_BinaryArchive::Read*() functions return false than you should 
            //immediately return false otherwise return true when all data was read. 
            protected override void ReadDocument(Rhino.RhinoDoc doc, Rhino.FileIO.BinaryArchiveReader archive, Rhino.FileIO.FileReadOptions options)
            {
                //Always read data in the EXACT same order you wrote it 
                int major, minor;
                archive.Read3dmChunkVersion(out major, out minor);

                //If you've changed your reading/writing code over time, 
                //you can use the version number of what you read 
                //to figure out what can be read from the archive 
                if ((major > 1 | minor > 0)) return;

                //the data you read/write will probably be member variables of your plug-in class, 
                //but for simplicity this sample is just using locally defined strings 
                string date_string = archive.ReadString();
                string time_string = archive.ReadString();

                //Get the commands for "Insert_Source" and "Insert_Receiver". This is where the Source and Receiver conduits are stored.
                UI.Pach_Source_Object S_command = Pach_Source_Object.Instance;
                UI.Pach_Receiver_Object R_command = Pach_Receiver_Object.Instance;

                System.Guid objectId = default(System.Guid);
                string Type = null;
                do
                {
                    try
                    {
                        objectId = archive.ReadGuid();
                        Type = archive.ReadString();
                        if (Type == "Source")
                        {
                            Rhino.DocObjects.RhinoObject Source = doc.Objects.Find(objectId);
                            if (Source != null)
                            {
                                SourceConduit.Instance.SetSource(Source);
                                doc.Views.Redraw();
                            }
                        }
                        else if (Type == "Receiver")
                        {
                            Rhino.DocObjects.RhinoObject Receiver = doc.Objects.Find(objectId);
                            if (Receiver != null)
                            {
                                ReceiverConduit.Instance.SetReceiver(Receiver);
                                doc.Views.Redraw();
                            }
                        }
                        Type = null;
                    }catch(Exception)
                    {
                        break;
                    }
                }
                while (objectId != null);
            }
开发者ID:MengdiGuo,项目名称:PachydermAcoustic_Rhinoceros,代码行数:59,代码来源:Pachyderm_AcousticPlugIn.cs


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