コード例 #1
0
            public IEnumerator <PluginInfo> GetEnumerator()
            {
                int count = PluginAPI.CountPlugins();

                for (int index = 0; index < count; index++)
                {
                    yield return(new PluginInfo(PluginAPI.GetNthPlugin(index)));
                }
            }
コード例 #2
0
            public PluginInfo this[int index]
            {
                get
                {
                    if (index < 0 || index >= Count)
                    {
                        throw new ArgumentOutOfRangeException(nameof(index));
                    }

                    return(new PluginInfo(PluginAPI.GetNthPlugin(index)));
                }
            }
コード例 #3
0
ファイル: Features.cs プロジェクト: fedarovich/xplane-dotnet
        public static unsafe IReadOnlyCollection <string> GetFeatures()
        {
            var features = new HashSet <string>();
            var handle   = GCHandle.Alloc(features);

            try
            {
                PluginAPI.EnumerateFeatures(Callback, GCHandle.ToIntPtr(handle).ToPointer());
                return(features);
            }
            finally
            {
                handle.Free();
            }
コード例 #4
0
 public void Setup(Config cfg)
 {
     localConfig = cfg;
     PluginAPI.WriteLine("Configuration file loaded.");
 }
コード例 #5
0
ファイル: Features.cs プロジェクト: fedarovich/xplane-dotnet
 public static void EnableFeature(string feature, bool enable = true) => PluginAPI.EnableFeature(feature, enable.ToInt());
コード例 #6
0
ファイル: Features.cs プロジェクト: fedarovich/xplane-dotnet
 public static bool IsFeatureEnabled(string feature) => PluginAPI.IsFeatureEnabled(feature) != 0;
コード例 #7
0
ファイル: Features.cs プロジェクト: fedarovich/xplane-dotnet
 public static bool HasFeature(string feature) => PluginAPI.HasFeature(feature) != 0;