internal void Update()
 {
     foreach (var inst in AllInstances.ToArray())
     {
         inst.StoreValues();
     }
 }
 public void Refresh()
 {
     mSuppressCollectionChangedEvents = true;
     AllInstances.Match <ArrowInstanceGeneralVm, object>(Model.AllInstances);
     mFiles.Match <ArrowReferencedFileVm, ArrowReferencedFileSave>(Model.Files);
     mSuppressCollectionChangedEvents = false;
 }
示例#3
0
        /// <summary>
        /// Get each and every configured instance that could possibly
        /// be cast to T
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        public IEnumerable <T> GetAllPossible <T>() where T : class
        {
            var targetType = typeof(T);

            return(AllInstances
                   .Where(x => x.ReturnedType.CanBeCastTo(targetType))
                   .Select(x => x.Get <T>())
                   .Where(x => x != null));
        }
示例#4
0
 public void OnLoad()
 {
     AllInstances.Add(this);
     if (!string.IsNullOrWhiteSpace(ChatID))
     {
         pnlstart.SendToBack();
     }
     RefreshUserInput();
 }
示例#5
0
        public void ReadInstanceIDs(BinaryReader reader)
        {
            AllInstances.Clear();
            uint len = reader.ReadUInt32();

            //Console.WriteLine("instlen: " + len);
            for (int i = 0; i < len; i++)
            {
                var inst = new YYInstance(reader, RunnerLayout);
                AllInstances.Add(inst);
                Console.WriteLine(inst.ToString());
            }
        }
示例#6
0
        public void ReadInstanceResults(BinaryReader reader)
        {
            int len = reader.ReadInt32();

            for (int i = 0; i < len; i++)
            {
                uint instID = reader.ReadUInt32();
                bool exists = reader.ReadInt32() != 0;
                if (exists)
                {
                    var __inst = AllInstances.Where(inst => inst.ID == instID).First();
                    __inst.Deserialize(reader, this);
                }
                else
                {
                    Console.WriteLine("No instance exists for ID " + instID.ToString());
                }
            }
        }
示例#7
0
 public static SQLInstance Get(string name)
 {
     return(name.IsNullOrEmpty()
                ? null
                : AllInstances.FirstOrDefault(i => i.Name.ToLower() == name.ToLower()));
 }
示例#8
0
 public static bool IsSQLServer(string server)
 {
     return(AllInstances.Any(i => string.Equals(i.Name, server, StringComparison.InvariantCultureIgnoreCase)));
 }
示例#9
0
 public Dictionary <CodeBag, IEnumerable <Instance> > ByNamespace()
 {
     return(Graph.AllNamespaces.ToDictionary(ns => ns, ns => AllInstances.Where(x => x.CodeBag.Equals(ns))));
 }
示例#10
0
 public int LinesOfCode() => AllInstances.Sum(c => c.LinesOfCode);
示例#11
0
 public double AbsoluteToxicity()
 {
     return(AllInstances.Sum(c => c.Toxicity));
 }
示例#12
0
 public bool OnUnload()
 {
     AllInstances.Remove(this);
     ChatID = null;
     return(true);
 }
示例#13
0
 public static SQLInstance Get(string name)
 {
     return(AllInstances.FirstOrDefault(i => string.Equals(i.Name, name, StringComparison.InvariantCultureIgnoreCase)));
 }