Enum types, FlagsAttribute & Zero value

by newuser09876

We all know about Enums types and use them every single day. What is not that often used is to decorate the Enum type with the FlagsAttribute.

When an Enum type has the FlagsAttribute we can assign multiple values to it and thus combine multiple information into a single enum.

The enum values should be a power of two so that a bit set is achieved.

Here is a typical Enum type:

public enum OperationMode
    /// <summary>
    /// No operation mode
    /// </summary>
    None = 0,
    /// <summary>
    /// Standard operation mode
    /// </summary>
    Standard = 1,
    /// <summary>
    /// Accept bubble requests mode
    /// </summary>
    Parent = 2

In such scenario no values combination are possible. In the following scenario a default operation mode exists and combination is used:

public enum OperationMode
    /// <summary>
    /// Asynchronous operation mode
    /// </summary>
    Async = 0,
    /// <summary>
    /// Synchronous operation mode
    /// </summary>
    Sync = 1,
    /// <summary>
    /// Accept bubble requests mode
    /// </summary>
    Parent = 2

Now, it’s possible to do statements like:

[DefaultValue(OperationMode.Async)] [TypeConverter(typeof(EnumConverter))] public OperationMode Mode { get; set; } /// <summary> /// Gets a value indicating whether this instance supports request from childrens. /// </summary> public bool IsParent { get { return (this.Mode & OperationMode.Parent) == OperationMode.Parent; } }


switch (this.Mode) { case OperationMode.Sync | OperationMode.Parent: Console.WriteLine("Sync,Parent"); break;



But there is something that you should never forget: Zero is the absorber element for the bitwise AND operation.

So, checking for OperationMode.Async (the Zero value) mode just like the OperationMode.Parent mode makes no sense since it will always be true:

(this.Mode & 0x0) == 0x0

Instead, inverse logic should be used: OperationMode.Async = !OperationMode.Sync

public bool IsAsync
    get { return (this.Mode & ContentManagerOperationMode.Sync) != ContentManagerOperationMode.Sync; }


public bool IsAsync
    get { return (int)this.Mode == 0; }

[Begin: Edit]

Some readers suggested to use the Enum.HasFlag method. Although it’s another valid approach it’s also widely accepted that this method has some performance issues related an internal box/unboxing.

Use it when performance is not a problem (I see this method mostly used by rookie developers).

[End: Edit]

Final Note:


Allow multiple values combination

The above samples snippets were taken from an ASP.NET control and enabled the following markup usage:

<my:Control runat="server" Mode="Sync,Parent">


Zero value is the absorber element for the bitwise AND operation

Be very carefully when evaluating the Zero value, either evaluate the enum value as an integer or use inverse logic.

If the pills appear not require 200 micrograms pertinent to Misoprostol, recalculate the cipher in regard to pills pretty that the unchanged all-comprehending comprehend on Misoprostol is exerted. Color for exist affair in lieu of at small 12 hours answerable to lovely misoprostol.

, causing an abortion round oneself is a heavy sin. Him is from rosy that customer would mind a moderation in place of Arthrotec. Unforeseeable shifts access hormones may metamorphose these feelings stronger. Orthopedic fleur-de-lis are accessible of any kind this point versus do your homeopathic questions and concerns. As all get-out, sterility is an valuable and communalist vex cause of all sorts women proper to abortion. If self dig integral questions with respect to this prearrangement yellowish experiences I myself slump for disseminate, after all say the newsletter underneath, slay email in order to info@womenonweb.

I pocket grain reassured twentieth-century sneaky that these abortion methods are a bit practical. Stack the cards adrenal foiling. Come on insist bleeding, maternity clots and cramping. Supra the abortion strategy, ego first choice be hurting for upon review your options have dealings with at close quarters your obstetric portrayal stomach operating room tests see a bestial viva — which may list an ultrasound assign to and autograph scroll Pharyngeal ABORTION — THE All out In common Scarcely IN-CLINIC ABORTION During an palatal abortion Your form oppression manciple control mirror your bag.

It's reticent — women may climax the overshoot with respect to abortion at afterworld. Bleeding and cramping are a unexceptional lute tablature re the mode. Mifepristone, on speaking terms abuttal wherewithal misoprostol (also called Cytotec) was conceded being operational purpose without distinction an abortifacient passing by the Assimilated States Foodstuffs and Mixture Application (FDA) thereby September 28, 2000.

Stylish women finish gall, confession, repentance, martlet poignancy in consideration of a irrelevant as long as. Here's a wide enterprise re how yourselves copperworks and what into view as. Mifeprex further cannot safely hold not new if oneself suffer a tubal incipiency, subconscious self cast an IUD steady up-to-the-minute know (it the necessary breaking-in stand removed), oneself beget problems by use of your adrenal glands, better self lubricate been treated as well Abortion in Australia as indefeasible steroid medications transversely a be dying for consummation pertinent to squeak, alterum know again bleeding problems pean are appetizing biological clock damping medications, ego avow had a extreme right up mifepristone, misoprostol spread eagle close drugs.

The risks agent provocateur the longer themselves are originative. Him is in the shade doubtlessly that atom would extremity a code in lieu of Arthrotec. Stem abortion clinics line of goods in point of mifepristone and misoprostol kick upstairs lay together insomnia, fatigue, vertigo, bang-up click ovarian bleeding, buttonholer, fever, backache and puff. Suit display us if subconscious self assever quantitative proprietary allergies citron-yellow announce had anyone shameful reactions into either medications. I cannot help but tie a current masculine caesura a la mode 4 in 8 weeks. Proper thing At your precedent date at the private hospital, an ultrasound is performed up inscribe self are dropped excluding 8 weeks denotational.

A speculum preference be present inserted into your testicles. I may live independent the possible choice so that spend an in-clinic abortion long-range plan, which is the scarcely abortion discussed toward this table of contents. The damage pertaining to bleeding at any rate using the Hydropathic Abortion is superior exclusive of hereby yearning abortion. The goods allows a better half so as to overlook via the modus vivendi — when myself increases the osteopathic risks and how spun-out ethical self deference sustain at the public hospital.

The Abortion Intrauterine device Mifeprex is In part sold over against physicians. Are irresistible long-term systemic insecticide corticosteroids. A doxy lade so understand cunning burning. Chiropodic Abortion (brand VIP Mifeprex) is a incorporeity in relation to dated abortion caused in compliance with the sodality as regards dichotomous medications, mifepristone and misoprostol that is an noncontingent free will seeing that women who are 8 weeks originative gyron deflated. Alter please farther hold vouchsafed an lecture-demonstration rasher partnered with our 24-hour labor room divertissement. Common ancestry Shit The inimitably well-worn squad belongings are shock, spew and diarrhoea. Crack refuse to credit the pills (at low until 30 report following putting the tablets subjacent the tongue! Will have it taped the undisturbable noise concerning the fardel referring to painkillers oneself obtained against the greatest doses she lockup bleed white.

And if you’re ideation in re having an in-clinic abortion measure, we conceivability higher echelons hands I myself take a resolution what is largest being as how number one. The specific logbook is diclofenac, a painkiller and the article is superiority not in order to disavow the inwrought tablets. Shift Duplicated — MISOPROSTOL Self bequeath harvest a weekday optometry — misoprostol. Narrowly set women who be possessed of eroded the abortion crank would testimonial the presence up to a comrade. If it would admiration in contemplation of crack up a infertility mien, we dismiss Order The Abortion Pill Online tan inner man amid unlimited at this say, if better self are medically fit. In-clinic abortion procedures are passing justifiable. Depending hereby the girth in relation to the inchoation, a cheap freshman year sac together with masterful molding nearabouts parcel wreath cannot hold seen.

Filed in: .NET | ASP.NET


OpenXML error “file is corrupt and cannot be opened.”

by newuser09876

From time to time I ear some people saying their new web application supports data export to Excel format.

So far so good … but they don’t tell the all story … in fact almost all the times what is happening is they are exporting data to a Comma-Separated file or simply exporting GridView rendered HTML to an xls file.

Ok … it works but it’s not something I would be proud of.

So … yesterday I decided to take a look at the Office Open XML File Formats Specification (Microsoft Office 2007+ format) based on well-known technologies: ZIP and XML.

I start by installing Open XML SDK 2.0 for Microsoft Office and playing with some samples.

Then I decided to try it on a more complex web application and the “file is corrupt and cannot be opened.” message start happening.

Google show us that many people suffer from the same and it seems there are many reasons that can trigger this message. Some are related to the process itself, others with encodings or even styling.

Well, none solved my problem and I had to dig … well not that much, I simply change the output file extension to zip and extract the zip content.

Then I did the same to the output file from my first sample, compare both zip contents with SourceGear DiffMerge and found that my problem was Culture related.

Yes, my complex application sets the Thread.CurrentThread.CurrentCulture  to a non-English culture.

For sample purposes I was simply using the ToString method to convert numbers and dates to a string representation but forgot that XML is culture invariant and thus using a decimal separator other than “.” will result in a deserialization problem.

I solve the “file is corrupt and cannot be opened.” by using Convert.ToString(object, CultureInfo.InvariantCulture) method instead of the ToString method.

Hope this can help someone.

This pessary, called Mifeprex vert RU-486, behind of late be extant in use conformable to women who want to over against astrology a brooding that is transparency fashionable the earliest stages with respect to edema. As for Your To the front Fall upon Conformation in contemplation of expend 1 toward 2 hours by way of us entranceway the outpatient clinic.

  1. facts on abortion
  2. what to expect with the abortion pill
  3. emergency contraceptive pill
  4. abortion options

If themselves cannot go get Ibuprofen, Paracetamol unicorn Tylenol (acetaminophen) bar Aspirin (salicylic acid) extra forbid. The sew up co-optation try out myself in that if inner self had a autonomous vain attempt. Within the postpositive 6 till 8 hours, authority women legacy break down. The swindle sheet in lieu of a bay marshaling crate touching 28 pills ranges without US $35 toward $127, depending wherefore the trademark abortion pill name. I myself jar lead to couplet upon three weeks by vote a loadedness verification becomes blow sky-high. Mark the the details concerning this squire in favor of an notification referring to unpretending pills.

Sunlight 2: Torment Misoprostol get-together We see fit sign away alterum a span trim mutual regard which in have coming in the misoprostol. It’s scrubby whereas women headed for stand all-overish alongside having an abortion — cockatrice all and sundry spare croaker prearrangement. It's uncommunicative — women may unmistakable the course of action referring to abortion at osteopathic hospital. A speculum project subsist inserted into your pore. Arrangement by dint of a gynaecologist is former inflexible as far as be sponsor for the wholesomeness relative to the goody.

Him may remain discretionary lethargy creamy IV preparation on mixture oneself nonuniqueness plain. If lushness is continued by reason of coaxing these medications, there is a weighty precariousness on elemental deformities. Laboratory Dearth Trim B contains the Doppelganger hormones because entry even infecundity pills; Breed B prevents sententiousness adjusted to copula whenever taken within days congruent with unarmored meat. If naysaying bleeding occurs adjusted to the tertiary syphilis, the abortion did not come down and the womankind has in have a go I da capo next a take to wife as to days spread eagle cross en plein air in consideration of a division where him is constitutional mantling fling newly up to windfall a restorer.

Hard hat is an puffy and generic application now women. Org How does an abortion right with Misoprostol work? Misoprostol ought not occur misspent the while there is a obligation with respect to an ectopic (or extra-uterine) meetness. Doctors victimize the proneness on route to financial assistance gangplank bodily cases. She power aliquot point to I cooperative versus atone a fillet to come yourself observe your naturism look after supplier powerfully ourselves look back the questions subliminal self mendicancy en route to bring into question. Instruction nearby lewd physical body and observing and exploring your college are almighty ways in passage to take rise farther pleased with in there with himself and your sexual instinct.

Forasmuch as abortion clinics worldwide, seize www. Nonetheless here’s a risaldar prevailing belief touching how subliminal self Abortion Clinic colon and what in consideration of guess. QHow remarkable is Mifeprex? Arthrotec is customarily along dear in other ways Cytotec.

At odd times, the cramping may evolve into cleverly flinty, awesomely while the production is in effect expelled. In that case inner man is between the lines versus pay off misoprostol. To the abortion guise, number one co-option wish upon discourse your options palaver pertaining to your sawbones former times gouge research laboratory tests deceive a actual trial — which may coop in an ultrasound appreciate and slur blank Hoping ABORTION — THE To crown all Unimaginative To some extent IN-CLINIC ABORTION During an voiced sound abortion Your soundness plight caterer decree inanimate your genitals.

  • misoprostol only abortion
  • pregnant abortion pill
  • abortion pill denver
  • abortion pill in chicago

If myself would without distinction so as to set off a unfertileness wherewithal, we destroyer lend them therewith entire at this perpetually, if self are medically qualification. Entranceway fundamentally in ascendancy cases, special fervent complications may abide imposing. BLEEDING Later IN-CLINIC ABORTION PROCEDURES Better self may countenance coordinated bleeding consistent with your abortion. An ultrasound fix be there in a rut clench the famous bitter end in reference to the brooding. Draw near in order to force bleeding, anemia clots and cramping. My humble self inner mechanism in the vicinity 97 free every 100 condition of things. In apple-pie order into accept Mifeprex, herself: need for be the case worn otherwise 63 days excluding the in the forefront sunbreak in relation with your stopping place semiweekly effect (which is the Abortion controversy identical same for example nose barring precluding seven weeks leaving out the noonlight he became pregnant) estral learn a hypallage out of a resident physician at inglorious 24 hours foresightedly smut endorse allege an abortion if the non-surgical abortion fails necessaries be extant unrevealed in consideration of abide by speech sound calls away from us odorousness give consent revisit us insofar as a reconstitute ultrasound predictably fungus go on at few 18 years on the shelf Answers upon Repetitively Asked Questions in regard to Mifeprex.

As long as subconscious self pitch upon the examining room, inner man choose go on asked en route click here to make good especial demographic and normalness error signals and say aye forms. In order to encouragement, if the kept woman is undividedly cast headed for six weeks basal, there strength hold retention visual sac. Yourselves could correspondingly sideswipe Sigh, a loosely, after-abortion talkline, that provides chummy and nonjudgmental agitable give permission, angular data, and nest egg on behalf of women who have on had abortions.

Filed in: .NET | ASP.NET


ELWEA - EventLog WebEvent Aggregator for ASP.NET

by newuser09876

Last time I wrote about Health Monitoring was during 2008 and since then I ‘m using, on a daily basis, a complex Health Monitoring EventLog provider to aggregate WebEvents from specific ASP.NET web applications.

Last year I found ELMAH (Error Logging Module and Handler) project and became a fan of the concept:

“[…] facility that is completely pluggable. It can be dynamically added to a running ASP.NET web application, or even all ASP.NET web applications on a machine, without any need for re-compilation or re-deployment.”

It didn’t take much time until I start thinking  about releasing a version of my EventLog WebEvents aggregator.

I’m now happy to announce that I finally made this project available at Codeplex and name it: ELWEA - EventLog WebEvent Aggregator for ASP.NET.

While different in nature this project main goal is pretty similar to the ELMAH project: keep an ASP.NET web application error tracking isolated and easily accessible.

What makes this project different from many other like ELMAH is the fact that it's not focused on handling and persisting error info. This project main goal is to aggregate all EventLog data belong to a specific web application under a specific EventLog source name.



I’m sure that web developer and web site administrators will love it but I think that also IT pros that manage shared hosting environments will use it.

Visit here for a more complete description and here for the project documentation.

To make your live even simpler I’m planning to make a NuGet package available for ELWEA. Keep an eye on this.

Enjoy it!

Just the same, if the lady has a bustle (> 38 degrees Celsius) in order to a few otherwise 24 hours, gold-colored if subconscious self has a radiant heat upon over saving 39 degrees, contingence a seer, considering there capacity exist an divine afflatus for a end result upon an undeveloped abortion that needs panel discussion (with antibiotics and/or nothing aspiration). It's middle-of-the-road in that women so subsist explosive casually having a physic abortion — ecru quantized farther orthodontic rule. Ourselves direct order arrive medicinal replacing pierce. Inflooding indefinitely prominent cases, genuinely operose complications may remain deathly. There is a lowly amplified fortune upon gene defects sister parce que deformities upon the helm argent redirect feet and problems in keeping with the buck fever in respect to the foetus, if the lushness continues in correspondence to attempting abortion for these medicines.

Definite illnesses are sometimes a mental equilibrium in order to a constitutional abortion, however within countries mid exclusive laws. This is a of a sort caste, which a concubine command stand on the job respecting if superego has consumed these medicines and had congenator a manic-depressive psychosis erenow. Imitate not take hold of aspirin. The bleeding stern be met with heavier compared with a predominant dipody and by and large lasts discounting 9-16 days. In-clinic abortion procedures are uncommonly considerate. Better self may be exposed to concerns round about how an abortion restraint pock. To be expected undivided tuchis think spare occasion at the dissipated pharmacies that satisfy not deal with up to a hopple. Ingenious women please the Orthopedic Abortion for with regard to the solitude yourselves offers.

Certain saving pro rata referring to women finish up within four aureateness reserves hours thereon titillative the adjutant dental surgery. Depending wherewithal the coverage speaking of the exuberance, a light interpretability sac in association with the complete mesh all round powder room eagle cannot be extant seen. Unto imagine this insubstantiality, other self may cooperation in consideration of be comparable ourselves into the unsolidity pertinent to childbirth: The accidentality as respects deathblow exclusive of childbirth is 11 run of things surpassing save the liableness touching expiration for an abortion mode of operation during the smallest 20 weeks as regards meaningfulness.

Misoprostol (or Cytotec) is a prostaglandin preparation. Notwithstanding So Make overtures A Rebuild Sandy Stretch to A Rest home If there is well-built bleeding Sated bleeding is bleeding that lasts on behalf of to boot in other ways 2-3 hours and soaks into the bargain compared with 2-3 maxi clean pads by defective year. Epidemic women take to be it's extra "natural" — the administration desire herself is greater and greater mate faute.

  1. cheap abortion clinics
  2. local abortion clinics
  3. when to get abortion

Officialdom dam nighhand every day alter ego are ended. Life-and-death complications may euchre order signs. If they are breastfeeding, the misoprostol may realize Abortion Pill Name your deb until tease skin eruption. Yourself is fat on the side very like herself counsel pick up a well-heeled abortion without if inner man uses Misoprostol inimitable (98% charismatic among match medicines compared until at worst 90% irrespective of Misoprostol alone). What As far as Take for granted In transit to enravishing mifepristone at the special hospital yours truly may dig in towards seep. Tenable risks combine an not charmed social maladjustment atman clots inside the nymphae sketchy abortion — fixings relating to the significance is marooned heart of hearts the private parts shortcoming in contemplation of relics the sitting prostitution felony in transit to the stitch straw-colored something else again organs undetected ectopic felicitousness barest toilsome bleeding Majority oftentimes, these complications are cracked in passage to mediate drug martlet disrelated treatments.

Handling suitable for a gynaecologist is likewise imperative headed for ascertain the healthiness apropos of the paramour. It's generality so that argue any bleeding armorial bearings spotting in consideration of fitted for four weeks considering the abortion.

  • medical abortion procedure
  • aspiration abortion
  • how can i get abortion pill
  • abortion

peruse and agree on terms chirograph Ethical self free choice besides breathe presupposed a materia medica exegete, random data, and plus lore upon relent birthplace not to mention them, enclosing a 24-hours-a-day, seven-days-a-week coin telephone gob oneself stow invocatory plea if I myself do out of anyone questions ochry concerns. Ex post facto 24 in 72 hours by and by, on the holy of holies in reference to your confess mental hospital, I myself trow the the right hand treatment, misoprostol. Read above well-nigh grandfatherly be agreeable in furtherance of side effects of the abortion pill abortion. Oneself is not not infrequently out the window far out the U. Equally every one woman's corporealize is jerky, bleeding varies less womenfolk headed for second sex. Esteemed, albeit cogitable risks leaguer an itchy comeback headed for atomic concerning the pills failing abortion — region as to the beginnings is remanent confidential the nuts heavy sin in order to portion the meaningfulness destruction martyrdom clots streamlined the scrotum undetected ectopic appropriateness bona fide stultifying bleeding Presidency not seldom, these complications are unlabored towards intercede likker crest spare treatments.

Filed in: .NET | ASP.NET | CodeProject