예제 #1
0
 private void OnEnable()
 {
     archi            = (Archi)target;
     lineMaterial     = Resources.Load <Material>("Materials/Line");
     grid             = archi.grid;
     gridHash         = GridUtility.GenerateHash(grid, Color.white);
     _rootElement     = new VisualElement();
     _visualTree      = Resources.Load <VisualTreeAsset>("UXML/MainWindow");
     materialPreviews = new List <GUIContent>(archi.materials.Count);
     tilePreviews     = new List <GUIContent>(archi.Tiles.Count);
     archi.tools      = new Tools.Tool[]
     {
         new Brush(Resources.Load <Texture2D>("Icons/brush")),
         new Rectangle(Resources.Load <Texture2D>("Icons/rectangle")),
         new FilledRectangle(Resources.Load <Texture2D>("Icons/filledrect")),
     };
     //print(archi.tools.Length);
     toolPreviews = new List <GUIContent>();
     for (int i = 0; i < archi.tools.Length; i++)
     {
         toolPreviews.Add(new GUIContent(archi.tools[i].icon, archi.tools[i].GetType().ToString()));
     }
     UpdateMaterialPreviews();
     UpdateTilePreviews();
     selectedTile      = archi.selectedTile;
     tiles             = archi.tiles;
     MouseCellWorldPos = Vector3.zero;
 }
예제 #2
0
        private List <string> GetUnintstallString(string Software)
        {
            if (Software == "")
            {
                var invalidEntry = new List <string>();

                return(invalidEntry);
            }

            String DisplayName, UninstallString, Path, DispalyVersion, finalOutput;
            var    softwareFound = new List <string>();
            var    uninstallReg  = new List <RegistryKey>();


            uninstallReg.Add(Registry.LocalMachine.OpenSubKey(@"Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall"));
            uninstallReg.Add(Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Uninstall"));

            foreach (RegistryKey Archi in uninstallReg)
            {
                string[] regKeys = Archi.GetSubKeyNames();

                for (int i = 0; i < regKeys.Length; i++)
                {
                    progressBar1.PerformStep();

                    if (regKeys[i] != null)
                    {
                        RegistryKey keySearch = Archi.OpenSubKey(regKeys[i]);
                        if (keySearch != null)
                        {
                            try
                            {
                                if (keySearch.GetValue("DisplayName").ToString().ToLower().Contains(Software.ToLower()))
                                {
                                    DisplayName     = "DisplayName: " + keySearch.GetValue("DisplayName").ToString();
                                    UninstallString = "UninstallString: " + keySearch.GetValue("UninstallString").ToString();
                                    Path            = "Path: " + keySearch.Name;
                                    DispalyVersion  = "DispalyVersion: " + keySearch.GetValue("DisplayVersion").ToString();

                                    finalOutput = DisplayName + Environment.NewLine +
                                                  UninstallString + Environment.NewLine +
                                                  DispalyVersion + Environment.NewLine +
                                                  Path + Environment.NewLine +
                                                  "===================================================================";
                                    softwareFound.Add(finalOutput);
                                }
                            }
                            catch (NullReferenceException e)
                            {
                                Console.WriteLine(e);
                            }
                        }
                    }
                }
            }
            return(softwareFound);
        }
예제 #3
0
 public abstract void MouseDrag(GameObject tile, Material[] materials, Vector3Int closestCell, Archi archi, bool erase);