Beispiel #1
0
        public IEnumerable <DocumentoRepositorio> BuscarDocumentosExpediente(IEnumerable <string> referencias, IEnumerable <string> nombreDocumentos)
        {
            List <DocumentoRepositorio> resultado = new List <DocumentoRepositorio>();
            StringBuilder busquedaStr             = new StringBuilder();

            foreach (string referencia in referencias)
            {
                busquedaStr.Append("({LF:Name=\"" + referencia + "\", Type=\"F\" } & ({LF:ParentName=\"IMPO\"}|{LF:ParentName=\"EXPO\"})) |");
            }
            busquedaStr.Remove(busquedaStr.Length - 1, 1);

            Search busqueda = new Search(Sesion, busquedaStr.ToString());

            busqueda.Run();

            SearchListingSettings configuracionResultadoBusqueda = new SearchListingSettings();

            configuracionResultadoBusqueda.EntryFilter = EntryTypeFilter.Folders;

            SearchResultListing resultadosBusqueda = busqueda.GetResultListing(configuracionResultadoBusqueda);

            //Atencion: Este listado esta en base 1
            for (int i = 1; i <= resultadosBusqueda.RowCount; i++)
            {
                EntryInfo informacionEntrada = resultadosBusqueda.GetEntryInfo(i);
                ExplorarDirectorio(informacionEntrada, informacionEntrada.Name, ref resultado);
            }

            busqueda.Close();



            return(resultado);
        }
        public void Clear()
        {
            if (m_size <= 0)
            {
                return;
            }

            Debug.Assert(m_buckets != null);
            Debug.Assert(m_entries != null);
            Debug.Assert(m_entriesInfo != null);
            Debug.Assert(m_entries.Length == m_entriesInfo.Length);

            for (int i = 0; i < m_buckets.Length; i++)
            {
                m_buckets[i] = -1;
            }

            for (int i = 0; i < m_entries.Length; i++)
            {
                m_entries[i]     = null;
                m_entriesInfo[i] = new EntryInfo((i < m_entries.Length - 1) ? i + 1 : -1);
            }

            m_size = 0;
            m_free = 0;

            unchecked
            {
                m_version++;
            }
        }
        private void RemoveCore(int bucket, int index, int previous)
        {
            Debug.Assert((bucket >= 0) && (bucket < m_buckets.Length));
            Debug.Assert((index >= 0) && (index < m_entries.Length));
            Debug.Assert(previous < m_entries.Length);

            var next = m_entriesInfo[index].Next;

            if (m_buckets[bucket] == index)
            {
                Debug.Assert(previous < 0);

                m_buckets[bucket] = next;
            }
            else
            {
                Debug.Assert(previous >= 0);
                Debug.Assert(m_entriesInfo[previous].Next == index);

                m_entriesInfo[previous] = m_entriesInfo[previous].SetNext(next);
            }

            m_entries[index]     = null;
            m_entriesInfo[index] = new EntryInfo(m_free);
            m_free = index;
            m_size--;

            unchecked
            {
                m_version++;
            }
        }
 public CatalogLoader(CatalogDB db, IEnumerable <Type> possibleTypes)
 {
     this.db = db;
     foreach (Type t in possibleTypes)
     {
         string   name  = t.Name;
         object[] attrs = t.GetCustomAttributes(typeof(CatalogEntryInfo), false);
         if (attrs.Length > 0)
         {
             name = ((CatalogEntryInfo)attrs[0]).name;
         }
         EntryInfo             info = new EntryInfo(t);
         List <EntryFieldInfo> efi  = new List <EntryFieldInfo>();
         //Debug.Log( name );
         foreach (FieldInfo fld in t.GetFields())
         {
             foreach (CatalogLoaded attr in fld.GetCustomAttributes(typeof(CatalogLoaded), false).Cast <CatalogLoaded>())
             {
                 efi.Add(new EntryFieldInfo(fld, attr.name != null?attr.name:fld.Name));
                 //Debug.Log( "\t"+attr.name!=null?attr.name:fld.Name );
             }
         }
         info.fields = efi.ToArray();
         loadTags.Add(name, info);
         tagNames.Add(t, name);
     }
 }
 public DefProcessor_IV(
     Dictionary<ushort, SectionInfo> textAndDataSections,
     ushort sectionIndex,
     EntryInfo<SYMBOL_ENTRY>[] symEntries)
     : base(textAndDataSections, sectionIndex, symEntries)
 {
 }
Beispiel #6
0
        public bool GetEntryInfo(Entry.DataUsages dataUsage, int usageIndex, out EntryInfo info)
        {
            info = new EntryInfo();

            uint previousStream = 0;

            foreach (Entry entry in Entries)
            {
                if (entry.Stream != previousStream)
                {
                    info.offset = 0;
                }

                info.streamIndex = (int)entry.Stream;

                if (entry.DataUsage == dataUsage && entry.DataUsageIndex == usageIndex)
                {
                    info.dataType = entry.DataType;
                    return(true);
                }

                //increment offset
                info.offset += Entry.GetDataTypeSize(entry.DataType);

                //set previous stream for next iteration
                previousStream = entry.Stream;
            }

            return(false);
        }
Beispiel #7
0
        private XmlElement AddNewEntry(EntryInfo entry)
        {
            var parentNode = _xmlDocument.CreateElement(Resources.Service_entry);
            Dictionary <string, string> entryDictionary = new Dictionary <string, string>
            {
                { Resources.Service_FullName, entry.FullName },
                { Resources.Service_Creation_Time, entry.CreationTime.ToString(CultureInfo.InvariantCulture) },
                { Resources.Service_Last_Data_Access_Time, entry.LastDataAccessTime.ToString(CultureInfo.InvariantCulture) },
                { Resources.Services_Modification_Time, entry.ModificationTime.ToString(CultureInfo.InvariantCulture) },
                { Resources.Services_Size, entry.Size },
                { Resources.Services_Owner, entry.Owner },
                { Resources.Services_Permissions, entry.Permissions.ToString() }
            };

            try
            {
                foreach (var entryElement in entryDictionary)
                {
                    XmlElement newElement = _xmlDocument.CreateElement(entryElement.Key);
                    newElement.InnerText = entryElement.Value;
                    parentNode.AppendChild(newElement);
                }
            }
            catch (Exception ex)
            {
                _helpers.WriteToLog(Resources.Error, ex.Message);
            }
            return(parentNode);
        }
Beispiel #8
0
        /// <inheritdoc />
        protected override Task <EntityTag> GetDeadETagAsync(IEntry entry, CancellationToken cancellationToken)
        {
            var       storeData = Load(entry, false, cancellationToken);
            var       entryKey  = GetEntryKey(entry);
            EntryInfo info;

            if (!storeData.Entries.TryGetValue(entryKey, out info))
            {
                info = new EntryInfo();
                storeData.Entries.Add(entryKey, info);
            }

            XElement etagElement;

            if (!info.Attributes.TryGetValue(_etagKey, out etagElement))
            {
                var etag = new EntityTag(false);
                etagElement = etag.ToXml();
                info.Attributes[_etagKey] = etagElement;

                Save(entry, storeData, cancellationToken);

                return(Task.FromResult(etag));
            }

            return(Task.FromResult(EntityTag.FromXml(etagElement)));
        }
Beispiel #9
0
        ///<inheritdoc/>
        public string GenerateNext(long chunkSize)
        {
            var builder = new StringBuilder();

            var chunkInfo = _chunkInfoBuilder.Build(chunkSize);

            builder.Clear();

            // Generate first entry that string will be repeated
            var firstNumber  = GenerateNumber(chunkInfo.RepeatedEntry.NumberLength);
            var lineToRepeat = _randomStringGenerator.Generate(chunkInfo.RepeatedEntry.LineLength);

            builder.AppendLine(EntryInfo.BuildEntry(firstNumber, lineToRepeat));

            foreach (var entryInfo in chunkInfo.EntryInfos)
            {
                var number = GenerateNumber(entryInfo.NumberLength);
                var line   = _randomStringGenerator.Generate(entryInfo.LineLength);
                builder.AppendLine(EntryInfo.BuildEntry(number, line));
            }

            // Generate last entry with repeated string
            var lastNumber = GenerateNumber(chunkInfo.RepeatedEntry.NumberLength);

            builder.AppendLine(EntryInfo.BuildEntry(lastNumber, lineToRepeat));

            return(builder.ToString());
        }
        public EntryInfo GetEntry(Java.Util.Date p0, int p1, string p2)
        {
            EntryInfo result = new EntryInfo();

            result.Text = p2;
            return(result);
        }
        /// <summary>
        /// Add an entry to the buffer
        /// </summary>
        /// <param name="tag">User tag to identify the entry, may be null</param>
        /// <param name="data">User disposable data to hold for this entry, may be null</param>
        /// <param name="matrix">Matrix to store</param>
        /// <param name="generation">Generation of matrix</param>
        /// <returns>return position added as index.</returns>

        public int Add(Object tag, IDisposable data, Matrix4 matrix, uint generation)
        {
            var entry = new EntryInfo()
            {
                tag = tag, data = data, generation = generation, empty = false
            };

            int pos = Deleted > 0 ? entries.FindIndex(x => x.empty) : -1;     // find an empty slot if any deleted

            if (pos == -1)
            {
                System.Diagnostics.Debug.Assert(Deleted == 0);
                System.Diagnostics.Debug.Assert(entries.Count < Max); // the caller should manage not overfilling
                pos = entries.Count;                                  // not found, so make a fresh one at end
                entries.Add(entry);
            }
            else
            {
                Deleted--;
                entries[pos] = entry;                               // set empty slot to active
            }

            //System.Diagnostics.Debug.WriteLine("Pos {0} Matrix {1}", pos, mat);
            matrix[0, 3] = pos;     // store pos of image in stack

            MatrixBuffer.StartWrite(GLLayoutStandards.Mat4size * pos, GLLayoutStandards.Mat4size);
            MatrixBuffer.Write(matrix);
            MatrixBuffer.StopReadWrite();

            //float[] stored = MatrixBuffer.ReadFloats(GLLayoutStandards.Mat4size * pos, 16, true);
            return(pos);
        }
        private void AddCore(TKey key, TValue value)
        {
            Debug.Assert(!object.ReferenceEquals(key, null));

            this.EnsureCapacity();
            Debug.Assert(m_buckets != null);
            Debug.Assert(m_entries != null);
            Debug.Assert(m_entriesInfo != null);
            Debug.Assert(m_free >= 0);

            var index    = m_free;
            var hashCode = m_comparer.GetHashCode(key);
            var bucket   = this.GetBucket(hashCode);

            m_free               = m_entriesInfo[index].Next;
            m_entries[index]     = m_creator.Invoke(key, value);
            m_entriesInfo[index] = new EntryInfo(hashCode, m_buckets[bucket]);
            m_buckets[bucket]    = index;
            m_size++;

            unchecked
            {
                m_version++;
            }
        }
 private void ClearEntries()
 {
     m_SelectedInfo = null;
     m_EntryInfos.Clear();
     m_FilteredInfos.Clear();
     m_LastEntryCount = -1;
     m_TypeCounts     = new[] { 0, 0, 0 };
 }
Beispiel #14
0
 public AdFilter()
 {
     htmlParser.AddOmitTags(new List<string>() { "<br>", "</br>" });
     Body = string.Empty;
     toString = string.Empty;
     Date = new DateTime();
     info = null;
 }
Beispiel #15
0
        private void UpdateInfo(IEntry entry, EntryInfo info, CancellationToken cancellationToken)
        {
            var storeData = Load(entry, true, cancellationToken);
            var entryKey  = GetEntryKey(entry);

            storeData.Entries[entryKey] = info;
            Save(entry, storeData, cancellationToken);
        }
 protected virtual bool OnEntryFound(EntryInfo info)
 {
     if (EntryFound != null)
     {
         EntryFound(this, info);
         return true;
     }
     return false;
 }
Beispiel #17
0
        /// <summary>
        /// Obtiene los directorios contenidos en una carpeta de repositorio asincrónicamente
        /// </summary>
        /// <param name="directorio">Objeto que representa una carpeta</param>
        /// <param name="sesion">Objeto de sesión del repositorio</param
        ///
        /// <returns>Lista de documentos</returns>
        public static Task <IEnumerable <DocumentoRepositorio> > ExtraerDirectoriosAsync(this DocumentoRepositorio directorio, object sesion = null)
        {
            if (!directorio.Directorio)
            {
                throw new Exception("No es directorio");
            }

            return(Task.Run <IEnumerable <DocumentoRepositorio> >(() =>
            {
                if (directorio.Repositorio == Repositorio.Laserfiche)
                {
                    FolderInfo directorioAsociado = (FolderInfo)directorio.DocumentoAsociado;
                    var ens = new EntryListingSettings();
                    ens.EntryFilter = EntryTypeFilter.Folders;
                    ens.AddColumn(SystemColumn.Name);
                    ens.AddColumn(SystemColumn.Uuid);
                    FolderListing listado = directorioAsociado.OpenFolderListing(ens);

                    List <DocumentoRepositorio> documentoRepositorios = new List <DocumentoRepositorio>();


                    for (int registro = 1; registro <= listado.RowCount; registro++)
                    {
                        DocumentoRepositorio documentoRepositorio = new DocumentoRepositorio();
                        EntryInfo informacionEntrada = listado.GetEntryInfo(registro);



                        documentoRepositorio.Directorio = informacionEntrada.EntryType == EntryType.Folder;
                        DocumentInfo documentInfo = null;
                        FolderInfo folderInfo = null;
                        if (documentoRepositorio.Directorio)
                        {
                            folderInfo = Folder.GetFolderInfo(informacionEntrada.Id, (Session)sesion);
                            documentoRepositorio.DocumentoAsociado = folderInfo;
                        }
                        else
                        {
                            documentInfo = Document.GetDocumentInfo(informacionEntrada.Id, (Session)sesion);
                            documentoRepositorio.DocumentoAsociado = documentInfo;
                        }
                        documentoRepositorio.Repositorio = Repositorio.Laserfiche;
                        documentoRepositorio.Nombre = documentoRepositorio.Directorio ? folderInfo.Name : documentInfo.Name;
                        //documentoRepositorio.Plantilla = documentInfo.TemplateName;
                        documentoRepositorio.Ruta = folderInfo.Path;
                        documentoRepositorios.Add(documentoRepositorio);
                    }


                    return documentoRepositorios;
                }

                return new List <DocumentoRepositorio>();
            }));
        }
            private void SearchIndexToTagIndex(EntryInfo entryInfo, int searchLength)
            {
                if (entryInfo.searchIndex == -1)
                {
                    return;
                }

                entryInfo.searchEndIndex = GetOriginalCharIndex(entryInfo.searchIndex + searchLength,
                                                                entryInfo.tagPosInfos);
                entryInfo.searchIndex = GetOriginalCharIndex(entryInfo.searchIndex, entryInfo.tagPosInfos);
            }
            public int SetSelectedEntry(int row)
            {
                m_SelectedInfo = null;
                if (row < 0 || row >= m_FilteredInfos.Count)
                {
                    return(0);
                }

                m_SelectedInfo = m_FilteredInfos[row];
                return(m_SelectedInfo.entry.instanceID);
            }
Beispiel #20
0
        private async void deleteItem_Click(object sender, RoutedEventArgs e)
        {
            EntryInfo info = ((FrameworkElement)sender).DataContext as EntryInfo;
            await FileHistory.DeleteFromHistory(info.Key);

            if (Windows.UI.StartScreen.SecondaryTile.Exists(info.Key))
            {
                SecondaryTile st = new SecondaryTile(info.Key);
                await st.RequestDeleteAsync();
            }
            _history.Entries = await FileHistory.GetHistoryEntriesInfo();
        }
Beispiel #21
0
            public override bool Equals(object obj)
            {
                EntryInfo other = (EntryInfo)obj;

                return(String.Equals(this.Id, other.Id) &&
                       (this.Priority == other.Priority) &&
                       String.Equals(this.Status, other.Status) &&
                       (this.TotalBytes == other.TotalBytes) &&
                       (this.Holders == other.Holders) &&
                       (this.OldBitmaps == other.OldBitmaps) &&
                       (this.CanDispose == other.CanDispose));
            }
Beispiel #22
0
        public static EntryInfo GetEntryInfo(string path)
        {
            FileSystemInfo entry = IsDirectory(path)
               ? (FileSystemInfo) new DirectoryInfo(path)
               : new FileInfo(path);

            var entryInfo = new EntryInfo
            {
                Name               = entry.Name,
                FullName           = entry.FullName,
                CreationTime       = entry.CreationTime,
                LastDataAccessTime = entry.LastAccessTime,
                ModificationTime   = entry.LastWriteTime,
                Owner              = IsDirectory(path)
                    ? Directory.GetAccessControl(path).GetOwner(typeof(NTAccount)).ToString()
                    : File.GetAccessControl(path).GetOwner(typeof(NTAccount)).ToString()
            };

            try
            {
                FileSystemSecurity security;
                if (IsDirectory(path))
                {
                    var directory   = (DirectoryInfo)entry;
                    var directories = directory.GetFiles();
                    var filesLength = directories.Select(fileInfo => fileInfo.Length);
                    entryInfo.Size = filesLength.Sum().ToString();

                    security = directory.GetAccessControl();
                }
                else
                {
                    var file = (FileInfo)entry;
                    entryInfo.Size = file.Length.ToString();
                    security       = file.GetAccessControl();
                }
                foreach (FileSystemAccessRule rule in
                         security.GetAccessRules(true, true, typeof(NTAccount)))
                {
                    entryInfo.Permissions = rule.FileSystemRights;
                    return(entryInfo);
                }
            }
            catch (UnauthorizedAccessException)
            {
                entryInfo.Size = Resources.Access_Denided;
            }
            catch (Exception ex)
            {
                WriteToLog(Resources.Error_message, ex.Message);
            }
            return(entryInfo);
        }
Beispiel #23
0
        public static IEnumerable <DocumentoRepositorio> RecuperarDocumentos(this DocumentoRepositorio directorio, Session sesion)
        {
            if (!directorio.Directorio)
            {
                throw new Exception("No es directorio");
            }


            if (directorio.Repositorio == Repositorio.Laserfiche)
            {
                FolderInfo directorioAsociado = (FolderInfo)directorio.DocumentoAsociado;
                var        ens = new EntryListingSettings();
                ens.EntryFilter = EntryTypeFilter.Documents;
                ens.AddColumn(SystemColumn.Name);
                ens.AddColumn(SystemColumn.Uuid);
                FolderListing listado = directorioAsociado.OpenFolderListing(ens);

                List <DocumentoRepositorio> documentoRepositorios = new List <DocumentoRepositorio>();

                DocumentoRepositorio documentoRepositorio = new DocumentoRepositorio();

                for (int registro = 1; registro <= listado.RowCount; registro++)
                {
                    EntryInfo informacionEntrada = listado.GetEntryInfo(registro);



                    documentoRepositorio.Directorio = informacionEntrada.EntryType == EntryType.Folder;
                    DocumentInfo documentInfo = null;
                    FolderInfo   folderInfo   = null;
                    if (documentoRepositorio.Directorio)
                    {
                        folderInfo = Folder.GetFolderInfo(informacionEntrada.Id, sesion);
                        documentoRepositorio.DocumentoAsociado = folderInfo;
                    }
                    else
                    {
                        documentInfo = Document.GetDocumentInfo(informacionEntrada.Id, sesion);
                        documentoRepositorio.DocumentoAsociado = documentInfo;
                    }
                    documentoRepositorio.Repositorio = Repositorio.Laserfiche;
                    documentoRepositorio.Nombre      = documentoRepositorio.Directorio ? folderInfo.Name : documentInfo.Name;
                    documentoRepositorio.Plantilla   = documentInfo.TemplateName;
                    documentoRepositorios.Add(documentoRepositorio);
                }


                return(documentoRepositorios);
            }

            return(new List <DocumentoRepositorio>());
        }
Beispiel #24
0
        static void Test1()
        {
#if NET20
            //---------------------------------------------------------------------------
            string testfile = @"d:\\WImageTest\\testdb.dat";
            //test store in the same file name
            EntryInfo en1 = FileDB.Store(testfile, "/usr/test/d1/aaaaaaaaa/bbbbbbbbb/ccccccccddddddddddddddd.a.txt", GenerateTestDataBuffer("hello!...1"));
            EntryInfo en2 = FileDB.Store(testfile, "/usr/test/d1/aaaaaaaaa/bbbbbbbbb/ccccccccddddddddddddddd.a.txt", GenerateTestDataBuffer("hello!...2"));
            EntryInfo en3 = FileDB.Store(testfile, "/usr/test/d1/aaaaaaaaa/bbbbbbbbb/ccccccccddddddddddddddd.a.txt", GenerateTestDataBuffer("hello!...3"));
            EntryInfo en4 = FileDB.Store(testfile, "/usr/test/d1/aaaaaaaaa/bbbbbbbbb/ccccccccddddddddddddddd.a.txt", GenerateTestDataBuffer("hello!...4"));
            EntryInfo en5 = FileDB.Store(testfile, "/usr/test/d1/aaaaaaaaa/bbbbbbbbb/ccccccccddddddddddddddd.a.txt", GenerateTestDataBuffer("hello!...5"));
            //---------------------------------------------------------------------------
            EntryInfo[] fileList = FileDB.ListFiles(testfile);

            using (MemoryStream ms = new MemoryStream())
            {
                //test read file and metadata
                //EntryInfo enInfo = FileDB.Read(testfile, en5.ID, ms);

                FileDB.ReadFileContent(testfile, fileList[0], ms);
                string content = System.Text.Encoding.UTF8.GetString(ms.ToArray());

                //read only file metadata
                //EntryInfo enInfo = FileDB.ReadMetadata(testfile, en5.ID);


                ms.Close();
            }

            //foreach (var f in fileList)
            //{
            //    FileDB.Delete(testfile, en1.ID);
            //}
            //---------------------------------------------------------------------------
            fileList = FileDB.ListFiles(testfile);
#else
            //
            // Parallel Insert
            //
            string   dbFile = @"C:\Temp\MvcDemo.dat";
            string[] files  = new string[] {
                @"C:\Temp\DSC04901.jpg", @"C:\Temp\DSC04902.jpg", @"C:\Temp\ZipFile.zip"
            };
            Parallel.For(0, 3, (i) =>
            {
                Console.WriteLine("Starting " + Path.GetFileName(files[i]));
                FileDB.Store(dbFile, files[i]);
                Console.WriteLine("Ended " + Path.GetFileName(files[i]));
            });
            Console.ReadLine();
#endif
        }
 public override void SaveData(string dataName, byte[] content)
 {
     lock (_filelock)
     {
         using (System.IO.MemoryStream ms = new System.IO.MemoryStream(content))
         {
             EntryInfo en = filedb.Store(dataName, ms);
             filedb.Flush();
             //then replace
             _allFiles[dataName] = en;
         }
     }
 }
Beispiel #26
0
        private EntryInfo GetInfo(IEntry entry, CancellationToken cancellationToken)
        {
            var storeData = Load(entry, false, cancellationToken);

            EntryInfo info;

            if (!storeData.Entries.TryGetValue(GetEntryKey(entry), out info))
            {
                info = new EntryInfo();
            }

            return(info);
        }
        public void TestEntryInfo()
        {
            string     name       = "TestEntryInfo";
            NtType     type       = NtType.Boolean;
            EntryFlags flags      = EntryFlags.Persistent;
            long       lastChange = 55;

            EntryInfo info = new EntryInfo(name, type, flags, lastChange);

            Assert.That(info.Name, Is.EqualTo(name));
            Assert.That(info.Type, Is.EqualTo(type));
            Assert.That(info.Flags, Is.EqualTo(flags));
            Assert.That(info.LastChange, Is.EqualTo(lastChange));
        }
            public string GetEntryLinesAndFlagAndCount(int row, ref int consoleFlag, ref int entryCount, ref int searchIndex, ref int searchEndIndex)
            {
                if (row < 0 || row >= m_FilteredInfos.Count)
                {
                    return(String.Empty);
                }

                EntryInfo entryInfo = m_FilteredInfos[row];

                consoleFlag    = (int)entryInfo.flags;
                entryCount     = entryInfo.entryCount;
                searchIndex    = entryInfo.searchIndex;
                searchEndIndex = entryInfo.searchEndIndex;
                return(entryInfo.text);
            }
        protected override HookResult OnDrawLogEntry(EntryInfo entry)
        {
            // make selected entry a button
            if (entry.IsSelected)
            {
                if (GUI.Button(entry.DrawPosition, "Hooked!"))
                {
                    Debug.Log("Hooked Row " + entry.RowNumber);
                }

                return(HookResult.Hooked);
            }

            return(HookResult.Default);
        }
Beispiel #30
0
        protected override HookResult OnDrawLogEntry(EntryInfo entry)
        {
            // make selected entry a button
            if (entry.IsSelected)
            {
                if (GUI.Button(entry.DrawPosition, "Hooked!"))
                {
                    Debug.Log("Hooked Row " + entry.RowNumber);
                }

                return HookResult.Hooked;
            }

            return HookResult.Default;
        }
            private void StacktraceListView_Parse(EntryInfo entryInfo)
            {
                var lines = entryInfo.entry.condition.Split(new char[] { '\n' }, StringSplitOptions.None);

                entryInfo.stacktraceLineInfos = new List <StacktraceLineInfo>(lines.Length);

                string rootDirectory        = System.IO.Path.Combine(Application.dataPath, "..");
                Uri    uriRoot              = new Uri(rootDirectory);
                string textBeforeFilePath   = ") (at ";
                string textUnityEngineDebug = "UnityEngine.Debug";

#if UNITY_2019_1_OR_NEWER
                string fileInBuildSlave = "D:/unity/";
#else
                string fileInBuildSlave = "C:/buildslave/unity/";
#endif
                string luaCFunction    = "[C]";
                string luaMethodBefore = ": in function ";
                string luaFileExt      = ".lua";
                string luaAssetPath    = "Assets/Lua/";
                for (int i = 0; i < lines.Length; i++)
                {
                    var line = lines[i];
                    if (i == lines.Length - 1 && string.IsNullOrEmpty(line))
                    {
                        continue;
                    }
                    if (line.StartsWith(textUnityEngineDebug))
                    {
                        continue;
                    }

                    StacktraceLineInfo info = new StacktraceLineInfo();
                    info.plain = line;
                    info.text  = info.plain;
                    entryInfo.stacktraceLineInfos.Add(info);

                    if (i == 0)
                    {
                        continue;
                    }

                    if (!StacktraceListView_Parse_CSharp(line, info, textBeforeFilePath, fileInBuildSlave, uriRoot))
                    {
                        StacktraceListView_Parse_Lua(line, info, luaCFunction, luaMethodBefore, luaFileExt, luaAssetPath);
                    }
                }
            }
Beispiel #32
0
 private void ItemGridView_Holding(object sender, HoldingRoutedEventArgs e)
 {
     if (e.HoldingState == Windows.UI.Input.HoldingState.Started)
     {
         EntryInfo info = ((FrameworkElement)sender).DataContext as EntryInfo;
         if (Windows.UI.StartScreen.SecondaryTile.Exists(info.Key))
         {
             pinItem.Text = App.Localizer.GetString("Unpin/Text");
         }
         else
         {
             pinItem.Text = App.Localizer.GetString("Pin/Text");
         }
         FlyoutBase.ShowAttachedFlyout((FrameworkElement)sender);
     }
 }
Beispiel #33
0
        protected override HookResult OnTaggingLogEntry(EntryInfo entry, out string tag, out TagColor tagColor)
        {
            tag = null;
            tagColor = TagColor.Cyan;

            // tag even odd row orange and change tag text.
            if (entry.RowNumber % 2 == 1)
            {
                tag = "Odd!";
                tagColor = TagColor.Orange;

                return HookResult.Hooked;
            }

            return HookResult.Default;
        }
        protected override HookResult OnColoringLogEntry(EntryInfo entry, out Color color)
        {
            color = default(Color);

            // make even row green
            if (entry.RowNumber % 2 == 0)
            {
                color = Color.green;

                // notify color is hooked.
                return(HookResult.Hooked);
            }

            // use default behaviour;
            return(HookResult.Default);
        }
        protected override HookResult OnTaggingLogEntry(EntryInfo entry, out string tag, out TagColor tagColor)
        {
            tag      = null;
            tagColor = TagColor.Cyan;

            // tag even odd row orange and change tag text.
            if (entry.RowNumber % 2 == 1)
            {
                tag      = "Odd!";
                tagColor = TagColor.Orange;

                return(HookResult.Hooked);
            }

            return(HookResult.Default);
        }
Beispiel #36
0
        protected override HookResult OnColoringLogEntry(EntryInfo entry, out Color color)
        {
            color = default(Color);

            // make even row green
            if (entry.RowNumber % 2 == 0)
            {
                color = Color.green;

                // notify color is hooked.
                return HookResult.Hooked;
            }

            // use default behaviour;
            return HookResult.Default;
        }
 //        protected override HookResult OnColoringLogEntry(EntryInfo entry, out Color color)
 //        {
 //            color = default(Color);
 //
 //            // make even row green
 //            if (entry.RowNumber % 2 == 0)
 //            {
 //                color = Color.green;
 //
 //                // notify color is hooked.
 //                return HookResult.Hooked;
 //            }
 //
 //            // use default behaviour;
 //            return HookResult.Default;
 //        }
 //        protected override HookResult OnTaggingLogEntry(EntryInfo entry, out string tag, out TagColor tagColor)
 //        {
 //            tag = null;
 //            tagColor = TagColor.Cyan;
 //
 //            // tag even odd row orange and change tag text.
 //            if (entry.RowNumber % 2 == 1)
 //            {
 //                tag = "Odd!";
 //                tagColor = TagColor.Orange;
 //
 //                return HookResult.Hooked;
 //            }
 //
 //            return HookResult.Default;
 //        }
 //        protected override HookResult OnDrawLogEntry(EntryInfo entry)
 //        {
 //            return HookResult.Default;
 //        }
 protected override HookResult OnOpenExternalEditor(EntryInfo entry)
 {
     //            if (Application.platform == RuntimePlatform.WindowsEditor)
     //            {
     //				UnityEditor.EditorUtility.OpenWithDefaultApp( entry.FileName );
     //			}
     //            else if (Application.platform == RuntimePlatform.OSXEditor)
     //            {
     //				UnityEditor.EditorUtility.OpenWithDefaultApp( entry.FileName );
     //            }
     //            else
     //            {
     //                return HookResult.Default;
     //            }
     //
     return HookResult.Hooked;
 }
Beispiel #38
0
        protected override HookResult OnOpenExternalEditor(EntryInfo entry)
        {
            if (Application.platform == RuntimePlatform.WindowsEditor)
            {
                // pass editor's executable path and command line args.
                OpenExternalApplication("notepad.exe", entry.FileName);
            }
            else if (Application.platform == RuntimePlatform.OSXEditor)
            {
                OpenExternalApplication("mi",
                    string.Format("\"{0}:{1}\"", entry.FileName, entry.LineNumber));
            }
            else
            {
                return HookResult.Default;
            }

            // return hooked to turn it on.
            return HookResult.Hooked;
        }
        protected void OnEntryFound(BaseBackgroundPoller poller, EntryInfo info)
        {
            List<string> lastFiveSearched = null;
            if (!areaLastFiveSearched.TryGetValue(poller.PollerAreaDetails, out lastFiveSearched) || lastFiveSearched.Contains(info.URL))
            {
                poller.EntryFound -= this._entryFoundHandler;
                return;
            }

            lastFiveSearched.Insert(0, info.URL);
        }
 protected void OnEntryParsed(BaseBackgroundPoller poller, EntryInfo info)
 {
     if (this.wbEntries.InvokeRequired)
         this.wbEntries.Invoke(new MethodInvoker(delegate() { OnEntryParsed(poller, info); }));
     else
     {
         try
         {
             string body = info.Body.ToLower();
             string title = info.Title.ToLower();
             foreach (string key in keywords)
             {
                 if (body.Contains(key) || title.Contains(key))
                 {
                     string output = String.Format(CLWTabPage.entryFormat, info.ToString());
                     this.wbEntries.Document.Write(output);
                     if (this.wbEntries.Document.Body != null)
                         this.wbEntries.Document.Window.ScrollTo(0, this.wbEntries.Document.Body.ScrollRectangle.Bottom);
                     Application.DoEvents();
                     UpdateEntriesFound();
                     break;
                 }
             }
             UpdateEntriesSearched();
         }
         catch (System.Exception ex)
         {
             Logger.Instance.Log(ex.ToString() + ": " + info, LogType.ltError);
         }
     }
 }
Beispiel #41
0
        public void ReadDirectory()
        {
            var reader = new DataReader(FileData, _startOffset, _dataLen);
            int numEntries = reader.ReadInt32();

            for (int entry = 0; entry < numEntries; ++entry) {
                if (EngineVersion.ReturnToArms == _engineVersion)
                {
                    int stringOffset = reader.ReadInt32();
                    int dataOffset = reader.ReadInt32();
                    int dataLength = reader.ReadInt32();

                    var tempOffset = reader.Offset;
                    reader.SetOffset(stringOffset);
                    var name = reader.ReadZString();
                    reader.SetOffset(tempOffset);

                    var info = new EntryInfo() { Name = name, StartOffset = dataOffset + _startOffset, Length = dataLength };
                    Directory[name] = info;
                }
                else
                {
                    int headerOffset = _startOffset + 4 + entry * 64;
                    String subfileName = DataUtil.GetString(FileData, headerOffset);

                    int subOffset = BitConverter.ToInt32(FileData, headerOffset + 56);
                    int subLen = BitConverter.ToInt32(FileData, headerOffset + 60);

                    var info = new EntryInfo()
                    {Name = subfileName, StartOffset = subOffset + _startOffset, Length = subLen};
                    Directory[subfileName] = info;
                }
            }
        }
 private void OnEntryFound(EntryInfo entry)
 {
     lock (onEntryFoundLock)
     {
         if (EntryFound != null)
             EntryFound(entry);
     }
 }
Beispiel #43
0
 protected void OnEntryFound(BaseBackgroundPoller poller, EntryInfo info)
 {
 }
 protected new void OnEntryParsed(EntryInfo info, ParseFilter filter)
 {
     lock (EntryParsedLock)
     {
         BaseBackgroundPoller.EntryParsedHandler handler = null;
         if (entryCallbacks.TryGetValue(info.URL, out handler))
             handler(this, info);
         if (++entriesSearched == numEntriesToSearch)
             waitHandle.Set();
     }
 }
 protected new bool OnEntryFound(EntryInfo info)
 {
     lock (EntryFoundLock)
     {
         return base.OnEntryFound(info);
     }
 }
        internal static EntryInfo[] GetEntries(string prefix, NtType types)
        {
            UIntPtr size;
            byte[] str = CreateUTF8String(prefix, out size);
            UIntPtr arrSize = UIntPtr.Zero;
            IntPtr arr = Interop.NT_GetEntryInfo(str, size, (uint)types, ref arrSize);
            int entryInfoSize = Marshal.SizeOf(typeof(NtEntryInfo));
            int arraySize = (int)arrSize.ToUInt64();
            EntryInfo[] entryArray = new EntryInfo[arraySize];

            for (int i = 0; i < arraySize; i++)
            {
                IntPtr data = new IntPtr(arr.ToInt64() + entryInfoSize * i);
                NtEntryInfo info = (NtEntryInfo)Marshal.PtrToStructure(data, typeof(NtEntryInfo));
                entryArray[i] = new EntryInfo(info.name.ToString(), info.type, (EntryFlags)info.flags, (long)info.last_change);
            }
            Interop.NT_DisposeEntryInfoArray(arr, arrSize);
            return entryArray;
        }
Beispiel #47
0
        public IV_BASE(
            Dictionary<ushort, SectionInfo> textAndDataSections,
            ushort sectionIndex,
            EntryInfo<SYMBOL_ENTRY>[] symEntries)
        {
            _textAndDataSections = textAndDataSections;
            _sectionIndex = sectionIndex;
            _symEntries = symEntries;

            _section = _textAndDataSections[_sectionIndex];

            NeedsEndianSwap = false;
        }
Beispiel #48
0
 public void ParseURLAsync(ref EntryInfo info, CLWParseURLCompletedHandler handler)
 {
     this.info = info;
     ParseURLAsync(info, handler);
 }
Beispiel #49
0
 protected virtual void OnEntryParsed(BaseBackgroundPoller poller, EntryInfo info)
 {
 }
 protected void OnEntryFound(EntryInfo info, ParseFilter filter)
 {
     lock (EntryFoundLock)
     {
         entriesSearched++;
         if (EntryFound != null)
             EntryFound(info);
     }
 }
		public override bool onContextItemSelected(MenuItem item)
		{
			AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.MenuInfo;
			string logicalName = ((TextView) info.targetView).Text.ToString();

			switch (item.ItemId)
			{
			case R.id.context_modify_entry:
				int deviceCategory = bxlConfigLoader.getDeviceCategory(logicalName);
				string dc = null;
				switch (deviceCategory)
				{
				case BXLConfigLoader.DEVICE_CATEGORY_CASH_DRAWER:
					dc = Resources.getStringArray(R.array.device_categories)[0];
					break;

				case BXLConfigLoader.DEVICE_CATEGORY_MSR:
					dc = Resources.getStringArray(R.array.device_categories)[1];
					break;

				case BXLConfigLoader.DEVICE_CATEGORY_POS_PRINTER:
					dc = Resources.getStringArray(R.array.device_categories)[2];
					break;

				case BXLConfigLoader.DEVICE_CATEGORY_SMART_CARD_RW:
					dc = Resources.getStringArray(R.array.device_categories)[3];
					break;
				}

				int deviceBus = bxlConfigLoader.getDeviceBus(logicalName);
				string db = null;
				switch (deviceBus)
				{
				case BXLConfigLoader.DEVICE_BUS_BLUETOOTH:
					db = Resources.getStringArray(R.array.device_bus)[0];
					break;

				case BXLConfigLoader.DEVICE_BUS_ETHERNET:
					db = Resources.getStringArray(R.array.device_bus)[1];
					break;

				case BXLConfigLoader.DEVICE_BUS_USB:
					db = Resources.getStringArray(R.array.device_bus)[2];
					break;

				case BXLConfigLoader.DEVICE_BUS_WIFI:
					db = Resources.getStringArray(R.array.device_bus)[3];
					break;

				case BXLConfigLoader.DEVICE_BUS_WIFI_DIRECT:
					db = Resources.getStringArray(R.array.device_bus)[4];
					break;
				}

				EntryInfo entryInfo = new EntryInfo(logicalName, dc, bxlConfigLoader.getProductName(logicalName), db, bxlConfigLoader.getAddress(logicalName));
				EntryDialogFragment.showDialog(SupportFragmentManager, "Modify entry", entryInfo);
				return true;

			case R.id.context_remove_entry:
				if (bxlConfigLoader.removeEntry(logicalName))
				{
					arrayAdapter.remove(logicalName);
				}
				else
				{
					Toast.makeText(this, "Remove failed", Toast.LENGTH_SHORT).show();
				}
				return true;

			default:
				return base.onContextItemSelected(item);
			}
		}
		public virtual void onClick(bool isModified, EntryInfo entryInfo)
		{
			string[] deviceCategories = Resources.getStringArray(R.array.device_categories);
			int deviceCategory = 0;
			if (entryInfo.DeviceCategory.Equals(deviceCategories[0]))
			{
				deviceCategory = BXLConfigLoader.DEVICE_CATEGORY_CASH_DRAWER;
			}
			else if (entryInfo.DeviceCategory.Equals(deviceCategories[1]))
			{
				deviceCategory = BXLConfigLoader.DEVICE_CATEGORY_MSR;
			}
			else if (entryInfo.DeviceCategory.Equals(deviceCategories[2]))
			{
				deviceCategory = BXLConfigLoader.DEVICE_CATEGORY_POS_PRINTER;
			}
			else if (entryInfo.DeviceCategory.Equals(deviceCategories[3]))
			{
				deviceCategory = BXLConfigLoader.DEVICE_CATEGORY_SMART_CARD_RW;
			}

			string[] deviceBuses = Resources.getStringArray(R.array.device_bus);
			int deviceBus = 0;
			if (entryInfo.DeviceBus.Equals(deviceBuses[0]))
			{
				deviceBus = BXLConfigLoader.DEVICE_BUS_BLUETOOTH;
			}
			else if (entryInfo.DeviceBus.Equals(deviceBuses[1]))
			{
				deviceBus = BXLConfigLoader.DEVICE_BUS_ETHERNET;
			}
			else if (entryInfo.DeviceBus.Equals(deviceBuses[2]))
			{
				deviceBus = BXLConfigLoader.DEVICE_BUS_USB;
			}
			else if (entryInfo.DeviceBus.Equals(deviceBuses[3]))
			{
				deviceBus = BXLConfigLoader.DEVICE_BUS_WIFI;
			}
			else if (entryInfo.DeviceBus.Equals(deviceBuses[4]))
			{
				deviceBus = BXLConfigLoader.DEVICE_BUS_WIFI_DIRECT;
			}

			if (isModified)
			{
				bxlConfigLoader.modifyEntry(entryInfo.LogicalName, deviceBus, entryInfo.Address);
			}
			else
			{
				try
				{
					bxlConfigLoader.addEntry(entryInfo.LogicalName, deviceCategory, entryInfo.ProductName, deviceBus, entryInfo.Address);
					arrayAdapter.add(entryInfo.LogicalName);
				}
				catch (System.ArgumentException e)
				{
					Console.WriteLine(e.ToString());
					Console.Write(e.StackTrace);
					Toast.makeText(this, e.Message, Toast.LENGTH_SHORT).show();
				}
			}
		}