Example #1
0
        private void UpdateFileList()
        {
            ObservableCollection <WinFileModel> newList = new ObservableCollection <WinFileModel>();
            var path = CurrPath.Trim();

            if (path.EndsWith(@"\"))
            {
                path += '*';
            }
            else
            {
                if (!path.EndsWith(@"*"))
                {
                    path += @"\*";
                }
            }
            FileUtil.FileEnum(path, (x, b) =>
            {
                var str = Marshal.PtrToStringAuto(x);
                newList.Add(
                    new WinFileModel
                {
                    Name     = CurrPath + str,
                    IsFolder = b,
                });
                return(false);
            });
            FileList = newList;
        }
Example #2
0
        public ExpandableVertex(Vertex vertex, float cost, Path currPath)
        {
            this.Vertex   = vertex;
            this.Cost     = cost;
            this.CurrPath = new Path();
            Vertex v = null;

            // We got to copy our path manually, as it messes up when we try: this.CurrPath = currPath. It's a reference assignment somehow
            currPath.First();
            while (currPath.TryGetNextVertex(out v))
            {
                CurrPath.AddVertex(v);
            }
        }