CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets for: mikecvelide
C#
// writing document
new XDocument(
    new XElement("data",
        new XElement("automatic_updates", 1),
        new XElement("install_mscreens", 0))).Save("c:\\test.xml");
 
 
// reading back
var doc = XDocument.Load("c:\\test.xml");
var update = doc.Element("data").Element("automatic_updates").Value == "1";
by mikecvelide   October 08, 2009 @ 11:32am
152 Views
no comments
 
C#
if (componentID == 0 && mgr != null) {
    OLECRINFO[] crinfo = new OLECRINFO[1];
    crinfo[0].cbSize = (uint)Marshal.SizeOf(typeof(OLECRINFO));
    crinfo[0].grfcrf = (uint)_OLECRF.olecrfNeedIdleTime |
                                  (uint)_OLECRF.olecrfNeedPeriodicIdleTime;
    crinfo[0].grfcadvf = (uint)_OLECADVF.olecadvfModal |
                                  (uint)_OLECADVF.olecadvfRedrawOff |
                                  (uint)_OLECADVF.olecadvfWarningsOff;
    crinfo[0].uIdleTimeInterval = 1000;
    int hr = mgr.FRegisterComponent(this, crinfo, out componentID);
by mikecvelide   October 08, 2009 @ 10:59am
207 Views
no comments
 
C#
private readonly SortedList<Distance, List<BearingPoint>> pointsByX;
private readonly SortedList<Distance, List<BearingPoint>> pointsByY;
 
 
...
 
Point targetPoint;
var bestMatch = 
   (from pt in 
    (from kvp in pointsByX
by mikecvelide   September 28, 2009 @ 11:34am
200 Views
no comments
 
C#
public class Command : IExternalCommand
{
    public IExternalCommand.Result Execute(ExternalCommandData commandData,
        ref string message, ElementSet elements)
    {
        System.Diagnostics.Debugger.Break();
        MessageBox.Show("test");
        return IExternalCommand.Result.Succeeded;
    }
}
by mikecvelide   September 23, 2009 @ 6:19am
201 Views
no comments
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate