当前位置: 首页>>代码示例>>C#>>正文


C# IMethodResult.set方法代码示例

本文整理汇总了C#中IMethodResult.set方法的典型用法代码示例。如果您正苦于以下问题:C# IMethodResult.set方法的具体用法?C# IMethodResult.set怎么用?C# IMethodResult.set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IMethodResult的用法示例。


在下文中一共展示了IMethodResult.set方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: retrieveFileNames

        public void retrieveFileNames(IMethodResult oResult)
        {
            Logger.Write("call retrieveFileNames ");

            IReadOnlyDictionary<string, object> resultHash = new IReadOnlyDictionary<string, object>();

            if (m_connection != null && m_connection.IsConnected())
            {
                RetriveParser parser = new RetriveParser(m_connection);

                List<string> resultNames = parser.getAllFileNames();
                
                resultHash.Add(ZebraConstants.HK_STATUS, ZebraConstants.PRINTER_STATUS_SUCCESS);
                resultHash.Add(ZebraConstants.HK_FILE_NAMES, resultNames);
                oResult.set(resultHash);

                return;
            }

            resultHash.Add(ZebraConstants.HK_STATUS, ZebraConstants.PRINTER_STATUS_ERROR);
            resultHash.Add(ZebraConstants.HK_FILE_NAMES, new List<string>());
            oResult.set(resultHash);
        }
开发者ID:rhomobile,项目名称:rhodes,代码行数:23,代码来源:PrinterZebra_impl.cs

示例2: getFullScreen

 public void getFullScreen(IMethodResult oResult)
 {
     MainPage mp = getMainPage();
     oResult.set(mp != null ? mp.isFullscreen() : false);
 }
开发者ID:jcarlosgarcia,项目名称:rhodes,代码行数:5,代码来源:WebView_impl.cs

示例3: getEnableWebPlugins

 public void getEnableWebPlugins(IMethodResult oResult)
 {
     // implement this method in C# here
     oResult.set(true);
 }
开发者ID:jcarlosgarcia,项目名称:rhodes,代码行数:5,代码来源:WebView_impl.cs

示例4: getTextZoomLevel

 public void getTextZoomLevel(IMethodResult oResult)
 {
     // implement this method in C# here
     oResult.set(1.0);
 }
开发者ID:jcarlosgarcia,项目名称:rhodes,代码行数:5,代码来源:WebView_impl.cs

示例5: currentURL

 public void currentURL(int tabIndex, IMethodResult oResult)
 {
     MainPage mp = getMainPage();
     oResult.set(mp != null ? mp.getCurrentURL(tabIndex) : "");
 }
开发者ID:jcarlosgarcia,项目名称:rhodes,代码行数:5,代码来源:WebView_impl.cs

示例6: getCacheSize

 public void getCacheSize(IMethodResult oResult)
 {
     // implement this method in C# here
     oResult.set(0);
 }
开发者ID:jcarlosgarcia,项目名称:rhodes,代码行数:5,代码来源:WebView_impl.cs

示例7: getAcceptLanguage

 public void getAcceptLanguage(IMethodResult oResult)
 {
     // implement this method in C# here
     oResult.set("en");
 }
开发者ID:jcarlosgarcia,项目名称:rhodes,代码行数:5,代码来源:WebView_impl.cs

示例8: connectWithOptions

        public void connectWithOptions(IReadOnlyDictionary<string, string> options, IMethodResult oResult)
        {
            Logger.Write("connectWithOptions call");
            Logger.Write("options:", options);

            string valueObj = null;
            Int32  connectionTimeout = 0;

            if (m_connection != null && m_connection.IsConnected() && m_printer != null)
            {
                m_connection.Close();

                Thread.Sleep(1000);

                m_connection = null;
                m_printer    = null;
            }

            if (options.ContainsKey(ZebraConstants.HK_TIMEOUT))
            {
                valueObj = options[ZebraConstants.HK_TIMEOUT];

                if ((valueObj != null) && (valueObj is String))
                {
                    try
                    {
                        connectionTimeout = Int32.Parse(valueObj.ToString());
                    }
                    catch (System.FormatException)
                    {
                        m_maxTimeoutForRead = 0;
                    }
                }
            }

            if (options.ContainsKey(ZebraConstants.PROPERTY_MAX_TIMEOUT_FOR_READ))
            {
                valueObj = options[ZebraConstants.PROPERTY_MAX_TIMEOUT_FOR_READ];
                
                if ((valueObj != null) && (valueObj is String))
                {
                    try
                    {
                        m_maxTimeoutForRead = Int32.Parse(valueObj.ToString());
                    }
                    catch (System.FormatException)
                    {
                        m_maxTimeoutForRead = 0;
                    }
                }
            }

            if (options.ContainsKey(ZebraConstants.PROPERTY_TIME_TO_WAIT_FOR_MORE_DATA))
            {
                valueObj = options[ZebraConstants.PROPERTY_TIME_TO_WAIT_FOR_MORE_DATA];

                if ((valueObj != null) && (valueObj is String))
                {
                    try
                    {
                        m_timeToWaitForMoreData = Int32.Parse(valueObj.ToString());
                    }
                    catch (System.FormatException)
                    {
                        m_maxTimeoutForRead = 0;
                    }
                }
            }
            
            ConnecttionJob job = new ConnecttionJob();

            job.Address               = ID;
            job.Port                  = Port;
            job.ConnectionType        = connectionType;
            job.MaxTimeoutForRead     = m_maxTimeoutForRead;
            job.TimeToWaitForMoreData = m_timeToWaitForMoreData;

            if (connectionTimeout == 0)
            {
                job.Connect();
            }
            else
            {
                if (!job.Connect(connectionTimeout))
                {
                    oResult.set(ZebraConstants.PRINTER_STATUS_ERR_TIMEOUT);
                    return;
                }
            }
            
            if (job.Connection != null && job.Printer != null)
            {
                m_connection = job.Connection;
                m_printer    = job.Printer;

                oResult.set(ZebraConstants.PRINTER_STATUS_SUCCESS);
                return;
            }

            oResult.set(ZebraConstants.PRINTER_STATUS_ERR_NOT_CONNECTED);
//.........这里部分代码省略.........
开发者ID:rhomobile,项目名称:rhodes,代码行数:101,代码来源:PrinterZebra_impl.cs

示例9: sendConnectFinish

 public void sendConnectFinish(string status, IMethodResult oResult)
 {
     IReadOnlyDictionary<string, string> printerResult = new IReadOnlyDictionary<string, string>();
     printerResult[ZebraConstants.HK_STATUS] = status;
     oResult.set(printerResult);
 }
开发者ID:rhomobile,项目名称:rhodes,代码行数:6,代码来源:PrinterZebra_impl.cs

示例10: storeImage

        public void storeImage(string printerDriveAndFileName, string imageFilePathOnDevice, int width, int height, IMethodResult oResult)
        {
            Logger.Write("storeImage call");
            Logger.Write("printerDriveAndFileName: " + printerDriveAndFileName);
            Logger.Write("imageFilePathOnDevice: " + imageFilePathOnDevice);
            Logger.Write("width: " + width.ToString());
            Logger.Write("height: " + height.ToString());

            try
            {
                if (m_printer != null && width != 0 && height != 0 &&
                    Path.GetExtension(imageFilePathOnDevice) != ".bmp" && Path.GetExtension(imageFilePathOnDevice) != ".gif")
                {
                    m_printer.GetGraphicsUtil().StoreImage(printerDriveAndFileName, imageFilePathOnDevice, width, height);
                    oResult.set(ZebraConstants.PRINTER_STATUS_SUCCESS);
                    return;
                }
            }
            catch(ZebraPrinterConnectionException)
            {
                oResult.set(ZebraConstants.PRINTER_STATUS_ERR_NETWORK);
                return;
            }
            catch(ZebraIllegalArgumentException)
            {
                oResult.set(ZebraConstants.PRINTER_STATUS_ERR_IO);
                return;
            }
            catch(ArgumentException)
            {
                oResult.set(ZebraConstants.PRINTER_STATUS_ERR_PARAM);
                return;
            }
            catch (Exception)
            {
                oResult.set(ZebraConstants.PRINTER_STATUS_ERROR);
                return;
            }

            oResult.set(ZebraConstants.PRINTER_STATUS_ERROR);
        }
开发者ID:rhomobile,项目名称:rhodes,代码行数:41,代码来源:PrinterZebra_impl.cs

示例11: requestState


//.........这里部分代码省略.........
                    resultHash.Add(ZebraConstants.HK_MESSAGE, "");

                    foreach (string parameter in listOfParameters)
                    {
                        switch(parameter)
                        {
                        case ZebraConstants.PRINTER_STATE_IS_HEAD_COLD:
                            resultHash.Add(ZebraConstants.PRINTER_STATE_IS_HEAD_COLD, currStatus.IsHeadCold);
                            break;
                        case ZebraConstants.PRINTER_STATE_IS_HEAD_OPEN:
                            resultHash.Add(ZebraConstants.PRINTER_STATE_IS_HEAD_OPEN, currStatus.IsHeadOpen);
                            break;
                        case ZebraConstants.PRINTER_STATE_IS_HEAD_TOO_HOT:
                            resultHash.Add(ZebraConstants.PRINTER_STATE_IS_HEAD_TOO_HOT, currStatus.IsHeadTooHot);
                            break;
                        case ZebraConstants.PRINTER_STATE_IS_PAPER_OUT:
                            resultHash.Add(ZebraConstants.PRINTER_STATE_IS_PAPER_OUT, currStatus.IsPaperOut);
                            break;
                        case ZebraConstants.PRINTER_STATE_IS_PARTIAL_FORMAT_IN_PROGRESS:
                            resultHash.Add(ZebraConstants.PRINTER_STATE_IS_PARTIAL_FORMAT_IN_PROGRESS, currStatus.IsPartialFormatInProgress);
                            break;
                        case ZebraConstants.PRINTER_STATE_IS_PAUSED:
                            resultHash.Add(ZebraConstants.PRINTER_STATE_IS_BATTERY_LOW, currStatus.IsPaused);
                            break;
                        case ZebraConstants.PRINTER_STATE_IS_READY_TO_PRINT:
                            resultHash.Add(ZebraConstants.PRINTER_STATE_IS_READY_TO_PRINT, currStatus.IsReadyToPrint);
                            break;
                        case ZebraConstants.PRINTER_STATE_IS_RECEIVE_BUFFER_FULL:
                            resultHash.Add(ZebraConstants.PRINTER_STATE_IS_RECEIVE_BUFFER_FULL, currStatus.IsReceiveBufferFull);
                            break;
                        case ZebraConstants.PRINTER_STATE_IS_RIBBON_OUT:
                            resultHash.Add(ZebraConstants.PRINTER_STATE_IS_RIBBON_OUT, currStatus.IsRibbonOut);
                            break;
                        case ZebraConstants.PRINTER_STATE_LABELS_REMAINING_IN_BATCH:
                            resultHash.Add(ZebraConstants.PRINTER_STATE_LABELS_REMAINING_IN_BATCH, currStatus.LabelsRemainingInBatch);
                            break;
                        case ZebraConstants.PRINTER_STATE_LABEL_LENGTH_IN_DOTS:
                            resultHash.Add(ZebraConstants.PRINTER_STATE_LABEL_LENGTH_IN_DOTS, currStatus.LabelLengthInDots);
                            break;
                        case ZebraConstants.PRINTER_STATE_NUMBER_OF_FORMATS_IN_RECEIVE_BUFFER:
                            resultHash.Add(ZebraConstants.PRINTER_STATE_NUMBER_OF_FORMATS_IN_RECEIVE_BUFFER, currStatus.NumberOfFormatsInReceiveBuffer);
                            break;
                        case ZebraConstants.PRINTER_STATE_PRINT_MODE:
                            switch (currStatus.PrintMode)
                            {
                                case ZplPrintMode.REWIND:
                                    resultHash.Add(ZebraConstants.PRINTER_STATE_PRINT_MODE, ZebraConstants.PRINT_MODE_REWIND);
                                    break;
                                case ZplPrintMode.PEEL_OFF:
                                    resultHash.Add(ZebraConstants.PRINTER_STATE_PRINT_MODE, ZebraConstants.PRINT_MODE_PEEL_OFF);
                                    break;
                                case ZplPrintMode.TEAR_OFF:
                                    resultHash.Add(ZebraConstants.PRINTER_STATE_PRINT_MODE, ZebraConstants.PRINT_MODE_TEAR_OFF);
                                    break;
                                case ZplPrintMode.CUTTER:
                                    resultHash.Add(ZebraConstants.PRINTER_STATE_PRINT_MODE, ZebraConstants.PRINT_MODE_CUTTER);
                                    break;
                                case ZplPrintMode.APPLICATOR:
                                    resultHash.Add(ZebraConstants.PRINTER_STATE_PRINT_MODE, ZebraConstants.PRINT_MODE_APPLICATOR);
                                    break;
                                case ZplPrintMode.DELAYED_CUT:
                                    resultHash.Add(ZebraConstants.PRINTER_STATE_PRINT_MODE, ZebraConstants.PRINT_MODE_DELAYED_CUT);
                                    break;
                                case ZplPrintMode.LINERLESS_PEEL:
                                    resultHash.Add(ZebraConstants.PRINTER_STATE_PRINT_MODE, ZebraConstants.PRINT_MODE_LINERLESS_PEEL);
                                    break;
                                case ZplPrintMode.LINERLESS_REWIND:
                                    resultHash.Add(ZebraConstants.PRINTER_STATE_PRINT_MODE, ZebraConstants.PRINT_MODE_REWIND);
                                    break;
                                case ZplPrintMode.PARTIAL_CUTTER:
                                    resultHash.Add(ZebraConstants.PRINTER_STATE_PRINT_MODE, ZebraConstants.PRINT_MODE_PARTIAL_CUTTER);
                                    break;
                                case ZplPrintMode.RFID:
                                    resultHash.Add(ZebraConstants.PRINTER_STATE_PRINT_MODE, ZebraConstants.PRINT_MODE_RFID);
                                    break;
                                case ZplPrintMode.KIOSK:
                                    resultHash.Add(ZebraConstants.PRINTER_STATE_PRINT_MODE, ZebraConstants.PRINT_MODE_KIOSK);
                                    break;
                                case ZplPrintMode.UNKNOWN:
                                    resultHash.Add(ZebraConstants.PRINTER_STATE_PRINT_MODE, ZebraConstants.PRINT_MODE_UNKNOWN);
                                    break;
                            }
                            break;
                        }
                    }
                }
                else
                {
                    resultHash.Add(ZebraConstants.HK_STATUS, ZebraConstants.PRINTER_STATUS_ERROR);
                    resultHash.Add(ZebraConstants.HK_MESSAGE, "");
                }
            }
            else
            {
                resultHash.Add(ZebraConstants.HK_STATUS, ZebraConstants.PRINTER_STATUS_ERR_NOT_CONNECTED);
                resultHash.Add(ZebraConstants.HK_MESSAGE, "");
            }

            oResult.set(resultHash);
        }
开发者ID:rhomobile,项目名称:rhodes,代码行数:101,代码来源:PrinterZebra_impl.cs

示例12: printStoredFormatWithArray

        public void printStoredFormatWithArray(string formatPathOnPrinter, IReadOnlyList<string> vars, IMethodResult oResult)
        {
            Logger.Write("printStoredFormatWithArray call");
            Logger.Write("formatPathOnPrinter: " + formatPathOnPrinter);
            Logger.Write("vars: ", vars);

            if (m_printer != null)
            {
                m_printer.GetFormatUtil().PrintStoredFormat(formatPathOnPrinter, vars.ToArray());
                oResult.set(ZebraConstants.PRINTER_STATUS_SUCCESS);
                return;
            }

            oResult.set(ZebraConstants.PRINTER_STATUS_ERROR);
        }
开发者ID:rhomobile,项目名称:rhodes,代码行数:15,代码来源:PrinterZebra_impl.cs

示例13: printStoredFormatWithHash

        public void printStoredFormatWithHash(string formatPathOnPrinter, IReadOnlyDictionary<string, string> vars, IMethodResult oResult)
        {
            Logger.Write("printStoredFormatWithHash call");
            Logger.Write("formatPathOnPrinter: " + formatPathOnPrinter);
            Logger.Write("vars: ", vars);

            if (m_printer != null)
            {
                Dictionary<int, string> _params = new Dictionary<int, string>();

                foreach (KeyValuePair<string, string> pair in vars)
                {
                    try 
                    {
                        _params.Add(Int32.Parse(pair.Key), pair.Value);
                    }
                    catch(Exception e) 
                    {
                    }
                }

                m_printer.GetFormatUtil().PrintStoredFormat(formatPathOnPrinter, _params);
                oResult.set(ZebraConstants.PRINTER_STATUS_SUCCESS);
                return;
            }

            oResult.set(ZebraConstants.PRINTER_STATUS_ERROR);
        }
开发者ID:rhomobile,项目名称:rhodes,代码行数:28,代码来源:PrinterZebra_impl.cs

示例14: retrieveFileNamesWithExtensions

        public void retrieveFileNamesWithExtensions(IReadOnlyList<string> extensions, IMethodResult oResult)
        {
            Logger.Write("retrieveFileNamesWithExtensions call");
            Logger.Write("extensions:", extensions);

            IReadOnlyDictionary<string, object> resultHash = new IReadOnlyDictionary<string, object>();

            if (m_printer != null)
            {
                RetriveParser parser = new RetriveParser(m_connection);

                List<string> resultNames = parser.getAllFileNames(extensions);

                resultHash.Add(ZebraConstants.HK_STATUS, ZebraConstants.PRINTER_STATUS_SUCCESS);
                resultHash.Add(ZebraConstants.HK_FILE_NAMES, resultNames);
                oResult.set(resultHash);

                return;
            }

            resultHash.Add(ZebraConstants.HK_STATUS, ZebraConstants.PRINTER_STATUS_ERROR);
            resultHash.Add(ZebraConstants.HK_FILE_NAMES, new List<string>());
            oResult.set(resultHash);
        }
开发者ID:rhomobile,项目名称:rhodes,代码行数:24,代码来源:PrinterZebra_impl.cs

示例15: getViewportEnabled

 public void getViewportEnabled(IMethodResult oResult)
 {
     // implement this method in C# here
     oResult.set(true);
 }
开发者ID:jcarlosgarcia,项目名称:rhodes,代码行数:5,代码来源:WebView_impl.cs


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