Ejemplo n.º 1
0
        public MessageWindow(CS classStyle, WS style, WS_EX exStyle, Rect location, string name, WndProc callback)
        {
            // A null callback means just use DefWindowProc.
            _wndProcCallback = callback;
            _className = "MessageWindowClass+" + Guid.NewGuid().ToString();

            var wc = new WNDCLASSEX
            {
                cbSize = Marshal.SizeOf(typeof(WNDCLASSEX)),
                style = classStyle,
                lpfnWndProc = s_WndProc,
                hInstance = NativeMethods.GetModuleHandle(null),
                hbrBackground = NativeMethods.GetStockObject(StockObject.NULL_BRUSH),
                lpszMenuName = "",
                lpszClassName = _className,
            };

            NativeMethods.RegisterClassEx(ref wc);

            GCHandle gcHandle = default(GCHandle);
            try
            {
                gcHandle = GCHandle.Alloc(this);
                IntPtr pinnedThisPtr = (IntPtr)gcHandle;

                Handle = NativeMethods.CreateWindowEx(
                    exStyle,
                    _className,
                    name,
                    style,
                    (int)location.X,
                    (int)location.Y,
                    (int)location.Width,
                    (int)location.Height,
                    IntPtr.Zero,
                    IntPtr.Zero,
                    IntPtr.Zero,
                    pinnedThisPtr);
            }
            finally
            {
                gcHandle.Free();
            }
            
            _dispatcher = Dispatcher.CurrentDispatcher;
        }
Ejemplo n.º 2
0
    public static void checkAs(System.Object x)
    {
        X x1 = x as X;

        if (x1 != null)
        {
            (new X()).incCount();
        }
        A a = x as A;

        if (a != null)
        {
            (new A()).incCount();
        }
        B b = x as B;

        if (b != null)
        {
            (new B()).incCount();
        }
        C c = x as C;

        if (c != null)
        {
            (new C()).incCount();
        }
        D d = x as D;

        if (d != null)
        {
            (new D()).incCount();
        }
        CS cs = x as CS;

        if (cs != null)
        {
            (new CS()).incCount();
        }
        DS ds = x as DS;

        if (ds != null)
        {
            (new DS()).incCount();
        }
    }
Ejemplo n.º 3
0
        public void Get5MostActiveNumbers()
        {
            var groupsCall = _callFromAccounts.GroupBy(call => call);

            var groupsSMS = _smsFromAccounts.GroupBy(sms => sms);


            var leftoutrtjoin = (from sms in groupsSMS

                                 join call in groupsCall on sms.Key equals call.Key into SC

                                 from newSC in SC.DefaultIfEmpty()

                                 select new
            {
                account = sms.Key,
                activity = newSC?.Count() + (double)sms.Count() / 2 ?? (double)sms.Count() / 2
            }).ToList();

            var rightouterjoin = (from call in groupsCall

                                  join sms in groupsSMS on call.Key equals sms.Key into CS

                                  from newCS in CS.DefaultIfEmpty()

                                  select new
            {
                account = call.Key,
                activity = newCS == null ? call.Count() : (double)newCS.Count() / 2 + call.Count()
            }).ToList();


            var fullouterjoin = leftoutrtjoin.Union(rightouterjoin);

            var result = (from account in fullouterjoin
                          orderby account.activity descending
                          select account.account).Take(5);


            Console.WriteLine("5 Most Active Numbers: ");
            foreach (var item in result)
            {
                Console.WriteLine(item);
            }
        }
Ejemplo n.º 4
0
        public MessageWindow(CS classStyle, WS style, WS_EX exStyle, Rect location, string name, WndProc callback)
        {
            // A null callback means just use DefWindowProc.
            _wndProcCallback = callback;
            _className       = "MessageWindowClass+" + Guid.NewGuid().ToString();

            var wc = new WNDCLASSEX
            {
                cbSize        = Marshal.SizeOf(typeof(WNDCLASSEX)),
                style         = classStyle,
                lpfnWndProc   = s_WndProc,
                hInstance     = NativeMethods.GetModuleHandle(null),
                hbrBackground = NativeMethods.GetStockObject(StockObject.NULL_BRUSH),
                lpszMenuName  = "",
                lpszClassName = _className,
            };

            NativeMethods.RegisterClassEx(ref wc);

            GCHandle gcHandle = default(GCHandle);

            try
            {
                gcHandle = GCHandle.Alloc(this);
                IntPtr pinnedThisPtr = (IntPtr)gcHandle;

                Handle = NativeMethods.CreateWindowEx(
                    exStyle,
                    _className,
                    name,
                    style,
                    (int)location.X,
                    (int)location.Y,
                    (int)location.Width,
                    (int)location.Height,
                    IntPtr.Zero,
                    IntPtr.Zero,
                    IntPtr.Zero,
                    pinnedThisPtr);
            }
            finally
            {
                gcHandle.Free();
            }
        }
Ejemplo n.º 5
0
    public static void checkAsObjectCast(System.Object x)
    {
        X x2 = x as X;

        if (x2 != null)
        {
            ((X)x).incCount();
        }
        A a = x as A;

        if (a != null)
        {
            ((A)x).incCount();
        }
        B b = x as B;

        if (b != null)
        {
            ((B)x).incCount();
        }
        C c = x as C;

        if (c != null)
        {
            ((C)x).incCount();
        }
        D d = x as D;

        if (d != null)
        {
            ((D)x).incCount();
        }
        CS cs = x as CS;

        if (cs != null)
        {
            ((CS)x).incCount();
        }
        DS ds = x as DS;

        if (ds != null)
        {
            ((DS)x).incCount();
        }
    }
Ejemplo n.º 6
0
 private void button5_Click(object sender, EventArgs e)
 {
     CS++;
     if (CS < 10)
     {
         label3.Text = "0" + CS;
     }
     else
     {
         label3.Text = CS.ToString();
     }
     if (CS > 59)
     {
         CS          = 0;
         label3.Text = "0" + CS;
         //MessageBox.Show("Impossibile superare questa cifra.");
     }
 }
Ejemplo n.º 7
0
 public Prescription()
 {
     this.id                  = new IIImpl();
     this.statusCode          = new CSImpl();
     this.confidentialityCode = new SETImpl <CV, Code>(typeof(CVImpl));
     this.reason              = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2007_v02_r02.Pharmacy.Merged.PrescribedBecauseOf>();
     this.preconditionVerificationEventCriterion = new BLImpl(false);
     this.derivedFromSourceDispense        = new BLImpl(false);
     this.coverageCoverage                 = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2007_v02_r02.Pharmacy.Merged.CoverageExtensions_1>();
     this.fulfillment5DeviceDispense       = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2007_v02_r02.Pharmacy.Porx_mt060040ca.PrescriptionDispenses>();
     this.subjectOf1DetectedIssueEvent     = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2007_v02_r02.Common.Coct_mt260030ca.Issues>();
     this.subjectOf2ControlActEvent        = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2007_v02_r02.Pharmacy.Merged.StatusChanges>();
     this.subjectOf3Annotation             = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2007_v02_r02.Common.Coct_mt120600ca.Notes>();
     this.subjectOf4RefusalToFill          = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2007_v02_r02.Pharmacy.Merged.RefusalToFills>();
     this.subjectOf5DetectedIssueIndicator = new BLImpl(false);
     this.subjectOf6AnnotationIndicator    = new BLImpl(false);
     this.componentOf = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2007_v02_r02.Merged.IsPartOf>();
 }
Ejemplo n.º 8
0
        public CompilerErrorCollection Build(CS cS)
        {
            CSharpCodeProvider codeProvider = new CSharpCodeProvider();
            CompilerParameters cp           = new CompilerParameters();
            string             path         = (cS.ToString().TrimEnd(cS.Name.ToCharArray())) + "mymy.exe";

            cp.GenerateExecutable = true;
            cp.OutputAssembly     = path;
            cp.GenerateInMemory   = false;
            cp.WarningLevel       = 3;
            var result = codeProvider.CompileAssemblyFromSource(cp, cS.Text);

            if (result.Errors.HasErrors)
            {
                return(result.Errors);
            }
            return(null);
        }
Ejemplo n.º 9
0
 public ObservationReport()
 {
     this.id                  = new IIImpl();
     this.code                = new CDImpl();
     this.title               = new STImpl();
     this.text                = new EDImpl <EncapsulatedData>();
     this.statusCode          = new CSImpl();
     this.effectiveTime       = new TSImpl();
     this.confidentialityCode = new SETImpl <CV, Code>(typeof(CVImpl));
     this.specimen            = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_04_03.Lab.Merged.ReportSectionSpecimen>();
     this.receiverRoleChoice  = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_04_03.Lab.Merged.IRoleChoice>();
     this.performerRoleChoice = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_04_03.Lab.Merged.IRoleChoice>();
     this.inFulfillmentOfFulfillmentChoice = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_04_03.Lab.Merged.IFulfillmentChoice>();
     this.pertinentInformation2SupportingClinicalObservationEvent = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_04_03.Lab.Merged.SupportingClinicalInformation>();
     this.component2ReportableTestIndicator = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_04_03.Lab.Merged.ReportableHealthIndicator>();
     this.component3ResultChoice            = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_04_03.Lab.Polb_mt004000ca.IResultChoice>();
     this.subjectOf2 = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_04_03.Merged.Includes>();
 }
Ejemplo n.º 10
0
 public Organizer()
 {
     this.classCode     = new CSImpl();
     this.typeId        = new IIImpl();
     this.templateId    = new LISTImpl <II, Identifier>(typeof(IIImpl));
     this.id            = new LISTImpl <II, Identifier>(typeof(IIImpl));
     this.code          = new CDImpl();
     this.statusCode    = new CSImpl();
     this.effectiveTime = new IVLTSCDAR1Impl();
     this.specimen      = new List <Ca.Infoway.Messagebuilder.Model.Ccda_pcs_r1_1.Merged.Specimen>();
     this.performer     = new List <Ca.Infoway.Messagebuilder.Model.Ccda_pcs_r1_1.Merged.Performer2_1>();
     this.author        = new List <Ca.Infoway.Messagebuilder.Model.Ccda_pcs_r1_1.Merged.Author_1>();
     this.informant     = new List <Ca.Infoway.Messagebuilder.Model.Ccda_pcs_r1_1.Merged.Informant12>();
     this.participant   = new List <Ca.Infoway.Messagebuilder.Model.Ccda_pcs_r1_1.Merged.Participant2_2>();
     this.reference     = new List <Ca.Infoway.Messagebuilder.Model.Ccda_pcs_r1_1.Basemodel.Reference>();
     this.precondition  = new List <Ca.Infoway.Messagebuilder.Model.Ccda_pcs_r1_1.Basemodel.Precondition>();
     this.component     = new List <Ca.Infoway.Messagebuilder.Model.Ccda_pcs_r1_1.Resultorganizer.IComponent4Choice>();
 }
Ejemplo n.º 11
0
 public CareComposition()
 {
     this.id                  = new IIImpl();
     this.code                = new CVImpl();
     this.negationInd         = new BLImpl();
     this.statusCode          = new CSImpl();
     this.effectiveTime       = new IVLImpl <TS, Interval <PlatformDate> >();
     this.confidentialityCode = new SETImpl <CV, Code>(typeof(CVImpl));
     this.subject2Patient     = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_05_00.Pr.Coct_mt050202ca.Patient>();
     this.subject3PatientPatientEntityQuantifiedKindQuantity = new INTImpl();
     this.performerActingPerson = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_05_00.Common.Coct_mt911108ca.IActingPerson>();
     this.location = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_05_00.Merged.OccurredAt>();
     this.outcomeDiagnosisEvent = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_05_00.Iehr.Merged.DischargeDiagnosis>();
     this.predecessorOldPatientCareProvisionEvent = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_05_00.Iehr.Merged.OldPatientCareProvisionEvent>();
     this.reason = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_05_00.Merged.BecauseOf>();
     this.subjectOf1AnnotationIndicator        = new BLImpl(false);
     this.componentOfPatientCareProvisionEvent = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_05_00.Common.Coct_mt011001ca.CareCompositions>();
 }
Ejemplo n.º 12
0
 public ObservationRequest()
 {
     this.id                                  = new SETImpl <II, Identifier>(typeof(IIImpl));
     this.code                                = new CDImpl();
     this.statusCode                          = new CSImpl();
     this.effectiveTime                       = new LISTImpl <GTS, GeneralTimingSpecification>(typeof(GTSImpl));
     this.availabilityTime                    = new TSImpl();
     this.priorityCode                        = new CVImpl();
     this.confidentialityCode                 = new SETImpl <CV, Code>(typeof(CVImpl));
     this.specimenSpecimen                    = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_04_03.Common.Coct_mt080100ca.SpecimenRole>();
     this.callBackContactAssignedEntity       = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_04_03.Common.Coct_mt090108ca.HealthcareWorker>();
     this.informationRecipientRecipientChoice = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_04_03.Lab.Merged.IRecipientChoice>();
     this.verifierAssignedEntity              = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_04_03.Common.Coct_mt090102ca.HealthcareWorker>();
     this.pertinentInformation2SupportingClinicalObservationEvent = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_04_03.Lab.Merged.SupportingClinicalInformation>();
     this.component4RequestChoice  = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_04_03.Lab.Polb_mt001999ca.IRequestChoice>();
     this.fulfillmentResultChoice1 = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_04_03.Lab.Polb_mt001999ca.IResultChoice>();
     this.subjectOf1 = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_04_03.Merged.Includes>();
 }
Ejemplo n.º 13
0
 private void button6_Click(object sender, EventArgs e)
 {
     CS--;
     if (CS < 10)
     {
         label3.Text = "0" + CS;
     }
     else
     {
         label3.Text = CS.ToString();
     }
     if (CS < 0)
     {
         CS          = 59;
         label3.Text = CS.ToString();
         //MessageBox.Show("Troppo poco, non credi?");
     }
 }
Ejemplo n.º 14
0
 public DiagnosisOrInterpretationObservation() {
     this.id = new SETImpl<II, Identifier>(typeof(IIImpl));
     this.code = new CDImpl();
     this.text = new STImpl();
     this.statusCode = new CSImpl();
     this.effectiveTime = new TSImpl();
     this.confidentialityCode = new SETImpl<CV, Code>(typeof(CVImpl));
     this.value = new ANYImpl<object>();
     this.specimen = new List<Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_04_02.Lab.Merged.ReportSectionSpecimen>();
     this.receiverRoleChoice = new List<Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_04_02.Lab.Merged.IRoleChoice>();
     this.performer = new List<Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_04_02.Lab.Merged.WasPerformedBy>();
     this.inFulfillmentOfFulfillmentChoice = new List<Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_04_02.Lab.Merged.IFulfillmentChoice>();
     this.pertinentInformation2SupportingClinicalObservationEvent = new List<Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_04_02.Lab.Merged.SupportingClinicalInformation>();
     this.component1ReportableTestIndicator = new List<Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_04_02.Lab.Merged.ReportableHealthIndicator>();
     this.component3ReportLevelObservationEvent = new List<Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_04_02.Lab.Polb_mt004200ca.ReportSectionObservation>();
     this.component4ObservationChoice = new List<Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_04_02.Lab.Polb_mt004200ca.IObservationChoice>();
     this.subjectOf2 = new List<Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_04_02.Merged.Includes>();
 }
Ejemplo n.º 15
0
 public Informant12()
 {
     this.typeId                     = new IIImpl();
     this.templateId                 = new LISTImpl <II, Identifier>(typeof(IIImpl));
     this.assignedEntityTypeId       = new IIImpl();
     this.assignedEntityTemplateId   = new LISTImpl <II, Identifier>(typeof(IIImpl));
     this.assignedEntityId           = new LISTImpl <II, Identifier>(typeof(IIImpl));
     this.assignedEntityCode         = new CEImpl();
     this.assignedEntityAddr         = new LISTImpl <AD, PostalAddress>(typeof(ADImpl));
     this.assignedEntityTelecom      = new LISTImpl <TEL, TelecommunicationAddress>(typeof(TELImpl));
     this.relatedEntityClassCode     = new CSImpl();
     this.relatedEntityTypeId        = new IIImpl();
     this.relatedEntityTemplateId    = new LISTImpl <II, Identifier>(typeof(IIImpl));
     this.relatedEntityCode          = new CVImpl();
     this.relatedEntityAddr          = new LISTImpl <AD, PostalAddress>(typeof(ADImpl));
     this.relatedEntityTelecom       = new LISTImpl <TEL, TelecommunicationAddress>(typeof(TELImpl));
     this.relatedEntityEffectiveTime = new IVLTSCDAR1Impl();
 }
Ejemplo n.º 16
0
        private void TmrRefresh_Tick(object sender, EventArgs e)
        {
            if (first)
            {
                first = false;

                // BtnSend_Click(sender, e);
            }
            Wo1fSocketSettingStats St = C.Socket.Stats;

            LblPps.Text   = "rps: " + St.rpps + " - sps: " + St.pps;
            LblPing.Text  = "Ping: " + St.Ping;
            LblDebug.Text = "Debug: WFT:" + CS.ThreadCount() + " T: " + "??";
            if (C != null)
            {
                tabControl1.TabPages[0].Text = C.Name;
            }
        }
Ejemplo n.º 17
0
        internal static CS <TelecommunicationAddressUse> ConvertUse(TEL_TelecomUse value)
        {
            CS <TelecommunicationAddressUse> converted = new CS <TelecommunicationAddressUse>();

            switch (value)
            {
            case TEL_TelecomUse.Home:
                converted.Code = TelecommunicationAddressUse.Home;
                break;

            case TEL_TelecomUse.PrimaryHome:
                converted.Code = TelecommunicationAddressUse.PrimaryHome;
                break;

            case TEL_TelecomUse.VacationHome:
                converted.Code = TelecommunicationAddressUse.VacationHome;
                break;

            case TEL_TelecomUse.WorkPlace:
                converted.Code = TelecommunicationAddressUse.WorkPlace;
                break;

            case TEL_TelecomUse.AnsweringService:
                converted.Code = TelecommunicationAddressUse.AnsweringService;
                break;

            case TEL_TelecomUse.EmergencyContact:
                converted.Code = TelecommunicationAddressUse.EmergencyContact;
                break;

            case TEL_TelecomUse.MobileContact:
                converted.Code = TelecommunicationAddressUse.MobileContact;
                break;

            case TEL_TelecomUse.Pager:
                converted.Code = TelecommunicationAddressUse.Pager;
                break;

            default:
                converted.Code = TelecommunicationAddressUse.Home;     // It should never get this far
                break;
            }
            return(converted);
        }
Ejemplo n.º 18
0
        public Form1()
        {
            InitializeComponent();
            C.OnRecv           += new Client.PacketReceivedEventHandler(C_OnRecv);
            C.OnDisconnect     += new Client.OnDisconnectEventHandler(C_OnDisconnect);
            C.OnConnectSuccess += new Client.OnConnectSuccessEventHandler(C_OnConnectSuccess);

            Wo1f_Framework.Wo1f_Framework.Init();
            CS.SysLog("Form1 Initializing");
            Vars.Add("Hostport", 9001);
            CS.ConsoleLog   += new CS.ConsoleLogEventHandler(CS_ConsoleLog);
            CS.EnableLogging = true;
            C.Automate       = true;
            Cmd.Register("Msg", new CommandDelegate(OnMsg));
            Cmd.Register("Name", new CommandDelegate(OnName));

            C.Encryption = true;
            CS.SysLog("Form1 Initialized");
        }
Ejemplo n.º 19
0
        public void EIVLValidEIVL()
        {
            // Offset of 1d
            IVL <PQ> effectiveTime = new IVL <PQ>()
            {
                High = new PQ(1, "d")
            };
            // Event is BeforeLunch
            CS <DomainTimingEventType> event1 = new CS <DomainTimingEventType>(DomainTimingEventType.BeforeLunch);

            // Create EIVL instance and pass it the effective Time and event
            EIVL <TS> eivlInstance = new EIVL <TS>();

            //eivlInstance.Offset = effectiveTime;
            eivlInstance.Event = event1;

            // true if it validates
            Assert.IsTrue(eivlInstance.Validate());
        }
Ejemplo n.º 20
0
 public string DoChooseLesson(List <string> Cnos)
 {
     try {
         JXGLDBContext context = new JXGLDBContext();
         for (int i = 0; i < Cnos.Count; i++)
         {
             CS cs = new CS();
             cs.Sno = this.HttpContext.Session["UserName"].ToString();
             cs.Cno = Cnos[i];
             context.CSs.Add(cs);
             context.SaveChanges();
         }
         return("success");
     }
     catch
     {
         return("error");
     }
 }
Ejemplo n.º 21
0
 public IdentifiedClient()
 {
     this.id                      = new SETImpl <II, Identifier>(typeof(IIImpl));
     this.statusCode              = new CSImpl();
     this.effectiveTime           = new IVLImpl <TS, Interval <PlatformDate> >();
     this.confidentialityCode     = new CVImpl();
     this.identifiedPersonName    = new LISTImpl <PN, PersonName>(typeof(PNImpl));
     this.identifiedPersonTelecom = new LISTImpl <TEL, TelecommunicationAddress>(typeof(TELImpl));
     this.identifiedPersonAdministrativeGenderCode = new CVImpl();
     this.identifiedPersonBirthTime                = new TSImpl();
     this.identifiedPersonDeceasedInd              = new BLImpl();
     this.identifiedPersonDeceasedTime             = new TSImpl();
     this.identifiedPersonMultipleBirthInd         = new BLImpl();
     this.identifiedPersonMultipleBirthOrderNumber = new INTImpl();
     this.identifiedPersonAddr                  = new LISTImpl <AD, PostalAddress>(typeof(ADImpl));
     this.identifiedPersonAsOtherIDs            = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2007_v02_r02.Cr.Merged.OtherIDsNonHealthcareIdentifiers>();
     this.identifiedPersonPersonalRelationship  = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2007_v02_r02.Cr.Merged.PersonalRelationship>();
     this.identifiedPersonLanguageCommunication = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2007_v02_r02.Merged.LanguageCommunication>();
 }
Ejemplo n.º 22
0
 public ObservationMedia()
 {
     this.iD                = new STImpl();
     this.classCode         = new CSImpl();
     this.moodCode          = new CSImpl();
     this.typeId            = new IIImpl();
     this.templateId        = new LISTImpl <II, Identifier>(typeof(IIImpl));
     this.id                = new LISTImpl <II, Identifier>(typeof(IIImpl));
     this.languageCode      = new CSImpl();
     this.value             = new EDImpl <EncapsulatedData>();
     this.specimen          = new List <Ca.Infoway.Messagebuilder.Model.Pcs_cda_r1_2.Basemodel.Specimen>();
     this.performer         = new List <Ca.Infoway.Messagebuilder.Model.Pcs_cda_r1_2.Merged.Performer2>();
     this.author            = new List <Ca.Infoway.Messagebuilder.Model.Pcs_cda_r1_2.Basemodel.Author>();
     this.informant         = new List <Ca.Infoway.Messagebuilder.Model.Pcs_cda_r1_2.Merged.Informant12>();
     this.participant       = new List <Ca.Infoway.Messagebuilder.Model.Pcs_cda_r1_2.Merged.Participant2>();
     this.entryRelationship = new List <Ca.Infoway.Messagebuilder.Model.Pcs_cda_r1_2.Basemodel.EntryRelationship>();
     this.reference         = new List <Ca.Infoway.Messagebuilder.Model.Pcs_cda_r1_2.Basemodel.Reference>();
     this.precondition      = new List <Ca.Infoway.Messagebuilder.Model.Pcs_cda_r1_2.Basemodel.Precondition>();
 }
Ejemplo n.º 23
0
        /// <summary>
        /// Parse an object from <paramref name="s"/>
        /// </summary>
        /// <param name="s">The stream to parse from</param>
        /// <returns>The parsed object</returns>
        public override object Parse(System.Xml.XmlReader s, DatatypeFormatterParseResult result)
        {
            // Parse CS
            CS <String> retVal = base.Parse <CS <String> >(s, result);

            // Now parse our data out... Attributes
            if (retVal.NullFlavor == null && s.GetAttribute("code") != null)
            {
                retVal.Code = s.GetAttribute("code");
            }

            // Validate
            string pathName = s is XmlStateReader ? (s as XmlStateReader).CurrentPath : s.Name;

            base.Validate(retVal, pathName, result);


            return(retVal);
        }
Ejemplo n.º 24
0
 protected override void VisitFuseExpression(FuseExpression expression)
 {
     CS.IndentInOut(
         "FuseExpression",
         () =>
     {
         VisitExpression(expression.Expression);
         CS.If(
             $"{Locals.Result}.IsSuccess",
             () =>
         {
             using var value = Locals.Use("value");
             using var node  = Locals.Use("node");
             CS.Ln($"{value} = string.Join(string.Empty, {Locals.Result}.Nodes.Select(n => n.Fuse()));");
             CS.Ln($"{node} = Leaf.From({Locals.Result}, NodeSymbols.Fusion, {value});");
             CS.Ln($"{Locals.Result} = Result.Success({Locals.Result}, {Locals.Result}.Next, {node});");
         });
     });
 }
 public Act()
 {
     this.negationInd       = new BLImpl();
     this.typeId            = new IIImpl();
     this.templateId        = new LISTImpl <II, Identifier>(typeof(IIImpl));
     this.id                = new LISTImpl <II, Identifier>(typeof(IIImpl));
     this.text              = new EDImpl <EncapsulatedData>();
     this.effectiveTime     = new IVLTSCDAR1Impl();
     this.priorityCode      = new CEImpl();
     this.languageCode      = new CSImpl();
     this.specimen          = new List <Ca.Infoway.Messagebuilder.Model.Ccda_pcs_r1_1.Merged.Specimen>();
     this.performer         = new List <Ca.Infoway.Messagebuilder.Model.Ccda_pcs_r1_1.Merged.Performer2_1>();
     this.author            = new List <Ca.Infoway.Messagebuilder.Model.Ccda_pcs_r1_1.Merged.Author_1>();
     this.informant         = new List <Ca.Infoway.Messagebuilder.Model.Ccda_pcs_r1_1.Merged.Informant12>();
     this.participant       = new List <Ca.Infoway.Messagebuilder.Model.Ccda_pcs_r1_1.Merged.Participant2_2>();
     this.entryRelationship = new List <Ca.Infoway.Messagebuilder.Model.Ccda_pcs_r1_1.Coverageactivity.IEntryRelationshipChoice>();
     this.reference         = new List <Ca.Infoway.Messagebuilder.Model.Ccda_pcs_r1_1.Basemodel.Reference>();
     this.precondition      = new List <Ca.Infoway.Messagebuilder.Model.Ccda_pcs_r1_1.Basemodel.Precondition>();
 }
Ejemplo n.º 26
0
        private void AsyncSend(Packet P)
        {
            if (asyncbusy)
            {
                SQueue.Add(P);
                return;
            }

            if (SQueue.Count > 0)
            {
                int x = 0;
                P.ExtraPacket = true;
                while (x < 10) //x packets at a time or until full(todo: add code to check if full)
                {
                    if (SQueue.Count == 0)
                    {
                        break;
                    }
                    P.Extras.Add(SQueue[0]);
                    SQueue.RemoveAt(0);
                    x++;
                }
                CS.SysLog("Send queue backed up.  Sending " + P.Extras.Count + " extra packets.");
            }
            asyncbusy = true;
            byte[] info = P.ToBytes();
            try
            {
                Tcp.Client.BeginSend(info, 0, info.Length, SocketFlags.None, new AsyncCallback(BeginSendCallback), this);
            }
            catch (Exception E)
            {
                //OnSendFail

                CS.SysLog("Packet sending failed");
            }
            asyncbusy = false;
            this.Stats.packetssent++;
            if (P.ExtraPacket)
            {
                this.Stats.packetssent += P.Extras.Count;
            }
        }
Ejemplo n.º 27
0
 protected override void VisitPlusExpression(PlusExpression plus)
 {
     CS.IndentInOut(
         "PlusExpression",
         () =>
     {
         using var start = Locals.Use("start");
         using var nodes = Locals.Use("nodes");
         CS.Ln($"{start} = {Cfg.CurName};");
         CS.Ln($"{nodes} = new List<INode>(10);");
         Locals.PeekPrep(Writer);
         CS.ForEver(
             () =>
         {
             VisitExpression(plus.Expression);
             CS.If(
                 $"{Locals.Result}.IsSuccess",
                 () =>
             {
                 CS.Ln($"{Cfg.CurName} = {Locals.Result}.Next;");
                 CS.Ln($"{nodes}.AddRange({Locals.Result}.Nodes);");
             },
                 () =>
             {
                 CS.Ln("break;");
             });
         });
         CS.If(
             $"{nodes}.Count > 0",
             () =>
         {
             using var location = Locals.Use("location");
             using var node     = Locals.Use("node");
             CS.Ln($"{location} = Location.From({start}, {Cfg.CurName});");
             CS.Ln($"{node} = NodeList.From({location}, NodeSymbols.Plus, {nodes}.ToArray());");
             CS.Ln($"{Locals.Result} = Result.Success({location}, {Cfg.CurName}, {node});");
         },
             () =>
         {
             CS.Ln($"{Locals.Result} = Result.Fail({start});");
         });
     });
 }
Ejemplo n.º 28
0
 protected override void VisitAndExpression(AndExpression expression)
 {
     CS.IndentInOut(
         "AndExpression",
         () =>
     {
         Locals.PeekPrep(Writer);
         VisitExpression(expression.Expression);
         CS.If(
             $"{Locals.Result}.IsSuccess",
             () =>
         {
             CS.Ln($"{Locals.Result} = Result.Success({Locals.Result}, {Cfg.CurName});");
         },
             () =>
         {
             CS.Ln($"{Locals.Result} = Result.Fail({Cfg.CurName});");
         });
     });
 }
Ejemplo n.º 29
0
 private void TmrRefresh_Tick(object sender, EventArgs e)
 {
     if (!listening)
     {
         LblSocket.Text = "Socket is: Waiting";
     }
     else
     {
         if (Listener.Stats.Listening)
         {
             LblSocket.Text = "Socket is: Listening on port " + Listener.Port;//.Settings.Port;
             //LblRecv.Text = "Recv: " +
         }
     }
     LblSent.Text  = "Sent: " + Clients.Sent();
     LblRecv.Text  = "Recv: " + Clients.Recv();
     LblRPPS.Text  = "RPPS: " + Clients.RecvPPS();
     LblSPPS.Text  = "SPPS: " + Clients.SentPPS();
     LblDebug.Text = string.Format("WFT: {0} - T: {1}", CS.ThreadCount(), "??");
 }
Ejemplo n.º 30
0
 public Prescription()
 {
     this.id                  = new IIImpl();
     this.statusCode          = new CSImpl();
     this.confidentialityCode = new CVImpl();
     this.definitionSubstanceAdministrationDefinition = new List <Ca.Infoway.Messagebuilder.Model.Sk_cerx_v01_r04_2.Pharmacy.Merged.Protocols>();
     this.reason = new List <Ca.Infoway.Messagebuilder.Model.Sk_cerx_v01_r04_2.Pharmacy.Merged.PrescribedBecauseOf>();
     this.preconditionVerificationEventCriterion       = new BLImpl(false);
     this.pertinentInformationQuantityObservationEvent = new List <Ca.Infoway.Messagebuilder.Model.Sk_cerx_v01_r04_2.Pharmacy.Merged.PrescriptionPatientMeasurements>();
     this.derivedFromSourceDispense        = new BLImpl(false);
     this.coverageCoverage                 = new List <Ca.Infoway.Messagebuilder.Model.Sk_cerx_v01_r04_2.Pharmacy.Merged.CoverageExtensions_2>();
     this.component1DosageInstruction      = new List <Ca.Infoway.Messagebuilder.Model.Sk_cerx_v01_r04_2.Pharmacy.Porx_mt980040ca.AdministrationInstructions>();
     this.fulfillment1MedicationDispense   = new List <Ca.Infoway.Messagebuilder.Model.Sk_cerx_v01_r04_2.Pharmacy.Merged.PrescriptionDispenses>();
     this.subjectOf1DetectedIssueEvent     = new List <Ca.Infoway.Messagebuilder.Model.Sk_cerx_v01_r04_2.Pharmacy.Porx_mt980030ca.Issues>();
     this.subjectOf2AnnotationIndicator    = new BLImpl(false);
     this.subjectOf3Annotation             = new List <Ca.Infoway.Messagebuilder.Model.Sk_cerx_v01_r04_2.Common.Coct_mt120600ca.Notes>();
     this.subjectOf4ControlActEvent        = new List <Ca.Infoway.Messagebuilder.Model.Sk_cerx_v01_r04_2.Pharmacy.Merged.StatusChanges>();
     this.subjectOf6RefusalToFill          = new List <Ca.Infoway.Messagebuilder.Model.Sk_cerx_v01_r04_2.Pharmacy.Merged.RefusalToFills>();
     this.subjectOf7DetectedIssueIndicator = new BLImpl(false);
 }
Ejemplo n.º 31
0
 public ComponentEncounter()
 {
     this.typeId                   = new IIImpl();
     this.templateId               = new LISTImpl <II, Identifier>(typeof(IIImpl));
     this.id                       = new IIImpl();
     this.code                     = new CDImpl();
     this.text                     = new EDImpl <EncapsulatedData>();
     this.statusCode               = new CSImpl();
     this.effectiveTime            = new IVLTSCDAR1Impl();
     this.dischargeDispositionCode = new CEImpl();
     this.priorityCode             = new CEImpl();
     this.specimen                 = new List <Ca.Infoway.Messagebuilder.Model.Ccda_pcs_r1_1.Merged.Specimen>();
     this.performer                = new List <Ca.Infoway.Messagebuilder.Model.Ccda_pcs_r1_1.Merged.Performer2_1>();
     this.author                   = new List <Ca.Infoway.Messagebuilder.Model.Ccda_pcs_r1_1.Merged.Author_1>();
     this.informant                = new List <Ca.Infoway.Messagebuilder.Model.Ccda_pcs_r1_1.Merged.Informant12>();
     this.participant              = new List <Ca.Infoway.Messagebuilder.Model.Ccda_pcs_r1_1.Merged.Participant2_2>();
     this.entryRelationship        = new List <Ca.Infoway.Messagebuilder.Model.Ccda_pcs_r1_1.Merged.EntryRelationship_2>();
     this.reference                = new List <Ca.Infoway.Messagebuilder.Model.Ccda_pcs_r1_1.Basemodel.Reference>();
     this.precondition             = new List <Ca.Infoway.Messagebuilder.Model.Ccda_pcs_r1_1.Basemodel.Precondition>();
 }
Ejemplo n.º 32
0
        public void CSCastGenericToTypeTest()
        {
                //CS<NullFlavor>.Code = Other
                CS<NullFlavor> csInstance = new CS<NullFlavor>();
                csInstance.Code = NullFlavor.Other;

                // Cast CS<T> to T
                NullFlavor nvInstance = (NullFlavor)csInstance;
                
                // True if cast was successful
                Assert.IsTrue(nvInstance == NullFlavor.Other);
        }
Ejemplo n.º 33
0
        //バッファに残っているデータの送信
        //パラメータ cs CS.SERVER を設定した場合、buf[CS.SERVER]を処理対象とし、クライアント側に送信する
        bool SendBuf(CS cs)
        {
            var sock = Proxy.Sock(CS.Client);
            if(cs == CS.Client)
                sock = Proxy.Sock(CS.Server);

            var len = _oneObj.Body[cs].Length - _oneObj.Pos[cs];
            if(len > 0) {
                var sendBuf = _oneObj.Body[cs].SendBuf((int)_oneObj.Pos[cs]);
                if(!Send(sock,sendBuf))//送信
                    return false;
                _oneObj.Pos[cs] += len;
                _lastRecvServer = DateTime.Now.Ticks;
            }
            return true;
        }
Ejemplo n.º 34
0
 public void CSContentSameEqualityTest()
 {
     CS<String> a = new CS<string>(
         "12345"
         ),
     b = new CS<String>(
         "12345"
         );
     Assert.IsTrue(a.Equals(b));
 }
Ejemplo n.º 35
0
 //ソケットに到着しているデータ量
 public int Length(CS cs)
 {
     return _sock[cs].Length();
 }
Ejemplo n.º 36
0
 internal static CS<TelecommunicationAddressUse> ConvertUse(TEL_TelecomUse value)
 {
     CS<TelecommunicationAddressUse> converted = new CS<TelecommunicationAddressUse>();
     switch (value)
     {
         case TEL_TelecomUse.Home:
             converted.Code = TelecommunicationAddressUse.Home;
             break;
         case TEL_TelecomUse.PrimaryHome:
             converted.Code = TelecommunicationAddressUse.PrimaryHome;
             break;
         case TEL_TelecomUse.VacationHome:
             converted.Code = TelecommunicationAddressUse.VacationHome;
             break;
         case TEL_TelecomUse.WorkPlace:
             converted.Code = TelecommunicationAddressUse.WorkPlace;
             break;
         case TEL_TelecomUse.AnsweringService:
             converted.Code = TelecommunicationAddressUse.AnsweringService;
             break;
         case TEL_TelecomUse.EmergencyContact:
             converted.Code = TelecommunicationAddressUse.EmergencyContact;
             break;
         case TEL_TelecomUse.MobileContact:
             converted.Code = TelecommunicationAddressUse.MobileContact;
             break;
         case TEL_TelecomUse.Pager:
             converted.Code = TelecommunicationAddressUse.Pager;
             break;
         default:
             converted.Code = TelecommunicationAddressUse.Home; // It should never get this far
             break;
     }
     return converted;
 }
Ejemplo n.º 37
0
 public void CSNullTest()
 {
     CS<String> cs = new CS<String>();
     cs.Code = null;
     cs.NullFlavor = null;
     Assert.IsFalse(cs.Validate());
 }
Ejemplo n.º 38
0
        //バッファに残っているデータの送信
        //パラメータ cs CS.SERVER を設定した場合、buf[CS.SERVER]を処理対象とし、クライアント側に送信する
        bool SendBuf(CS cs)
        {
            var sock = _proxy.Sock(CS.Client);
            if (cs == CS.Client)
                sock = _proxy.Sock(CS.Server);

            var len = _oneObj.Body[cs].Length - _oneObj.Pos[cs];
            if (len > 0) {
                //Ver5.6.1
                byte[] sendBuf = _oneObj.Body[cs].SendBuf((int)_oneObj.Pos[cs]);
                if (!Send(sock, sendBuf))//送信
                    return false;
                _oneObj.Pos[cs] += len;
                //byte[] sendBuf = new byte[len];
                //Buffer.BlockCopy(oneObj.Body[cs], oneObj.Pos[cs], sendBuf, 0, len);
                //if (!Send(sock, sendBuf))//送信
                //    return false;
                //if (oneObj.Pos[cs] == 0) {
                //    oneObj.Body[cs] = new byte[0];
                //    if (len > 65535) {
                //        System.GC.Collect();
                //    }
                //} else {
                //    oneObj.Pos[cs] += len;
                //}

            }
            return true;
        }
Ejemplo n.º 39
0
 public void CSCodeTest()
 {
     CS<String> cs = new CS<String>();
     cs.Code = "284196006";
     cs.NullFlavor = null;
     Assert.IsTrue(cs.Validate());
 }
Ejemplo n.º 40
0
 public void CSCodeNullFlavorTest()
 {
     CS<String> cs = new CS<String>();
     cs.Code = "284196006";
     cs.NullFlavor = NullFlavor.NoInformation;
     Assert.IsFalse(cs.Validate());
 }
Ejemplo n.º 41
0
 /// <summary>
 /// Gets a common ancestor
 /// </summary>
 public static NullFlavor GetCommonParent(this CS<NullFlavor> a, CS<NullFlavor> other)
 {
     return NullFlavorUtil.GetCommonParent((NullFlavor)a, (NullFlavor)other);
 }
Ejemplo n.º 42
0
 public SockTcp Sock(CS cs)
 {
     return _sock[cs];
 }
Ejemplo n.º 43
0
        public void CSCastCStoGenericCSTest()
        {
                //CS.Code = “OTH”
                CS<String> csInstance = new CS<String>();
                csInstance.Code = "OTH";
                
                // create a CS<NullFlavor> object
                CS<NullFlavor> csNullFlavorInstance = new CS<NullFlavor>();

                //Cast CS<String> to CS<T>
                csNullFlavorInstance = Util.Convert<CS<NullFlavor>>(csInstance);
                
                // is true if cast was successful
                Assert.IsTrue(csNullFlavorInstance.Code == NullFlavor.Other);
        }
Ejemplo n.º 44
0
 public HttpSideState SideState(CS cs)
 {
     return _sideState[cs];
 }
Ejemplo n.º 45
0
 public void CSNullFlavorTest()
 {
     CS<String> cs = new CS<String>();
     cs.Code = null;
     cs.NullFlavor = NullFlavor.NotApplicable;
     Assert.IsTrue(cs.Validate());
 }
Ejemplo n.º 46
0
 CS Reverse(CS cs)
 {
     return cs == CS.Client ? CS.Server : CS.Client;
 }
Ejemplo n.º 47
0
 public void CSContentDifferentEqualityTest()
 {
     CS<String> a = new CS<string>(
         "12345"
         ),
     b = new CS<String>(
         "12346"
         );
     Assert.IsFalse(a.Equals(b));
 }
Ejemplo n.º 48
0
        //バッファに残っているデータの送信
        //パラメータ cs CS.SERVER を設定した場合、buf[CS.SERVER]を処理対象とし、クライアント側に送信する
        bool SendBuf(CS cs)
        {
            TcpObj sock = proxy.Sock(CS.CLIENT);
            if(cs == CS.CLIENT)
                sock = proxy.Sock(CS.SERVER);

            int len = oneObj.Buf[cs].Length - oneObj.Pos[cs];
            if(len > 0) {
                byte[] sendBuf = new byte[len];
                Buffer.BlockCopy(oneObj.Buf[cs],oneObj.Pos[cs],sendBuf,0,len);
                if(!Send(sock,sendBuf))//送信
                    return false;
                oneObj.Pos[cs] += len;
            }
            return true;
        }
Ejemplo n.º 49
0
 public void CSExample9Test02()
 {
     CS<AcknowledgementCondition> condition =
             new CS<AcknowledgementCondition>(AcknowledgementCondition.Always);
     // Direct assignment of a code
     condition = AcknowledgementCondition.Never;
     // Assignment through the code property
     condition.Code = null;
     Assert.IsFalse(condition.Validate());
 }
Ejemplo n.º 50
0
        internal static CS<PostalAddressUse> ConvertUse(AD_AddressUse value)
        {
            CS<PostalAddressUse> converted = new CS<PostalAddressUse>();

            switch (value)
            {
                case AD_AddressUse.HomeAddress:
                    converted.Code = PostalAddressUse.HomeAddress;
                    break;
                case AD_AddressUse.PrimaryHome:
                    converted.Code = PostalAddressUse.PrimaryHome;
                    break;
                case AD_AddressUse.VacationHome:
                    converted.Code = PostalAddressUse.VacationHome;
                    break;
                case AD_AddressUse.WorkPlace:
                    converted.Code = PostalAddressUse.WorkPlace;
                    break;
                case AD_AddressUse.Public:
                    converted.Code = PostalAddressUse.Public;
                    break;
                case AD_AddressUse.BadAddress:
                    converted.Code = PostalAddressUse.BadAddress;
                    break;
                case AD_AddressUse.PhysicalVisit:
                    converted.Code = PostalAddressUse.PhysicalVisit;
                    break;
                case AD_AddressUse.PostalAddress:
                    converted.Code = PostalAddressUse.PostalAddress;
                    break;
                case AD_AddressUse.TemporaryAddress:
                    converted.Code = PostalAddressUse.TemporaryAddress;
                    break;
                case AD_AddressUse.Alphabetic:
                    converted.Code = PostalAddressUse.Alphabetic;
                    break;
                case AD_AddressUse.Ideographic:
                    converted.Code = PostalAddressUse.Ideographic;
                    break;
                case AD_AddressUse.Syllabic:
                    converted.Code = PostalAddressUse.Syllabic;
                    break;
                default:
                    break;
            }
            return converted;
        }
Ejemplo n.º 51
0
 public void CSExample9Test()
 {
     CS<AcknowledgementCondition> condition =
             new CS<AcknowledgementCondition>(AcknowledgementCondition.Always);
     // Direct assignment of a code
     condition = AcknowledgementCondition.Never;
     // Assignment through the code property
     condition.Code = AcknowledgementCondition.ErrorRejectOnly;
     // Assignment of a non-bound code
     condition.Code = CodeValue<AcknowledgementCondition>.Parse("OTHER CODE");
     Assert.IsFalse(condition.Validate());
 }
Ejemplo n.º 52
0
 public HTTP_SIDE_STATE SideState(CS cs)
 {
     return sideState[cs];
 }
Ejemplo n.º 53
0
 public void CSTypeMismatchEqualityTest()
 {
     CS<NullFlavor> a = new CS<NullFlavor>(
         NullFlavor.NoInformation
         );
     Assert.IsFalse(a.Equals("12345"));
 }
Ejemplo n.º 54
0
        public void CSExample9Test05()
        {
            CS<AcknowledgementCondition> condition = 
                new CS<AcknowledgementCondition>(AcknowledgementCondition.Always);
            condition.Code = null;
            condition.NullFlavor = NullFlavor.NoInformation;

            Assert.IsTrue(condition.Validate());

        }
Ejemplo n.º 55
0
        public void EIVLValidEIVL()
        {
            // Offset of 1d
            IVL<PQ> effectiveTime = new IVL<PQ>() { High = new PQ(1, "d") };
            // Event is BeforeLunch
            CS<DomainTimingEventType> event1 = new CS<DomainTimingEventType>(DomainTimingEventType.BeforeLunch);
            
            // Create EIVL instance and pass it the effective Time and event 
            EIVL<TS> eivlInstance = new EIVL<TS>();
            //eivlInstance.Offset = effectiveTime;
            eivlInstance.Event = event1;

            // true if it validates
            Assert.IsTrue(eivlInstance.Validate());
        }
Ejemplo n.º 56
0
        //データの受信
        //パラメータ cs CS.SERVER を設定した場合、buf[CS.SERVER]を処理対象とし、クライアント側に送信する
        bool RecvBuf(CS cs, ILife iLife)
        {
            SockTcp sock = Proxy.Sock(cs);
            if(sock == null)//サーバ側未接続
                return true;

            var len = sock.Length();
            if(len == 0)
                return true;
            var b = sock.Recv(len,Proxy.OptionTimeout,iLife);
            if(b == null)
                return false;
            _oneObj.Body[cs].Add(b);
            _lastRecvServer = DateTime.Now.Ticks;
            return true;
        }
Ejemplo n.º 57
0
 CS Reverse(CS cs)
 {
     if (cs == CS.CLIENT)
         return CS.SERVER;
     return CS.CLIENT;
 }
Ejemplo n.º 58
0
 /// <summary>
 /// Gets a common ancestor
 /// </summary>
 public static NullFlavor CommonAncestorWith(this CS<NullFlavor> a, CS<NullFlavor> other)
 {
     return NullFlavorUtil.CommonAncestorWith((NullFlavor)a, (NullFlavor)other);
 }
Ejemplo n.º 59
0
        public void CS32CastStringToGenericTest()
        {
            // “Other”
            String stringText = "OTH";

            // create CS<NullFlavor> instance
            CS<NullFlavor> csInstance = new CS<NullFlavor>();

            // cast String to CS<T>
            csInstance = Util.Convert<CS<NullFlavor>>(stringText);
            
            // True if the cast was successful
            Assert.IsTrue(csInstance.Code == NullFlavor.Other);
        }