Exemple #1
0
        public void OnRPC(RPCNode node)
        {
            // RPCs cannot get (due to copyrights) any info besides assets.
            // There is currently no public API for RPCs

            return;
        }
Exemple #2
0
        // Removed in Revit 2017:
        //public void OnDaylightPortal( DaylightPortalNode node )
        //{
        //  Debug.WriteLine( "OnDaylightPortal: " + node.NodeName );
        //  Asset asset = node.GetAsset();
        //  Debug.WriteLine( "OnDaylightPortal: Asset:"
        //    + ( ( asset != null ) ? asset.Name : "Null" ) );
        //}

        public void OnRPC(RPCNode node)
        {
            Debug.WriteLine("OnRPC: " + node.NodeName);
            //Asset asset = node.GetAsset();
            //Debug.WriteLine( "OnRPC: Asset:"
            //  + ( ( asset != null ) ? asset.Name : "Null" ) );
        }
Exemple #3
0
        // OnRPC marks the beginning of export of an RPC object.
        // This method is only called for interface IPhotoRenderContext.
        public void OnRPC(
            RPCNode InRPCNode             // RPC content output node
            )
        {
            // We ignore the RPC node local transform since the RPC location point will be used later.

            // Add an RPC mesh actor in the hierarchy of Datasmith actors being processed.
            AddRPCActor(WorldTransformStack.Peek(), InRPCNode.GetAsset());
        }
Exemple #4
0
 /// <summary>
 /// This method is only called for photo-rendering export
 /// (a custom exporter that implements IPhotoRenderContext ).
 /// When an RPC object is encountered for a model context export
 /// (a custom exporter that implements IModelExportContext ),
 /// the RPC object will be provided as a polymesh (via OnPolymesh(PolymeshTopology) ).
 /// https://www.revitapidocs.com/2018/f84574d9-ef15-c317-c6dd-91304a0c174c.htm
 /// </summary>
 /// <param name="node"></param>
 public void OnRPC(RPCNode node)
 {
     Debug.WriteLine($"OnRPC:{node.NodeName}");
 }
Exemple #5
0
 public void OnRPC(RPCNode node)
 {
     throw new NotImplementedException();
 }
Exemple #6
0
 public void OnRPC(RPCNode node)
 {
     Debug.Print($"RPC {node.NodeName}");
 }
 /// <summary>
 /// 此方法标志着RPC对象导出的开始。
 /// </summary>
 /// <param name="node"></param>
 public void OnRPC(RPCNode node)
 {
     //再看OnRPC(RPCNode node)方法,API里写清楚了,这个方法只在使用IPhotoRenderContext时发挥作用
     Debug.Print($"RPC {node.NodeName}");
 }
Exemple #8
0
 /// <summary>
 /// 此方法标志着RPC对象导出的开始。
 /// </summary>
 /// <param name="node"></param>
 public void OnRPC(RPCNode node)
 {
     //再看OnRPC(RPCNode node)方法,API里写清楚了,这个方法只在使用IPhotoRenderContext时发挥作用
 }
Exemple #9
0
 public void OnRPC(RPCNode inNode)
 {
 }
 /// <summary>
 ///     This method marks the beginning of export of an RPC object.
 /// </summary>
 /// <param name="node">The RPC object node.</param>
 public void OnRPC(RPCNode node)
 {
     // do nothing, not supported
 }
 public void OnRPC(RPCNode node)
 {
     // do nothing
 }
Exemple #12
0
 public void OnRPC(RPCNode node)
 {
     Debug.Print("OnRPC not implemented.");
     throw new NotImplementedException();
 }
Exemple #13
0
        public void OnRPC(RPCNode node)
        {
            // RPCs cannot get (due to copyrights) any info besides assets.
            // There is currently no public API for RPCs

            return;
        }
Exemple #14
0
 public void OnRPC(RPCNode node)
 {
     Debug.WriteLine("OnRPC: " + node.NodeName);
 }
 public void OnRPC(RPCNode inNode)
 {
 }
 public void OnRPC(RPCNode node)
 {
 }
Exemple #17
0
 void IExportContext.OnRPC(RPCNode node)
 {
     throw new NotImplementedException();
 }
Exemple #18
0
    void ProcessService(TypeDefinition type)
    {
        ServiceNode service           = null;
        var         retType           = default(TypeName);
        var         constructorWalker = new MethodWalker(type.Methods.First(m =>
                                                                            m.IsConstructor && !m.HasParameters));

        constructorWalker.OnCall = info => {
            var methodDef = info.Method.Resolve();
            if (methodDef.IsConstructor)
            {
                var declType = methodDef.DeclaringType;
                if (declType == type.BaseType)
                {
                    // Base class constructor invocation.
                    var fullName    = info.Arguments[1] as string;
                    var i           = fullName.LastIndexOf('.');
                    var serviceType = new TypeName(fullName.Substring(0, i), fullName.Substring(i + 1));
                    service = new ServiceNode(serviceType);
                }
                else if (declType.FullName == "MethodDescriptor/ParseMethod")
                {
                    var funcPtr  = info.Arguments[2] as string;
                    var start    = funcPtr.IndexOf('<') + 1;
                    var end      = funcPtr.IndexOf('>');
                    var fullName = funcPtr.Substring(start, end - start);
                    if (!retType.Equals(default(TypeName)))
                    {
                        Console.WriteLine("Discarding RPC return type: " + retType.Name);
                    }
                    var i = fullName.LastIndexOf('.');
                    retType = new TypeName(fullName.Substring(0, i), fullName.Substring(i + 1));
                }
                else if (declType.FullName == "MethodDescriptor")
                {
                    if (retType.Equals(default(TypeName)))
                    {
                        Console.WriteLine("Missing RPC return type");
                    }
                    else
                    {
                        var fullMethodName = info.Arguments[1] as string;
                        var methodName     = fullMethodName.Substring(fullMethodName.LastIndexOf('.') + 1);
                        var argType        = new TypeName("unknown", "Unknown");
                        var rpc            = new RPCNode(methodName, argType, retType);
                        rpc.Options.Add("(method_id)", info.Arguments[2].ToString());
                        if (service != null)
                        {
                            service.Methods.Add(rpc);
                        }
                        retType = default(TypeName);
                    }
                }
            }
        };
        constructorWalker.Walk();

        // TODO: Extract argument types.
        //       This will require analysis of senders, handlers and/or handler registration.

        if (service == null)
        {
            Console.WriteLine("Failed to extract protobuf name for service class: " + type.FullName);
        }
        else
        {
            AddPackageNode(service.Name.Package, service);
        }
    }