Esempio n. 1
0
    private void AddBindingComponentsIfRequired()
    {
        if (m_bindingComponentsAlreadyAdded)
        {
            return;
        }

        m_bindingComponentsAlreadyAdded = true;

        // Create compoennts
        addressBook         = AddComponentBasedOnPlatform <AddressBook>();
        networkConnectivity = AddComponentBasedOnPlatform <NetworkConnectivity>();
        sharing             = AddComponentBasedOnPlatform <Sharing>();
        userInterface       = AddComponentBasedOnPlatform <UI>();
        utility             = AddComponentBasedOnPlatform <Utility>();

#if !NATIVE_PLUGINS_LITE_VERSION
        billing             = AddComponentBasedOnPlatform <Billing>();
        mediaLibrary        = AddComponentBasedOnPlatform <MediaLibrary>();
        notificationService = AddComponentBasedOnPlatform <NotificationService>();
        twitter             = AddComponentBasedOnPlatform <Twitter>();
        webview             = AddComponentBasedOnPlatform <WebViewNative>();
        gameServices        = AddComponentBasedOnPlatform <GameServices>();
#endif
    }
        public IHttpActionResult PostSharing(Sharing sharing)
        {
            db.Sharings.Add(sharing);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = sharing.ShareId }, sharing));
        }
Esempio n. 3
0
 static extern Result SCardConnect(
     IntPtr context,
     String szReaderName,
     Sharing dwShareMode,
     CardProtocol dwPrefProtocol,
     out IntPtr hCard,
     out CardProtocol ActiveProtocol);
Esempio n. 4
0
 // Use this for initialization
 void Start()
 {
     coll     = GetComponent <Collider2D>();
     mySize   = this.transform.localScale;
     pushSize = new Vector3(mySize.x - 0.1f, mySize.y - 0.1f);
     share    = new Sharing();
 }
Esempio n. 5
0
    protected override void Awake()
    {
        base.Awake();

        // Not interested in non singleton instance
        if (instance != this)
        {
            return;
        }

        // Create instances
        m_addressBook         = AddComponentBasedOnPlatform <AddressBook>();
        m_networkConnectivity = AddComponentBasedOnPlatform <NetworkConnectivity>();
        m_sharing             = AddComponentBasedOnPlatform <Sharing>();
        m_UI      = AddComponentBasedOnPlatform <UI>();
        m_utility = AddComponentBasedOnPlatform <Utility>();

#if !NATIVE_PLUGINS_LITE_VERSION
        m_billing             = AddComponentBasedOnPlatform <Billing>();
        m_mediaLibrary        = AddComponentBasedOnPlatform <MediaLibrary>();
        m_notificationService = AddComponentBasedOnPlatform <NotificationService>();
        m_twitter             = AddComponentBasedOnPlatform <Twitter>();
        m_webView             = AddComponentBasedOnPlatform <WebViewNative>();
#endif
    }
Esempio n. 6
0
 // Use this for initialization
 void Start()
 {
     btn = GetComponent <Button>();
     btn.onClick.AddListener(test);
     Sharing = GameObject.Find("/Sharing");
     Sharing.SetActive(false);
 }
        public IHttpActionResult PutSharingTemplate(long id, Sharing sharing)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != sharing.Id)
            {
                return(BadRequest());
            }

            db.Entry(sharing).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!SharingTemplateExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public ActionResult SharedEdit(/*[Bind(Include = "Name")]*/ Sharing entry, string action)
        {
            string currentUser = User.Identity.GetUserId();

            string currentUserEmail = User.Identity.GetUserName();


            bool isAllowed = db.Inventories.Where(inv => inv.Id == entry.InventoryId && (inv.UserId == currentUser || inv.SharedUsers.Any(s => s.Email == currentUserEmail && (s.Permission == AccessLevel.Edit || s.Permission == AccessLevel.Admin)))).Any();

            if (ModelState.IsValid && isAllowed)
            {
                db.Entry(entry).State = EntityState.Modified;
                db.SaveChanges();

                if (action == "SaveAndOpen")
                {
                    return(RedirectToAction("Open", "Inventories", new { id = entry.InventoryId }));
                }
                else
                {
                    return(RedirectToAction("Shared", "Inventories", new { inventoryid = entry.InventoryId }));
                }
            }

            return(View(entry));
        }
        public IActionResult Create(BusViewModel model)
        {
            var response = ResponseModelFactory.CreateInstance;

            using (_dbContext)
            {
                if (_dbContext.Sharing.Count(x => x.Name == model.Name) > 0)
                {
                    response.SetFailed("名称已存在");
                    return(Ok(response));
                }
                //var entity = _mapper.Map<FoodViewModel, Sharing>(model);
                var entity = new Sharing();
                entity.Name         = model.Name;
                entity.Title        = model.Title;
                entity.Introduction = model.Introduction;
                entity.Address      = model.Address;
                entity.Picture      = model.Picture;
                entity.State        = model.State;
                entity.Cover        = model.Cover;
                entity.Lon          = model.Lon;
                entity.Lat          = model.Lat;
                entity.CreateTime   = DateTime.Now;
                entity.SharingUuid  = Guid.NewGuid();
                entity.IsDelete     = 0;
                _dbContext.Sharing.Add(entity);
                int res = _dbContext.SaveChanges();
                if (res > 0)
                {
                    ToLog.AddLog("添加", "成功:添加:共享单车点位管理列表数据", _dbContext);
                }
                response.SetSuccess();
                return(Ok(response));
            }
        }
Esempio n. 10
0
 public async Task <bool> CheckAuthAsync(Sharing sharing)
 {
     if (sharing.Giver == await _userManager.GetUserAsync(User))
     {
         return(true);
     }
     return(false);
 }
        public ActionResult SharedDeleteConfirmed(int id)
        {
            Sharing entry = db.SharedUsers.Find(id);

            db.SharedUsers.Remove(entry);
            db.SaveChanges();
            return(RedirectToAction("Open", "Inventories", new { id = entry.InventoryId }));
        }
Esempio n. 12
0
        IEnumerator CRSaveScreenshot()
        {
            yield return(new WaitForEndOfFrame());

            TwoStepScreenshotPath = Sharing.SaveScreenshot(TwoStepScreenshotName);

            NativeUI.Alert("Alert", "A new screenshot was saved at " + TwoStepScreenshotPath);
        }
Esempio n. 13
0
 public override void WriteXml(XmlWriter writer)
 {
     writer.WriteElementString("name", Name);
     writer.WriteElementString("status", Status.ToString());
     writer.WriteElementString("sharing", Sharing.ToString());
     writer.WriteIfNotDefaultOrNull(DueDate, "due_date");
     writer.WriteElementString("description", Description);
 }
Esempio n. 14
0
        public static void ShareTexture(Texture2D texture, string shareMessage = EmptyString)
        {
#if UNITY_IOS
            Sharing.ShareTexture2D(texture, Filename, EmptyString);
#else
            Sharing.ShareTexture2D(texture, Filename, shareMessage);
#endif
        }
Esempio n. 15
0
    IEnumerator CaptureScreenshot()
    {
        yield return(new WaitForEndOfFrame());

        Texture2D texture = Sharing.CaptureScreenshot();

        Sharing.ShareTexture2D(texture, "HighwayRacer_screenshot", "Patrz ile mam punktów!");
    }
Esempio n. 16
0
 public void Share()
 {
     #if UNITY_ANDROID
     Sharing.ShareText("Play a fun minimalist puzzle game. Even monkeys can count available for IOS & Android");
     #elif UNITY_IOS
     Sharing.ShareText("Play a fun minimalist puzzle game. Even monkeys can count available for IOS & Android");
     #endif
 }
        private async void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
        {
            var stream = await QRGrid.RenderToRandomAccessStream();

            Sharing share = new Sharing();

            share.Show(await Save(stream));
        }
Esempio n. 18
0
        public void ShareScreenshot()
        {
            string path = System.IO.Path.Combine(Application.persistentDataPath, screenshotFilename);
            string msg  = shareMessage;

            msg = msg.Replace("[score]", ScoreManager.Instance.Score.ToString());
            Sharing.ShareImage(path, screenshotFilename, msg);
        }
Esempio n. 19
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="writer"></param>
 public override void WriteXml(XmlWriter writer)
 {
     writer.WriteElementString(RedmineKeys.NAME, Name);
     writer.WriteElementString(RedmineKeys.STATUS, Status.ToString().ToLowerInv());
     writer.WriteElementString(RedmineKeys.SHARING, Sharing.ToString().ToLowerInv());
     writer.WriteDateOrEmpty(RedmineKeys.DUE_DATE, DueDate);
     writer.WriteElementString(RedmineKeys.DESCRIPTION, Description);
 }
Esempio n. 20
0
    IEnumerator SaveScreenshot()
    {
        // Wait until the end of frame
        yield return(new WaitForEndOfFrame());

        // The SaveScreenshot() method returns the path of the saved image
        // The provided file name will be added a ".png" extension automatically
        screenshotPath = Sharing.SaveScreenshot("screenshot");
    }
Esempio n. 21
0
    public void ExportList()
    {
        var AM = AppManager.Instance;

        if (AM.noLogin == 0)
        {
            Sharing.ShareText(shareIngrList);
        }
    }
Esempio n. 22
0
        public BaseResponseDto ChangeStatus(string sharingId, bool status)
        {
            BaseResponseDto responseDto = null;
            Guid            guid        = new Guid(sharingId);

            if (sharingId.Equals(null))
            {
                responseDto = new BaseResponseDto
                {
                    Status  = 1,
                    Message = "Faulthy sharing Id."
                };
                return(responseDto);
            }

            Sharing existingSharing = _uow
                                      .GetRepository <Sharing>()
                                      .GetAll()
                                      .FirstOrDefault(s => s.SharingId == guid);

            if (existingSharing == null)
            {
                responseDto = new BaseResponseDto
                {
                    Status  = 2,
                    Message = "Sharing with specified id not found"
                };
                return(responseDto);
            }

            try
            {
                existingSharing.IsDisable = status;
                _uow.GetRepository <Sharing>().Update(existingSharing);
                _uow.Commit();
            }
            catch (Exception e)
            {
                throw e;
            }

            responseDto = new BaseResponseDto
            {
                Status = 0
            };

            if (status == true)
            {
                responseDto.Message = "Sharing is disabled.";
            }
            else if (status == false)
            {
                responseDto.Message = "Sharing is enabled.";
            }

            return(responseDto);
        }
Esempio n. 23
0
        // Invoked by NatCorder once recording is finished
        void OnReplay(string path)
        {
            // Get the video thumbnail
            Texture2D thumbnail = Sharing.GetThumbnail(path, 5f);     // Get the thumbnail after 5 seconds of video

            // Do stuff with the thumbnail
            DisplayThumbnail(thumbnail);
            // Save the path to the replay so we can use it in `OnShare`
            this.pathToReplay = path;
        }
Esempio n. 24
0
        void doShare()
        {
            path = recordingPath.Value;
            if (path == null)
            {
                return;
            }

            Sharing.Share(path);
        }
Esempio n. 25
0
        public void ShareGiphyURL()
        {
            if (string.IsNullOrEmpty(uploadedGifUrl))
            {
                NativeUI.Alert("Invalid URL", "No valid Giphy URL found. Did the upload succeed?");
                return;
            }

            Sharing.ShareURL(uploadedGifUrl);
        }
Esempio n. 26
0
    void ShareURL(string url)
    {
        if (string.IsNullOrEmpty(url))
        {
            Debug.LogWarning("ShareURL failed: the given URL is invalid.");
            return;
        }

        Sharing.ShareURL(url);
    }
Esempio n. 27
0
 public Call()
 {
     Sharing         = new Sharing();
     Camera          = new Camera();
     Microphone      = new Microphone();
     Layout          = new Layout();
     Lock            = new Lock();
     MuteUserOnEntry = new MuteUserOnEntry();
     ClosedCaption   = new ClosedCaption();
 }
Esempio n. 28
0
 public override void WriteXml(XmlWriter writer)
 {
     writer.WriteElementString("name", Name);
     writer.WriteElementString("status", Status.ToString());
     writer.WriteElementString("sharing", Sharing.ToString());
     if (DueDate != null)
     {
         writer.WriteElementString("due_date", DueDate.Value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture));
     }
     writer.WriteElementString("description", Description);
 }
Esempio n. 29
0
 public void ShareScreenshot()
 {
     if (!string.IsNullOrEmpty(TwoStepScreenshotPath))
     {
         Sharing.ShareImage(TwoStepScreenshotPath, sampleMessage);
     }
     else
     {
         NativeUI.Alert("Alert", "Please save a screenshot first.");
     }
 }
Esempio n. 30
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="writer"></param>
 public override void WriteJson(JsonWriter writer)
 {
     using (new JsonObject(writer, RedmineKeys.VERSION))
     {
         writer.WriteProperty(RedmineKeys.NAME, Name);
         writer.WriteProperty(RedmineKeys.STATUS, Status.ToString().ToLowerInv());
         writer.WriteProperty(RedmineKeys.SHARING, Sharing.ToString().ToLowerInv());
         writer.WriteProperty(RedmineKeys.DESCRIPTION, Description);
         writer.WriteDateOrEmpty(RedmineKeys.DUE_DATE, DueDate);
     }
 }
Esempio n. 31
0
        private SPI(Socket socket, Configuration conf, Sharing sharingMode, Cpu.Pin chipSelectPin, Module module)
        {
            SPIInstance si = SPIInstance.GetInstance(socket, module);

            if (si.Users == 0)
            {
                socket.ReservePin(Socket.Pin.Seven, module);
                socket.ReservePin(Socket.Pin.Eight, module);
                socket.ReservePin(Socket.Pin.Nine, module);
            }
            else
            {
                if (si.SharingMode != Sharing.Shared)
                {
                    throw new Exception("SPI bus " + si + " is already reserved, cannot instantiate it again");
                }

                if (sharingMode == Sharing.Exclusive)
                {
                    throw new Exception("SPI bus " + si + " is already shared among " + si.Users + " users, cannot instantiate it for exclusive use");
                }
            }

            this.spiInstance = si;

            lock (this.spiInstance)
            {
                si.Users++;
                si.SharingMode = sharingMode;

                if (conf != null)
                {
                    this.spiConfig = new Microsoft.SPOT.Hardware.SPI.Configuration(
                        (Cpu.Pin)chipSelectPin,
                         conf.ChipSelectActiveState,
                         conf.ChipSelectSetupTime,
                         conf.ChipSelectHoldTime,
                         conf.ClockIdleState,
                         conf.ClockEdge,
                         conf.ClockRateKHz,
                         si.SPIModule);
                    if (!si.IsInitialised)
                    {
                        si.SpotSPI = new Microsoft.SPOT.Hardware.SPI(this.spiConfig);
                        si.IsInitialised = true;
                    }

                    this.spotSPI = si.SpotSPI;
                }
            }
        }
Esempio n. 32
0
 private static Sharing ParseSharing(XElement sharingElement)
 {
     Sharing sharing = new Sharing
     {
         Enabled = sharingElement.AttributeAsBool("enabled")
     };
     if (sharing.Enabled)
     {
         sharing.ReadAllowed = sharingElement.Element("readAllowed").AttributeAsBool("enabled");
         sharing.WriteAllowed = sharingElement.Element("writeAllowed").AttributeAsBool("enabled");
         sharing.ShareList = sharingElement.Element("shareList", true).Value;
     }
     return sharing;
 }
Esempio n. 33
0
 /// <summary>
 /// </summary>
 /// <remarks>This automatically checks that the socket supports Type S, and reserves the pins if necessary.
 /// An exception will be thrown if there is a problem with these checks.</remarks>
 /// <param name="socket">The <see cref="Socket"/> for the <see cref="SPI"/> interface.</param>
 /// <param name="spiConfiguration">The <see cref="Configuration"/> object for the <see cref="SPI"/> interface.</param>
 /// <param name="sharingMode">The <see cref="Sharing"/> of the <see cref="SPI"/> interface.</param>
 /// <param name="module">The <see cref="Module"/> that is connected to the <see cref="SPI"/> interface.</param>
 public SPI(Socket socket, Configuration spiConfiguration, Sharing sharingMode, Module module)
     : this(socket, spiConfiguration, sharingMode, Socket.UnspecifiedPin, module)
 {
 }
Esempio n. 34
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="socket">The <see cref="Socket"/> for the <see cref="SPI"/> interface.</param>
 /// <param name="spiConfiguration">The <see cref="Configuration"/> object for the <see cref="SPI"/> interface.</param>
 /// <param name="sharingMode">The <see cref="Sharing"/> mode of the <see cref="SPI"/> interface.</param>
 /// <param name="chipSelectSocket">The chip select <see cref="Socket"/>of the <see cref="SPI"/> interface.</param>
 /// <param name="chipSelectPin">The <see cref="Socket"/></param>
 /// <param name="module">The <see cref="Module"/> that is connected to the <see cref="SPI"/> interface.</param>
 public SPI(Socket socket, Configuration spiConfiguration, Sharing sharingMode, Socket chipSelectSocket, Socket.Pin chipSelectPin, Module module)
     : this(socket, spiConfiguration, sharingMode, chipSelectSocket.ReservePin(chipSelectPin, module), module)
 {
 }
Esempio n. 35
0
 /// <summary>
 /// </summary>
 /// <remarks>This automatically checks that the socket supports Type S, and reserves the pins if necessary.
 /// An exception will be thrown if there is a problem with these checks.</remarks>
 /// <param name="socket">The <see cref="Socket"/> for the <see cref="SPI"/> interface.</param>
 /// <param name="spiConfiguration">The <see cref="Configuration"/> object for the <see cref="SPI"/> interface.</param>
 /// <param name="sharingMode">The <see cref="Sharing"/> of the <see cref="SPI"/> interface.</param>
 /// <param name="module">The <see cref="Module"/> that is connected to the <see cref="SPI"/> interface.</param>
 public SPI(Socket socket, Configuration spiConfiguration, Sharing sharingMode, Module module)
     : this(socket, spiConfiguration, sharingMode, null, default(Socket.Pin), module)
 {
 }
Esempio n. 36
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="socket">The <see cref="Socket"/> for the <see cref="SPI"/> interface.</param>
        /// <param name="spiConfiguration">The <see cref="Configuration"/> object for the <see cref="SPI"/> interface.</param>
        /// <param name="sharingMode">The <see cref="Sharing"/> mode of the <see cref="SPI"/> interface.</param>
        /// <param name="chipSelectSocket">The chip select <see cref="Socket"/>of the <see cref="SPI"/> interface.</param>
        /// <param name="chipSelectPin">The <see cref="Socket"/></param>
        /// <param name="module">The <see cref="Module"/> that is connected to the <see cref="SPI"/> interface.</param>
        public SPI(Socket socket, Configuration spiConfiguration, Sharing sharingMode, Socket chipSelectSocket, Socket.Pin chipSelectPin, Module module)
        {
            socket.EnsureTypeIsSupported('S', module);

            Cpu.Pin reservedSelectPin = Socket.UnspecifiedPin;

            if (chipSelectSocket != null)
                reservedSelectPin = chipSelectSocket.ReservePin(chipSelectPin, module);

            if (socket.SPIModule != Socket.SocketInterfaces.SPIMissing)
                    Interface = new NativeSpi(socket, spiConfiguration == null ? null : new Socket.SocketInterfaces.SpiConfiguration(
                        spiConfiguration.ChipSelectActiveState,
                        spiConfiguration.ChipSelectSetupTime,
                        spiConfiguration.ChipSelectHoldTime,
                        spiConfiguration.ClockIdleState,
                        spiConfiguration.ClockEdge,
                        spiConfiguration.ClockRateKHz,
                        false), (Socket.SocketInterfaces.SpiSharing)sharingMode, reservedSelectPin, module, socket.SPIModule);

            else
                Interface = socket.SpiIndirector(socket, spiConfiguration == null ? null : new Socket.SocketInterfaces.SpiConfiguration(
                    spiConfiguration.ChipSelectActiveState,
                    spiConfiguration.ChipSelectSetupTime,
                    spiConfiguration.ChipSelectHoldTime,
                    spiConfiguration.ClockIdleState,
                    spiConfiguration.ClockEdge,
                    spiConfiguration.ClockRateKHz,
                    false), (Socket.SocketInterfaces.SpiSharing)sharingMode, chipSelectSocket, chipSelectPin, null, default(Socket.Pin), module);

            _spiModule = socket.SPIModule;
        }