コード例 #1
0
        public async void Upload_Picture_Clicked(object sender, EventArgs e)
        {
            await CrossMedia.Current.Initialize();

            try
            {
                file = await Plugin.Media.CrossMedia.Current.PickPhotoAsync(new Plugin.Media.Abstractions.PickMediaOptions
                {
                    PhotoSize = Plugin.Media.Abstractions.PhotoSize.Medium
                });

                if (file == null)
                {
                    return;
                }
                imgChosen.Source = ImageSource.FromStream(() =>
                {
                    var imageStram = file.GetStream();
                    return(imageStram);
                });
                string id    = CommunityID.ToString();
                string photo = await fb.UploadCommunityPhoto(file.GetStream(), id);

                CommunityImage = imgChosen;
            }
            catch (Exception ex)
            {
                await DisplayAlert("Upload Failed", ex.Message, "OK");
            }
        }
コード例 #2
0
        public Server(int id, string name, CommunityID com, string ip, int port)
        {
            this.ID        = id;
            this.Name      = name;
            this.Community = com;
            this.Ip        = ip;
            (this.Ports = new List <int>()).Add(port);
            this.Ip = ip;

            this.Propertys = new Dictionary <PropertyID, string>();
            this.Propertys.Add(PropertyID.SERVER_ID, id.ToString());
        }
コード例 #3
0
ファイル: SysParams.cs プロジェクト: fflorat/IRAP
 public void Save()
 {
     IniFile.WriteString(
         "Content",
         "ExCode",
         ExCode,
         SysGlobalVariable.Instance.SysParamsFileName);
     IniFile.WriteString(
         "Content",
         "CommunityID",
         CommunityID.ToString(),
         SysGlobalVariable.Instance.SysParamsFileName);
     IniFile.WriteString(
         "Content",
         "SysLogID",
         SysLogID.ToString(),
         SysGlobalVariable.Instance.SysParamsFileName);
     IniFile.WriteString(
         "Content",
         "UserCode",
         UserCode,
         SysGlobalVariable.Instance.SysParamsFileName);
     IniFile.WriteString(
         "Content",
         "AgencyLeaf",
         AgencyLeaf.ToString(),
         SysGlobalVariable.Instance.SysParamsFileName);
     IniFile.WriteString(
         "Content",
         "RoleLeaf",
         RoleLeaf.ToString(),
         SysGlobalVariable.Instance.SysParamsFileName);
     IniFile.WriteString(
         "Content",
         "StationID",
         StationID,
         SysGlobalVariable.Instance.SysParamsFileName);
 }
コード例 #4
0
ファイル: Image.ascx.cs プロジェクト: pimboden/csbooster
        public override bool ShowObject(string settingsXml)
        {
            DataObjectCommunity community = new DataObjectCommunity(UserDataContext.GetUserDataContext());

            community.ObjectID = CommunityID.ToString();
            community.Load();
            if (community.ObjectType == ObjectType.ProfileCommunity)
            {
                DataObjectUser user = new DataObjectUser(UserDataContext.GetUserDataContext());
                user.ObjectID = community.UserID;
                user.Load();

                string image = user.GetImage(PictureVersion.S);
                if (string.IsNullOrEmpty(image))
                {
                    IMAGE.ImageUrl = SiteContext.MediaDomainName + Constants.DEFIMG_USER;
                }
                else
                {
                    IMAGE.ImageUrl = SiteContext.MediaDomainName + image;
                }
            }
            else
            {
                string image = community.GetImage(PictureVersion.S);
                if (string.IsNullOrEmpty(image))
                {
                    IMAGE.ImageUrl = SiteContext.MediaDomainName + Constants.DEFIMG_COMMUNITY;
                }
                else
                {
                    IMAGE.ImageUrl = SiteContext.MediaDomainName + image;
                }
            }
            return(true);
        }
コード例 #5
0
 public virtual String ToString()
 {
     return("oType:" + FQN + " type:" + ObjectTypeID.ToString() + " Id:" + ObjectLongID.ToString() + " IdVersion:" + ObjectIdVersion.ToString() + " idCommunity:" + CommunityID.ToString() + " module:" + ServiceCode);
 }
コード例 #6
0
        public override bool ShowObject(string settingsXml)
        {
            bool HasContent = false;

            try
            {
                XmlDocument xmlDom = new XmlDocument();
                xmlDom.LoadXml(settingsXml);

                Control      control   = LoadControl("~/UserControls/MapViewerVE.ascx");
                IMapViewerVE mapViewer = (IMapViewerVE)control;
                mapViewer.OverWriteByURL = Convert.ToBoolean(XmlHelper.GetElementValue(xmlDom.DocumentElement, "rcbOverWriteByURL", 0));

                mapViewer.TagWords     = XmlHelper.GetElementValue(xmlDom.DocumentElement, "tagWords", string.Empty);
                mapViewer.TagWords2    = XmlHelper.GetElementValue(xmlDom.DocumentElement, "tagWords2", string.Empty);
                mapViewer.TagWords3    = XmlHelper.GetElementValue(xmlDom.DocumentElement, "tagWords3", string.Empty);
                mapViewer.TypeOfLayout = (VEMAPVWLayoutType)(XmlHelper.GetElementValue(xmlDom.DocumentElement, "layoutType", (int)VEMAPVWLayoutType.MultiLayerByObjectType));
                mapViewer.DataSource   = (WidgetDataSource)(XmlHelper.GetElementValue(xmlDom.DocumentElement, "rcbDS", (int)WidgetDataSource.CommunityAndGroups));
                mapViewer.SourceID     = XmlHelper.GetElementValue(xmlDom.DocumentElement, "ctyID", CommunityID.ToString());
                mapViewer.ObjectTypes  = XmlHelper.GetElementValue(xmlDom.DocumentElement, "objTypes", string.Empty);
                mapViewer.UserID       = XmlHelper.GetElementValue(xmlDom.DocumentElement, "txtUI", SiteContext.UserProfile.UserId.ToString()).ToNullableGuid();
                mapViewer.MaxPerLayer  = XmlHelper.GetElementValue(xmlDom.DocumentElement, "rcbAnz", 10000);

                string urlECSS = XmlHelper.GetElementValue(xmlDom.DocumentElement, "txtECSS", string.Empty);
                if (!string.IsNullOrEmpty(urlECSS))
                {
                    mapViewer.ExternalStyleSheet = urlECSS;
                }

                string urlImg = XmlHelper.GetElementValue(xmlDom.DocumentElement, "txtIP", string.Empty);

                if (!string.IsNullOrEmpty(urlImg))
                {
                    mapViewer.PinURL = urlImg;
                }

                mapViewer.ImagePrefix = XmlHelper.GetElementValue(xmlDom.DocumentElement, "txtIP", string.Empty);
                mapViewer.ImageExt    = XmlHelper.GetElementValue(xmlDom.DocumentElement, "rcbPT", "png");
                ;
                mapViewer.StartLat             = XmlHelper.GetElementValue(xmlDom.DocumentElement, "txtLat", "46.86770273172813");
                mapViewer.StartLong            = XmlHelper.GetElementValue(xmlDom.DocumentElement, "txtLong", "8.3990478515625");
                mapViewer.StartZoom            = XmlHelper.GetElementValue(xmlDom.DocumentElement, "txtZoom", "7");
                mapViewer.MapHeight            = Unit.Parse(XmlHelper.GetElementValue(xmlDom.DocumentElement, "txtMH", "400px"));
                mapViewer.MapWidth             = Unit.Parse(XmlHelper.GetElementValue(xmlDom.DocumentElement, "txtMW", "400px"));
                mapViewer.NavigationPanelWidth = Unit.Parse(XmlHelper.GetElementValue(xmlDom.DocumentElement, "txtLPW", "200px"));
                try
                {
                    mapViewer.MapStyle = ((VEMAPSytle)Convert.ToInt32(XmlHelper.GetElementValue(xmlDom.DocumentElement, "rcbMS", "2")));
                }
                catch
                {
                    mapViewer.MapStyle = VEMAPSytle.Road;
                }
                try
                {
                    mapViewer.MapMode = ((VEMAPMode)Convert.ToInt32(XmlHelper.GetElementValue(xmlDom.DocumentElement, "rcbMM", "1")));
                }
                catch
                {
                    mapViewer.MapMode = VEMAPMode.Both;
                }
                try
                {
                    mapViewer.MapNavControl = ((VEMAPNavControl)Convert.ToInt32(XmlHelper.GetElementValue(xmlDom.DocumentElement, "rcbNC", "1")));
                }
                catch
                {
                    mapViewer.MapNavControl = VEMAPNavControl.Normal;
                }

                PnlCnt.Controls.Add(control);
                //Its hasrd to define here what is COntent of the Map: Because it might have pins for some layers
                //but not for others, SO just return true;

                HasContent = true;
            }
            catch
            {
            }
            return(HasContent);
        }
コード例 #7
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            ctrlSourceAndTagSelector         = LoadControl("~/WidgetControls/SourceAndTagSelector.ascx");
            SourceAndTagSelector             = (ISourceAndTagSelector)ctrlSourceAndTagSelector;
            SourceAndTagSelector.CommunityID = CommunityID.Value;
            InstanceID = ObjectID.Value;
            string strXml = LoadInstanceData(InstanceID);

            XmlDocument xmlDom = new XmlDocument();

            if (!string.IsNullOrEmpty(strXml))
            {
                xmlDom.LoadXml(strXml);
            }

            if (rcbOT.Items.Count == 0)
            {
                rcbOT.AllowCustomText = true;
                rcbOT.Text            = string.Empty;
                RadComboBoxItem item = new RadComboBoxItem("Alle", string.Empty);
                CheckBox        cbx  = new CheckBox();
                cbx.ID   = "CheckBox";
                cbx.Text = "Alle";
                cbx.Attributes.Add("onClick", "setComboboxText('" + rcbOT.ClientID + "');stopPropagation(event);");
                item.Controls.Add(cbx);
                rcbOT.Items.Add(item);

                List <SiteObjectType> completeObjectTypesList = Helper.GetObjectTypes();
                var allObjectTypes = from types in completeObjectTypesList.Where(x => x.IsGeoTaggable)
                                     select new
                {
                    type     = types.Id,
                    Singular = GuiLanguage.GetGuiLanguage("SiteObjects").GetString(types.NameSingularKey),
                    Plural   = GuiLanguage.GetGuiLanguage("SiteObjects").GetString(types.NamePluralKey)
                };
                string[] objTypes = { };
                string   oTTemp   = XmlHelper.GetElementValue(xmlDom.DocumentElement, "objTypes", string.Empty).ToLower();
                if (oTTemp.Length > 0)
                {
                    objTypes = oTTemp.Split(',');
                }
                else
                {
                    cbx.Checked = true;
                    rcbOT.Text  = "Alle";
                }
                foreach (var obj in allObjectTypes)
                {
                    item     = new RadComboBoxItem(obj.Plural, obj.type);
                    cbx      = new CheckBox();
                    cbx.ID   = "CheckBox";
                    cbx.Text = obj.Plural;
                    if (objTypes.Contains(obj.type.ToLower()))
                    {
                        cbx.Checked = true;
                        rcbOT.Text += cbx.Text + ",";
                    }

                    cbx.Attributes.Add("onClick", "setComboboxText('" + rcbOT.ClientID + "');stopPropagation(event);");
                    item.Controls.Add(cbx);
                    rcbOT.Items.Add(item);
                }
                rcbOT.Text = rcbOT.Text.Trim(',');
            }


            rcbOverWriteByURL.SelectedIndex = rcbOverWriteByURL.Items.IndexOf(rcbOverWriteByURL.Items.FindItemByValue(XmlHelper.GetElementValue(xmlDom.DocumentElement, "rcbOverWriteByURL", "0")));
            int layoutType = XmlHelper.GetElementValue(xmlDom.DocumentElement, "layoutType", (int)VEMAPVWLayoutType.MultiLayerByObjectType);

            if (layoutType == (int)VEMAPVWLayoutType.MultiLayerByObjectType)
            {
                rcbLT.SelectedIndex = 2;
                rcbST.SelectedIndex = 0;
            }
            else if (layoutType == (int)VEMAPVWLayoutType.MultiLayerByTag)
            {
                rcbLT.SelectedIndex = 2;
                rcbST.SelectedIndex = 1;
            }
            else if (layoutType == (int)VEMAPVWLayoutType.SingleLayerByObjectType)
            {
                rcbLT.SelectedIndex = 1;
                rcbST.SelectedIndex = 0;
            }
            else if (layoutType == (int)VEMAPVWLayoutType.SingleLayerdByTag)
            {
                rcbLT.SelectedIndex = 1;
                rcbST.SelectedIndex = 1;
            }
            else if (layoutType == (int)VEMAPVWLayoutType.SimpleByObjectType)
            {
                rcbLT.SelectedIndex = 0;
                rcbST.SelectedIndex = 0;
            }
            else if (layoutType == (int)VEMAPVWLayoutType.SimpleByTag)
            {
                rcbLT.SelectedIndex = 0;
                rcbST.SelectedIndex = 1;
            }
            SourceAndTagSelector.TagList1            = XmlHelper.GetElementValue(xmlDom.DocumentElement, "tagWords", string.Empty).ToLower();
            SourceAndTagSelector.TagList2            = XmlHelper.GetElementValue(xmlDom.DocumentElement, "tagWords2", string.Empty).ToLower();
            SourceAndTagSelector.TagList3            = XmlHelper.GetElementValue(xmlDom.DocumentElement, "tagWords3", string.Empty).ToLower();
            SourceAndTagSelector.DataSourceIDs       = XmlHelper.GetElementValue(xmlDom.DocumentElement, "ctyID", CommunityID.ToString());
            SourceAndTagSelector.DataSourceSelection = XmlHelper.GetElementValue(xmlDom.DocumentElement, "rcbDS", Convert.ToString((int)WidgetDataSource.SingleCommunity));
            SourceAndTagSelector.UserID = XmlHelper.GetElementValue(xmlDom.DocumentElement, "txtUI", SiteContext.UserProfile.UserId.ToString()).ToNullableGuid();

            phSTS.Controls.Add(ctrlSourceAndTagSelector);
            ctrlRoleVisibilityAndFixation        = LoadControl("~/WidgetControls/RoleVisibilityAndFixation.ascx");
            RoleVisibilityAndFixation            = (IRoleVisibilityAndFixation)ctrlRoleVisibilityAndFixation;
            ctrlRoleVisibilityAndFixation.ID     = "RVAF";
            RoleVisibilityAndFixation.InstanceID = InstanceID;
            phRF.Controls.Add(ctrlRoleVisibilityAndFixation);
        }