예제 #1
0
        public Team(string name, Lehrers lehrers, List <string> list) : this(name)
        {
            DisplayName = name.Replace("--", "-")
                          .Replace("/ ", "-")
                          .Replace("---", "-")
                          .Replace("ä", "ae")
                          .Replace("ö", "oe")
                          .Replace("ü", "ue")
                          .Replace("ß", "ss")
                          .Replace("Ä", "Ae")
                          .Replace("Ö", "Oe")
                          .Replace("Ü", "Ue")
                          .Replace(" ", "-")
                          .Replace("/", "-")
                          .Replace("(", "")
                          .Replace(")", "")
                          .Replace("---", "-");

            if (DisplayName.StartsWith("Fachschaft"))
            {
                Vorsitz = (from l in lehrers from a in l.Anrechnungen where a.TextGekürzt == name select l.Mail).FirstOrDefault();

                if (Vorsitz == null)
                {
                    Vorsitz = "N.N.";
                }
            }

            Members = list;
            Typ     = (new List <string>()
            {
                "Abitur", "Kollegium", "FHR"
            }).Contains(DisplayName) ? "Team" : "Verteilergruppe";
        }
예제 #2
0
            public InternalEntry(int body, int itemID, string name)
            {
                Body   = body;
                ItemID = itemID;
                Name   = name;

                DisplayName = name.ToLower();

                for (int i = 0; i < m_GroupNames.Length; ++i)
                {
                    if (DisplayName.StartsWith(m_GroupNames[i]))
                    {
                        DisplayName = DisplayName.Substring(m_GroupNames[i].Length);
                        break;
                    }
                }

                DisplayName = DisplayName.Replace('_', ' ');
            }
예제 #3
0
        public void BuildName(ECMAStore store)
        {
            DisplayName = ItemType == ItemType.Constructor ? Parent.Name : Name;
            if (DisplayName.StartsWith("op_"))
            {
                DisplayName = DisplayName.Substring("op_".Length);
            }
            var displayNameWithoutEII = DisplayName;

            if (IsEII)
            {
                var typeStr   = DisplayName.Substring(0, DisplayName.LastIndexOf('.'));
                var memberStr = DisplayName.Substring(DisplayName.LastIndexOf('.') + 1);
                DisplayName = typeStr.ToDisplayName() + '.' + memberStr;
            }

            string paramPart = null;

            if (Parameters?.Count > 0)
            {
                if (Name == "op_Explicit" || Name == "op_Implicit")
                {
                    var rtype = ReturnValueType.VersionedTypes.First().Value.ToDisplayName();

                    paramPart = string.Format("({0} to {1})", Parameters.First().Type.ToDisplayName(), rtype);
                }
                else if (IsIndexer)
                {
                    paramPart = string.Format("[{0}]", string.Join(", ", Parameters.Select(p => p.Type.ToDisplayName())));
                }
                else
                {
                    paramPart = string.Format("({0})", string.Join(", ", Parameters.Select(p => p.Type.ToDisplayName())));
                }
            }
            else if (ItemType == ItemType.Method || ItemType == ItemType.Constructor)
            {
                paramPart = "()";
            }
            DisplayName    += paramPart;
            FullDisplayName = ((Type)Parent).FullName + "." + displayNameWithoutEII + paramPart;
        }
 public void CreateAzureIoTEdgeDevice()
 {
     if (!_parentPage._isSaaSSetup)
     {
         if ((DisplayName == null) ||
             (DisplayName == string.Empty) ||
             !DisplayName.StartsWith("HostName=") ||
             !DisplayName.Contains(".azure-devices.net;SharedAccessKeyName=iothubowner;SharedAccessKey="))
         {
             MessageBox.Show(Strings.IoTHubs, Strings.AboutSubtitle, MessageBoxButton.OK, MessageBoxImage.Error);
         }
         else
         {
             QueueUserWorkItem(CreateAzureIoTEdgeDevice, new AzureIoTHub(DisplayName));
         }
     }
     else
     {
         QueueUserWorkItem(CreateAzureIoTEdgeDevice, null);
     }
 }
예제 #5
0
        private void Parse(string rawAddress)
        {
            if (rawAddress == null)
            {
                throw new ArgumentNullException("rawAddress");
            }

            rawAddress = rawAddress.Trim();

            var extendedPartIndex = rawAddress.IndexOf("|", StringComparison.InvariantCultureIgnoreCase);

            if (extendedPartIndex > -1)
            {
                var extendedPart = rawAddress.Substring(extendedPartIndex);
                var parts        = extendedPart.Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries);

                if (parts.Length > 0)
                {
                    AvatarUrl = parts[0];
                }

                if (parts.Length > 1)
                {
                    ChannelName = parts[1];
                }

                // Remove extended part from rawAddress and continue parsing
                rawAddress = rawAddress.Substring(0, extendedPartIndex);
            }

            if (rawAddress.Contains("<") && rawAddress.Contains(">"))
            {
                string[] parts = rawAddress.Split(new[] { '<', '>' }, StringSplitOptions.RemoveEmptyEntries);

                if (parts.Length == 1)
                {
                    this.Address     = parts[0];
                    this.DisplayName = parts[0];

                    // See if the displayname is quoted, if so, remove the quotes
                    if (DisplayName.StartsWith("\"") && DisplayName.EndsWith("\""))
                    {
                        DisplayName = DisplayName.Substring(1, DisplayName.Length - 2);
                    }
                }
                if (parts.Length == 2)
                {
                    this.DisplayName = parts[0].Trim();
                    this.Address     = parts[1].Trim();

                    // Can happen when you receive addresses like " <*****@*****.**>" (space in the beginning)
                    if (String.IsNullOrEmpty(this.DisplayName))
                    {
                        this.DisplayName = this.Address;
                    }

                    // See if the displayname is quoted, if so, remove the quotes
                    if (DisplayName.StartsWith("\"") && DisplayName.EndsWith("\""))
                    {
                        DisplayName = DisplayName.Substring(1, DisplayName.Length - 2);
                    }

                    return;
                }
            }
            else
            {
                this.DisplayName = rawAddress;
                this.Address     = rawAddress;
            }

            if (String.IsNullOrEmpty(Address))
            {
                this.Address = rawAddress;
            }
        }
예제 #6
0
        public WMAppManifest()
        {
            // parse the xml manifest once

            // parse the package xml to get attributes
            XmlReader xr = XmlReader.Create("WMAppManifest.xml");

            if (xr.ReadToDescendant("Deployment"))
            {
                // if built as an 8.1 app defer to platform for most properties
                IsSilverlight81 = new Version(xr["AppPlatformVersion"]) > new Version(8, 0);

                if (xr.ReadToDescendant("App"))
                {
                    ProductID   = xr["ProductID"];
                    DisplayName = xr["Title"];
                    Description = xr["Description"];

                    if (DisplayName.StartsWith("@"))
                    {
                        try
                        {
                            object[] attributes = Assembly.Load(Deployment.Current.EntryPointAssembly).GetCustomAttributes(typeof(AssemblyProductAttribute), false);
                            if (attributes.Length > 0)
                            {
                                AssemblyProductAttribute productAttribute = attributes[0] as AssemblyProductAttribute;
                                if (productAttribute != null)
                                {
                                    DisplayName = productAttribute.Product;
                                }
                            }
                        }
                        catch
                        {
                            // will fail from background task
                        }
                    }



                    Version = new Version(xr["Version"]).ToPackageVersion();

                    PublisherDisplayName = xr["Publisher"];
                    PublisherId          = xr["PublisherID"];


                    if (xr.ReadToDescendant("IconPath"))
                    {
                        Logo = ImagePathToUri(xr);
                    }

                    if (xr.ReadToFollowing("Capabilities"))
                    {
                        bool more = xr.ReadToDescendant("Capability");
                        while (more)
                        {
                            Capability       newCapability       = (Capability)0;
                            DeviceCapability newDeviceCapability = (DeviceCapability)0;
                            switch (xr["Name"])
                            {
                            case "ID_CAP_NETWORKING":
                                newCapability = Capability.Internet;
                                break;

                            /*case "ID_CAP_IDENTITY_DEVICE":
                             *  newCapability = Capability.IdentityDevice;
                             *  break;
                             * case "ID_CAP_IDENTITY_USER":
                             *  newCapability = Capability.IdentityUser;
                             *  break;
                             * case "ID_FUNCCAP_EXTEND_MEM":
                             *  newCapability = Capability.ExtendedMemory;
                             *  break;*/
                            case "ID_CAP_LOCATION":
                                newDeviceCapability = DeviceCapability.Location;
                                break;

                            case "ID_CAP_SENSORS":
                                newDeviceCapability = DeviceCapability.Sensors;
                                break;

                            case "ID_CAP_MICROPHONE":
                                newDeviceCapability = DeviceCapability.Microphone;
                                break;

                            //case "ID_CAP_MEDIALIB":
                            //    newCapability = Capability.MediaLibrary;
                            //    break;
                            case "ID_CAP_MEDIALIB_AUDIO":
                                newCapability = Capability.Music;
                                break;

                            case "ID_CAP_MEDIALIB_PHOTO":
                                newCapability = Capability.Pictures;
                                break;

                            /*case "ID_CAP_MEDIALIB_PLAYBACK":
                             *  newCapability = Capability.MusicLibraryPlayback;
                             *  break;
                             * case "ID_CAP_GAMERSERVICES":
                             *  newCapability = Capability.GamerServices;
                             *  break;*/
                            case "ID_CAP_PHONEDIALER":
                                newCapability = Capability.PhoneDialer;
                                break;

                            case "ID_CAP_PUSH_NOTIFICATION":
                                newCapability = Capability.PushNotification;
                                break;

                            case "ID_CAP_REMOVABLE_STORAGE":
                                newCapability = Capability.RemovableStorage;
                                break;

                            /*case "ID_CAP_WEBBROWSERCOMPONENT":
                             *  newCapability = Capability.WebBrowserComponent;
                             *  break;
                             * case "ID_CAP_RINGTONE_ADD":
                             *  newCapability = Capability.RingtoneAdd;
                             *  break;*/
                            case "ID_CAP_PROXIMITY":
                                newDeviceCapability = DeviceCapability.Proximity;
                                break;

                            case "ID_CAP_SPEECH_RECOGNITION":
                                newCapability = Capability.SpeechRecognition;
                                break;

                            case "ID_CAP_VOIP":
                                newCapability = Capability.Voip;
                                break;

                            case "ID_CAP_WALLET":
                                newCapability = Capability.Wallet;
                                break;

                            /*case "ID_CAP_WALLET_PAYMENTINSTRUMENTS":
                             *  newCapability = Capability.WalletPaymentInstruments;
                             *  break;
                             * case "ID_CAP_WALLET_SECUREELEMENT":
                             *  newCapability = Capability.WalletSecureElement;
                             *  break;*/

                            case "ID_CAP_APPOINTMENTS":
                                newCapability = Capability.Appointments;
                                break;

                            case "ID_CAP_CONTACTS":
                                newCapability = Capability.Contacts;
                                break;

                            case "ID_CAP_ISV_CAMERA":
                                newDeviceCapability = DeviceCapability.Camera;
                                break;
                            }

                            global::System.Diagnostics.Debug.WriteLine((int)newCapability);
                            Capabilities       |= newCapability;
                            DeviceCapabilities |= newDeviceCapability;
                            more = xr.ReadToNextSibling("Capability");
                        }
                    }
                }
            }

            xr.Dispose();
        }