Exemple #1
0
        public override Task <ConfigManager> GetConfig(NullClass request, ServerCallContext context)
        {
            //throw new Exception("f**k");

            var Config = MQService.GetConfig();

            ConfigManager res = new ConfigManager();

            MQServerConfig ServerConfig = new MQServerConfig();

            ServerConfig.Account     = Config.ServerConfig.Account;
            ServerConfig.Host        = Config.ServerConfig.Host;
            ServerConfig.Pass        = Config.ServerConfig.Pass;
            ServerConfig.Port        = Config.ServerConfig.Port;
            ServerConfig.VirtualHost = Config.ServerConfig.VirtualHost;

            res.ServerConfig = ServerConfig;


            foreach (var item in Config.Data)
            {
                MQQueueConfig QueueConfig = new MQQueueConfig();
                QueueConfig.BindingKeys.Add(item.Value.BindingKeys.ToArray());
                QueueConfig.ExchangeName = item.Value.ExchangeName;
                QueueConfig.QueueName    = item.Value.QueueName;
                QueueConfig.ThreadCount  = item.Value.ThreadCount;
                res.Data.Add(item.Key, QueueConfig);
            }


            return(Task.FromResult(res));
        }
 internal static extern bool WriteFile0(
     IntPtr hFile,
     [MarshalAs(UnmanagedType.LPArray)]
     byte[] lpBuffer,
     uint nNumberOfBytesToWrite,
     out uint lpNumberOfBytesWritten,
     NullClass lpOverlapped);
Exemple #3
0
 internal static extern Boolean SetupDiGetDeviceInterfaceDetail0(
     IntPtr hDevInfo,
     ref SP_DEVICE_INTERFACE_DATA deviceInterfaceData,
     NullClass deviceInterfaceDetailData, // OPTIONAL
     UInt32 deviceInterfaceDetailDataSize,
     out UInt32 requiredSize,             // OPTIONAL
     NullClass deviceInfoData);           // OPTIONAL
Exemple #4
0
 public MessageData(object o, int cmdNum)
 {
     if (o == null)
     {
         o = new NullClass();
     }
 }
Exemple #5
0
 [DllImport(@"setupapi.dll", CharSet = CharSet.Auto, SetLastError = true, EntryPoint = "SetupDiGetDeviceRegistryProperty")] // overloaded for null refs
 internal static extern Boolean SetupDiGetDeviceRegistryProperty0(
     IntPtr hDevInfo,
     ref SP_DEVINFO_DATA deviceInfoData,
     UInt32 property,
     out IntPtr propertyRegDataType, // OPTIONAL
     NullClass propertyBuffer,
     UInt32 propertyBufferSize,      // set to 0 (Zero)
     out UInt32 requiredSize);       // OPTIONAL
Exemple #6
0
 internal static extern Boolean SetupDiGetDeviceRegistryProperty0(
     IntPtr hDevInfo,
     ref SP_DEVINFO_DATA deviceInfoData,
     UInt32 property,
     /* out IntPtr */ NullClass propertyRegDataType, // OPTIONAL
     StringBuilder propertyBuffer,
     UInt32 propertyBufferSize,
     /* out IntPtr */ NullClass requiredSize);                                                                              // OPTIONAL
Exemple #7
0
        private string GetNullableRefTypes()
        {
            var nuller = new NullClass {
                One = 1
            };

            if (nuller.Two is null)
            {
                return("Null value");
            }
            ;

            return(string.Empty);
        }
 internal static extern bool ReadFile0(
     IntPtr hFile,
     [MarshalAs(UnmanagedType.LPArray)][Out] byte[] lpBuffer,
     uint nNumberOfBytesToRead,
     out uint lpNumberOfBytesRead,
     NullClass lpOverlapped);
 internal static extern bool WriteFile0(
     IntPtr hFile,
     [MarshalAs(UnmanagedType.LPArray)]
     byte[] lpBuffer,
     uint nNumberOfBytesToWrite,
     out uint lpNumberOfBytesWritten,
     NullClass lpOverlapped);
 internal static extern bool ReadFile0(
     IntPtr hFile,
     [MarshalAs(UnmanagedType.LPArray)] [Out] byte[] lpBuffer,
     uint nNumberOfBytesToRead,
     out uint lpNumberOfBytesRead,
     NullClass lpOverlapped);