Click here to Skip to main content
15,913,941 members
Home / Discussions / C#
   

C#

 
GeneralRe: form multithreading trouble!... Pin
Gareth H10-Mar-08 12:20
Gareth H10-Mar-08 12:20 
Generalnew Form/thread to remain open after main Application closes Pin
Alex4thDegree10-Mar-08 9:53
Alex4thDegree10-Mar-08 9:53 
GeneralRe: new Form/thread to remain open after main Application closes Pin
led mike10-Mar-08 10:04
led mike10-Mar-08 10:04 
GeneralRe: new Form/thread to remain open after main Application closes Pin
Alex4thDegree10-Mar-08 10:24
Alex4thDegree10-Mar-08 10:24 
GeneralRe: new Form/thread to remain open after main Application closes Pin
Christian Graus10-Mar-08 10:21
protectorChristian Graus10-Mar-08 10:21 
GeneralRe: new Form/thread to remain open after main Application closes Pin
Alex4thDegree10-Mar-08 10:26
Alex4thDegree10-Mar-08 10:26 
GeneralRe: new Form/thread to remain open after main Application closes Pin
led mike10-Mar-08 11:17
led mike10-Mar-08 11:17 
GeneralRe: new Form/thread to remain open after main Application closes Pin
Alex4thDegree11-Mar-08 3:58
Alex4thDegree11-Mar-08 3:58 
GeneralRe: new Form/thread to remain open after main Application closes Pin
led mike11-Mar-08 5:19
led mike11-Mar-08 5:19 
GeneralLoad Cursor [modified] Wrong Code Pin
lsconyer10-Mar-08 9:48
lsconyer10-Mar-08 9:48 
GeneralRe: Load Cursor Pin
Christian Graus10-Mar-08 10:24
protectorChristian Graus10-Mar-08 10:24 
GeneralRe: Load Cursor Pin
lsconyer10-Mar-08 10:34
lsconyer10-Mar-08 10:34 
GeneralRe: Load Cursor Pin
Christian Graus10-Mar-08 11:22
protectorChristian Graus10-Mar-08 11:22 
QuestionOracle Data Provider 11g: combining UDT and associated Array ??? Pin
faehne10-Mar-08 9:19
faehne10-Mar-08 9:19 
QuestionStrange Assembly Reference Issue Pin
classNoob10-Mar-08 8:36
classNoob10-Mar-08 8:36 
GeneralRe: Strange Assembly Reference Issue Pin
classNoob10-Mar-08 9:43
classNoob10-Mar-08 9:43 
GeneralRe: Strange Assembly Reference Issue Pin
classNoob10-Mar-08 10:05
classNoob10-Mar-08 10:05 
AnswerRe: Strange Assembly Reference Issue Pin
classNoob10-Mar-08 10:37
classNoob10-Mar-08 10:37 
QuestionStreamWriter reformatting output??? Pin
LongRange.Shooter10-Mar-08 8:29
LongRange.Shooter10-Mar-08 8:29 
GeneralRe: StreamWriter reformatting output??? Pin
Christian Graus10-Mar-08 10:25
protectorChristian Graus10-Mar-08 10:25 
GeneralRe: StreamWriter reformatting output??? Pin
LongRange.Shooter11-Mar-08 16:42
LongRange.Shooter11-Mar-08 16:42 
Christian,
Trust me, I've been saying the same thing myself. Below is the code. I commented the line where I verified the format was still dateTtime and then looked at the output that was put to the file in notepad to see that the format was now data time AM. Messed up my head something fierce.

public sealed class Serialize:IDisposable
{
    static StreamWriter output;
    //static FileStream output;

    /// <summary>
    /// Writes an opening Xml node to the stream
    /// </summary>
    /// <param name="fieldName"></param>
    public static void WriteOpen(string fieldName)
    {
        string buffer = String.Format("<{0}>", fieldName);
        //output.Write(Encoding.UTF8.GetBytes(buffer),0,buffer.Length);
        output.Write( buffer );
    }

    /// <summary>
    /// Writes a closing Xml node to the stream
    /// </summary>
    /// <param name="fieldName"></param>
    public static void WriteClose(string fieldName)
    {
        string buffer = String.Format("</{0}>", fieldName);
        //output.Write(Encoding.UTF8.GetBytes(buffer),0,buffer.Length);
        output.Write( buffer );
    }

    /// <summary>
    /// Writes a raw line of data to the stream
    /// </summary>
    /// <param name="rawData"></param>
    public static void WriteRaw(string rawData)
    {
        //output.Write(Encoding.UTF8.GetBytes(rawData), 0, rawData.Length);
        output.Write( rawData );
    }

    /// <summary>
    /// Writes a formatted Xml line of data to the stream
    /// </summary>
    /// <param name="fieldName"></param>
    /// <param name="value"></param>
    public static void WriteLine(string fieldName, string value)
    {
        if (value.Length.Equals(0))
        {
            string buffer = String.Format("<{0} />", fieldName);
            //output.Write(Encoding.UTF8.GetBytes(buffer),0,buffer.Length);
            output.Write( buffer );
        }
        else
        {
            string buffer = String.Format("<{0}>{1}</{0}>", fieldName, value);
            //output.Write(Encoding.UTF8.GetBytes(buffer),0,buffer.Length);
            // THIS IS WHERE I BROKE THE CODE AND  VERIFIED THE BUFFER DATA PASSED TO THE STREAMWRITER
            output.Write( buffer );
        }
    }

    /// <summary>
    /// Entry point for outputting an object to a FileStream in an Xml-ish format
    /// </summary>
    /// <param name="stream"></param>
    /// <param name="value"></param>
    public static void OutputXmlStream(FileStream stream, Object value)
    {
        output = stream;
        string buffer = "<?xml version=\"1.0\" encoding=\"UTF-16\" ?>";
        output.Write(Encoding.UTF8.GetBytes(buffer),0,buffer.Length);

        Type baseObjectType = value.GetType();
        WriteOpen(value.GetType().Name);
        PropertyInfo[] propertyList = baseObjectType.GetProperties();

        foreach (PropertyInfo embeddedProperty in propertyList)
        {
            if (embeddedProperty.DeclaringType.ToString().StartsWith("SourceOne"))
                ObjectWalker.Walk(embeddedProperty.GetValue(value, null));
            else if (embeddedProperty.GetValue(value, null) is ArrayList)
                IEnumerableWalker.Walk( (ArrayList)embeddedProperty.GetValue(value, null));
        }

        WriteClose(value.GetType().Name);
    }

    #region IDisposable Members

    public void Dispose()
    {
        Dispose(true);
    }
    internal void Dispose(bool disposing)
    {
        if (disposing)
        {
        }
        GC.SuppressFinalize(this);
    }

    #endregion
}

Generalsomething weird is going on Pin
damianrda10-Mar-08 8:04
damianrda10-Mar-08 8:04 
GeneralRe: something weird is going on Pin
LongRange.Shooter10-Mar-08 8:32
LongRange.Shooter10-Mar-08 8:32 
GeneralAdding picturebox [modified] Pin
netJP12L10-Mar-08 7:41
netJP12L10-Mar-08 7:41 
GeneralRe: Adding picturebox Pin
Judah Gabriel Himango10-Mar-08 8:01
sponsorJudah Gabriel Himango10-Mar-08 8:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.