private static void OnNoteChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            SteamWorkshopItem me = d as SteamWorkshopItem;

            if (me != null)
            {
                if (!me.IsInitializing)
                {
                    if (Configuration.Current.Notes != null)
                    {
                        if (Configuration.Current.Notes.ContainsKey(me.Key))
                        {
                            Configuration.Current.Notes[me.Key] = me.Note;
                            Configuration.Current.Save();
                        }
                        else
                        {
                            Configuration.Current.Notes.Add(me.Key, me.Note);

                            Configuration.Current.Save();
                        }
                    }
                }
            }
        }
        private void OnOpenInGCFScape(object sender, RoutedEventArgs e)
        {
            Button btn = sender as Button;

            if (btn != null)
            {
                SteamWorkshopItem key = btn.CommandParameter as SteamWorkshopItem;
                OpenInGCFScape(key.Key);
            }
        }
Esempio n. 3
0
 static void ProcessWorkshopIDList(object state)
 {
     string[] idList = state as string[];
     if (idList != null)
     {
         foreach (var addOn in idList)
         {
             SteamWorkshopItem item = UIDependencyObject.CreateInstance <SteamWorkshopItem>(addOn);
             NewWorkshopItemRetrieved?.BeginInvoke(null, new NewSteamWorkshopItemEventArgs(item), null, null);
         }
     }
 }
        private void OnOpenWorkshopWebpage(object sender, RoutedEventArgs e)
        {
            Button btn = sender as Button;

            if (btn != null)
            {
                SteamWorkshopItem item = btn.CommandParameter as SteamWorkshopItem;
                if (item != null)
                {
                    System.Diagnostics.Process.Start("\"" + Utility.GetWorkshopWebpageURL(item.Key) + "\"");
                }
            }
        }
        private void OnOpenFolder(object sender, RoutedEventArgs e)
        {
            Button btn = sender as Button;

            if (btn != null)
            {
                SteamWorkshopItem item = btn.CommandParameter as SteamWorkshopItem;
                if (item != null)
                {
                    var path = System.IO.Path.Combine(Utility.GetHLAWorkshopFolder(), item.Key);
                    System.Diagnostics.Process.Start("\"" + path + "\"");
                }
            }
        }
        bool IsMatch(SteamWorkshopItem item, string search)
        {
            bool match = false;

            if (!string.IsNullOrEmpty(item.Description))
            {
                match = item.Description.ToUpperInvariant().Contains(search);
            }
            if (!match && !string.IsNullOrEmpty(item.Author))
            {
                match = item.Author.ToUpperInvariant().Contains(search);
            }
            if (!match && !string.IsNullOrEmpty(item.Title))
            {
                match = item.Title.ToUpperInvariant().Contains(search);
            }
            return(match);
        }
        private static void OnNoteChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            SteamWorkshopItem me = d as SteamWorkshopItem;

            if (me != null)
            {
                if (!me.IsInitializing)
                {
                    if (noteList != null)
                    {
                        if (noteList.ContainsKey(me.Key))
                        {
                            noteList.Add(me.Key, me.Note);
                            Utility.SaveNotes(noteList);
                        }
                        else
                        {
                            noteList[me.Key] = me.Note;
                            Utility.SaveNotes(noteList);
                        }
                    }
                }
            }
        }
Esempio n. 8
0
        public static SteamWorkshopItem[] GetHLAWorkshopList()
        {
            List <SteamWorkshopItem> retVal = new List <SteamWorkshopItem>();

            string folder = GetHLAWorkshopFolder();

            if (!string.IsNullOrEmpty(folder) && Directory.Exists(folder))
            {
                foreach (var dir in new DirectoryInfo(folder).GetDirectories())
                {
                    string key          = dir.Name;
                    string workshopFile = Path.Combine(folder, key, WorkshopInfoFile);

                    string vpkFile = GetVPKFile(key);
                    if (File.Exists(vpkFile))
                    {
                        if (File.Exists(workshopFile))
                        {
                            var info = new SteamInfo(workshopFile);
                            var data = new SteamWorkshopItem(key, info);
                            data.LoadCompleted += Data_LoadCompleted;
                            retVal.Add(data);
                            //totalAddOns++;
                        }
                        else
                        {
                            var data = new SteamWorkshopItem(key);
                            data.LoadCompleted += Data_LoadCompleted;
                            retVal.Add(data);
                            //totalAddOns++;
                        }
                    }
                }
            }
            return(retVal.ToArray());
        }
 public NewSteamWorkshopItemEventArgs(SteamWorkshopItem item)
 {
     WorkshopItem = item;
 }
 void MatchFound(SteamWorkshopItem item)
 {
     SelectedItem = item;
     theListView.ScrollIntoView(SelectedItem);
 }