예제 #1
0
        public static void Register(string DefaultIcon, string Title, bool Bounceable)
        {
            if (!IsRegistered)
            {
                Initilize();

                iconName   = DefaultIcon;
                title      = Title;
                bounceable = Bounceable;

                using (var parameters = new Parameters())
                {
                    Id = APICall(parameters
                                 .AddInt((int)Function.Register)
                                 .AddString(Process.GetCurrentProcess().MainModule.FileName)
                                 .AddInt(HwndSource.Handle.ToInt32())
                                 .AddString(DefaultIcon)
                                 .AddString(Title)
                                 .AddInt((int)UId)
                                 .AddInt(Bounceable ? 1 : 0));
                }

                using (var parameters = new Parameters())
                {
                    UId = APICall(parameters
                                  .AddInt((int)Function.GetUId)
                                  .AddInt((int)Id));
                }
            }
        }
예제 #2
0
 public static void BounceStop()
 {
     if (IsRegistered)
     {
         using (var parameters = new Parameters())
         {
             APICall(parameters
                     .AddInt((int)Function.BounceStop)
                     .AddInt((int)Id));
         }
     }
 }
예제 #3
0
 private static void GetConfig()
 {
     if (IsRegistered)
     {
         using (var parameters = new Parameters())
         {
             APICall(parameters
                     .AddInt((int)Function.GetConfig)
                     .AddInt((int)Id));
         }
     }
 }
예제 #4
0
 public static void RemoveFolderWatcher(int FolderId)
 {
     if (IsRegistered)
     {
         using (var parameters = new Parameters())
         {
             APICall(parameters
                     .AddInt((int)Function.RemoveFolderWatcher)
                     .AddInt((int)Id)
                     .AddInt(FolderId));
         }
     }
 }
예제 #5
0
 public static void Bounce(BounceType Type, int Count)
 {
     if (IsRegistered)
     {
         using (var parameters = new Parameters())
         {
             APICall(parameters
                     .AddInt((int)Function.Bounce)
                     .AddInt((int)Id)
                     .AddInt((int)Type)
                     .AddInt((int)Count));
         }
     }
 }
예제 #6
0
 public static void Remove()
 {
     if (IsRegistered)
     {
         using (var parameters = new Parameters())
         {
             APICall(parameters
                     .AddInt((int)Function.Remove)
                     .AddInt((int)Id));
         }
         Id  = IntPtr.Zero;
         UId = IntPtr.Zero;
     }
 }
예제 #7
0
 public static void SetNotification(bool Visible, string Text, NotificationPosition Position)
 {
     if (IsRegistered)
     {
         using (var parameters = new Parameters())
         {
             APICall(parameters
                     .AddInt((int)Function.SetNotification)
                     .AddInt((int)Id)
                     .AddInt((int)(Visible ? 1 : 0))
                     .AddString(Text)
                     .AddInt((int)Position));
         }
     }
 }
예제 #8
0
 public static void AddFolderWatcher(int FolderId, FolderWatcherActions Actions, string Folder)
 {
     if (IsRegistered)
     {
         using (var parameters = new Parameters())
         {
             APICall(parameters
                     .AddInt((int)Function.AddFolderWatcher)
                     .AddInt((int)Id)
                     .AddInt(FolderId)
                     .AddInt((int)Actions)
                     .AddString(Folder));
         }
     }
 }
예제 #9
0
 private static void SetConfig()
 {
     if (IsRegistered)
     {
         using (var parameters = new Parameters())
         {
             APICall(parameters
                     .AddInt((int)Function.SetConfig)
                     .AddInt((int)Id)
                     .AddInt((int)(keepInDock ? 1 : 0))
                     .AddInt((int)(activatable ? 1 : 0))
                     .AddInt((int)(exposable ? 1 : 0))
                     .AddInt((int)(bounceable ? 1 : 0)));
         }
     }
 }
예제 #10
0
 private static void OnEventGetMenu()
 {
     if (GetMenu is EventGetMenu)
     {
         var menu = new List <Menu>();
         GetMenu(menu);
         if (IsRegistered)
         {
             using (var parameters = new Parameters())
             {
                 parameters.AddInt((int)Function.GetMenu).AddInt((int)Id).AddInt(menu.Count);
                 for (int i = menu.Count - 1; i >= 0; i--)
                 {
                     parameters.AddStructure(menu[i]);
                 }
                 APICall(parameters);
             }
         }
     }
 }
예제 #11
0
        public static void Register(string DefaultIcon, string Title, bool Bounceable)
        {
            if (!IsRegistered)
            {
                Initilize();

                iconName = DefaultIcon;
                title = Title;
                bounceable = Bounceable;

                using (var parameters = new Parameters())
                {
                    Id = APICall(parameters
                        .AddInt((int)Function.Register)
                        .AddString(Process.GetCurrentProcess().MainModule.FileName)
                        .AddInt(HwndSource.Handle.ToInt32())
                        .AddString(DefaultIcon)
                        .AddString(Title)
                        .AddInt((int)UId)
                        .AddInt(Bounceable ? 1 : 0));
                }

                using (var parameters = new Parameters())
                {
                    UId = APICall(parameters
                        .AddInt((int)Function.GetUId)
                        .AddInt((int)Id));
                }
            }
        }
예제 #12
0
 public static void BounceStop()
 {
     if (IsRegistered)
     {
         using (var parameters = new Parameters())
         {
             APICall(parameters
                 .AddInt((int)Function.BounceStop)
                 .AddInt((int)Id));
         }
     }
 }
예제 #13
0
 public static void Bounce(BounceType Type, int Count)
 {
     if (IsRegistered)
     {
         using (var parameters = new Parameters())
         {
             APICall(parameters
                 .AddInt((int)Function.Bounce)
                 .AddInt((int)Id)
                 .AddInt((int)Type)
                 .AddInt((int)Count));
         }
     }
 }
예제 #14
0
 private static void GetConfig()
 {
     if (IsRegistered)
     {
         using (var parameters = new Parameters())
         {
             APICall(parameters
                 .AddInt((int)Function.GetConfig)
                 .AddInt((int)Id));
         }
     }
 }
예제 #15
0
 private static void SetConfig()
 {
     if (IsRegistered)
     {
         using (var parameters = new Parameters())
         {
             APICall(parameters
                 .AddInt((int)Function.SetConfig)
                 .AddInt((int)Id)
                 .AddInt((int)(keepInDock ? 1 : 0))
                 .AddInt((int)(activatable ? 1 : 0))
                 .AddInt((int)(exposable ? 1 : 0))
                 .AddInt((int)(bounceable ? 1 : 0)));
         }
     }
 }
예제 #16
0
 public static void SetNotification(bool Visible, string Text, NotificationPosition Position)
 {
     if (IsRegistered)
     {
         using (var parameters = new Parameters())
         {
             APICall(parameters
                 .AddInt((int)Function.SetNotification)
                 .AddInt((int)Id)
                 .AddInt((int)(Visible ? 1 : 0))
                 .AddString(Text)
                 .AddInt((int)Position));
         }
     }
 }
예제 #17
0
 public static void AddFolderWatcher(int FolderId, FolderWatcherActions Actions, string Folder)
 {
     if (IsRegistered)
     {
         using (var parameters = new Parameters())
         {
             APICall(parameters
                 .AddInt((int)Function.AddFolderWatcher)
                 .AddInt((int)Id)
                 .AddInt(FolderId)
                 .AddInt((int)Actions)
                 .AddString(Folder));
         }
     }
 }
예제 #18
0
 public static void RemoveFolderWatcher(int FolderId)
 {
     if (IsRegistered)
     {
         using (var parameters = new Parameters())
         {
             APICall(parameters
                 .AddInt((int)Function.RemoveFolderWatcher)
                 .AddInt((int)Id)
                 .AddInt(FolderId));
         }
     }
 }
예제 #19
0
 private static void OnEventGetMenu()
 {
     if (GetMenu is EventGetMenu)
     {
         var menu = new List<Menu>();
         GetMenu(menu);
         if (IsRegistered)
         {
             using (var parameters = new Parameters())
             {
                 parameters.AddInt((int)Function.GetMenu).AddInt((int)Id).AddInt(menu.Count);
                 for (int i = menu.Count - 1; i >= 0; i--)
                 {
                     parameters.AddStructure(menu[i]);
                 }
                 APICall(parameters);
             }
         }
     }
 }
예제 #20
0
 public static void Remove()
 {
     if (IsRegistered)
     {
         using (var parameters = new Parameters())
         {
             APICall(parameters
                 .AddInt((int)Function.Remove)
                 .AddInt((int)Id));
         }
         Id = IntPtr.Zero;
         UId = IntPtr.Zero;
     }
 }