• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Result类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Result的典型用法代码示例。如果您正苦于以下问题:C# Result类的具体用法?C# Result怎么用?C# Result使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Result类属于命名空间,在下文中一共展示了Result类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Build

 /// <summary>
 /// Build the index
 /// </summary>
 public virtual void Build(MetricDB db, int bsize, Random rand)
 {
     this.DB = db;
     var n = this.DB.Count;
     // randomized has very good performance, even compared with more "intelligent" strategies
     var dseq = new DynamicSequentialOrdered ();
     dseq.Build (db, rand);
     this.NODES = new List<Node> (n / bsize + 1);
     var L = new List<ItemPair> (n);
     while (dseq.Count > 0) {
         if (this.NODES.Count % 100 == 0) {
             Console.WriteLine ("XXX {0}, bucketSize: {1}, remain {2}/{3}, db: {4}, date-time: {5}",
                                this, bsize, dseq.Count, db.Count, Path.GetFileName(db.Name), DateTime.Now);
         }
         var refID = dseq.GetAnyItem ();
         dseq.Remove (refID);
         L.Clear ();
         dseq.ComputeDistances (this.DB[refID], L);
         var near = new Result(bsize);
         var far = new Result (1);
         dseq.AppendKExtremes (near, far, L);
         var node = new Node (refID);
         this.NODES.Add (node);
         dseq.Remove (near);
         foreach (var p in near) {
             node.Add(p.ObjID, p.Dist);
         }
     }
 }
开发者ID:sadit,项目名称:natix,代码行数:32,代码来源:LC.cs


示例2: SetSessionByCategoryList

    public static Result SetSessionByCategoryList()
    {
        CategoryBO oCategoryBO = new CategoryBO();
        Result oResult = new Result();

        List<Category> oListCategory = new List<Category>();

        try
        {
            oResult = oCategoryBO.CategoryGetFromDatabaseForSetSession();

            if (oResult.ResultIsSuccess)
            {
                oListCategory = (List<Category>)oResult.ResultObject;

                Utils.SetSession(SessionManager.csStoredCategory, oListCategory);
            }
        }
        catch (Exception oEx)
        {
            oResult.ResultIsSuccess = false;
            oResult.ResultException = oEx;
            oResult.ResultMessage = "Exception occured during Set Session By CategoryList.";
        }

        return oResult;
    }
开发者ID:krishnakanthms,项目名称:Online-Exam-tool,代码行数:27,代码来源:Utils.cs


示例3: Run

        public Result Run(int itemCount, long dllSize)
        {
            var result = new Result()
            {
                TestName = Name,
                DTOCount = itemCount,
                DLLSize = dllSize
            };

            var startDate = DateTime.Now;
            var stream = new MemoryStream();
            var testData = SampleDTO.GenerateSamples(itemCount);
            var endDate = DateTime.Now;

            result.SetupTime = (endDate - startDate).TotalMilliseconds;

            startDate = DateTime.Now;
            SerializerUtility.Serialize(stream, testData);
            endDate = DateTime.Now;

            result.SerializeTime = (endDate - startDate).TotalMilliseconds;
            result.SerializedByteCount = stream.ToArray().Length;

            stream.Seek(0, SeekOrigin.Begin);
            startDate = DateTime.Now;
            var deData = SerializerUtility.Deserialize<SampleDTO>(stream);
            endDate = DateTime.Now;

            result.DeserializeTime = (endDate - startDate).TotalMilliseconds;

            return result;
        }
开发者ID:tarwn,项目名称:PCLProtobufComparison,代码行数:32,代码来源:Test.cs


示例4: GetResult

        /// <summary>
        /// Get the variable value.
        /// </summary>
        /// <returns></returns>
        public Result GetResult()
        {
            Result result = new Result( 1 );
            result.Add( new object[]{Value} );

            return result;
        }
开发者ID:furesoft,项目名称:SharpHSQL,代码行数:11,代码来源:Declare.cs


示例5: OnActivityResult

 protected override void OnActivityResult(int requestCode, Result resultCode, Intent data)
 {
     if (requestCode == 111 && resultCode == Result.Ok) {
         Console.WriteLine (data.Data);
     }
     base.OnActivityResult (requestCode, resultCode, data);
 }
开发者ID:Grawl,项目名称:hubbl,代码行数:7,代码来源:SongsPickingActivity.cs


示例6: ResultMarker

		public ResultMarker (Result result) : base (
				GetColor (result),
				IsOneLine (result)? (result.Region.BeginColumn) : 0,
				IsOneLine (result)? (result.Region.EndColumn) : 0)
		{
			this.result = result;
		}
开发者ID:nocache,项目名称:monodevelop,代码行数:7,代码来源:ResultMarker.cs


示例7: GetStatusCode

 /// <summary>
 /// �w��REST API�̌Ăяo����s��
 /// </summary>
 public int GetStatusCode(string extend, ref Result result)
 {
     result.Initialize();
     result.url = baseurl;
     HttpWebRequest webreq = null;
     try
     {
         webreq = (HttpWebRequest)WebRequest.Create(result.url);
     }
     catch (SystemException e)
     {
         result.data = e.Message;
         result.returnCode = -1;
         return result.returnCode;
     }
     //���\�b�h��POST��w��
     webreq.Timeout = timeoutLimit;
     webreq.Method = "GET";
     if (extend != null && extend.Length > 0)
     {
         webreq.Method = "POST";
         webreq.ContentLength = extend.Length;
         System.IO.Stream reqStream = webreq.GetRequestStream();
         reqStream.Write(Encoding.UTF8.GetBytes(extend), 0, extend.Length);
         reqStream.Close();
     }
     HttpWebResponse webres = null;
     try
     {
         webres = (HttpWebResponse)webreq.GetResponse();
         Stream st = webres.GetResponseStream();
         Encoding enc = Encoding.GetEncoding("utf-8");
         StreamReader sr = new StreamReader(st, enc);
         result.data = sr.ReadToEnd();
         sr.Close();
         result.returnCode = (int)webres.StatusCode;
     }
     catch (System.Net.WebException ex)
     {
         if (ex.Status == System.Net.WebExceptionStatus.ProtocolError)
         {
             HttpWebResponse errres = (HttpWebResponse)ex.Response;
             result.returnCode = (int)errres.StatusCode;
         }
         else
         {
             // �������z�X�g���Ȃǂ�����ł��Ȃ����
             result.returnCode = -1;
         }
         result.data = ex.Message;
     }
     finally
     {
         if (webres != null)
         {
             webres.Close();
         }
     }
     return result.returnCode;
 }
开发者ID:kawahira,项目名称:WebApiTest,代码行数:63,代码来源:connection.cs


示例8: Invoke

        public Yield Invoke(Plug plug, string verb, XUri uri, DreamMessage request, Result<DreamMessage> response)
        {
            // NOTE (steveb): we convert 'xri://@name/path?params' into 'http://xri.net/@name/path?params'

            // prepend segments with authority
            List<string> segments = new List<string>();
            segments.Add(uri.Authority);
            if(uri.Segments != null) {
                segments.AddRange(uri.Segments);
            }

            // build new plug
            List<PlugHandler> preHandlers = (plug.PreHandlers != null) ? new List<PlugHandler>(plug.PreHandlers) : null;
            List<PlugHandler> postHandlers = (plug.PostHandlers != null) ? new List<PlugHandler>(plug.PostHandlers) : null;
            Plug xri = new Plug(new XUri("http", null, null, "xri.net", 80, segments.ToArray(), uri.TrailingSlash, uri.Params, uri.Fragment), plug.Timeout, request.Headers, preHandlers, postHandlers, plug.Credentials, plug.CookieJar, plug.MaxAutoRedirects);

            // add 'Accept' header for 'application/xrds+xml' mime-type
            if((xri.Headers == null) || (xri.Headers.Accept == null)) {
                xri = xri.WithHeader(DreamHeaders.ACCEPT, MimeType.RenderAcceptHeader(MimeType.XRDS));
            }

            // BUGBUGBUG (steveb): this will probably fail in some cases since we may exit this coroutine before the call has completed!

            xri.InvokeEx(verb, request, response);
            yield break;
        }
开发者ID:maximmass,项目名称:DReAM,代码行数:26,代码来源:XriPlugEndpoint.cs


示例9: UpdateAccount

        public Result UpdateAccount(Account account, bool deleteAccount)
        {
            IList<Account> accounts = GetAccounts().ToList();
            var result = new Result()
            {
                Activity = deleteAccount ? "Delete Account" : "Update Account"
            };
            if (accounts.Count > 0 && accounts.All(x => x != null))
            {
                if (deleteAccount)
                {
                    accounts.Remove(accounts.FirstOrDefault(x => x.UserName == account.UserName));
                }
                else
                {
                    accounts.Remove(accounts.FirstOrDefault(x => x.UserName == account.UserName));
                    accounts.Add(account);
                    result.Account = account;
                }

                using (TextWriter writer = new StreamWriter(_FileName))
                {
                    _Serializer.Serialize(writer, accounts.ToArray());
                }

                result.IsSuccessful = true;
            }
            else
            {
                result.IsSuccessful = false;
                result.Reason = "Xml did not return any accounts.";
            }

            return result;
        }
开发者ID:wi937c-amr,项目名称:IDesign-Code,代码行数:35,代码来源:XmlAccountStoreResource.cs


示例10: GetData

    public void GetData(IRequest request)
    {
        int numberToDisplay = 5;

        Sage.SalesLogix.Security.SLXUserService slxUserService = ApplicationContext.Current.Services.Get<Sage.Platform.Security.IUserService>() as Sage.SalesLogix.Security.SLXUserService;
        string currentUserId = slxUserService.GetUser().Id.ToString();
        IRepository<IOpportunity> oRep = EntityFactory.GetRepository<IOpportunity>();
        IExpressionFactory ep = ((IQueryable)oRep).GetExpressionFactory();
        ICriteria countCrit = GetOpenOppCrit(oRep, ep, currentUserId);
        countCrit.SetProjection(((IQueryable)oRep).GetProjectionsFactory().RowCount());
        int totalCount = Convert.ToInt32(countCrit.UniqueResult());

        ICriteria crit = GetOpenOppCrit(oRep, ep, currentUserId);
        crit.AddOrder(ep.Asc("EstimatedClose"));
        crit.SetMaxResults(numberToDisplay);
        IList<IOpportunity> opps = crit.List<IOpportunity>();
        numberToDisplay = (totalCount < numberToDisplay) ? totalCount : numberToDisplay;

        var result = new Result();
        result.items = new List<OpportunityRepresentation>();
        result.columns = new string[] { "id", "description", "estClose", "potential", "probability", "stage", "nextStep", "nextActivityId", "nextActivityName", "daysInStage", "daysSinceLastActivity" };
        for (int i = 0; i < numberToDisplay; i++)
        {
            result.items.Add(OpportunityRepresentation.from(opps[i]));
        }
        string groupId = GetPluginIdFromFamilyAndName("Opportunity", "My Open Opps");
        int groupCount = totalCount;
        result.openOppGroup = groupId;
        result.openOppCount = groupCount;
        result.numberToDisplay = numberToDisplay;

        request.Response.ContentType = MediaType.JSON;
        request.Response.Html = JavaScriptConvert.SerializeObject(result);
    }
开发者ID:pebre77,项目名称:PrxS2,代码行数:34,代码来源:ClosingOpportunityAdapter.cs


示例11: AdminWindow_OnBeforeDisplayAdminWindowOverlay

 void AdminWindow_OnBeforeDisplayAdminWindowOverlay(Result result)
 {
     if(WebAuthentication.IsLoggedIn)
         if(WebAuthentication.VerifyAccess(PermissionType.AdministrativeAccess))
             return;
     result.SetFailed("access denied");
 }
开发者ID:priaonehaha,项目名称:sprocketcms,代码行数:7,代码来源:WebSecurity.cs


示例12: ParseResult

        private Result ParseResult(string line)
        {
            string[] parts = line.Split(new[] { ',' }, StringSplitOptions.None);

            if (parts.Length != 12)
            {
                throw new InvalidOperationException("CSV file has invalid format. Please delete CSV first.");
            }

            var result = new Result();

            result.Name = parts[0];
            result.Version = parts[1];

            result.SingletonTime = long.Parse(parts[2]);
            result.TransientTime = long.Parse(parts[3]);
            result.CombinedTime = long.Parse(parts[4]);
            result.ComplexTime = long.Parse(parts[5]);

            result.PropertyInjectionTime = parts[6] == "0" ? (long?)null : long.Parse(parts[6]);
            result.GenericTime = parts[7] == "0" ? (long?)null : long.Parse(parts[7]);
            result.MultipleImport = parts[8] == "0" ? (long?)null : long.Parse(parts[8]);
            result.ConditionalTime = parts[9] == "0" ? (long?)null : long.Parse(parts[9]);
            result.ChildContainerTime = parts[10] == "0" ? (long?)null : long.Parse(parts[10]);
            result.InterceptionTime = parts[11] == "0" ? (long?)null : long.Parse(parts[11]);

            return result;
        }
开发者ID:huangyingwen,项目名称:IocPerformance,代码行数:28,代码来源:CsvOutputReader.cs


示例13: OnSpecificationEnd

        public void OnSpecificationEnd(SpecificationInfo specification, Result result)
        {
            var formatter = resultFormatterFactory.GetResultFormatterFor(result);
            testListener.WriteLine(formatter.FormatResult(specification), Category.Output);

            var testResult = new TestResult();
            testResult.Name = specification.Name;
            if (result.Passed)
                testResult.State = TestState.Passed;
            else if (result.Status == Status.Ignored)
            {
                testResult.State = TestState.Ignored;
                testResult.Message = "Ignored";
            }
            else if (result.Status == Status.NotImplemented)
            {
                testResult.State = TestState.Ignored;
                testResult.Message = "Not Implemented";
            }
            else
            {
                testResult.State = TestState.Failed;
                if (result.Exception != null)
                    testResult.StackTrace = result.Exception.ToString();
            }

            testResults.Add(testResult);
        }
开发者ID:jayhill,项目名称:machine.specifications,代码行数:28,代码来源:TDNetRunListener.cs


示例14: ResultPage

 public ResultPage(Result r)
 {
     InitializeComponent();
     currentResult = r;
     timer.Tick += new EventHandler(hideSaved);
     timer.Interval = new TimeSpan(0, 0, 1);
 }
开发者ID:shuqunzhang,项目名称:cs160_APK,代码行数:7,代码来源:ResultPage.xaml.cs


示例15: OnActivityResult

        protected override void OnActivityResult(int requestCode, Result resultCode, Intent data)
        {
            Console.WriteLine(requestCode);
            Console.WriteLine(resultCode);


        }
开发者ID:adbk,项目名称:spikes,代码行数:7,代码来源:Activity1.cs


示例16: Method3

 public Result Method3()
 {
     Result result = new Result();
     result.State = true;
     result.Message = "Test Message";
     return result;
 }
开发者ID:ismailkocacan,项目名称:CppCSharpInterop,代码行数:7,代码来源:MyClass.cs


示例17: CreateResult

        private Result CreateResult(string[] args)
        {
            if (args.Length < 4)
                return null;

            DateTime date;
            int original, optimized;

            Result result = new Result();

            if (!DateTime.TryParse(args[0], out date))
                return null;

            result.Date = date;
            result.FileName = HttpUtility.UrlDecode(args[1]);

            if (!int.TryParse(args[2], out original))
                return null;

            result.Original = original;

            if (!int.TryParse(args[3], out optimized))
                return null;

            result.Optimized = optimized;

            return result;
        }
开发者ID:CumpsD,项目名称:AzureJobs,代码行数:28,代码来源:Default.aspx.cs


示例18: LoadQuestionsForACandidateInExam

        public Result LoadQuestionsForACandidateInExam(CandidateForExam oCandidateForExam)
        {
            //new CLogger("Start LoadQuestionsForACandidateInExam CandidateExamProcessBO+BO", FileNameManagerInDLL.sLogFileName, 1).WriteLog("Start LoadQuestionsForACandidateInExam CandidateExamProcessBO+BO", ELogLevel.Debug);

            Result oResult = new Result();

            CandidateExamProcessDAO oCandidateExamProcessDAO = new CandidateExamProcessDAO();

            try
            {
                oResult = oCandidateExamProcessDAO.LoadQuestionsForACandidateInExam(oCandidateForExam);
            }
            catch (Exception oEx)
            {
                oResult.ResultIsSuccess = false;
                oResult.ResultMessage = "Exception in Question Load For an Exam..";
                oResult.ResultException = oEx;

                //new CLogger("Exception LoadQuestionsForACandidateInExam CandidateExamProcessBO+BO", FileNameManagerInDLL.sLogFileName, 1).WriteLog("Exception LoadQuestionsForACandidateInExam CandidateExamProcessBO+BO", ELogLevel.Debug, oEx);
            }

            //new CLogger("Out LoadQuestionsForACandidateInExam CandidateExamProcessBO+BO", FileNameManagerInDLL.sLogFileName, 1).WriteLog("Out LoadQuestionsForACandidateInExam CandidateExamProcessBO+BO", ELogLevel.Debug);

            return oResult;
        }
开发者ID:krishnakanthms,项目名称:Online-Exam-tool,代码行数:25,代码来源:CandidateExamProcessBO.cs


示例19: containerReader

        public List<Result> containerReader(string xml)
        {
            var xmlDocument = new XmlDocument();
            //xmlDocument.Load("SomeXML.xml");
            xmlDocument.LoadXml(xml);

            var tmpList = new List<Result>();

            XmlNodeList nodeList = xmlDocument.GetElementsByTagName("container");

            foreach (XmlElement elm in nodeList)
            {
                var result = new Result();
                XmlNodeList titleList = elm.GetElementsByTagName("dc:title");

                result.id = elm.GetAttribute("id");
                result.partenID = elm.GetAttribute("parentID");
                result.ContainerRes = "Container";
                result.type = titleList[0].InnerText;

                tmpList.Add(result);

            }
            return tmpList;
        }
开发者ID:GufCab,项目名称:Semester-Projekt---Test-Kode,代码行数:25,代码来源:XMLReaderPi.cs


示例20: button1_Click

        private void button1_Click(object sender, EventArgs e)
        {
         
            //bdl ma ad5l el input kol shwia
/*
            Recognetion r = new Recognetion(600, 600,
            100.ToString(), 110.ToString(), 120.ToString(), 0.7.ToString(), 0.4.ToString(), 0.3.ToString(),
            230.ToString(), 20.ToString(), 20.ToString(), 0.1.ToString(), 0.2.ToString(), 0.6.ToString(),
            210.ToString(), 230.ToString(), 190.ToString(), 0.5.ToString(), 0.4.ToString(), 0.3.ToString(),
            40.ToString(), 10.ToString(), 30.ToString(), 0.4.ToString(), 0.2.ToString(), 0.1.ToString()

            );

           */

            Recognetion r = new Recognetion(Convert.ToInt32(textBox1.Text),Convert.ToInt32(textBox2.Text),
           textBox3.Text, textBox5.Text, textBox7.Text, textBox4.Text, textBox6.Text, textBox8.Text,
          textBox20.Text, textBox18.Text, textBox16.Text, textBox19.Text, textBox17.Text, textBox15.Text,
           textBox14.Text, textBox12.Text, textBox10.Text, textBox13.Text, textBox11.Text, textBox9.Text,
           textBox26.Text, textBox24.Text, textBox22.Text, textBox25.Text, textBox23.Text, textBox21.Text);

            Result frm = new Result(r);
            frm.Show();
          
        }
开发者ID:DevMahmoud10,项目名称:Bayesian-Classifier1,代码行数:25,代码来源:Form1.cs



注:本文中的Result类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ResultClass类代码示例发布时间:2022-05-24
下一篇:
C# RestVerbs类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap