SnippetOrganizer BETA 2

    • Beta

    Es gibt 40 Antworten in diesem Thema. Der letzte Beitrag () ist von MrLee.

      Ich würde das Dingens nachprogrammieren, wenns fertig ist. Den Snippet-Server als PHP5 kann ich aber sofort proggen :) In welcher Archivform willst dus am liebsten haben? Ich favorisiere für Text .tar.bz2 (gute Kompression, besonders wenn mehrere Dateien in einem Archiv sind), kann man das mit .net irgendwie entpacken?
      Die Idee gefällt mir. Insbesondere mit den Paketquellen. Ich wünsche mir für Windows ja immernoch ein Paketmanagement wie bei Linux. Wäre wesentlich einfacher, per MinGW was zu kompilieren. Einfach alle Build-Dependencys apt-getten :)
      @Mad Andy: Wenn du einen Python-GTK Nachbau programmierst, läuft das dann auch auf Windows mit installiertem Python und GTK+? Mir sagt der Mac-Style nämlich nicht wirklich zu, weil ich ihn nicht grade mag und das StyleSDK recht langsam ist. Aber ansonsten gutes Tool.

      Am besten wäre natürlich auch eine Updatemöglichkeit, damit die Autoren ihre Snippets aktualisieren können.
      Und ein paar Richtlinien wären auch praktisch - Dass oben Beschreibung und so weiter steht.
      Joar mit Apfel und Andy wurde, sag ich mal ein kleines DEV Team zusamm getrommelt was naja alles doofe beseitigt und naja der Mac Style, ne^^ love so... aba naja kann ja was einbauen zum Style switchen..^^

      Achja das StyleSDK kann man beschleunigen in dem man das abrunden ausschaltet und die schatten auch^^

      Keine PN's bezüglich VB an mich! Dafür gibt es das Forum!

      :Kreis hier. Kreis da.:

      Apfel schrieb:

      Ja, dass style, mein Freund.. Nö, eig.: Mein Feind :P
      Feind trifft es dann wohl schon eher :D

      Oder ihr macht das ganze eher modular, dass ihr eine Klassenbibliothek erstellt, die man in sein eigenes Projekt einbinden kann und sich so sein eigenes Frontend bauen kann.

      Wie soll dann eigentlich das php-Backend aussehen? Eher xml oder was anderes? Ich weiß leider nicht genau, wie das bei apt geregelt ist.
      Hi!

      Aaaaalso, der Python/GTK client funzt natürlich voarussichtlich auch unter Windows und MAC. Deps sind halt Python 2.x (nicht 3k!) und GTK. Ich versuche dann wohl das Design (also Struktur, Positionierung) dem Fensterstil von Mr Lee nachzubauen, jedoch mit GTK/Windoof Theme.
      Das PHP-Backend stellt (so weit vorgesehen) nur eine Liste (Links) von Downloads zu Verfügung. Dazu kommt hald noch die Version und ein Beschreibungstext. Die Dateien werden (imho) nicht einzeln runter geladen, sondern in Archiven, wodurch das ganze Struktuierter ist.

      Angedach wird das Erstellen mit RTF zu machen, und das ganze dann nach (X)HTML zu konvertieren.
      So ich hab da mal was gefunden bei CodeProject.com...
      Der Name von dem das is, steht drin, dieses Modul verwenden ich dann auch im SNippetOrganizer^^

      Viel Spass damit ^^

      VB.NET-Quellcode

      1. ''' <summary>
      2. ''' An object that converts RTF to HTML
      3. ''' </summary>
      4. ''' <remarks>
      5. ''' Completed: 11/02/2006
      6. ''' Author: George H. Slaterpryce III
      7. ''' Modifications: none
      8. ''' *************************************************************************
      9. ''' *************************************************************************
      10. ''' License: This code is free to use in private or commercial
      11. ''' applications, re-distribution of this code is allowed in whole
      12. ''' or in part so long as this header remains intact. All modifications
      13. ''' and further development to this code should be indicated by adding the
      14. ''' name of the author and the modifications/improvements under the
      15. ''' "Modifications:" section.
      16. ''' Modification Listings should be in the format of.
      17. ''' (#) Description of modification (Name, Date)
      18. ''' *************************************************************************
      19. ''' *************************************************************************
      20. ''' </remarks>
      21. Public Class RTFtoHTML
      22. #Region "Private Members"
      23. ' A RichTextBox control to use to help with parsing.
      24. Private _rtfSource As New System.Windows.Forms.RichTextBox
      25. #End Region
      26. #Region "Read/Write Properties"
      27. ''' <summary>
      28. ''' Returns/Sets The RTF formatted text to parse
      29. ''' </summary>
      30. Public Property rtf() As String
      31. Get
      32. Return _rtfSource.Rtf
      33. End Get
      34. Set(ByVal value As String)
      35. _rtfSource.Rtf = value
      36. End Set
      37. End Property
      38. #End Region
      39. #Region "ReadOnly Properties"
      40. ''' <summary>
      41. ''' Returns the HTML code for the provided RTF
      42. ''' </summary>
      43. Public ReadOnly Property html() As String
      44. Get
      45. Return GetHtml()
      46. End Get
      47. End Property
      48. #End Region
      49. #Region "Private Functions"
      50. ''' <summary>
      51. ''' Returns an HTML Formated Color string for the style from a system.drawing.color
      52. ''' </summary>
      53. ''' <param name="clr">The color you wish to convert</param>
      54. Private Function HtmlColorFromColor(ByRef clr As System.Drawing.Color) As String
      55. Dim strReturn As String = ""
      56. If clr.IsNamedColor Then
      57. strReturn = clr.Name.ToLower
      58. Else
      59. strReturn = clr.Name
      60. If strReturn.Length > 6 Then
      61. strReturn = strReturn.Substring(strReturn.Length - 6, 6)
      62. End If
      63. strReturn = "#" & strReturn
      64. End If
      65. Return strReturn
      66. End Function
      67. ''' <summary>
      68. ''' Provides the font style per given font
      69. ''' </summary>
      70. ''' <param name="fnt">The font you wish to convert</param>
      71. Private Function HtmlFontStyleFromFont(ByRef fnt As System.Drawing.Font) As String
      72. Dim strReturn As String = ""
      73. 'style
      74. If fnt.Italic Then
      75. strReturn &= "italic "
      76. Else
      77. strReturn &= "normal "
      78. End If
      79. 'variant
      80. strReturn &= "normal "
      81. 'weight
      82. If fnt.Bold Then
      83. strReturn &= "bold "
      84. Else
      85. strReturn &= "normal "
      86. End If
      87. 'size
      88. strReturn &= fnt.SizeInPoints & "pt/normal "
      89. 'family
      90. strReturn &= fnt.FontFamily.Name
      91. Return strReturn
      92. End Function
      93. ''' <summary>
      94. ''' Parses the given rich text and returns the html.
      95. ''' </summary>
      96. Private Function GetHtml() As String
      97. Dim strReturn As String = "<div>"
      98. Dim clrForeColor As System.Drawing.Color = Color.Black
      99. Dim clrBackColor As System.Drawing.Color = Color.Black
      100. Dim fntCurrentFont As System.Drawing.Font = _rtfSource.Font
      101. Dim altCurrent As System.Windows.Forms.HorizontalAlignment = HorizontalAlignment.Left
      102. Dim intPos As Integer = 0
      103. For intPos = 0 To _rtfSource.Text.Length - 1
      104. _rtfSource.Select(intPos, 1)
      105. 'Forecolor
      106. If intPos = 0 Then
      107. strReturn &= "<span style=""color:" & HtmlColorFromColor(_rtfSource.SelectionColor) & """>"
      108. clrForeColor = _rtfSource.SelectionColor
      109. Else
      110. If _rtfSource.SelectionColor <> clrForeColor Then
      111. strReturn &= "</span>"
      112. strReturn &= "<span style=""color:" & HtmlColorFromColor(_rtfSource.SelectionColor) & """>"
      113. clrForeColor = _rtfSource.SelectionColor
      114. End If
      115. End If
      116. 'Background color
      117. If intPos = 0 Then
      118. strReturn &= "<span style=""background-color:" & HtmlColorFromColor(_rtfSource.SelectionBackColor) & """>"
      119. clrBackColor = _rtfSource.SelectionBackColor
      120. Else
      121. If _rtfSource.SelectionBackColor <> clrBackColor Then
      122. strReturn &= "</span>"
      123. strReturn &= "<span style=""background-color:" & HtmlColorFromColor(_rtfSource.SelectionBackColor) & """>"
      124. clrBackColor = _rtfSource.SelectionBackColor
      125. End If
      126. End If
      127. 'Font
      128. If intPos = 0 Then
      129. strReturn &= "<span style=""font:" & HtmlFontStyleFromFont(_rtfSource.SelectionFont) & """>"
      130. fntCurrentFont = _rtfSource.SelectionFont
      131. Else
      132. If _rtfSource.SelectionFont.GetHashCode <> fntCurrentFont.GetHashCode Then
      133. strReturn &= "</span>"
      134. strReturn &= "<span style=""font:" & HtmlFontStyleFromFont(_rtfSource.SelectionFont) & """>"
      135. fntCurrentFont = _rtfSource.SelectionFont
      136. End If
      137. End If
      138. 'Alignment
      139. If intPos = 0 Then
      140. strReturn &= "<p style=""text-align:" & _rtfSource.SelectionAlignment.ToString & """>"
      141. altCurrent = _rtfSource.SelectionAlignment
      142. Else
      143. If _rtfSource.SelectionAlignment <> altCurrent Then
      144. strReturn &= "</p>"
      145. strReturn &= "<p style=""text-align:" & _rtfSource.SelectionAlignment.ToString & """>"
      146. altCurrent = _rtfSource.SelectionAlignment
      147. End If
      148. End If
      149. strReturn &= _rtfSource.Text.Substring(intPos, 1)
      150. Next
      151. 'close all the spans
      152. strReturn &= "</span>"
      153. strReturn &= "</span>"
      154. strReturn &= "</span>"
      155. strReturn &= "</p>"
      156. strReturn &= "</div>"
      157. strReturn = strReturn.Replace(Convert.ToChar(10), "<br />")
      158. Return strReturn
      159. End Function
      160. #End Region
      161. End Class

      Keine PN's bezüglich VB an mich! Dafür gibt es das Forum!

      :Kreis hier. Kreis da.:

      SnippetOrganizer BETA2

      So ich habe jetzt die Beta 2 vom SNippetOrganizer fertiggestellt..wurde alles naja n bissle aufgepeppt^^

      LINK

      Keine PN's bezüglich VB an mich! Dafür gibt es das Forum!

      :Kreis hier. Kreis da.:

      Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von „MrLee“ ()

      gefällt mir wirklich sehr gut, dein/euer programmchen.
      Was mir jedoch fehlt/was ich ganz gerne hätte wäre syntaxhighlightning, ganz einfach der übersicht wegen.
      Außerdem wäre es nicht schlecht wenn man nicht nur den Code durchsuchen könnte sondern auch die Bibliotheken.
      Du hast beim Link oben den Punkt vor der Endung vergessen....
      wintoolz.de
      • wintoolz.KeyLocker - Programm zum sicheren Verwalten von Passwörten
      • wintoolz.CodeGallery - Datenbank für Codebeispiele veschiedener Programmiersprachen
      • wintoolz.Haushaltsbuch - Dient zum Auflisten der Aktivitäten ihrer Bankkonten

      Benutze auch du Ecosia
      Wirklich cooles Design...

      Aber bei mir funktioniert das Programm nicht...
      Wenn ich die Exe-Datei öffne, kann ich das auf Ausführen oder Extrahieren klicken, wenn ich auf Extrahieren klicke,
      kommt dass der Ordner schon existiere. Die Dateien werden aber trotzdem angezeigt.
      Wenn ich dann die exe öffne, kommt gleich beim Start eine Fehlermeldung, und eine Kategorie kann ich auch nicht erstellen, weil der Button nicht funktioniert...