Exemple #1
0
            public static ScriptInfo DeclareScript(string path, MainDelegate main)
            {
                int index = EnsureScriptIndex(ref path);
                var info  = new ScriptInfo(index, path, main);

                DeclareScript(info);
                return(info);
            }
Exemple #2
0
        static void Main(string[] args)
        {
            //Создаем объект делегата и инициализируем методом, возвращающим нового кота
            MainDelegate mainDelegate = () => new Cat();

            //Через mainDelegate создается экземпляр кота, и из этого экземпляра вызывается делегат meowDelegate, ссылающийся на метод мяукания
            mainDelegate().meowDelegate();
        }
Exemple #3
0
        private void demoDelegateExtensions()
        {
            MainDelegate  mainDelegate  = new MainDelegate(Main);        // static
            LogicDelegate logicDelegate = new LogicDelegate(this.logic); // instance, cannot call this from a static method without having an instance

            mainDelegate.DelegateSignature().DebugLog();
            logicDelegate.DelegateSignature().DebugLog();
        }
Exemple #4
0
            public static List <MainDelegate> Fill(int count)
            {
                List <MainDelegate> list = new List <MainDelegate>();
                MainDelegate        m1   = new MainDelegate(MainDelegateMethod);

                for (int i = 0; i < count; i++)
                {
                    list.Add(m1);
                }
                return(list);
            }
Exemple #5
0
    void Awake()
    {
        // Add Pick up behaviour to the delegate if true.
        if (_pickUp)
        {
            MyDelegate += PickupRay;
        }

        // Add Interaction behaviour to the delegate if true.
        if (_interact)
        {
            MyDelegate += InteractRay;
        }
    }
Exemple #6
0
 internal static extern void CSharpResourceImpl_SetMainDelegate(IntPtr resource,
                                                                MainDelegate @delegate);
Exemple #7
0
 internal ScriptInfo(int index, string path, MainDelegate method)
 {
     Index      = index;
     Path       = path;
     MainMethod = method;
 }
 internal ScriptInfo(int index, string path, TypeInfo script)
 {
     Index      = index;
     Path       = path;
     MainMethod = CreateMain(script);
 }
Exemple #9
0
 public ScriptInfo(int index, string path, TypeInfo script)
 {
     Index      = index;
     Path       = CurrentPlatform.NormalizeSlashes(path);
     MainMethod = CreateMain(script);
 }
 private void Zaloguj_Click(object sender, RoutedEventArgs e)
 {
     MD = AuthorizeUser;
     MD.Invoke();
 }
 public Window1()
 {
     InitializeComponent();
     MD = InitializeUsers;
     MD.Invoke();
 }
Exemple #12
0
 public static void DeclareScript(string relpath, MainDelegate main) => ScriptsMap.DeclareScript(relpath, main);
Exemple #13
0
            public static void DeclareScript(string path, MainDelegate main)
            {
                int index = EnsureScriptIndex(ref path);

                DeclareScript(index, new ScriptInfo(index, path, main));
            }
Exemple #14
0
 internal static extern void CSharpResource_SetMain(IntPtr resourcePointer, MainDelegate mainDelegate,
                                                    StopDelegate stopDelegate,
                                                    TickDelegate tickDelegate, ServerEventDelegate serverEventDelegate,
                                                    CheckpointDelegate checkpointDelegate,
                                                    ClientEventDelegate clientEventDelegate, PlayerDamageDelegate playerDamageDelegate,
                                                    PlayerConnectDelegate playerConnectDelegate, PlayerDeathDelegate playerDeathDelegate,
                                                    PlayerDisconnectDelegate playerDisconnectDelegate, PlayerRemoveDelegate playerRemoveDelegate,
                                                    VehicleRemoveDelegate vehicleRemoveDelegate,
                                                    PlayerChangeVehicleSeatDelegate playerChangeVehicleSeatDelegate,
                                                    PlayerEnterVehicleDelegate playerEnterVehicleDelegate,
                                                    PlayerLeaveVehicleDelegate playerLeaveVehicleDelegate,
                                                    CreatePlayerDelegate createPlayerDelegate, RemovePlayerDelegate removePlayerDelegate,
                                                    CreateVehicleDelegate createVehicleDelegate, RemoveVehicleDelegate removeVehicleDelegate,
                                                    CreateBlipDelegate createBlipDelegate, RemoveBlipDelegate removeBlipDelegate,
                                                    CreateCheckpointDelegate createCheckpointDelegate, RemoveCheckpointDelegate removeCheckpointDelegate,
                                                    CreateVoiceChannelDelegate createVoiceChannelDelegate,
                                                    RemoveVoiceChannelDelegate removeVoiceChannelDelegate,
                                                    ConsoleCommandDelegate consoleCommandDelegate,
                                                    MetaDataChange metaDataChange,
                                                    MetaDataChange syncedMetaDataChange,
                                                    CreateColShapeDelegate createColShapeDelegate,
                                                    RemoveColShapeDelegate removeColShapeDelegate,
                                                    ColShapeDelegate colShapeDelegate
                                                    );