private void btnChangeIcon_Click(object sender, RoutedEventArgs e)
        {
            System.Windows.Forms.OpenFileDialog ofd = new System.Windows.Forms.OpenFileDialog();
            ofd.Filter = "PNG文件|*.png";
            ofd.ShowDialog();


            string FileName = ofd.FileName;

            if (System.IO.File.Exists(FileName))
            {
                FileStream fs = new FileStream(FileName, FileMode.Open);

                byte[] b = null;
                fs.Position = 0;
                using (BinaryReader br = new BinaryReader(fs))
                {
                    b = br.ReadBytes((int)fs.Length);
                }

                this.imgIcon.Source  = GetIcon.ByteArrayToIS(b);
                itemdata.IconChanged = true;
            }
            else
            {
                Manage.TipPublic.ShowFixed(this, "File doesn't exists.");
            }
        }
 public ProjectLayoutDocument(ProjectInfo pi, FiledropsFile fi, GetIcon iconfunction)
 {
     this._pi = pi;
     this._fi = fi;
     this.Title = fi.NameWithoutExtension;
     if (iconfunction != null)
         this.IconSource = iconfunction(fi, null, 32);
     if (this.IconSource == null)
         this.IconSource = fi.Icon32x32;
     this.Closed += CloseDoc;
     this.Closing += new EventHandler<System.ComponentModel.CancelEventArgs>(TryClose);
 }
        protected override void Setup64Bit(SigScanner scanner)
        {
            ComboTimer = scanner.GetStaticAddressFromSig("48 89 2D ?? ?? ?? ?? 85 C0 74 0F");

            GetIcon = scanner.ScanText("E8 ?? ?? ?? ?? 8B F8 3B DF");  // Client::Game::ActionManager.GetAdjustedActionId

            IsIconReplaceable = scanner.ScanText("81 F9 ?? ?? ?? ?? 7F 39 81 F9 ?? ?? ?? ??");

            GetActionCooldown = scanner.ScanText("E8 ?? ?? ?? ?? 0F 57 FF 48 85 C0");

            PluginLog.Verbose("===== H O T B A R S =====");
            PluginLog.Verbose($"GetIcon address   0x{GetIcon.ToInt64():X}");
            PluginLog.Verbose($"IsIconReplaceable 0x{IsIconReplaceable.ToInt64():X}");
            PluginLog.Verbose($"ComboTimer        0x{ComboTimer.ToInt64():X}");
            PluginLog.Verbose($"LastComboMove     0x{LastComboMove.ToInt64():X}");
        }
        public static GUIContent GetTrackIcon(Type trackAssetType)
        {
            Type tDType = GetCustomDrawer.Invoke(null, new object[] { trackAssetType }) as Type;

            if (tDType == null)
            {
                return(GUIContent.none);
            }
            object tD = Activator.CreateInstance(tDType);

            //There's a null reference exception if we get the default icon, so return none!
            if (tD.GetType() == trackDrawerType)
            {
                return(GUIContent.none);
            }
            return((GUIContent)GetIcon.Invoke(tD, null));
        }
        private void btnClose_Click(object sender, RoutedEventArgs e)
        {
            if (!string.IsNullOrEmpty(this.ItemName.Trim()))
            {
                itemdata.Name = this.ItemName;
            }

            if (!string.IsNullOrEmpty(this.Path.Trim()))
            {
                itemdata.Path = this.Path;
            }

            if (!string.IsNullOrEmpty(this.Arguments.Trim()))
            {
                itemdata.Arguments = this.Arguments;
            }

            if (!string.IsNullOrEmpty(this.WorkingDirectory.Trim()))
            {
                itemdata.WorkingDirectory = this.WorkingDirectory;
            }

            if (this.ItemIcon != null && this.itemdata.IconChanged)
            {
                itemdata.Icon_imagesource = this.ItemIcon;
                itemdata.Icon_byte        = GetIcon.ImageSourceToByteArray(this.ItemIcon);
            }

            if (!string.IsNullOrEmpty(this.TagName.Trim()))
            {
                itemdata.TagName = TagName;
            }

            if (this.txtHotKey.Available)
            {
                this.itemdata.AddHotKey(this.txtHotKey);
            }
            else
            {
                this.itemdata.RemoveHotKey();
            }

            Manage.RefreshSingle(item, itemdata);

            this.Close();
        }
Beispiel #6
0
        protected override void Setup64Bit(SigScanner scanner)
        {
            ComboTimer = scanner.GetStaticAddressFromSig("E8 ?? ?? ?? ?? 80 7E 21 00", 0x178);

            // this.GetIcon = scanner.ScanText("48 89 5c 24 08 48 89 6c 24 10 48 89 74 24 18 57 48 83 ec 30 8b da be dd 1c 00 00 bd d3 0d 00 00");  // 5.35
            GetIcon = scanner.ScanText("E8 ?? ?? ?? ?? 8B F8 3B DF"); // 5.4

            // this.IsIconReplaceable = scanner.ScanText("81 f9 2e 01 00 00 7f 39 81 f9 2d 01 00 00 0f 8d 11 02 00 00 83 c1 eb");  // 5.35
            IsIconReplaceable = scanner.ScanText("81 F9 ?? ?? ?? ?? 7F 39 81 F9 ?? ?? ?? ??"); // 5.4

            BuffVTableAddr = scanner.GetStaticAddressFromSig("48 89 05 ?? ?? ?? ?? 88 05 ?? ?? ?? ?? 88 05 ?? ?? ?? ??");

            PluginLog.Verbose("===== H O T B A R S =====");
            PluginLog.Verbose($"GetIcon address   0x{GetIcon.ToInt64():X}");
            PluginLog.Verbose($"IsIconReplaceable 0x{IsIconReplaceable.ToInt64():X}");
            PluginLog.Verbose($"ComboTimer        0x{ComboTimer.ToInt64():X}");
            PluginLog.Verbose($"LastComboMove     0x{LastComboMove.ToInt64():X}");
        }
Beispiel #7
0
        private void SaveSettings()
        {
            if (!string.IsNullOrEmpty(this.ItemName))
            {
                itemdata.Name = this.ItemName;
            }

            if (!string.IsNullOrEmpty(this.Path))
            {
                itemdata.Path = this.Path;
            }

            if (!string.IsNullOrEmpty(this.Arguments))
            {
                itemdata.Arguments = this.Arguments;
            }

            if (!string.IsNullOrEmpty(this.WorkingDirectory))
            {
                itemdata.WorkingDirectory = this.WorkingDirectory;
            }

            if (this.ItemIcon != null && this.itemdata.IconChanged)
            {
                itemdata.Icon = GetIcon.ImageSourceToByteArray(this.ItemIcon);
            }


            itemdata.TagName = TagName;


            if (this.txtHotKey.Available)
            {
                this.itemdata.AddHotKey(this.txtHotKey);
            }
            else
            {
                this.itemdata.RemoveHotKey();
            }

            Manage.RefreshSingle(item, itemdata);

            this.Close();
        }
Beispiel #8
0
        public wndItemInformation(Item item)
        {
            InitializeComponent();

            //填充信息
            this.Item             = item;
            this.Itemdata         = item.refItemData;
            this.ItemName         = this.Itemdata.Name;
            this.Path             = this.Itemdata.Path;
            this.Arguments        = this.Itemdata.Arguments;
            this.ItemIcon         = GetIcon.ByteArrayToIS(this.Itemdata.Icon);
            this.WorkingDirectory = this.Itemdata.WorkingDirectory;
            this.TagName          = this.Itemdata.TagName;
            this.txtHotKey.InputKeyString(this.Itemdata.HotKey);



            this.vtnMain.GetTags(Manage.WindowMain.Recent);

            this.Show();
        }
Beispiel #9
0
		public NewFilePanel(FiledropsDirectory folder, FiledropsDirectory schemadir, string ext, GetIcon iconFunction)
		{
			InitializeComponent();
            this.IconFunction = iconFunction;
            this._ext = ext;
            this._folderpath = folder.FullName;

            _lv = new FiledropsFileList(schemadir, false, false, ".xsd");
            _lv.ShowFiles = true;

			Button b = new Button();
			b.Content = "Create file";
			b.Click += CreateFileClick;
			b.Margin = new System.Windows.Thickness(10);

            _lv.MouseDoubleClick += CreateFileClick;


			Grid.SetRow(_lv, 0);
			Grid.SetRow(b, 1);

            grid.Children.Add(_lv);
            grid.Children.Add(b);
		}
Beispiel #10
0
        /// <summary>
        /// 从数据文件路径初始化内部数据
        /// </summary>
        /// <param name="path"></param>
        /// <returns></returns>
        private int ConnectDB()
        {
            if (objDB != null)
            {
                this.data.Name = objDB.ReadFirstByName("Name") as string;
                this.data.ID   = objDB.ReadFirstByName("ID") as string;
                int Count = Convert.ToInt32(objDB.ReadFirstByName("Icon"));

                try
                {
                    using (BinaryReader br = new BinaryReader(new FileStream(Manage.IconPath + data.ID + ".ib", FileMode.Open)))
                    {
                        data.Icon = br.ReadBytes(Count);
                    }

                    data.IS = GetIcon.ByteArrayToIS(data.Icon);
                }
                catch
                {
                }

                this.data.Path             = objDB.ReadFirstByName("Path") as string;
                this.data.Arguments        = objDB.ReadFirstByName("Arguments") as string;
                this.data.RunAs            = Convert.ToInt32(objDB.ReadFirstByName("Runas"));
                this.data.AutoRun          = Convert.ToInt32(objDB.ReadFirstByName("Autorun"));
                this.data.Levels           = Convert.ToInt32(objDB.ReadFirstByName("Levels"));
                this.data.WorkingDirectory = objDB.ReadFirstByName("WorkingDirectory");
                this.data.tagName          = objDB.ReadFirstByName("TagName");

                string strHKI = objDB.ReadFirstByName("HotKey");

                if (strHKI != null)
                {
                    if (!string.IsNullOrEmpty(strHKI.Replace(",", "").Replace(" ", "")))
                    {
                        string[] HKISplit;
                        try
                        {
                            HKISplit = strHKI.Split(',');
                        }
                        catch
                        {
                            HKISplit = new string[] { };
                        }
                        if (HKISplit.Length >= 3)
                        {
                            System.Windows.Forms.KeysConverter keyCvt = new System.Windows.Forms.KeysConverter();

                            this.data.HotKey = new HotKeyItem(this, (System.Windows.Forms.Keys)keyCvt.ConvertFromString(HKISplit[0]), Convert.ToUInt32(HKISplit[1]), Convert.ToInt32(HKISplit[2]), HotKeyItem.HotKeyParentType.Item);

                            if (Manage.CheckAndRegisterHotKey(data.HotKey))
                            {
                                Anything_wpf_main_.cls.HotKey.CurrentID++;
                                data.EnableHotKey = true;
                            }
                        }
                        else
                        {
                            this.data.HotKey = new HotKeyItem(null, System.Windows.Forms.Keys.None, 0, 0, HotKeyItem.HotKeyParentType.Item);
                        }
                    }
                    else
                    {
                        data.HotKey = new HotKeyItem(this, System.Windows.Forms.Keys.None, 0, 0, HotKeyItem.HotKeyParentType.Item);
                    }
                }

                return(0);
            }
            return(-1);
        }
 public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
 {
     return(GetIcon.ByteArrayToIS((byte[])value));
 }
Beispiel #12
0
        /// <summary>
        /// 添加新项目
        /// </summary>
        /// <param name="Path"></param>
        /// <param name="Name"></param>
        /// <param name="Arguments"></param>
        /// <returns></returns>
        public static Item AddItem(String Path, string Name = "", string Arguments = "", string tagName = "")
        {
            //try
            {
                //检查路径
                CheckPath(Path);

                string subPath = "";

                if (!string.IsNullOrEmpty(lnkInfo.Name))
                {
                    Path = lnkInfo.TargetPath;
                    if (string.IsNullOrEmpty(Name))
                    {
                        Name = lnkInfo.Name;
                        if (string.IsNullOrEmpty(Arguments))
                        {
                            Arguments = lnkInfo.Arguments;
                        }

                        if (string.IsNullOrEmpty(lnkInfo.WorkingDirectory))
                        {
                            subPath = GetSubPath(Path);
                        }
                        else
                        {
                            subPath = lnkInfo.WorkingDirectory;
                        }
                    }
                }
                else
                {
                    if (string.IsNullOrEmpty(Name))
                    {
                        Name = FileOperation.GetNameWithoutExtension(FileOperation.GetName(Path));
                    }

                    subPath = GetSubPath(Path);

                    if (string.IsNullOrEmpty(Arguments))
                    {
                        if (!new Regex("::\\{.+\\}").IsMatch(Path))
                        {
                            Arguments = GetArgumentsFromFullPath(Path);
                        }
                    }
                }



                //获取图标
                byte[] b;

                if (FileOperation.IsFile(Path) == -1)
                {
                    b = GetResourcesIcon("folder.png");
                }
                else
                {
                    //系统引用
                    if (Path.IndexOf("{") > 0 && Path.IndexOf("}") > 0)
                    {
                        switch (Path)
                        {
                        case MyComputer:
                            b = GetResourcesIcon("computer.png");
                            break;

                        case ControlPanel:
                            b = GetResourcesIcon("controlpanel.png");
                            break;

                        case MyDocument:
                            b = GetResourcesIcon("mydocument.png");
                            break;

                        case RecycleBin:
                            b = GetResourcesIcon("recyclebin.png");
                            break;

                        case NetworkNeighborhood:
                            b = GetResourcesIcon("networkneighborhood.png");
                            break;

                        default:
                            b = GetIcon.GetIconByteArray(Path);
                            break;
                        }
                    }
                    else
                    {
                        b = GetIcon.GetIconByteArray(Path);
                    }
                }

                string id = ClsMD5.ClsMD5.Encrypt(Name + Path);

                ImageSource IS = GetIcon.ByteArrayToIS(b);

                //构造UI对象
                Item item = new Item(id, Name, IS, ApplicationInformations.Anything.AppInfoOperations.GetItemSize(), tagName);

                item.Path = Path;

                //构造itemdata类对象
                ItemData itemdata = new ItemData(new ItemData.DataST(Name, Path, id, IS, b, "", 1, 0, 0));

                if (!string.IsNullOrEmpty(tagName))
                {
                    itemdata.TagName = tagName;
                }

                //有参数则填充参数
                if (!string.IsNullOrEmpty(Arguments.Trim()))
                {
                    itemdata.Arguments = Arguments;
                }

                //填充工作路径
                if (!string.IsNullOrEmpty(subPath.Trim()))
                {
                    itemdata.WorkingDirectory = subPath;
                }


                Manage.listOfInnerData.Add(itemdata);

                item.RefItemData = itemdata;

                item.Margin = new System.Windows.Thickness(5);

                item.Click += Item_Click;

                return(item);
            }
        }